KisSketchView::KisSketchView(QDeclarativeItem* parent) : QDeclarativeItem(parent) , d(new Private(this)) { // this is just an interaction overlay, the contents are painted on the sceneview background setFlag(QGraphicsItem::ItemHasNoContents, true); setAcceptTouchEvents(true); setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton); setAcceptHoverEvents(true); grabGesture(Qt::PanGesture); //grabGesture(Qt::PinchGesture); KoZoomMode::setMinimumZoom(0.1); KoZoomMode::setMaximumZoom(16.0); d->timer = new QTimer(this); d->timer->setSingleShot(true); connect(d->timer, SIGNAL(timeout()), this, SLOT(resetDocumentPosition())); d->loadedTimer = new QTimer(this); d->loadedTimer->setSingleShot(true); d->loadedTimer->setInterval(100); connect(d->loadedTimer, SIGNAL(timeout()), SIGNAL(loadingFinished())); d->savedTimer = new QTimer(this); d->savedTimer->setSingleShot(true); d->savedTimer->setInterval(100); connect(d->savedTimer, SIGNAL(timeout()), SIGNAL(savingFinished())); connect(DocumentManager::instance(), SIGNAL(aboutToDeleteDocument()), SLOT(documentAboutToBeDeleted())); connect(DocumentManager::instance(), SIGNAL(documentChanged()), SLOT(documentChanged())); connect(DocumentManager::instance()->progressProxy(), SIGNAL(valueChanged(int)), SIGNAL(progress(int))); connect(DocumentManager::instance(), SIGNAL(documentSaved()), d->savedTimer, SLOT(start())); if (DocumentManager::instance()->document()) documentChanged(); }
// DkImageContainerT -------------------------------------------------------------------- DkImageContainerT::DkImageContainerT(const QFileInfo& file) : DkImageContainer(file) { thumb = QSharedPointer<DkThumbNailT>(new DkThumbNailT(file)); #ifdef WITH_QUAZIP if(isFromZip()) thumb = QSharedPointer<DkThumbNailT>(new DkThumbNailT(zipData->getEncodedFileInfo())); #endif fetchingImage = false; fetchingBuffer = false; // our file watcher fileUpdateTimer.setSingleShot(false); fileUpdateTimer.setInterval(500); waitForUpdate = false; connect(&fileUpdateTimer, SIGNAL(timeout()), this, SLOT(checkForFileUpdates())); connect(&saveImageWatcher, SIGNAL(finished()), this, SLOT(savingFinished())); connect(&bufferWatcher, SIGNAL(finished()), this, SLOT(bufferLoaded())); connect(&imageWatcher, SIGNAL(finished()), this, SLOT(imageLoaded())); connect(loader.data(), SIGNAL(errorDialogSignal(const QString&)), this, SIGNAL(errorDialogSignal(const QString&))); connect(thumb.data(), SIGNAL(thumbLoadedSignal(bool)), this, SIGNAL(thumbLoadedSignal(bool))); //connect(&metaDataWatcher, SIGNAL(finished()), this, SLOT(metaDataLoaded())); }