893 | | d_func()->model = model; |
894 | | if (model) { |
895 | | connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), |
896 | | this, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int))); |
897 | | connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), |
898 | | this, SLOT(_q_columnsAboutToBeRemoved(QModelIndex,int,int))); |
899 | | connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), |
900 | | this, SLOT(_q_rowsAboutToBeInserted(QModelIndex,int,int))); |
901 | | connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), |
902 | | this, SLOT(_q_columnsAboutToBeInserted(QModelIndex,int,int))); |
903 | | connect(model, SIGNAL(layoutAboutToBeChanged()), |
904 | | this, SLOT(_q_layoutAboutToBeChanged())); |
905 | | connect(model, SIGNAL(layoutChanged()), |
906 | | this, SLOT(_q_layoutChanged())); |
907 | | } |
| 939 | d_func()->initModel(model); |
916 | | d_func()->model = model; |
917 | | if (model) { |
918 | | connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), |
919 | | this, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int))); |
920 | | connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), |
921 | | this, SLOT(_q_columnsAboutToBeRemoved(QModelIndex,int,int))); |
922 | | connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), |
923 | | this, SLOT(_q_rowsAboutToBeInserted(QModelIndex,int,int))); |
924 | | connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), |
925 | | this, SLOT(_q_columnsAboutToBeInserted(QModelIndex,int,int))); |
926 | | connect(model, SIGNAL(layoutAboutToBeChanged()), |
927 | | this, SLOT(_q_layoutAboutToBeChanged())); |
928 | | connect(model, SIGNAL(layoutChanged()), |
929 | | this, SLOT(_q_layoutChanged())); |
930 | | } |
| 948 | d_func()->initModel(model); |
939 | | d_func()->model = model; |
940 | | if (model) { |
941 | | connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), |
942 | | this, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int))); |
943 | | connect(model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), |
944 | | this, SLOT(_q_columnsAboutToBeRemoved(QModelIndex,int,int))); |
945 | | connect(model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), |
946 | | this, SLOT(_q_rowsAboutToBeInserted(QModelIndex,int,int))); |
947 | | connect(model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), |
948 | | this, SLOT(_q_columnsAboutToBeInserted(QModelIndex,int,int))); |
949 | | connect(model, SIGNAL(layoutAboutToBeChanged()), |
950 | | this, SLOT(_q_layoutAboutToBeChanged())); |
951 | | connect(model, SIGNAL(layoutChanged()), |
952 | | this, SLOT(_q_layoutChanged())); |
953 | | } |
| 957 | dd.initModel(model); |
961 | | Q_D(QItemSelectionModel); |
962 | | if (d->model) { |
963 | | disconnect(d->model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), |
964 | | this, SLOT(_q_rowsAboutToBeRemoved(QModelIndex,int,int))); |
965 | | disconnect(d->model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)), |
966 | | this, SLOT(_q_columnsAboutToBeRemoved(QModelIndex,int,int))); |
967 | | disconnect(d->model, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), |
968 | | this, SLOT(_q_rowsAboutToBeInserted(QModelIndex,int,int))); |
969 | | disconnect(d->model, SIGNAL(columnsAboutToBeInserted(QModelIndex,int,int)), |
970 | | this, SLOT(_q_columnsAboutToBeInserted(QModelIndex,int,int))); |
971 | | disconnect(d->model, SIGNAL(layoutAboutToBeChanged()), |
972 | | this, SLOT(_q_layoutAboutToBeChanged())); |
973 | | disconnect(d->model, SIGNAL(layoutChanged()), |
974 | | this, SLOT(_q_layoutChanged())); |
975 | | } |