PackAddonSummaryFilesWidget::PackAddonSummaryFilesWidget(PackAddonDialog * pParent) : QDialog(pParent) { setObjectName("addon_package_summary_file_dialog"); setWindowTitle(__tr2qs_ctx("File Summary","addon")); setWindowModality(Qt::WindowModal); setModal(true); QVBoxLayout * pLayout = new QVBoxLayout(this); QLabel * pLabel = new QLabel(this); pLabel->setText(__tr2qs_ctx("Here are the files found in the directories you provided.\nIf the files listed below are correct, hit the \"Finish\" button to complete the packaging operation.","addon")); pLayout->addWidget(pLabel); m_pFiles = new QTextEdit(this); m_pFiles->setReadOnly(true); pLayout->addWidget(m_pFiles); KviTalHBox * pBox = new KviTalHBox(this); QPushButton * pCancel = new QPushButton(pBox); pCancel->setText(__tr2qs_ctx("Cancel","addon")); connect(pCancel,SIGNAL(clicked()),this,SLOT(reject())); QPushButton * pAccept = new QPushButton(pBox); pAccept->setText(__tr2qs_ctx("Finish","addon")); connect(pAccept,SIGNAL(clicked()),this,SLOT(accept())); pLayout->addWidget(pBox); }
NewPasswordDialog::NewPasswordDialog(GUtil::Qt::Settings *settings, const QString &filename, QWidget *par) :QDialog(par), ui(new Ui::NewPassword), m_settings(settings) { ui->setupUi(this); setWindowModality(Qt::WindowModal); setWindowTitle(QString(tr("New Key Info for %1")).arg(filename)); // We want to intercept when the user presses 'return' ui->lineEdit->installEventFilter(this); ui->lineEdit_2->installEventFilter(this); ui->lineEdit->setFocus(); if(settings->Contains(SETTING_LAST_CB_INDEX)){ int old_index = ui->comboBox->currentIndex(); ui->comboBox->setCurrentIndex(settings->Value(SETTING_LAST_CB_INDEX).toInt()); if(old_index == ui->comboBox->currentIndex()) _combobox_indexchanged(old_index); } else _combobox_indexchanged(ui->comboBox->currentIndex()); }
VBoxScreenshotViewer::VBoxScreenshotViewer (QWidget *aParent, const QPixmap &aScreenshot, const QString &aSnapshotName, const QString &aMachineName) : QIWithRetranslateUI2 <QWidget> (aParent, Qt::Tool) , mArea (new QScrollArea (this)) , mPicture (new QLabel) , mScreenshot (aScreenshot) , mSnapshotName (aSnapshotName) , mMachineName (aMachineName) , mZoomMode (true) { setWindowModality (Qt::ApplicationModal); setCursor (Qt::PointingHandCursor); QVBoxLayout *layout = new QVBoxLayout (this); layout->setMargin (0); mArea->setWidget (mPicture); mArea->setWidgetResizable (true); layout->addWidget (mArea); double aspectRatio = (double) aScreenshot.height() / aScreenshot.width(); QSize maxSize = aScreenshot.size() + QSize (mArea->frameWidth() * 2, mArea->frameWidth() * 2); QSize initSize = QSize (640, (int)(640 * aspectRatio)).boundedTo (maxSize); setMaximumSize (maxSize); QRect geo (QPoint (0, 0), initSize); geo.moveCenter (parentWidget()->geometry().center()); VBoxGlobal::setTopLevelGeometry(this, geo); retranslateUi(); }
void Frame::set_window_modality() { if (frame_type == "Dialog") // modal for Dialog frames { setWindowModality(Qt::WindowModal); } }
EditorPanel::EditorPanel(QPixmap pix, QWidget *parent) : QDialog(parent,Qt::CustomizeWindowHint), ui(new Ui::EditorPanelUI) { ui->setupUi(this); setFixedSize(size()); currentPix = pix; setWindowModality(Qt::ApplicationModal); QObject::connect(ui->btn_OK, SIGNAL(clicked()), this, SLOT(edit())); QObject::connect(ui->pushCancel, SIGNAL(clicked()), this, SLOT(reject())); ui->spinBoxHeight->setValue(currentPix.height()); ui->spinBoxWigth->setValue(currentPix.width()); pixSize = pix.size(); connect(ui->spinBoxHeight,static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [=](int h){ if(ui->btn_lock->isChecked()){ ui->spinBoxWigth->blockSignals(true); QSize newSize(ui->spinBoxHeight->value(),h); QSize diffSize = (QSize(pixSize.width(),h) - pixSize); pixSize.scale(newSize, diffSize.isValid() ? Qt::KeepAspectRatioByExpanding : Qt::KeepAspectRatio); ui->spinBoxWigth->setValue(pixSize.width()); ui->spinBoxWigth->blockSignals(false); } }); connect(ui->spinBoxWigth,static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [=](int w){ if(ui->btn_lock->isChecked()){ ui->spinBoxHeight->blockSignals(true); QSize newSize(w,ui->spinBoxHeight->value()); QSize diffSize = (QSize(w,pixSize.height()) - pixSize); pixSize.scale(newSize, diffSize.isValid() ? Qt::KeepAspectRatioByExpanding : Qt::KeepAspectRatio); ui->spinBoxHeight->setValue(pixSize.height()); ui->spinBoxWigth->blockSignals(false); } }); }
TicketPopup::TicketPopup(QWidget *parent, QString text, QPixmap pixmap, int timeToClose) { setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint); setWindowModality(Qt::ApplicationModal); setObjectName("main"); gridLayout = new QGridLayout(this); imagelabel = new QLabel(this); imagelabel->setPixmap(pixmap); imagelabel->setAlignment(Qt::AlignCenter); gridLayout->addWidget(imagelabel, 0, 0); editText = new QTextEdit(this); editText->setHtml(text); editText->setReadOnly(true); gridLayout->addWidget(editText, 1, 0); gridLayout->setMargin(17); timer = new QTimer(this); timer->setInterval(timeToClose); connect(timer, SIGNAL(timeout()), this, SLOT(closeIt())); QString path = KStandardDirs::locate("appdata", "images/"); QString filen = path + "/imgPrint.png"; QPixmap pix(filen); setMask(pix.mask()); QString st; st = QString("main { background-image: url(%1);}").arg(filen); setStyleSheet(st); }
KrCalcSpaceDialog::KrCalcSpaceDialog(QWidget *parent, KrPanel * panel, const QStringList & items, bool autoclose) : QDialog(parent), m_autoClose(autoclose), m_canceled(false), m_timerCounter(0), m_items(items), m_view(panel->view) { setWindowTitle(i18n("Calculate Occupied Space")); setWindowModality(Qt::WindowModal); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); m_thread = new CalcThread(panel->virtualPath(), items); m_pollTimer = new QTimer(this); m_label = new QLabel("", this); mainLayout->addWidget(m_label); showResult(); // fill m_label with something useful mainLayout->addStretch(10); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); mainLayout->addWidget(buttonBox); okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); // the dialog: The Ok button is hidden until it is needed okButton->setVisible(false); cancelButton = buttonBox->button(QDialogButtonBox::Cancel); connect(buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), SLOT(slotCancel())); }
SkinWidget::SkinWidget(QWidget *parent) : ShadowWidget(parent) , PIC_PATH(qApp->applicationDirPath() + "/../sources/img/skin/") , pImpl(new SkinWidget_Impl()) { setAttribute(Qt::WA_QuitOnClose, false); setWindowModality(Qt::ApplicationModal); QHBoxLayout *up_title_layout = new QHBoxLayout; set_no_margin(up_title_layout); pImpl->btn_close->setPicName(":/sysbutton/close"); connect(pImpl->btn_close, SIGNAL(clicked()), this, SLOT(hide())); up_title_layout->addWidget(pImpl->btn_close, 0, Qt::AlignTop); up_title_layout->addStretch(); QVBoxLayout *main_layout = new QVBoxLayout(this); pImpl->view->setWidgetResizable(true); pImpl->view->setContentsMargins(0, 0, 0, 0); QWidget *viewWidgetContents = new QWidget(pImpl->view); pImpl->scroll_layout->setContentsMargins(0, 0, 0, 0); pImpl->scroll_layout->setSpacing(2); viewWidgetContents->setLayout(pImpl->scroll_layout); pImpl->view->setWidget(viewWidgetContents); main_layout->addLayout(up_title_layout); main_layout->addWidget(pImpl->view); main_layout->setSpacing(0); main_layout->setContentsMargins(5, 5, 5, 5); QPalette text_palette = palette(); text_palette.setColor(QPalette::Background, QColor(255, 255, 255, 50)); setPalette(text_palette); setMinimumSize(800, 430); find_file(PIC_PATH); }
MDialog::MDialog(QWidget* parent): QDialog(parent) { onyx::screen::instance().enableUpdate ( true ); onyx::screen::instance().setDefaultWaveform(onyx::screen::ScreenProxy::GC); setWindowModality(Qt::ApplicationModal); setWindowFlags(Qt::FramelessWindowHint); QGridLayout *layout = new QGridLayout(this); QButtonGroup *group = new QButtonGroup(this); for ( int i = 1; i < 10; ++i ) { MToolButton *key = new MToolButton(this); key->setText(QString::number(i)); //key->resize(40,40); key->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); //setFocusPolicy(Qt::NoFocus); list.append (key); group->addButton ( key, i ); layout->addWidget ( key, (i - 1) / 3, (i - 1) % 3 ); connect(key, SIGNAL(clicked(bool)),this, SLOT(accept())); } group->button ( qBound ( 1, QSettings().value ( "Key", 1 ).toInt(), 10 ) )->click(); connect ( group, SIGNAL (buttonClicked(int)), this, SLOT ( setActiveKey ( int ) ) ); ///<will change keypad setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); //TODO set current_button_ to selected one current_button_ = 0; list.at(0)->setFocus(); setLayout(layout); }
//------------------------------------------------------------------------- IoProgressDialog::IoProgressDialog( QWidget *parent /*= 0*/ ) :QDialog(parent),_parent(parent) { ui.setupUi(this); setSizeAndPosition( _parent); Qt::WindowFlags flags; ui.label->setOpenExternalLinks( true ); ui.msgLabel->setOpenExternalLinks( true ); #ifdef Q_OS_OSX flags = Qt::Sheet; #else flags = Qt::SplashScreen; ui.progressBar->setFormat("%v/%m"); ui.progressBar->setTextVisible(true); #endif this->setWindowOpacity(0.8); flags ^= Qt::NoDropShadowWindowHint; setWindowFlags(flags); setWindowModality(Qt::WindowModal); setModal(true); this->setWindowIcon(QIcon(":/images/res/dcpm_256x256x32.png")); _s = size(); setIoHealth( 0 ); }
ParentBoxContextMenu::ParentBoxContextMenu(ParentBox *box) : BoxContextMenu((BasicBox*)box) { _box = box; setWindowModality(Qt::ApplicationModal); }
//----------------------------------------------------------------------------- //! //----------------------------------------------------------------------------- tLockedDialog::tLockedDialog( QWidget* pParent ) : tDialog( tDialog::Partial, pParent, DarkenOff ) { setWindowTitle( tr( "Locked" ) ); setWindowModality( Qt::WindowModal ); m_pTimer = new QTimer( this ); m_pTimer->setInterval( 2000 ); m_pTimer->setSingleShot( true ); Connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( accept() ) ); m_pTimer->start(); QHBoxLayout* pLayout = new QHBoxLayout( this ); QLabel* pIcon = new QLabel(); pIcon->setPixmap( tSystemSettings::Instance()->NightMode() ? tPath::ResourceFile( "medusa/icons/keylock_night.png" ) : tPath::ResourceFile( "medusa/icons/keylock_day.png" ) ); QLabel* pLabel = new QLabel( tr( "Autopilot is locked" ) ); pLayout->addWidget( pIcon ); pLayout->addWidget( pLabel ); setLayout( pLayout ); }
AdvancedSettingsWnd::AdvancedSettingsWnd(QWidget *parent) : QWidget(parent) { ui.setupUi(this); #ifdef Q_WS_MAEMO_5 setWindowFlags(windowFlags() | Qt::Window); // setAttribute(Qt::WA_Maemo5StackedWindow, true); // workaround for stacked window not working correclty: setAttribute(Qt::WA_Maemo5PortraitOrientation, true); setWindowModality(Qt::WindowModal); #else setParent(NULL); #endif if (true) // TODO zzzz; auto-detect orientation { // switch to portrait mode QHBoxLayout* buttonBoxLayout = new QHBoxLayout(); ui.buttonBoxSpacer->changeSize(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); ui.buttonBoxLayout->removeItem(ui.buttonBoxSpacer); _delete(ui.buttonBoxSpacer); ui.verticalLayout->removeWidget(ui.buttonBox); buttonBoxLayout->addWidget(ui.buttonBox); ui.gridLayout->removeItem(ui.buttonBoxLayout); _delete(ui.buttonBoxLayout); ui.gridLayout->addItem(buttonBoxLayout, 1, 0, 1, 1); } m_result = QDialog::Rejected; }
CLayoutWizard::CLayoutWizard(QWidget *parent) : QDialog(parent,Qt::Sheet), ui(new Ui::CLayoutWizard) { ui->setupUi(this); setWindowModality(Qt::WindowModal); setVisible(false); TitleElement.SetFont(QFont("Times New Roman",24)); SubtitleElement.SetFont(QFont("Times New Roman",18)); ComposerElement.SetFont(QFont("Times New Roman",12)); NamesElement.SetFont(QFont("Times New Roman",8)); connect(ui->topMargin,SIGNAL(Changed()),this,SLOT(UpdateMargins())); connect(ui->leftMargin,SIGNAL(Changed()),this,SLOT(UpdateMargins())); connect(ui->rightMargin,SIGNAL(Changed()),this,SLOT(UpdateMargins())); connect(ui->bottomMargin,SIGNAL(Changed()),this,SLOT(UpdateMargins())); connect(ui->tabWidget,SIGNAL(currentChanged(int)),this,SLOT(UpdateMargins())); connect(ui->NoteSpace,SIGNAL(valueChanged(int)),this,SLOT(SpacingTooltip(int))); ui->graphicsView->setScene(&S); Printer=new QPrinter(); pageSetupButton=new QToolButton(ui->graphicsView); pageSetupButton->setProperty("transparent",true); pageSetupButton->setIcon(QIcon(":/preferences.png")); pageSetupButton->setIconSize(QSize(32,32)); pageSetupButton->setFixedSize(QSize(36,36)); connect(pageSetupButton,SIGNAL(clicked()),this,SLOT(ShowPageSetup())); UpdateMargins(); }
Menu::Menu(QWidget *parent) : QWidget(parent), ui(new Ui::Menu) { ui->setupUi(this); setWindowFlags(Qt::WindowStaysOnTopHint); setWindowModality(Qt::ApplicationModal); setWindowTitle("Tandem Techies"); setFixedSize(geometry().width(), geometry().height()); QIcon icon(":/images/player.png"); setWindowIcon(icon); QLabel* background = new QLabel(this); QPixmap backgroundImg(":/images/bg.png"); background->setPixmap(backgroundImg); background->setGeometry(0, 0, geometry().width(), geometry().height()); background->setScaledContents(true); background->lower(); background->show(); //Make the logo's background transparent ui->lblLogo->setAttribute(Qt::WA_TranslucentBackground); //Make the menu border invisible setWindowFlags(Qt::MSWindowsFixedSizeDialogHint); setWindowFlags(Qt::CustomizeWindowHint); setWindowFlags(Qt::FramelessWindowHint); }
SplashScreen::SplashScreen( QWidget *parent /* = NULL*/ ):QDialog(parent) { setEnabled(false); setAttribute(Qt::WA_DeleteOnClose); setWindowFlags(Qt::Window | Qt::FramelessWindowHint); #ifdef Q_OS_WIN setWindowFlags(windowFlags() | Qt::MSWindowsFixedSizeDialogHint); #endif setWindowModality(Qt::ApplicationModal); QHBoxLayout* mainLayout = new QHBoxLayout(); setLayout(mainLayout); setContentsMargins(0, 0, 0, 0); mainLayout->setMargin(0); QFrame *frame = new QFrame(this); mainLayout->addWidget(frame); QHBoxLayout* frameLayout = new QHBoxLayout(); frameLayout->setMargin(0); frame->setContentsMargins(0, 0, 0, 0); frame->setLayout(frameLayout); SplashScreenWidget* sWidget = new SplashScreenWidget(); QVBoxLayout* aWLayout = (QVBoxLayout*)frame->layout(); aWLayout->insertWidget(0, sWidget); aWLayout->setStretchFactor(sWidget, 100); installEventFilter(this); }
VirtualInfo::VirtualInfo(QWidget* pParent, Qt::WindowFlags pFlags) : QDialog(pParent, pFlags) { setWindowModality(Qt::WindowModal); _parent = (VirtualClusterLineEdit*)(pParent); setObjectName("virtualInfo"); setCaption(_parent->_titleSingular); _id = _parent->_id; _titleLit = new QLabel(_parent->_titleSingular, this, "_titleLit"); _numberLit = new QLabel(tr("Number:"), this, "_numberLit"); _number = new QLabel(this, "_number"); _nameLit = new QLabel(tr("Name:"), this, "_nameLit"); _name = new QLabel(this, "_name"); _descripLit = new QLabel(tr("Description:"), this, "_descripLit"); _descrip = new QLabel(this, "_descrip"); _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); _numberLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _nameLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _close = new QPushButton(tr("&Close"), this, "_close"); _close->setDefault(true); QHBoxLayout* dialogLyt = new QHBoxLayout(this, 5, -1, "dialogLyt"); QVBoxLayout* titleLyt = new QVBoxLayout(dialogLyt, -1, "titleLyt"); titleLyt->addWidget(_titleLit); QHBoxLayout* dataLyt = new QHBoxLayout(titleLyt, -1, "mainLyt"); QVBoxLayout* litLyt = new QVBoxLayout(dataLyt, -1, "litLyt"); litLyt->addWidget(_numberLit); litLyt->addWidget(_nameLit); litLyt->addWidget(_descripLit); QVBoxLayout* infoLyt = new QVBoxLayout(dataLyt, -1, "infoLyt"); infoLyt->addWidget(_number); infoLyt->addWidget(_name); infoLyt->addWidget(_descrip); QSpacerItem* dataHtSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); titleLyt->addItem(dataHtSpacer); QHBoxLayout* buttonLyt = new QHBoxLayout(dialogLyt, -1, "buttonLyt"); QSpacerItem* wdSpacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonLyt->addItem(wdSpacer); QVBoxLayout* buttonColLyt = new QVBoxLayout(buttonLyt, -1, "buttonColLyt"); buttonColLyt->addWidget(_close); QSpacerItem* htSpacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonColLyt->addItem(htSpacer); connect(_close, SIGNAL(clicked()), this, SLOT(close())); _nameLit->setHidden(!_parent->_hasName); _name->setHidden(!_parent->_hasName); _descripLit->setHidden(!_parent->_hasDescription); _descrip->setHidden(!_parent->_hasDescription); sPopulate(); }
SpellChecker::SpellChecker(Editor* document) : QDialog(document->parentWidget(), Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint), m_document(document) { setWindowTitle(tr("Check Spelling")); setWindowModality(Qt::WindowModal); setAttribute(Qt::WA_DeleteOnClose); m_dictionary = new Dictionary(this); // Create widgets m_context = new Editor(this); m_context->setReadOnly(true); m_context->setTabStopWidth(50); QPushButton* add_button = new QPushButton(tr("Add"), this); add_button->setAutoDefault(false); connect(add_button, SIGNAL(clicked()), this, SLOT(add())); QPushButton* ignore_button = new QPushButton(tr("Ignore"), this); ignore_button->setAutoDefault(false); connect(ignore_button, SIGNAL(clicked()), this, SLOT(ignore())); QPushButton* ignore_all_button = new QPushButton(tr("Ignore All"), this); ignore_all_button->setAutoDefault(false); connect(ignore_all_button, SIGNAL(clicked()), this, SLOT(ignoreAll())); m_suggestion = new QLineEdit(this); QPushButton* change_button = new QPushButton(tr("Change"), this); change_button->setAutoDefault(false); connect(change_button, SIGNAL(clicked()), this, SLOT(change())); QPushButton* change_all_button = new QPushButton(tr("Change All"), this); change_all_button->setAutoDefault(false); connect(change_all_button, SIGNAL(clicked()), this, SLOT(changeAll())); m_suggestions = new QListWidget(this); connect(m_suggestions, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(suggestionChanged(QListWidgetItem*))); QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this); connect(buttons, SIGNAL(rejected()), this, SLOT(reject())); // Lay out dialog QGridLayout* layout = new QGridLayout(this); layout->setMargin(12); layout->setSpacing(6); layout->setColumnMinimumWidth(2, 6); layout->addWidget(new QLabel(tr("Not in dictionary:"), this), 0, 0, 1, 2); layout->addWidget(m_context, 1, 0, 3, 2); layout->addWidget(add_button, 1, 3); layout->addWidget(ignore_button, 2, 3); layout->addWidget(ignore_all_button, 3, 3); layout->setRowMinimumHeight(4, 12); layout->addWidget(new QLabel(tr("Change to:"), this), 5, 0); layout->addWidget(m_suggestion, 5, 1); layout->addWidget(m_suggestions, 6, 0, 1, 2); layout->addWidget(change_button, 5, 3); layout->addWidget(change_all_button, 6, 3, Qt::AlignTop); layout->setRowMinimumHeight(7, 12); layout->addWidget(buttons, 8, 3); }
RoomNamePrompt::RoomNamePrompt(QWidget* parent, const QString & roomName) : QDialog(parent) { setModal(true); setWindowFlags(Qt::Sheet); setWindowModality(Qt::WindowModal); setMinimumSize(360, 130); resize(360, 180); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); // Layout QVBoxLayout * dialogLayout = new QVBoxLayout(this); // Label label = new QLabel(tr("Enter a name for your room."), this); label->setWordWrap(true); dialogLayout->addWidget(label); // Input box leRoomName = new QLineEdit(this); leRoomName->setText(roomName); leRoomName->setMaxLength(59); // It didn't like 60 :( leRoomName->setStyleSheet("QLineEdit { padding: 3px; }"); leRoomName->selectAll(); dialogLayout->addWidget(leRoomName); cbSetPassword = new QCheckBox(this); cbSetPassword->setText(tr("set password")); dialogLayout->addWidget(cbSetPassword); lePassword = new QLineEdit(this); lePassword->setMaxLength(30); lePassword->setStyleSheet("QLineEdit { padding: 3px; }"); lePassword->setEnabled(false); dialogLayout->addWidget(lePassword); dialogLayout->addStretch(1); // Buttons QHBoxLayout * buttonLayout = new QHBoxLayout(); buttonLayout->addStretch(1); dialogLayout->addLayout(buttonLayout); QPushButton * btnCancel = new QPushButton(tr("Cancel")); QPushButton * btnOkay = new QPushButton(tr("Create room")); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); #ifdef Q_OS_MAC buttonLayout->addWidget(btnCancel); buttonLayout->addWidget(btnOkay); #else buttonLayout->addWidget(btnOkay); buttonLayout->addWidget(btnCancel); #endif btnOkay->setDefault(true); setStyleSheet("QPushButton { padding: 5px; }"); connect(cbSetPassword, SIGNAL(toggled(bool)), this, SLOT(checkBoxToggled())); }
workWindow::workWindow(QWidget *parent) : QDialog(parent) { ui=new Ui_workingDialog(); ui->setupUi(this); active=true; setWindowModality(Qt::ApplicationModal); connect( ui->buttonCancel,SIGNAL(clicked(bool)),this,SLOT(stop(bool))); }
BuildGroupUI::BuildGroupUI(QWidget *parent) : QWidget(parent) { init(); setWindowTitle(cns("新建群")); setAttribute(Qt::WA_DeleteOnClose); setWindowFlags(Qt::Tool); setWindowModality(Qt::ApplicationModal); }
LoadEmojiUI::LoadEmojiUI(QWidget *parent) : QWidget(parent) { init(); setWindowFlags(Qt::Tool); setAttribute(Qt::WA_DeleteOnClose); setWindowModality(Qt::ApplicationModal); setWindowTitle(cns("哈啤表情导入")); }
toAbout::toAbout(QWidget* parent, const char* name, bool modal) : QDialog(parent) { if (name) setObjectName(name); if (modal) setWindowModality(Qt::WindowModal); setupUi(this); #if !defined(TOBUILDTYPE_RELEASE) setWindowTitle(QString(TOAPPNAME) + " " BUILD_TAG); #endif // About Tab { QFile f(":/widgets/toabout.html"); f.open(QFile::ReadOnly); QString AboutText = QString::fromUtf8(f.readAll()); QString buffer = AboutText.arg(QString::fromLatin1(TORAVERSION)); textBrowserAbout->setHtml(buffer); } // License Tab { QFile f(":/widgets/gpl-2.0-standalone.html"); f.open(QFile::ReadOnly); QString LicenseText = QString::fromUtf8(f.readAll()); textBrowserLicense->setHtml(LicenseText); } // Copyright Tab { textBrowserCopyright->setHtml(CopyrightText); } // Version Tab { QString version; #if defined(HAVE_GITREVISION_H) version.append("<center><table>"); QString format = QString("<tr><td align=\"right\">%1:<td align=\"left\">%2"); version.append(format.arg("GITVERSION").arg(GITVERSION)); version.append(format.arg("GITVERSION_MAJOR").arg(GITVERSION_MAJOR)); version.append(format.arg("GITVERSION_MINOR").arg(GITVERSION_MINOR)); version.append(format.arg("GIT_BUILD_TYPE").arg(GIT_BUILD_TYPE)); version.append(format.arg("GITVERSION_COUNT").arg(GITVERSION_COUNT)); version.append(format.arg("GITVERSION_SHA1").arg(GITVERSION_SHA1)); version.append(format.arg("GITVERSION_SHORT").arg(GITVERSION_SHORT)); version.append(format.arg("BUILD_TAG").arg(BUILD_TAG)); version.append(format.arg("BUILD_DATE").arg(BUILD_DATE)); version.append("</table>"); #else version = TORAVERSION; #endif textBrowserVersion->setHtml(version); } }
QgsSymbolV2SelectorDialog::QgsSymbolV2SelectorDialog( QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent, bool embedded ) : QDialog( parent ) , mAdvancedMenu( NULL ) , mVectorLayer( vl ) , mMapCanvas( 0 ) { #ifdef Q_OS_MAC setWindowModality( Qt::WindowModal ); #endif mStyle = style; mSymbol = symbol; mPresentWidget = NULL; setupUi( this ); QSettings settings; restoreGeometry( settings.value( "/Windows/SymbolSelectorDialog/geometry" ).toByteArray() ); // can be embedded in renderer properties dialog if ( embedded ) { buttonBox->hide(); layout()->setContentsMargins( 0, 0, 0, 0 ); } // setup icons btnAddLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.svg" ) ) ); btnRemoveLayer->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.svg" ) ) ); QIcon iconLock; iconLock.addFile( QgsApplication::iconPath( "locked.svg" ), QSize(), QIcon::Normal, QIcon::On ); iconLock.addFile( QgsApplication::iconPath( "unlocked.svg" ), QSize(), QIcon::Normal, QIcon::Off ); btnLock->setIcon( iconLock ); btnUp->setIcon( QIcon( QgsApplication::iconPath( "symbologyUp.svg" ) ) ); btnDown->setIcon( QIcon( QgsApplication::iconPath( "symbologyDown.svg" ) ) ); model = new QStandardItemModel( layersTree ); // Set the symbol layersTree->setModel( model ); layersTree->setHeaderHidden( true ); QItemSelectionModel* selModel = layersTree->selectionModel(); connect( selModel, SIGNAL( currentChanged( const QModelIndex&, const QModelIndex& ) ), this, SLOT( layerChanged() ) ); loadSymbol( symbol, static_cast<SymbolLayerItem*>( model->invisibleRootItem() ) ); updatePreview(); connect( btnUp, SIGNAL( clicked() ), this, SLOT( moveLayerUp() ) ); connect( btnDown, SIGNAL( clicked() ), this, SLOT( moveLayerDown() ) ); connect( btnAddLayer, SIGNAL( clicked() ), this, SLOT( addLayer() ) ); connect( btnRemoveLayer, SIGNAL( clicked() ), this, SLOT( removeLayer() ) ); connect( btnLock, SIGNAL( clicked() ), this, SLOT( lockLayer() ) ); connect( btnSaveSymbol, SIGNAL( clicked() ), this, SLOT( saveSymbol() ) ); updateUi(); // set symbol as active item in the tree QModelIndex newIndex = layersTree->model()->index( 0, 0 ); layersTree->setCurrentIndex( newIndex ); }
EdgeWindow::EdgeWindow(QWidget* parent, EdgeWindowType type): QWidget(parent, Qt::Window) { setFixedSize(350, 130); setWindowModality(Qt::ApplicationModal); if (type == EW_ADD) setWindowTitle("Добавление ребра"); else setWindowTitle("Редактирование ребра"); QGridLayout* layout = new QGridLayout; setLayout(layout); QWidget* edit_widget = new QWidget(this); QGridLayout* edit_layout = new QGridLayout(); layout->addWidget(edit_widget, 0, 0); edit_widget->setLayout(edit_layout); QLabel* v1_lbl = new QLabel(edit_widget); v1_lbl->setText("Вершина"); v1_lbl->setAlignment(Qt::AlignCenter); edit_layout->addWidget(v1_lbl, 0, 0); QLabel* v2_lbl = new QLabel(edit_widget); v2_lbl->setText("Вершина"); v2_lbl->setAlignment(Qt::AlignCenter); edit_layout->addWidget(v2_lbl, 0, 1); QLabel* rel_lbl = new QLabel(edit_widget); rel_lbl->setText("Надежность"); rel_lbl->setAlignment(Qt::AlignCenter); edit_layout->addWidget(rel_lbl, 0, 2); v1_combo = new QComboBox(edit_widget); if (type == EW_EDIT) v1_combo->setEditable(false); edit_layout->addWidget(v1_combo, 1, 0); v2_combo = new QComboBox(edit_widget); if (type == EW_EDIT) v2_combo->setEditable(false); edit_layout->addWidget(v2_combo, 1, 1); rel_spin = new QDoubleSpinBox(edit_widget); rel_spin->setRange(0, 1); rel_spin->setSingleStep(0.001); rel_spin->setDecimals(6); rel_spin->setAlignment(Qt::AlignCenter); edit_layout->addWidget(rel_spin, 1, 2); QWidget* control_widget = new QWidget(this); QGridLayout* control_layout = new QGridLayout(); control_widget->setLayout(control_layout); layout->addWidget(control_widget, 1, 0); QPushButton* ok_button = new QPushButton(control_widget); if (type == EW_ADD) ok_button->setText("Добавить"); else ok_button->setText("Готово"); control_layout->addWidget(ok_button, 0, 0); QPushButton* cancel_button = new QPushButton(control_widget); cancel_button->setText("Отмена"); control_layout->addWidget(cancel_button, 0, 1); connect(ok_button, SIGNAL(clicked()), SLOT(okButtonClicked())); connect(cancel_button, SIGNAL(clicked()), SLOT(close())); }
Colordialog::Colordialog(const QColor &color, QWidget *parent) : QDialog(parent) { setWindowModality(Qt::WindowModal); actual_col = color; setSizeGripEnabled(true); setMinimumSize(250, 250); init(); show(); }
void FirstRun::buildPrivDialog() { setWindowTitle( qtr( "Privacy and Network Access Policy" ) ); setWindowRole( "vlc-privacy" ); setWindowModality( Qt::ApplicationModal ); setWindowFlags( Qt::Dialog ); setAttribute( Qt::WA_DeleteOnClose ); QGridLayout *gLayout = new QGridLayout( this ); QGroupBox *blabla = new QGroupBox( qtr( "Privacy and Network Access Policy" ) ); QGridLayout *blablaLayout = new QGridLayout( blabla ); QLabel *text = new QLabel( qtr( "<p>In order to protect your privacy, <i>VLC media player</i> " "does <b>not</b> collect personal data or transmit them, " "not even in anonymized form, to anyone." "</p>\n" "<p>Nevertheless, <i>VLC</i> is able to automatically retrieve " "information about the media in your playlist from third party " "Internet-based services. This includes cover art, track names, " "artist names and other meta-data." "</p>\n" "<p>Consequently, this may entail identifying some of your media files to third party " "entities. Therefore the <i>VLC</i> developers require your express " "consent for the media player to access the Internet automatically." "</p>\n" ) ); text->setWordWrap( true ); text->setTextFormat( Qt::RichText ); blablaLayout->addWidget( text, 0, 0 ) ; QGroupBox *options = new QGroupBox( qtr( "Network Access Policy" ) ); QGridLayout *optionsLayout = new QGridLayout( options ); gLayout->addWidget( blabla, 0, 0, 1, 3 ); gLayout->addWidget( options, 1, 0, 1, 3 ); int line = 0; checkbox = new QCheckBox( qtr( "Automatically retrieve media info" ) ); checkbox->setChecked( true ); optionsLayout->addWidget( checkbox, line++, 0 ); #ifdef UPDATE_CHECK checkbox2 = new QCheckBox( qtr( "Regularly check for VLC updates" ) ); checkbox2->setChecked( true ); optionsLayout->addWidget( checkbox2, line++, 0 ); #endif QDialogButtonBox *buttonsBox = new QDialogButtonBox( this ); buttonsBox->addButton( qtr( "Continue" ), QDialogButtonBox::AcceptRole ); gLayout->addWidget( buttonsBox, 2, 0, 2, 3 ); CONNECT( buttonsBox, accepted(), this, save() ); buttonsBox->setFocus(); }
SeedPrompt::SeedPrompt(QWidget* parent, const QString & seed, bool editable) : QDialog(parent) { setModal(true); setWindowFlags(Qt::Sheet); setWindowModality(Qt::WindowModal); setMinimumSize(360, 160); resize(360, 160); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); // Layout QVBoxLayout * dialogLayout = new QVBoxLayout(this); // Label QLabel * label = new QLabel(tr("The map seed is the basis for all random values generated by the game.")); label->setWordWrap(true); dialogLayout->addWidget(label, 0); // Input box editBox = new QLineEdit(); editBox->setText(seed); editBox->setReadOnly(!editable); editBox->setStyleSheet("QLineEdit { padding: 3px; }"); dialogLayout->addWidget(editBox, 1); dialogLayout->addStretch(1); // Buttons QHBoxLayout * buttonLayout = new QHBoxLayout(); buttonLayout->addStretch(1); dialogLayout->addLayout(buttonLayout); if (editable) { QPushButton * btnCancel = new QPushButton(tr("Cancel")); QPushButton * btnOkay = new QPushButton(tr("Set seed")); connect(btnCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(btnOkay, SIGNAL(clicked()), this, SLOT(accept())); #ifdef Q_OS_MAC buttonLayout->addWidget(btnCancel); buttonLayout->addWidget(btnOkay); #else buttonLayout->addWidget(btnOkay); buttonLayout->addWidget(btnCancel); #endif btnOkay->setDefault(true); } else { QPushButton * btnClose = new QPushButton(tr("Close")); connect(btnClose, SIGNAL(clicked()), this, SLOT(reject())); buttonLayout->addWidget(btnClose); btnClose->setDefault(true); } setStyleSheet("QPushButton { padding: 5px; }"); connect(this, SIGNAL(accepted()), this, SLOT(setSeed())); }
connectToServerDialogImpl::connectToServerDialogImpl(QWidget *parent) : QDialog(parent) { #ifdef __APPLE__ setWindowModality(Qt::ApplicationModal); setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog); #endif setupUi(this); }
PolarDialog::PolarDialog( Polar& polar, QWidget* parent) : QWidget(parent), _polar(polar) { setWindowFlags( Qt::Tool ); setWindowModality( Qt::WindowModal ); setAttribute(Qt::WA_DeleteOnClose); if( _globalMainWindow ) { // Resize the window to the same size as the main window has. That will // completely hide the parent window. resize( _globalMainWindow->size() ); } QPalette palette; palette.setColor(backgroundRole(), Qt::white); setPalette(palette); setWindowTitle ( polar.name() + tr(" - Mouse click to Close") ); QShortcut* rcUp = new QShortcut(this); QShortcut* rcDown = new QShortcut(this); QShortcut* rcShiftUp = new QShortcut(this); QShortcut* rcShiftDown = new QShortcut(this); QShortcut* rcLeft = new QShortcut(this); QShortcut* rcRight = new QShortcut(this); QShortcut* rcSpace = new QShortcut(this); QShortcut* rcReturn = new QShortcut(this); rcUp->setKey (Qt::Key_Up); rcDown->setKey (Qt::Key_Down); rcShiftUp->setKey (Qt::Key_Up + Qt::SHIFT); rcShiftDown->setKey (Qt::Key_Down + Qt::SHIFT); rcLeft->setKey (Qt::Key_Left); rcRight->setKey (Qt::Key_Right); rcSpace->setKey (Qt::Key_Space); rcReturn->setKey (Qt::Key_Return); connect(rcUp, SIGNAL(activated()), this, SLOT(slot_keyup())); connect(rcDown, SIGNAL(activated()), this, SLOT(slot_keydown())); connect(rcShiftUp, SIGNAL(activated()), this, SLOT(slot_shiftkeyup())); connect(rcShiftDown,SIGNAL(activated()), this, SLOT(slot_shiftkeydown())); connect(rcLeft, SIGNAL(activated()), this, SLOT(slot_keyleft())); connect(rcRight, SIGNAL(activated()), this, SLOT(slot_keyright())); connect(rcSpace, SIGNAL(activated()), this, SLOT(slot_keyhome())); connect(rcReturn, SIGNAL(activated()), this, SLOT(slot_keyreturn())); setVisible(true ); }