QWaitLabel::QWaitLabel(QWidget *parent) : QLabel(parent) { setMinimumHeight(25); outlineColor = Qt::black; fillColor = Qt::transparent; dir = FLY_IN; indicatorSize = 15; currentIndicator = 0; indicator = CIRCLE; // 5 indicators, 3 steps // = 15 positions scaleFactor = width()/14; // hide from screen startPos = -1 * scaleFactor; // go out of screen endPos = 16 * scaleFactor; // wait at middle waitPos = 9 * scaleFactor; // initialize with default start position for(int c=0; c<5; c++) indicators.push_back(startPos); connect(&timer, SIGNAL(timeout()), this, SLOT(updatePixmap())); updatePixmap(); timer.start(MID); }
void SvgImage::setSource(const QString &source) { QDeclarativeContext* context = QDeclarativeEngine::contextForObject( this ); QString baseDir; if ( context ) { QFileInfo info( context->baseUrl().path() ); baseDir = info.path(); } m_source = baseDir+ "/"+ source; QFile file( m_source ); //qDebug("SvgImage: setSource: opening %s ...", m_source.toAscii().constData() ); if ( file.open( QFile::ReadOnly ) ) { m_svgDocument.setContent( file.readAll() ); updatePixmap(); } else { m_source = ":" + m_source; file.setFileName( m_source ); if ( file.open( QFile::ReadOnly ) ) { m_svgDocument.setContent( file.readAll() ); updatePixmap(); } else qDebug("SvgImage: setSource: %s not found!", m_source.toAscii().constData() ); } }
void CardInfoPicture::setCard(CardInfo *card) { if (info) disconnect(info, 0, this, 0); info = card; connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap())); updatePixmap(); }
LockScreenBackgroundPixmap::LockScreenBackgroundPixmap(const QString &gConfKey) : gConfItem(new MGConfItem(gConfKey, this)), pixmap(NULL), pixmapFromTheme(false) { updatePixmap(); connect(gConfItem, SIGNAL(valueChanged()), this, SLOT(updatePixmap())); }
void CardInfoPicture::setCard(CardInfoPtr card) { if (info) { disconnect(info.data(), nullptr, this, nullptr); } info = card; if (info) { connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap())); } updatePixmap(); }
void CaptureWgt::slotFrameReady() { pd->video->frame( pd->img ); if ( pd->ui.brightnessRange->isChecked() ) brightnessRange(); updatePixmap(); }
void rviewOSectionImage::childMouseEvent(wxWindow *child, wxMouseEvent &mevt) { unsigned int i; for (i=0; i<numSections; i++) { if (child == (wxWindow*)(sliders[i])) { float mx, my; unsigned int newSect; mevt.Position(&mx, &my); if (sliders[i]->PositionInWell(mx, my)) newSect = i; else newSect = numSections + 1; if (newSect != currentSection) { currentSection = newSect; fillBuffer(); updatePixmap(imgData, imgData); } break; } } // pass on event rviewRenderImage::childMouseEvent(child, mevt); }
void QDragManager::startAsyncDrag(QDrag *o) { // if (object == o || !o || !o->source()) // TODO // return Qt::IgnoreAction; if (object) { cancel(); qApp->removeEventFilter(this); beingCancelled = false; } object = drag_object = o; dragObjectRetained = o; qt_qws_dnd_deco = new QShapedPixmapWidget(); oldstate = Qt::NoModifier; // #### Should use state that caused the drag // drag_mode = mode; willDrop = false; updatePixmap(); updateCursor(); restoreCursor = true; object->d_func()->target = 0; qApp->installEventFilter(this); global_accepted_action = Qt::CopyAction; #ifndef QT_NO_CURSOR qApp->setOverrideCursor(Qt::ArrowCursor); restoreCursor = true; updateCursor(); #endif qt_qws_dnd_dragging = true; }
PhraseWidget::PhraseWidget(Phrase* phrase,QWidget *parent) : QWidget(parent) { m_phrase = phrase; m_phraseEditor = new PhraseEditor(m_phrase); m_refreshButton = new QToolButton(this); m_name = new QLabel(m_phrase->name(),this); m_scrollArea = new QScrollArea(this); m_pixmap = new QLabel(); m_refreshButton->setIcon(QIcon::fromTheme("accessories-text-editor")); m_name->setFixedWidth(100); m_scrollArea->setWidget(m_pixmap); m_scrollArea->setWidgetResizable(true); m_scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); if(m_phrase->image()) m_pixmap->setPixmap(QPixmap::fromImage(*m_phrase->image())); QHBoxLayout* layout = new QHBoxLayout(this); layout->addWidget(m_name); layout->addWidget(m_refreshButton); layout->addWidget(m_scrollArea); connect(m_phrase,SIGNAL(previewChanged()),this,SLOT(updatePixmap())); connect(m_refreshButton,SIGNAL(clicked()),this,SLOT(openEditor())); }
SeanPptProgressWdg::SeanPptProgressWdg(QWidget *parent) : QWidget(parent) { ui.setupUi(this); QFile qssFile(":/qss/setting.qss"); QString qss; qssFile.open(QFile::ReadOnly); if(qssFile.isOpen()) { qss = QString(qssFile.readAll()); this->setStyleSheet(qss); qssFile.close(); } index = 1; QPixmap pixmap(QString(":/setting/setting/00900")); ui.imageLabel->setPixmap(pixmap); ui.imageLabel->setScaledContents(true); timer = new QTimer(this); timer->setInterval(100); connect(timer, SIGNAL(timeout()), this,SLOT(updatePixmap())); timer->start(); }
void QDragManager::updateCursor() { #ifdef DEBUG_QDND_WIN qDebug( "QDragManager::updateCursor()" ); #endif if ( !noDropCursor ) { stdNoDropCursor = new QCursor( ForbiddenCursor ); if ( !pm_cursor[ 0 ].isNull() ) stdMoveCursor = new QCursor( pm_cursor[ 0 ], 0, 0 ); if ( !pm_cursor[ 1 ].isNull() ) stdCopyCursor = new QCursor( pm_cursor[ 1 ], 0, 0 ); if ( !pm_cursor[ 2 ].isNull() ) stdLinkCursor = new QCursor( pm_cursor[ 2 ], 0, 0 ); } if ( !object->pixmap().isNull() ) { updatePixmap(); } else { delete noDropCursor; delete moveCursor; delete copyCursor; delete linkCursor; if ( usePixmapCursors ) { usePixmapCursors = false; } noDropCursor = new QCursor ( *stdNoDropCursor ); moveCursor = new QCursor ( *stdMoveCursor ); copyCursor = new QCursor ( *stdCopyCursor ); linkCursor = new QCursor ( *stdLinkCursor ); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { undoStack = new QUndoStack(this); createActions(); createMenus(); createToolBars(); createStatusBar(); createCentralWidget(); createDockWindows(); #ifndef QT_NO_DEBUG createUndoView(); #endif connect(pipelineWidget, SIGNAL(sourceCodeChanged(QString)), codeWidget, SLOT(setPlainText(QString))); connect(pipelineWidget, SIGNAL(outputPixmapChanged(QPixmap)), imageWidget, SLOT(updatePixmap(QPixmap))); setWindowTitle("Prototyping Toolkit for Image Processing"); loadImageFile(":/Images/lena.jpg"); resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 5); }
void SvgImage::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { if ( m_updateNeeded ) { updatePixmap( m_resizePixmap ); m_resizePixmap = false; } QRectF target(0, 0, m_pixmap.width(), m_pixmap.height()); if (m_startX != -1) { target.setX(m_startX); } if (m_startY != -1) { target.setY(m_startY); } if (m_endX != -1) { target.setWidth(m_endX); } if (m_endY != -1) { target.setHeight(m_endY); } painter->drawPixmap( target, m_pixmap, target ); }
// Background mask methods. void qsynthSystemTray::setBackground ( const QColor& background ) { // Set background color, now. m_background = background; updatePixmap(); }
void ScaledImagePlane::ensureUpToDate(unsigned int tileX, unsigned int tileY, PixmapTile* tile) { ImageTile& imageTile = tiles.at(tileX, tileY); //Create the image if need be. if (imageTile.image.isNull()) { imageTile.image = parent->format.makeImage(tileWidth (tileX), tileHeight(tileY)); ImageManager::imageCache()->addEntry(&imageTile); std::memset(imageTile.versions, 0, Tile::TileSize); } else ImageManager::imageCache()->touchEntry(&imageTile); //Pull in updates to the image. for (unsigned int line = 0; line < tileHeight(tileY); ++line) { int origLine = yScaleTable[line + tileY*Tile::TileSize]; if (imageTile.versions[line] < parent->versions[origLine]) { imageTile.versions[line] = parent->versions[origLine]; if (parent->format.depth() == 1) scaleLoop<quint8>(&imageTile.image, xScaleTable, line, parent->image, origLine, tileX, tileY); else scaleLoop<quint32>(&imageTile.image, xScaleTable, line, parent->image, origLine, tileX, tileY); } } //Now, push stuff into the pixmap. updatePixmap(tile, imageTile.image, tileX, tileY, 0, 0, imageTile.versions); }
void VESPERSEndstationConfigurationView::onGeometryClicked(int id) { switch(id){ case 1: // Straight on. endstation_->setGeometry(VESPERS::StraightOn); break; case 2: // Vertical 45. endstation_->setGeometry(VESPERS::Single45Vertical); break; case 3: // Horizontal 45. endstation_->setGeometry(VESPERS::Single45Horizontal); break; case 4: // Double 45. endstation_->setGeometry(VESPERS::Double45); break; case 5: // Big beam. endstation_->setGeometry(VESPERS::BigBeam); break; } updateAppearance(); updatePixmap(); if (techniquesBox_->isHidden()) techniquesBox_->show(); if (detectorsBox_->isHidden()) detectorsBox_->show(); }
AlbumWidget::AlbumWidget(QWidget* parent) : QWidget(parent) { qRegisterMetaType<QImage > ("QImage"); connect(&m_cd, SIGNAL(renderedImage(QImage)), this, SLOT(updatePixmap(QImage))); resize(300, 300); }
// Local rectangular contents update. void qtractorMidiEditView::updateContents ( const QRect& rect ) { updatePixmap( qtractorScrollView::contentsX(), qtractorScrollView::contentsY()); qtractorScrollView::updateContents(rect); }
void CaptureWidget::setPreview(const QImage& preview) { d->preview = preview; d->pixmap = QPixmap(contentsRect().size()); updatePixmap(); repaint(); }
void CellItem::reset() { m_state = KMinesState::Released; m_hasMine = false; m_exploded = false; m_digit = 0; updatePixmap(); }
// Overall contents update. void qtractorMidiEditView::updateContents (void) { updatePixmap( qtractorScrollView::contentsX(), qtractorScrollView::contentsY()); qtractorScrollView::updateContents(); }
void CaptureWidget::resizeEvent(QResizeEvent*) { blockSignals(true); d->pixmap = QPixmap(contentsRect().size()); updatePixmap(); repaint(); blockSignals(false); }
void KisTemplateCreateDia::slotCustom() { d->m_default->setChecked(false); d->m_custom->setChecked(true); if(d->m_customFile.isEmpty()) slotSelect(); else updatePixmap(); }
void rviewOSectionImage::refreshSlices(bool force) { if (force) flushSlices(); ensureSections(); fillBuffer(); updatePixmap(imgData, imgData); }
// Sets the mode according to the given textual mode. void QucsTranscalc::setMode (QString _mode) { for (int i = 0; i < MAX_TRANS_TYPES; i++) { if (TransLineTypes[i].description == _mode) { setMode (TransLineTypes[i].type); updatePixmap (mode); break; } } }
bool QDragManager::drag( QDragObject * o, QDragObject::DragMode mode ) { #ifdef DEBUG_QDND_SRC qDebug( "QDragManager::drag ( %p, %d )", o, mode ); #endif if ( object == o || !o || !o->parent() ) return false; if ( object ) { cancel(); qApp->removeEventFilter( this ); beingCancelled = false; } object = o; drag_mode = mode; updatePixmap(); willDrop = FALSE; #ifndef QT_NO_ACCESSIBILITY QAccessible::updateAccessibility( this, 0, QAccessible::DragDropStart ); #endif DWORD dwEffect, dwOKEffect; QOleDataObject *obj = new QOleDataObject( o ); QOleDropSource *qsrc = new QOleDropSource(); src = o->target(); dwOKEffect = translateToWinDragEffects ( mode ); updateCursor(); #ifdef Q_OS_TEMP HRESULT r = 0; resultEffect = 0; #else HRESULT r = DoDragDrop( obj, qsrc, dwOKEffect, &dwEffect ); #endif #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); restoreCursor = false; #endif // clean up obj->releaseQt(); obj->Release(); // Will delete obj if refcount becomes 0 qsrc->Release(); // Will delete src if refcount becomes 0 object = 0; #ifndef QT_NO_ACCESSIBILITY QAccessible::updateAccessibility( this, 0, QAccessible::DragDropEnd ); #endif return true; }
///// constructor ///////////////////////////////////////////////////////////// ColorButton::ColorButton(QWidget* parent, const char* name) : QPushButton(name, parent) /// The default constructor. { pixmap = new QPixmap(); setColor(QColor(0, 0, 0)); connect(this, SIGNAL(resized()), this, SLOT(updatePixmap())); connect(this, SIGNAL(clicked()), this, SLOT(selectColor())); }
///// constructor (overloaded) //////////////////////////////////////////////// ColorButton::ColorButton(const QColor& color, QWidget* parent, const char* name) : QPushButton(name, parent) /// \overloaded { pixmap = new QPixmap(); setColor(color); connect(this, SIGNAL(resized()), this, SLOT(updatePixmap())); connect(this, SIGNAL(clicked()), this, SLOT(selectColor())); }
void ClickableLabel::setPixmap(const QString& fileName) { m_pixmap = QPixmap(fileName); m_pixmapSize = m_pixmap.size(); this->QLabel::setPixmap(m_pixmap.scaled(this->width(), this->height(), Qt::KeepAspectRatio)); m_pixmap = *this->pixmap(); updatePixmap(); }
Viewportal::Viewportal(QWidget *parent) : QLabel(parent), cbType("Deuteranope"), simulate(false) { screenX = QApplication::desktop() -> screenGeometry().width(); screenY = QApplication::desktop() -> screenGeometry().height(); setFixedSize(screenX/2,screenY); setGeometry(QRect(screenX/2, 0, screenX, screenY)); QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(updatePixmap())); timer->start(MAX_UPDATE_INTERVAL); }