void TelegramImageElement::destinationChangeEvent() { QString dest = p->handler->destination(); if(dest.isEmpty() || !p->mdb.mimeTypeForFile(dest).name().contains("image", Qt::CaseInsensitive)) { QString thumb = p->handler->thumbnail(); setImage(thumb); Q_EMIT thumbnailChanged(); Q_EMIT thumbnailDownloadedChanged(); } else setImage(dest); Q_EMIT destinationChanged(); Q_EMIT downloadedChanged(); Q_EMIT downloadedChanged(); }
static void source_append(QQmlListProperty<DocumentProviderPlugin> *property, DocumentProviderPlugin *source) { Private *d = static_cast<Private *>(property->data); DocumentProviderListModel *q = static_cast<DocumentProviderListModel *>(property->object); d->providers.append(source); QObject::connect(source, SIGNAL(countChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(iconChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(thumbnailChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(pageChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(titleChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(modelChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(readyChanged()), q, SLOT(sourceInfoChanged())); QObject::connect(source, SIGNAL(needsSetupChanged()), q, SLOT(sourceInfoChanged())); if (source->isReady()) q->updateActiveSources(); }
void Task::generateThumbnail() { if ( _grab.isNull() ) return; QImage img = _grab.convertToImage(); double width = img.width(); double height = img.height(); width = width * _thumbSize; height = height * _thumbSize; img = img.smoothScale( (int) width, (int) height ); _thumb = img; _grab.resize( 0, 0 ); // Makes grab a null image. emit thumbnailChanged(); }
KasTaskItem::KasTaskItem( KasTasker *parent, Task::Ptr task ) : KasItem( parent ), task_(task), thumbTimer(0), attentionTimer(0) { setIcon( icon() ); setAttention( task->demandsAttention() ); updateTask(false); connect( task, SIGNAL( changed(bool) ), this, SLOT( updateTask(bool) ) ); connect( task, SIGNAL( activated() ), this, SLOT( startAutoThumbnail() ) ); connect( task, SIGNAL( deactivated() ), this, SLOT( stopAutoThumbnail() ) ); connect( task, SIGNAL( iconChanged() ), this, SLOT( iconChanged() ) ); connect( task, SIGNAL( thumbnailChanged() ), this, SLOT( iconChanged() ) ); connect( this, SIGNAL(leftButtonClicked(QMouseEvent *)), SLOT(toggleActivateAction()) ); connect( this, SIGNAL(rightButtonClicked(QMouseEvent *)), SLOT(showWindowMenuAt(QMouseEvent *) ) ); attentionTimer = new QTimer( this, "attentionTimer" ); connect( attentionTimer, SIGNAL( timeout() ), SLOT( checkAttention() ) ); attentionTimer->start( CHECK_ATTENTION_DELAY ); }
void SeList::toggleThumbnail() { Thumb = !Thumb; emit thumbnailChanged(); }
PagePalette::PagePalette(QWidget* parent) : ScrPaletteBase( parent, "SP", false, 0) { m_scMW=(ScribusMainWindow*)parent; PagePaletteLayout = new QVBoxLayout( this ); PagePaletteLayout->setSpacing( 5 ); PagePaletteLayout->setMargin( 5 ); Splitter1 = new QSplitter( this ); Splitter1->setOrientation( Qt::Vertical ); QWidget* privateLayoutWidget = new QWidget( Splitter1 ); Layout2 = new QVBoxLayout( privateLayoutWidget ); Layout2->setMargin(0); Layout2->setSpacing(5); TextLabel1 = new QLabel( privateLayoutWidget ); Layout2->addWidget( TextLabel1 ); masterPageList = new SeList(privateLayoutWidget); masterPageList->setMinimumSize(QSize(130,70)); masterPageList->Thumb = false; masterPageList->setIconSize(QSize(60, 60)); Layout2->addWidget( masterPageList ); QWidget* privateLayoutWidget_2 = new QWidget( Splitter1 ); Layout3 = new QVBoxLayout( privateLayoutWidget_2); Layout3->setMargin(0); Layout3->setSpacing(5); TextLabel2 = new QLabel( privateLayoutWidget_2 ); Layout3->addWidget( TextLabel2 ); pageView = new SeView(privateLayoutWidget_2); QHeaderView *Header = pageView->verticalHeader(); Header->setMovable(false); Header->setResizeMode(QHeaderView::Fixed); Header->hide(); Header = pageView->horizontalHeader(); Header->setMovable(false); Header->setResizeMode(QHeaderView::Fixed); Header->hide(); pageView->setSortingEnabled(false); pageView->setSelectionMode( QAbstractItemView::NoSelection ); pageView->setRowCount(1); pageView->setColumnCount(1); pageView->setIconSize(QSize(60, 60)); pageView->setMinimumSize(QSize(130,120)); Layout3->addWidget( pageView ); PagePaletteLayout->addWidget( Splitter1 ); Layout1 = new QHBoxLayout; Layout1->setSpacing( 5 ); Layout1->setMargin( 0 ); QList<PageSet> dummy; dummy.clear(); struct PageSet pageS; pageS.Name = CommonStrings::trPageSet2; pageS.FirstPage = 0; pageS.Rows = 1; pageS.Columns = 1; // pageS.GapHorizontal = 0.0; // pageS.GapVertical = 0.0; // pageS.GapBelow = 40.0; pageS.pageNames.clear(); pageS.pageNames.append(CommonStrings::trPageLocMiddleRight); dummy.append(pageS); pageLayout = new PageLayouts(this, dummy, false); Layout1->addWidget( pageLayout ); // QSpacerItem* spacer = new QSpacerItem( 15, 15, QSizePolicy::Expanding, QSizePolicy::Minimum ); // Layout1->addItem( spacer ); Trash = new TrashBin( this ); Trash->setMinimumSize(QSize(32,32)); Trash->setMaximumSize(QSize(32,32)); Layout1->addWidget( Trash ); PagePaletteLayout->addLayout( Layout1 ); pix = loadIcon("32/page-simple.png"); currView = 0; Rebuild(); languageChange(); connect(masterPageList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(selMasterPage())); connect(masterPageList, SIGNAL(thumbnailChanged()), this, SLOT(rebuildMasters())); connect(masterPageList, SIGNAL(DelMaster(QString)), this, SLOT(deleteMasterPage(QString))); connect(pageView, SIGNAL(Click(int, int, int)), this, SLOT(pageView_gotoPage(int, int, int))); connect(pageView, SIGNAL(movePage(int, int)), this, SLOT(pageView_movePage(int, int))); connect(Trash, SIGNAL(DelMaster(QString)), this, SLOT(deleteMasterPage(QString))); connect(pageLayout, SIGNAL(selectedLayout(int )), this, SLOT(handlePageLayout(int ))); connect(pageLayout, SIGNAL(selectedFirstPage(int )), this, SLOT(handleFirstPage(int ))); connect(this, SIGNAL(EditTemp(QString)), m_scMW, SLOT(manageMasterPages(QString))); connect(pageView, SIGNAL(UseTemp(QString, int)), m_scMW, SLOT(Apply_MasterPage(QString, int))); connect(pageView, SIGNAL(NewPage(int, QString)), m_scMW, SLOT(slotNewPageP(int, QString))); connect(Trash, SIGNAL(DelPage(int)), m_scMW, SLOT(DeletePage2(int))); connect(pageView, SIGNAL(DelPage(int)), m_scMW, SLOT(DeletePage2(int))); connect(this, SIGNAL(gotoPage(int)), m_scMW, SLOT(selectPagesFromOutlines(int))); }
foreach (QObject* resource, resources) { connect(resource, SIGNAL(filePathChanged()), this, SIGNAL(resourcesChanged())); connect(resource, SIGNAL(thumbnailChanged()), this, SIGNAL(resourcesChanged())); }
void NoteItem::onResourceAdded(QObject* resource) { connect(resource, SIGNAL(filePathChanged()), this, SIGNAL(resourcesChanged())); connect(resource, SIGNAL(thumbnailChanged()), this, SIGNAL(resourcesChanged())); }