StickyButton::StickyButton(QWidget *parent) : Button(parent, i18n("On all desktops")), on_(false) { setPixmap(QPixmap((const char **)sticky_xpm)); }
void GenomeColorSelector::repaintLabel() { if (genome_ptr) { QSize s(maximumSize()); int width(s.width()); QImage palette(s, QImage::Format_RGB32); QPainter p(&palette); p.fillRect(palette.rect(), CheckersBrush(16)); if (show_histogram) { // draw the genome color histogram over the palette double color_hist[256]; memset(color_hist, 0, sizeof(double)*256); if (flam3_colorhist(genome_ptr, 1, Util::get_isaac_randctx(), color_hist)) logWarn(QString("GenomeColorSelector::repaintLabel : couldn't get flam3 color histogram")); QColor c; double rc, gc, bc, ac; int chist_scale = ( width / 4 ) * width; for (int i = 0 ; i < 256 ; i++) { double* color = genome_ptr->palette[i].color; rc = color[0]; gc = color[1]; bc = color[2]; ac = color[3]; if (rc < 0.0 || rc > 1.0 || bc < 0.0 || bc > 1.0 || gc < 0.0 || gc > 1.0) return; if (selected_y - 1 == i) // roundoff voodoo { c = QColor::fromRgbF(1.0 - rc, 1.0 - gc, 1.0 - bc); p.setPen(c); p.drawLine(0, 255 - i, width, 255 - i); } else { c = QColor::fromRgbF(rc, gc, bc, ac); p.setPen(c); p.drawLine(0, 255 - i, width, 255 - i); p.setPen(c.darker(300)); p.drawLine(0, 255 - i, (width / 2) , 255 - i); p.setPen(QColor::fromRgb(255,255,255,192)); p.drawLine(0, 255 - i, chist_scale * color_hist[i], 255 - i); } } } else { // just draw the genome color palette on the label QColor c; double rc, gc, bc, ac; for (int i = 0 ; i < 256 ; i++) { double* color = genome_ptr->palette[i].color; rc = color[0]; gc = color[1]; bc = color[2]; ac = color[3]; if (rc < 0.0 || rc > 1.0 || bc < 0.0 || bc > 1.0 || gc < 0.0 || gc > 1.0) return; if (selected_y - 1 == i) // roundoff voodoo { c = QColor::fromRgbF(1.0 - rc, 1.0 - gc, 1.0 - bc); p.setPen(c); p.drawLine(0, 255 - i, width, 255 - i); } else { c = QColor::fromRgbF(rc, gc, bc, ac); p.setPen(c); p.drawLine(0, 255 - i, width, 255 - i); } } } setPixmap(QPixmap::fromImage( palette )); } }
// -------------------------------------------------------------------------------------------------------------------------------------- void CIconLabel::setActiveIcon() { setPixmap(m_icons.at(m_activeIconIndex)); }
void GameItem::setPicture(const QString str, int w, int h) { setPixmap(QPixmap(str).copy(w,h,80,80)); }
Drum::Drum(): QObject(),QGraphicsPixmapItem(){ // drew graphics setPixmap(QPixmap(":/images/dumeblack.png")); }
void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align ) { QColorGroup m_cg( cg ); // TODO: reuse icons? if( column == HostListItem::Video ) { if( m_video ) { // video ? if( m_read_only ) setPixmap( HostListItem::Video, SmallIcon("nmm_option_on_readonly") ); else setPixmap( HostListItem::Video, SmallIcon("nmm_option_on") ); } else if( ! m_read_only) setPixmap( HostListItem::Video, SmallIcon("nmm_option_off") ); } else if( column == HostListItem::Audio ) { if( m_audio ) {// audio ? if( m_read_only ) setPixmap( HostListItem::Audio, SmallIcon("nmm_option_on_readonly") ); else setPixmap( HostListItem::Audio, SmallIcon("nmm_option_on") ); } else if( ! m_read_only) setPixmap( HostListItem::Audio, SmallIcon("nmm_option_off") ); } else if( column == HostListItem::Status ) { QFont font( p->font() ); if( ! m_status ) // Unknown { font.setBold( false ); setText( HostListItem::Status , i18n("Unknown") ); } else if( m_status == NmmEngine::STATUS_OK ) { font.setBold( false ); m_cg.setColor( QColorGroup::Text, Qt::darkGreen ); setText( HostListItem::Status , i18n("OK") ); } else { // error font.setBold( true ); m_cg.setColor( QColorGroup::Text, Qt::red ); setText( HostListItem::Status , i18n("Failed") ); } p->setFont( font ); } else if( column == HostListItem::Volume ) { QPixmap buf( width, height() ); QColor bg = listView()->viewport()->backgroundColor(); buf.fill( bg ); bitBlt( &buf, 0, 0, pixmapVolume( PixInset ) ); // Draw gradient static int padding = 7; static int vol; // pixelposition if( this == ((HostList*)listView())->m_hoveredVolume ) { vol = listView()->viewportToContents( listView()->viewport()->mapFromGlobal( QCursor::pos() ) ).x(); vol -= listView()->header()->sectionPos( HostListItem::Volume ); } else vol = (m_volume / 2) + 56; //std::cerr << "rel vol = " << vol << std::endl; static int center = 56; if( vol > center ) { bitBlt( &buf, 0, 0, pixmapVolume( PixRight ), 0, 0, vol + 1 /* TODO: why + 1??? */ ); } else if ( vol < center ) { bitBlt( &buf, vol, 0, pixmapVolume( PixLeft ), vol, 0, 56 ); } else {} // Calculate actual volume string from pixelposition vol = volumeAtPosition( vol ); QString vol_text; if( vol > 0 ) vol_text = "+"; vol_text += QString::number( vol ); vol_text += "%"; // Draw relative volume number QPainter p_number(&buf); p_number.setPen( cg.buttonText() ); QFont font; font.setPixelSize( 9 ); p_number.setFont( font ); const QRect rect( 40, 0, 34, 15 ); p_number.drawText( rect, Qt::AlignRight | Qt::AlignVCenter, vol_text ); p_number.end(); //bitBlt( p_number.device(), 0, 0, &buf ); p->drawPixmap( 0, 0, buf ); return; } KListViewItem::paintCell(p, m_cg, column, width, align); }
void pion::mouseReleaseEvent(QMouseEvent *ev) { ((MainWindow*)parent())->posOk=false; // si la souris est dans une zone de drop qui n'est pas occupé for(int indice=0;indice<9;indice++) { int pointPosX=((MainWindow*)parent())->vPos.at(indice).x(); int pointPosY=((MainWindow*)parent())->vPos.at(indice).y(); int sourisPosX=mapToParent(ev->pos()).x(); int sourisPosY=mapToParent(ev->pos()).y(); int diffX=pointPosX-sourisPosX; int diffY=pointPosY-sourisPosY; bool libre=((MainWindow*)parent())->vPosLibre.at(indice); // si la souris est dans la zone autour du point if(diffX<0) diffX=diffX*(-1); if(diffY<0) diffY=diffY*(-1); // vérification des droits this->droits(indice); if((((MainWindow*)parent())->tourDuJoueur==1 && pionNum<3) || (((MainWindow*)parent())->tourDuJoueur==2 && pionNum>2)) { // qDebug()<<"diffX(<50) : "+QString::number(diffX); // qDebug()<<"diffY(<50) : "+QString::number(diffY); // qDebug()<<"tous sur le plateau : "+QString::number(((MainWindow*)parent())->tousSurLePlateau); // qDebug()<<"a le droit : "+QString::number(aLeDroit); // qDebug()<<"Libre : "+QString::number(libre); if(diffX<30 && diffY<30 && libre && aLeDroit && ((MainWindow*)parent())->tousSurLePlateau) { ((MainWindow*)parent())->posOk=true; // placement du pion sur la nouvelle position bonPoint.setX(pointPosX); bonPoint.setY(pointPosY); ///XXX // enregistre la position du point ((MainWindow*)parent())->vPionPos.replace(pionNum,QPoint(pointPosX,pointPosY)); qDebug()<<"Taille de vPionPos (normal=6 ou 5 je sais pas) : "+QString::number(((MainWindow*)parent())->vPionPos.size()); // la position n'est plus libre ((MainWindow*)parent())->vPosLibre.replace(indice,false); // réccupération del'ancienne position for(int oldIndice=0;oldIndice<9;oldIndice++) { int oldPosX=((MainWindow*)parent())->vPos.at(oldIndice).x(); int oldPosY=((MainWindow*)parent())->vPos.at(oldIndice).y(); if(oldPosX==oldX && oldPosY==oldY) { // l'ancienne position retrouve sa liberté ((MainWindow*)parent())->vPosLibre.replace(oldIndice,true); } } } } } if(((MainWindow*)parent())->posOk) { qDebug()<<"bonne position"; // qDebug()<<"tourDuJoueur passe de"+QString::number(((MainWindow*)parent())->tourDuJoueur); // positionnement du pion this->move(bonPoint); // fin du tour if(((MainWindow*)parent())->tourDuJoueur==1) { ((MainWindow*)parent())->suisJeGagnant(0,1,2); ((MainWindow*)parent())->tourDuJoueur=2; ((MainWindow*)parent())->ui->labelTour->setText(tr("It's up to player 2")); } else { ((MainWindow*)parent())->suisJeGagnant(3,4,5); ((MainWindow*)parent())->tourDuJoueur=1; ((MainWindow*)parent())->ui->labelTour->setText(tr("It's up to player 1")); } // qDebug()<<" à "+QString::number(((MainWindow*)parent())->tourDuJoueur); if(pionNum<3) { setPixmap(QPixmap(":/pions/P1g")); } else { setPixmap(QPixmap(":/pions/P2g")); } if(((MainWindow*)parent())->toutPlacer<6) ((MainWindow*)parent())->toutPlacer++; } else { // positionnement annulé this->move(oldX,oldY); qDebug()<<"mauvaise position"; if(oldY!=412) { if(pionNum<3) { setPixmap(QPixmap(":/pions/P1g")); } else { setPixmap(QPixmap(":/pions/P2g")); } } } }
void ColorPickerLabel::setColor(const QColor & color) { _currentColor = color; if (_pickingEnabled && _knob) { //draw the picker on top of the label QPixmap pickerIcon; appPTR->getIcon(NATRON_PIXMAP_COLOR_PICKER, &pickerIcon); QImage pickerImg = pickerIcon.toImage(); QImage img(pickerIcon.width(), pickerIcon.height(), QImage::Format_ARGB32); img.fill( color.rgb() ); int h = pickerIcon.height(); int w = pickerIcon.width(); for (int i = 0; i < h; ++i) { const QRgb* data = (QRgb*)pickerImg.scanLine(i); if ( (i == 0) || (i == h - 1) ) { for (int j = 0; j < w; ++j) { img.setPixel( j, i, qRgb(0, 0, 0) ); } } else { for (int j = 0; j < w; ++j) { if ( (j == 0) || (j == w - 1) ) { img.setPixel( j, i, qRgb(0, 0, 0) ); } else { int alpha = qAlpha(data[j]); if (alpha > 0) { img.setPixel(j, i, data[j]); } } } } } QPixmap pix = QPixmap::fromImage(img); //.scaled(20, 20); setPixmap(pix); } else { QImage img(NATRON_MEDIUM_BUTTON_SIZE, NATRON_MEDIUM_BUTTON_SIZE, QImage::Format_ARGB32); int h = img.height(); int w = img.width(); QRgb c = color.rgb(); for (int i = 0; i < h; ++i) { if ( (i == 0) || (i == h - 1) ) { for (int j = 0; j < w; ++j) { img.setPixel( j, i, qRgb(0, 0, 0) ); } } else { for (int j = 0; j < w; ++j) { if ( (j == 0) || (j == w - 1) ) { img.setPixel( j, i, qRgb(0, 0, 0) ); } else { img.setPixel(j, i, c); } } } } QPixmap pix = QPixmap::fromImage(img); setPixmap(pix); } } // ColorPickerLabel::setColor
void human::keyPressEvent(QKeyEvent *event) { QDesktopWidget desktop; int h=desktop.geometry().height()/12; int w=(desktop.geometry().width()/14); if(event->key()==Qt::Key_Up){ y-=3; if(change_u==0){ creature_img=new QPixmap("://image/up1.png"); change_u++; } else if(change_u==1){ creature_img=new QPixmap("://image/up2.png"); change_u++; } else if(change_u==2){ creature_img=new QPixmap("://image/up3.png"); change_u++; } else if(change_u==3){ creature_img=new QPixmap("://image/up4.png"); change_u=0; } * creature_img= creature_img->scaled(w,h); setPixmap(*creature_img); setPos(x,y); if(this->accident()==true){ y+=3; setPos(x,y); } } if(event->key()==Qt::Key_Down){ y+=3; if(change_d==0){ creature_img=new QPixmap("://image/down1.png"); change_d++; } else if(change_d==1){ creature_img=new QPixmap("://image/down2.png"); change_d++; } else if(change_d==2){ creature_img=new QPixmap("://image/down3.png"); change_d++; } else if(change_d==3){ creature_img=new QPixmap("://image/down4.png"); change_d=0; } * creature_img= creature_img->scaled(w,h); setPixmap(*creature_img); setPos(x,y); if(this->accident()==true){ y-=5; setPos(x,y); } } if(event->key()==Qt::Key_Right){ x+=3; if(change ==0){ creature_img=new QPixmap("://image/left1.png"); change++; } else if(change==1){ creature_img=new QPixmap("://image/left2.png"); change++; } else if(change==2){ creature_img=new QPixmap("://image/left3.png"); change++; } else if(change==3){ creature_img=new QPixmap("://image/left4.png"); change=0; } * creature_img= creature_img->scaled(w,h); setPixmap(*creature_img); setPos(x,y); if(this->accident()==true){ x-=3; setPos(x,y); } } if(event->key()==Qt::Key_Left){ x-=3; if(change_ ==0){ creature_img=new QPixmap("://image/right1.png"); change_++; } else if(change_==1){ creature_img=new QPixmap("://image/right2.png"); change_++; } else if(change_==2){ creature_img=new QPixmap("://image/right3.png"); change_++; } else if(change_==3){ creature_img=new QPixmap("://image/right4.png"); change_=0; } * creature_img= creature_img->scaled(w,h); setPixmap(*creature_img); setPos(x,y); if(this->accident()==true){ x+=3; setPos(x,y); } } }
void SafeListViewGroup::init() { setPixmap(0, qPixmapFromMimeSource("folder_blue.png")); setRenameEnabled(0, true); }
SafeListViewEntry::SafeListViewEntry(SafeListViewGroup *parent, SafeEntry *item) : SafeListViewItem(parent, item) { setPixmap(0, qPixmapFromMimeSource("file_locked.png")); }
//==================================== // Timer for double clicks... //------------------------------------ void SCCMouseTest::timerDone ( void ) { SCCWrapPointer< Q3Dict<QString> > mText (mTextPtr); mStatus -> message (mText["WheelReleased"]); setPixmap (0); }
//==================================== // release event... //------------------------------------ void SCCMouseTest::releaseEvent (int) { SCCWrapPointer< Q3Dict<QString> > mText (mTextPtr); mStatus -> message (mText["ButtonReleased"]); setPixmap (0); }
optionsPage::optionsPage (QWidget *parent, OPTIONS *op): QWizardPage (parent) { options = op; setTitle (tr ("trackLine Options")); setPixmap (QWizard::WatermarkPixmap, QPixmap(":/icons/trackLineWatermark.png")); QVBoxLayout *vbox = new QVBoxLayout (this); vbox->setMargin (5); vbox->setSpacing (5); QGroupBox *lbox = new QGroupBox (tr ("Limits"), this); QHBoxLayout *lboxLayout = new QHBoxLayout; lbox->setLayout (lboxLayout); QVBoxLayout *lboxLeftLayout = new QVBoxLayout; QVBoxLayout *lboxRightLayout = new QVBoxLayout; lboxLayout->addLayout (lboxLeftLayout); lboxLayout->addLayout (lboxRightLayout); QGroupBox *gBox = new QGroupBox (tr ("GSF"), this); QHBoxLayout *gBoxLayout = new QHBoxLayout; gBox->setLayout (gBoxLayout); gBoxLayout->setSpacing (10); QGroupBox *ghBox = new QGroupBox (tr ("Heading"), this); QHBoxLayout *ghBoxLayout = new QHBoxLayout; ghBox->setLayout (ghBoxLayout); ghBoxLayout->setSpacing (10); headingGSF = new QDoubleSpinBox (this); headingGSF->setDecimals (1); headingGSF->setRange (1.0, 50.0); headingGSF->setSingleStep (10.0); headingGSF->setValue (options->heading[TRACKLINE_GSF]); headingGSF->setWrapping (TRUE); headingGSF->setToolTip (tr ("Set the heading limit for GSF files (degrees)")); headingGSF->setWhatsThis (headingGSFText); ghBoxLayout->addWidget (headingGSF); gBoxLayout->addWidget (ghBox); QGroupBox *gsBox = new QGroupBox (tr ("Speed"), this); QHBoxLayout *gsBoxLayout = new QHBoxLayout; gsBox->setLayout (gsBoxLayout); gsBoxLayout->setSpacing (10); speedGSF = new QDoubleSpinBox (this); speedGSF->setDecimals (1); speedGSF->setRange (1.0, 50.0); speedGSF->setSingleStep (10.0); speedGSF->setValue (options->speed[TRACKLINE_GSF]); speedGSF->setWrapping (TRUE); speedGSF->setToolTip (tr ("Set the speed limit for GSF files (knots)")); speedGSF->setWhatsThis (speedGSFText); gsBoxLayout->addWidget (speedGSF); gBoxLayout->addWidget (gsBox); lboxLeftLayout->addWidget (gBox); QGroupBox *pBox = new QGroupBox (tr ("POS/SBET"), this); QHBoxLayout *pBoxLayout = new QHBoxLayout; pBox->setLayout (pBoxLayout); pBoxLayout->setSpacing (10); QGroupBox *phBox = new QGroupBox (tr ("Heading"), this); QHBoxLayout *phBoxLayout = new QHBoxLayout; phBox->setLayout (phBoxLayout); phBoxLayout->setSpacing (10); headingPOS = new QDoubleSpinBox (this); headingPOS->setDecimals (1); headingPOS->setRange (1.0, 50.0); headingPOS->setSingleStep (10.0); headingPOS->setValue (options->heading[TRACKLINE_POS]); headingPOS->setWrapping (TRUE); headingPOS->setToolTip (tr ("Set the heading limit for POS/SBET files (degrees)")); headingPOS->setWhatsThis (headingPOSText); phBoxLayout->addWidget (headingPOS); pBoxLayout->addWidget (phBox); QGroupBox *psBox = new QGroupBox (tr ("Speed"), this); QHBoxLayout *psBoxLayout = new QHBoxLayout; psBox->setLayout (psBoxLayout); psBoxLayout->setSpacing (10); speedPOS = new QDoubleSpinBox (this); speedPOS->setDecimals (1); speedPOS->setRange (50.0, 500.0); speedPOS->setSingleStep (10.0); speedPOS->setValue (options->speed[TRACKLINE_POS]); speedPOS->setWrapping (TRUE); speedPOS->setToolTip (tr ("Set the speed limit for POS/SBET files (knots)")); speedPOS->setWhatsThis (speedPOSText); psBoxLayout->addWidget (speedPOS); pBoxLayout->addWidget (psBox); lboxLeftLayout->addWidget (pBox); QGroupBox *wBox = new QGroupBox (tr ("WLF"), this); QHBoxLayout *wBoxLayout = new QHBoxLayout; wBox->setLayout (wBoxLayout); wBoxLayout->setSpacing (10); QGroupBox *whBox = new QGroupBox (tr ("Heading"), this); QHBoxLayout *whBoxLayout = new QHBoxLayout; whBox->setLayout (whBoxLayout); whBoxLayout->setSpacing (10); headingWLF = new QDoubleSpinBox (this); headingWLF->setDecimals (1); headingWLF->setRange (1.0, 50.0); headingWLF->setSingleStep (10.0); headingWLF->setValue (options->heading[TRACKLINE_WLF]); headingWLF->setWrapping (TRUE); headingWLF->setToolTip (tr ("Set the heading limit for WLF files (degrees)")); headingWLF->setWhatsThis (headingWLFText); whBoxLayout->addWidget (headingWLF); wBoxLayout->addWidget (whBox); QGroupBox *wsBox = new QGroupBox (tr ("Speed"), this); QHBoxLayout *wsBoxLayout = new QHBoxLayout; wsBox->setLayout (wsBoxLayout); wsBoxLayout->setSpacing (10); speedWLF = new QDoubleSpinBox (this); speedWLF->setDecimals (1); speedWLF->setRange (50.0, 500.0); speedWLF->setSingleStep (10.0); speedWLF->setValue (options->speed[TRACKLINE_WLF]); speedWLF->setWrapping (TRUE); speedWLF->setToolTip (tr ("Set the speed limit for WLF files (knots)")); speedWLF->setWhatsThis (speedWLFText); wsBoxLayout->addWidget (speedWLF); wBoxLayout->addWidget (wsBox); lboxRightLayout->addWidget (wBox); QGroupBox *hBox = new QGroupBox (tr ("Hawkeye"), this); QHBoxLayout *hBoxLayout = new QHBoxLayout; hBox->setLayout (hBoxLayout); hBoxLayout->setSpacing (10); QGroupBox *hhBox = new QGroupBox (tr ("Heading"), this); QHBoxLayout *hhBoxLayout = new QHBoxLayout; hhBox->setLayout (hhBoxLayout); hhBoxLayout->setSpacing (10); headingHWK = new QDoubleSpinBox (this); headingHWK->setDecimals (1); headingHWK->setRange (1.0, 50.0); headingHWK->setSingleStep (10.0); headingHWK->setValue (options->heading[TRACKLINE_HWK]); headingHWK->setWrapping (TRUE); headingHWK->setToolTip (tr ("Set the heading limit for Hawkeye files (degrees)")); headingHWK->setWhatsThis (headingHWKText); hhBoxLayout->addWidget (headingHWK); hBoxLayout->addWidget (hhBox); QGroupBox *hsBox = new QGroupBox (tr ("Speed"), this); QHBoxLayout *hsBoxLayout = new QHBoxLayout; hsBox->setLayout (hsBoxLayout); hsBoxLayout->setSpacing (10); speedHWK = new QDoubleSpinBox (this); speedHWK->setDecimals (1); speedHWK->setRange (50.0, 500.0); speedHWK->setSingleStep (10.0); speedHWK->setValue (options->speed[TRACKLINE_HWK]); speedHWK->setWrapping (TRUE); speedHWK->setToolTip (tr ("Set the speed limit for Hawkeye files (knots)")); speedHWK->setWhatsThis (speedHWKText); hsBoxLayout->addWidget (speedHWK); hBoxLayout->addWidget (hsBox); lboxRightLayout->addWidget (hBox); vbox->addWidget (lbox); registerField ("headingGSF", headingGSF, "value", "valueChanged"); registerField ("speedGSF", speedGSF, "value", "valueChanged"); registerField ("headingPOS", headingPOS, "value", "valueChanged"); registerField ("speedPOS", speedPOS, "value", "valueChanged"); registerField ("headingWLF", headingWLF, "value", "valueChanged"); registerField ("speedWLF", speedWLF, "value", "valueChanged"); registerField ("headingHWK", headingHWK, "value", "valueChanged"); registerField ("speedHWK", speedHWK, "value", "valueChanged"); }
BuildSaiTowerIcon::BuildSaiTowerIcon(QGraphicsItem *parent): QGraphicsPixmapItem(parent){ setPixmap(QPixmap(":/images/sai_icon.png")); }
MainInfoItem::MainInfoItem(QListView *view, unsigned id) : ConfigItem(view, id) { setText(0, i18n("User info")); setPixmap(0, Pict("info")); }
/** * @brief Constructs dialog with specified connection */ CreateConnectionDialog::CreateConnectionDialog(ConnectionsDialog* parent) : QDialog(), _connectionsDialog(parent), _connection(nullptr), _fromURI(true), // todo: _fromURI:false _mongoUriWithStatus(nullptr) { setWindowTitle("Create New Connection"); setWindowIcon(GuiRegistry::instance().serverIcon()); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); // Remove help button (?) setMinimumWidth(450); //setAttribute(Qt::WA_DeleteOnClose); // Splitter-Left auto label01 = new QLabel("Replica Set"); label01->setStyleSheet("font-weight: bold"); auto wid1 = new QLabel; auto repSetImage = QPixmap("C:\\Users\\gsimsek\\Google Drive\\Cases - Drive\\replica_sets\\icons\\repset.png"); wid1->setPixmap(repSetImage); _uriLineEdit = new QLineEdit("mongodb://localhost:27017,localhost:27018,localhost:27019/admin?replicaSet=repset"); auto const& createConnStr= QString("b) <a style='color: %1' href='create'>Create connection manually</a>").arg("#106CD6"); auto createConnLabel = new QLabel(createConnStr); VERIFY(connect(createConnLabel, SIGNAL(linkActivated(QString)), this, SLOT(on_createConnLinkActivated()))); auto splitterL = new QSplitter; splitterL->setOrientation(Qt::Vertical); splitterL->addWidget(label01); splitterL->addWidget(wid1); //splitterL->addWidget(new QLabel("")); //splitterL->addWidget(nameWid); splitterL->addWidget(new QLabel("")); splitterL->addWidget(new QLabel("a) I have a URI connection string:")); splitterL->addWidget(_uriLineEdit); splitterL->addWidget(new QLabel("")); splitterL->addWidget(createConnLabel); splitterL->addWidget(new QLabel("")); // Splitter-Right auto label2 = new QLabel("Stand Alone Server"); label2->setStyleSheet("font-weight: bold"); auto wid2 = new QLabel; auto standAlone = QPixmap("C:\\Users\\gsimsek\\Google Drive\\Cases - Drive\\replica_sets\\icons\\stand_alone.png"); wid2->setPixmap(standAlone); auto splitterR = new QSplitter; splitterR->setOrientation(Qt::Vertical); splitterR->addWidget(label2); splitterR->addWidget(wid2); // Splitter layout auto splitterLay = new QHBoxLayout; splitterLay->addWidget(splitterL); //splitterLay->addWidget(splitterR); // Button Box QPushButton *testButton = new QPushButton("&Test"); testButton->setIcon(qApp->style()->standardIcon(QStyle::SP_MessageBoxInformation)); VERIFY(connect(testButton, SIGNAL(clicked()), this, SLOT(testConnection()))); QHBoxLayout *bottomLayout = new QHBoxLayout; bottomLayout->addWidget(testButton, 1, Qt::AlignLeft); QDialogButtonBox *buttonBox = new QDialogButtonBox(this); buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Save); buttonBox->button(QDialogButtonBox::Save)->setText("Next"); VERIFY(connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()))); VERIFY(connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()))); bottomLayout->addWidget(buttonBox); // main layout auto mainLayout = new QVBoxLayout; mainLayout->addLayout(splitterLay); mainLayout->addLayout(bottomLayout); setLayout(mainLayout); //_basicTab->setFocus(); adjustSize(); // Set minimum width - adjustment after adding SSLTab setMinimumWidth(550); }
void Canvas::clear() { setPixmap( QPixmap() ); }
void FixedAspectLabel::updateImage() { setPixmap(QPixmap::fromImage(image->mirrored(mirrorH, !mirrorV))); }
CloseButton::CloseButton(QWidget *parent) : SysBtn(parent) { setPixmap(_st.close_image); }
// ---------- PropertySheetIconValue PropertySheetIconValue::PropertySheetIconValue(const PropertySheetPixmapValue &pixmap) { setPixmap(QIcon::Normal, QIcon::Off, pixmap); }
MinimizeButton::MinimizeButton(QWidget *parent) : SysBtn(parent) { setPixmap(_st.minimize_image); }
void Drum::changeback(){ setPixmap(QPixmap(":/images/dumeblack.png")); }
MaximizeButton::MaximizeButton(QWidget *parent) : SysBtn(parent), _maximized(false) { setPixmap(_st.maximize_image); }
VpnWizard::VpnWizard(QWidget * parent) : FramelessWizard(parent) { addPage(new CStartPage); addPage(new GeneralPage); addPage(new RemotePage); addPage(new CertPage); addPage(new AdvPage); addPage(new CEndPage); //this->button(QWizard::WizardButton::BackButton)->setIcon(QIcon(":/data/images/back_small.png")); //this->button(QWizard::WizardButton::NextButton)->setIcon(QIcon(":/data/images/next_small.png")); auto geom = this->geometry(); geom.setHeight(460); geom.setWidth(501); QSize size = geom.size(); // int h = size.height(); int w = size.width(); // size.setHeight(qFloor(h * windowsDpiScale())); size.setWidth(qFloor(w * windowsDpiScale())); setFixedWidth(size.width()); setFixedHeight(size.height()); // resize(size); QPixmap pixmap(":/data/images/banner_wiz.png"); pixmap = pixmap.scaledToWidth(size.width(), Qt::TransformationMode::SmoothTransformation); setPixmap(QWizard::BannerPixmap, pixmap); //page(0)->setContentsMargins(0, 20, 0, 0); //page(1)->setContentsMargins(0, 20, 0, 0); //page(2)->setContentsMargins(0, 20, 0, 0); //page(3)->setContentsMargins(0, 20, 0, 0); //page(4)->setContentsMargins(0, 20, 0, 0); setWindowIcon(QIcon(":/data/images/logo.png")); setWindowTitle(QObject::tr("Create a new SSL VPN connection")); setWindowFlags(Qt::WindowCloseButtonHint); setModal(true); this->setWindowFlags(Qt::WindowCloseButtonHint | Qt::FramelessWindowHint); DWORD style = GetWindowLong((HWND)winId(), GWL_STYLE); SetWindowLong((HWND)winId(), GWL_STYLE, style); setWizardStyle(ModernStyle); //this->button(QWizard::WizardButton::NextButton)->setLayoutDirection(Qt::RightToLeft); this->setButtonText(QWizard::WizardButton::NextButton, QObject::tr("Next")); this->setButtonText(QWizard::WizardButton::BackButton, QObject::tr("Back")); this->setButtonText(QWizard::WizardButton::CancelButton, QObject::tr("Cancel")); this->setButtonText(QWizard::WizardButton::FinishButton, QObject::tr("Finish")); setStyleSheet("QPushButton:hover {background-color: rgb(195, 195, 195);}\nQPushButton {;text-align:center; \npadding-left: 3px;\n padding-top: 3px; padding-right: 3px;\n padding-bottom: 3px;}"); this->setupFrameless(); }
/** Constructor */ PropertyWidget::PropertyWidget(Mantid::Kernel::Property *prop, QWidget *parent, QGridLayout *layout, int row) : QWidget(parent), m_prop(prop), m_gridLayout(layout), m_parent(nullptr), m_row(row), // m_info(NULL), m_doc(), m_replaceWSButton(nullptr), m_widgets(), m_error(), m_isOutputWsProp(false), m_previousValue(), m_enteredValue(), m_icons(), m_useHistory(true) { if (!prop) throw std::runtime_error( "NULL Property passed to the PropertyWidget constructor."); setObjectName(QString::fromStdString(prop->name())); if (!m_gridLayout) { // Create a LOCAL grid layout m_gridLayout = new QGridLayout(this); m_gridLayout->setSpacing(5); this->setLayout(m_gridLayout); m_row = 0; m_parent = this; } else { // Use the parent of the provided QGridLayout when adding widgets m_parent = parent; // HACK - In this mode a property widget is not a true self-contained // widget: it has no children // of its own. By default, when added to a parent widget, it will be // drawn invisble // at the top left of the parent widget and obscure mouse clicks etc. // The hack fix is to lower it down the visible stack. this->lower(); } QWidget *infoWidget = new QWidget(); infoWidget->setLayout(new QHBoxLayout(this)); infoWidget->layout()->setSpacing(1); infoWidget->layout()->setContentsMargins(0, 0, 0, 0); m_gridLayout->addWidget(infoWidget, m_row, 4); QMap<Info, QPair<QString, QString>> pathsAndToolTips; pathsAndToolTips[RESTORE] = QPair<QString, QString>( ":/history.png", "This property had a previously-entered value. Click " "to toggle it off and on."); pathsAndToolTips[REPLACE] = QPair<QString, QString>( ":/replace.png", "A workspace with this name already exists and so will be overwritten."); pathsAndToolTips[INVALID] = QPair<QString, QString>(":/invalid.png", ""); std::vector<Info> labelOrder = {RESTORE, REPLACE, INVALID}; for (const Info &info : labelOrder) { const QString iconPath = pathsAndToolTips[info].first; const QString toolTip = pathsAndToolTips[info].second; auto icon = new ClickableLabel(this); icon->setPixmap(QPixmap(iconPath).scaledToHeight(15)); icon->setVisible(false); icon->setToolTip(toolTip); infoWidget->layout()->addWidget(icon); m_icons[info] = icon; } connect(m_icons[RESTORE], SIGNAL(clicked()), this, SLOT(toggleUseHistory())); /// Save the documentation tooltip m_doc = QString::fromStdString(prop->briefDocumentation()); if (!isOptionalProperty(prop)) { if (!m_doc.isEmpty()) m_doc += ".\n\n"; m_doc += "This property is required."; } if (prop->direction() == Direction::Output && dynamic_cast<IWorkspaceProperty *>(prop)) m_isOutputWsProp = true; }
void Launcher::leaveEvent(QEvent *event) { Q_UNUSED(event); setPixmap(QPixmap(launcher_pix).scaled(dock_height-5, dock_height-5, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); }
Gameover2::Gameover2() { setPixmap(QPixmap(":/images/gameover2.png")); setScale(1); setPos(0,0); }
// -------------------------------------------------------------------------------------------------------------------------------------- void CIconLabel::clear() { setPixmap(QPixmap(16,16)); m_icons.clear(); }
CupsdNetworkPage::CupsdNetworkPage(TQWidget *parent, const char *name) : CupsdPage(parent, name) { setPageLabel(i18n("Network")); setHeader(i18n("Network Settings")); setPixmap("network"); keepalive_ = new TQCheckBox(i18n("Keep alive"), this); keepalivetimeout_ = new KIntNumInput(this); maxclients_ = new KIntNumInput(this); maxrequestsize_ = new SizeWidget(this); clienttimeout_ = new KIntNumInput(this); hostnamelookup_ = new TQComboBox(this); listen_ = new EditList(this); keepalivetimeout_->setRange(0, 10000, 1, true); keepalivetimeout_->setSteps(1, 10); keepalivetimeout_->setSpecialValueText(i18n("Unlimited")); keepalivetimeout_->setSuffix(i18n(" sec")); maxclients_->setRange(1, 1000, 1, true); maxclients_->setSteps(1, 10); clienttimeout_->setRange(0, 10000, 1, true); clienttimeout_->setSteps(1, 10); clienttimeout_->setSpecialValueText(i18n("Unlimited")); clienttimeout_->setSuffix(i18n(" sec")); hostnamelookup_->insertItem(i18n("Off")); hostnamelookup_->insertItem(i18n("On")); hostnamelookup_->insertItem(i18n("Double")); TQLabel *l1 = new TQLabel(i18n("Hostname lookups:"), this); TQLabel *l2 = new TQLabel(i18n("Keep-alive timeout:"), this); TQLabel *l3 = new TQLabel(i18n("Max clients:"), this); TQLabel *l4 = new TQLabel(i18n("Max request size:"), this); TQLabel *l5 = new TQLabel(i18n("Client timeout:"), this); TQLabel *l6 = new TQLabel(i18n("Listen to:"), this); TQGridLayout *m1 = new TQGridLayout(this, 8, 2, 10, 7); m1->setRowStretch(7, 1); m1->setColStretch(1, 1); m1->addWidget(l1, 0, 0, Qt::AlignRight); m1->addWidget(l2, 2, 0, Qt::AlignRight); m1->addWidget(l3, 3, 0, Qt::AlignRight); m1->addWidget(l4, 4, 0, Qt::AlignRight); m1->addWidget(l5, 5, 0, Qt::AlignRight); m1->addWidget(l6, 6, 0, Qt::AlignTop|Qt::AlignRight); m1->addWidget(keepalive_, 1, 1); m1->addWidget(hostnamelookup_, 0, 1); m1->addWidget(keepalivetimeout_, 2, 1); m1->addWidget(maxclients_, 3, 1); m1->addWidget(maxrequestsize_, 4, 1); m1->addWidget(clienttimeout_, 5, 1); m1->addWidget(listen_, 6, 1); connect(listen_, TQT_SIGNAL(add()), TQT_SLOT(slotAdd())); connect(listen_, TQT_SIGNAL(edit(int)), TQT_SLOT(slotEdit(int))); connect(listen_, TQT_SIGNAL(defaultList()), TQT_SLOT(slotDefaultList())); connect(keepalive_, TQT_SIGNAL(toggled(bool)), keepalivetimeout_, TQT_SLOT(setEnabled(bool))); keepalive_->setChecked(true); }