GPSSyncKGeoMapModelHelper::GPSSyncKGeoMapModelHelper(KipiImageModel* const model, QItemSelectionModel* const selectionModel, QObject* const parent) : ModelHelper(parent), d(new GPSSyncKGeoMapModelHelperPrivate()) { d->model = model; d->selectionModel = selectionModel; connect(d->model, SIGNAL(signalThumbnailForIndexAvailable(QPersistentModelIndex,QPixmap)), this, SLOT(slotThumbnailFromModel(QPersistentModelIndex,QPixmap))); connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(signalModelChangedDrastically())); }
void ItemMarkerTiler::setMarkerModelHelper(ModelHelper* const modelHelper) { d->modelHelper = modelHelper; d->markerModel = modelHelper->model(); d->selectionModel = modelHelper->selectionModel(); if (d->markerModel!=0) { // TODO: disconnect the old model if there was one connect(d->markerModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), this, SLOT(slotSourceModelRowsInserted(const QModelIndex&, int, int))); connect(d->markerModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)), this, SLOT(slotSourceModelRowsAboutToBeRemoved(const QModelIndex&, int, int))); // TODO: this signal now has to be monitored in the model helper // connect(d->markerModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), // this, SLOT(slotSourceModelDataChanged(const QModelIndex&, const QModelIndex&))); connect(d->modelHelper, SIGNAL(signalModelChangedDrastically()), this, SLOT(slotSourceModelReset())); connect(d->markerModel, SIGNAL(modelReset()), this, SLOT(slotSourceModelReset())); connect(d->markerModel, SIGNAL(layoutChanged()), this, SLOT(slotSourceModelLayoutChanged())); connect(d->modelHelper, SIGNAL(signalThumbnailAvailableForIndex(const QPersistentModelIndex&, const QPixmap&)), this, SLOT(slotThumbnailAvailableForIndex(const QPersistentModelIndex&, const QPixmap&))); if (d->selectionModel) { connect(d->selectionModel, SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(slotSelectionChanged(const QItemSelection&, const QItemSelection&))); }