Пример #1
0
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()));
}
Пример #2
0
void GPSItemList::setModelAndSelectionModel(GPSItemModel* const model, QItemSelectionModel* const selectionModel)
{
    d->model               = model;
    d->selectionModel      = selectionModel;
    d->imageSortProxyModel = new GPSItemSortProxyModel(d->model, d->selectionModel);
    setModel(d->imageSortProxyModel);

    connect(d->model, SIGNAL(signalThumbnailForIndexAvailable(QPersistentModelIndex,QPixmap)),
            this, SLOT(slotThumbnailFromModel(QPersistentModelIndex,QPixmap)));

    connect(this, SIGNAL(clicked(QModelIndex)),
            this, SLOT(slotInternalTreeViewImageActivated(QModelIndex)));

    if (d->imageSortProxyModel->mappedSelectionModel())
        setSelectionModel(d->imageSortProxyModel->mappedSelectionModel());
}