void ProfileDialog::on_profilesButton_clicked() { QString name = QInputDialog::getText(this, tr("Enter name"), tr("Profile name:"), QLineEdit::Normal); if (name.isEmpty()) { QMessageBox::critical(this, tr("Invalid name"), tr("Name can not be empty!")); return; } QString pass = QInputDialog::getText(this, tr("Enter password"), tr("Password:"******"Repeat password"), tr("Repeat password:"******"Incorrect password"), tr("Passwords don't match each other")); return; } if (pass.isEmpty()) { QMessageBox::critical(this, tr("Incorrect password"), tr("Password can not be empty!")); return; } QWizard *wizard = new ProfileCreationWizard(m_manager, name, pass); #if defined(QUTIM_MOBILE_UI) wizard->showMaximized(); #else wizard->show(); #endif connect(wizard, SIGNAL(accepted()), this, SLOT(deleteLater())); connect(wizard, SIGNAL(rejected()), this, SLOT(show())); hide(); }
void ICQSearchResult::setRequestId(unsigned short id) { m_id = id; setStatus(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, (m_id == 0) || (m_id == SEARCH_FAIL)); }
void HierarchyList::removeTabPage() { QWidget *w = current(); if ( !w ) return; if ( w->inherits( "QTabWidget" ) ) { QTabWidget *tw = (QTabWidget*)w; if ( tw->currentPage() ) { QDesignerTabWidget *dtw = (QDesignerTabWidget*)tw; DeleteTabPageCommand *cmd = new DeleteTabPageCommand( i18n("Delete Page %1 of %2" ). arg( dtw->pageTitle() ).arg( tw->name() ), formWindow, tw, tw->currentPage() ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } } else if ( w->inherits( "QWizard" ) ) { QWizard *wiz = (QWizard*)formWindow->mainContainer(); if ( wiz->currentPage() ) { QDesignerWizard *dw = (QDesignerWizard*)wiz; DeleteWizardPageCommand *cmd = new DeleteWizardPageCommand( i18n("Delete Page %1 of %2" ). arg( dw->pageTitle() ).arg( wiz->name() ), formWindow, wiz, wiz->indexOf( wiz->currentPage() ), true ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } } }
void ICQSearchResult::setText(const QString &text) { lblStatus->setText(text); tblUser->hide(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, true); }
void ICQSearchResult::clear() { setRequestId(SEARCH_DONE, SEARCH_DONE); m_nFound = 0; tblUser->clear(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); }
//============================================================= MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui -> setupUi(this); //zaczytanie konfiguracji string fileName = "config.conf"; config = new ConfigManager(fileName); //je¿eli konfiguracja istnieje if (config -> ReadConfigFile() == ConfigManager::ACTION_OK) { // SprawdŸ czy istnieje baza sqLiteMaper = new SqLiteMaper(config -> configDictionary["DbName"]); if (sqLiteMaper -> CheckDatabase()) { if(sqLiteMaper -> Connect()) { // baza danych istnieje i mo¿na nawi¹zaæ po³¹czenie ui -> textEdit -> append("Nawi¹za³em po³¹czenie !"); } } else { // baza danych nie istnieje // utwórz now¹ bazê danych ui -> textEdit -> append(QString::fromStdString(sqLiteMaper -> lastError)); sqLiteMaper -> CreateDatabase("create.sql"); // wyœwietl treœæ zapytañ for(vector<string>::iterator it = sqLiteMaper->sqlList.begin(); it != sqLiteMaper->sqlList.end(); it++) { ui -> textEdit -> append(QString::fromStdString(*it)); } } } // konfiguracja nie istnieje else { QWizard wizard; Ui::FirstStartWizard wizardFirstStart; wizardFirstStart.setupUi(&wizard); if (wizard.exec() == QWizard::Accepted) { } //stwórz domyœln¹ konfiguracjê //QMessageBox::warning(this, "Ostrze¿enie", "B³¹d otwierania pliku konfiguracyjnego"); map<string, string> defaultDeictionary; defaultDeictionary["DbName"] = "comics.db"; config -> SetDefaultConfig(defaultDeictionary); config -> SaveConfigFile(); } }
void InitiateAccountAddition(QWidget *parent) { QWizard *wizard = new QWizard (parent); wizard->setAttribute (Qt::WA_DeleteOnClose); wizard->setWindowTitle (QObject::tr ("Add account")); wizard->addPage (new AddAccountWizardFirstPage (wizard)); wizard->show (); }
void AccountsListWidget::on_Add__released () { QWizard *wizard = new QWizard (this); wizard->setAttribute (Qt::WA_DeleteOnClose); wizard->setWindowTitle (tr ("Add account")); wizard->addPage (new AddAccountWizardFirstPage (wizard)); wizard->show (); }
void ICQSearchResult::setRequestId(unsigned short id1, unsigned short id2) { m_id1 = id1; m_id2 = id2; setStatus(); tblUser->show(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, (m_id1 == SEARCH_DONE) && (m_id2 == SEARCH_DONE)); }
QToolButton* WizardFiller::getExpandButton(HI::GUITestOpStatus &os){ QToolButton* expandButton = NULL; QWidget* dialog = QApplication::activeModalWidget(); GT_CHECK_RESULT(dialog, "activeModalWidget is NULL",NULL); QWizard* wizard = qobject_cast<QWizard*>(dialog); GT_CHECK_RESULT(wizard, "activeModalWidget is not of wizard type",NULL); QList<QWidget*> widList = wizard->currentPage()->findChildren<QWidget*>(); QList<QToolButton*> plusList; foreach(QWidget* w, widList){ QToolButton* but = qobject_cast<QToolButton*>(w); if (but && but->text()=="+" && abs(but->rect().width()-19)<2) plusList.append(but); }
void GameControllerAttachment::sceneFileConfig() { QDomDocument sceneFile(m_sceneFile->sceneFileDom()); QDomElement pathNode(sceneFile.documentElement().firstChildElement("EnginePath")); // Create a wizard for the configuration of the directories QWizard wizard; PathPage* page = new PathPage(&wizard); page->setDirectories( pathNode.attribute("mediapath"), pathNode.attribute("scriptpath") ); wizard.addPage(page); if (wizard.exec() == QDialog::Accepted) { pathNode.setAttribute("mediapath", wizard.field("mediadir").toString()); pathNode.setAttribute("scriptpath", wizard.field("scriptdir").toString()); } }
QWizard *ModelClassWizard::createWizardDialog(QWidget *parent, const QString &defaultPath, const WizardPageList &extensionPages) const { // Create a wizard QWizard *wizard = new QWizard(parent); wizard->setWindowTitle(tr("Model Class Wizard")); // Make our page as first page ModelNamePage *page = new ModelNamePage(wizard); int pageId = wizard->addPage(page); wizard->setProperty("_PageId_", pageId); page->setPath(defaultPath); // Now add the remaining pages foreach (QWizardPage *p, extensionPages) wizard->addPage(p); return wizard; }
ModuleManagerImpl::ModuleManagerImpl() { ModuleManager::loadPlugins(); Config config = ProfileDialog::profilesInfo(); #ifdef QUTIM_SINGLE_PROFILE bool singleProfile = true; #else bool singleProfile = false; #endif singleProfile = config.value("singleProfile", singleProfile); QWizard *wizard = 0; StatisticsHelper *helper = 0; if (singleProfile) { if (!config.hasChildGroup("profile")) { wizard = new ProfileCreationWizard(this, QString(), QString(), true); } else { config.beginGroup("profile"); helper = new StatisticsHelper(); if (helper->action() == StatisticsHelper::NeedToAskInit || helper->action() == StatisticsHelper::NeedToAskUpdate) { wizard = new QWizard(); wizard->addPage(new SubmitPage(helper, wizard)); } if(ProfileDialog::acceptProfileInfo(config, QString())) { QTimer::singleShot(0, this, SLOT(initExtensions())); } else { qWarning("Can't login"); QDialog *dialog = new ProfileDialog(config, this); SystemIntegration::show(dialog); } config.endGroup(); } } else { QDialog *dialog = new ProfileDialog(config, this); SystemIntegration::show(dialog); } if (wizard) { wizard->setAttribute(Qt::WA_DeleteOnClose, true); wizard->setAttribute(Qt::WA_QuitOnClose, false); SystemIntegration::show(wizard); } }
void HierarchyList::addTabPage() { QWidget *w = current(); if ( !w ) return; if ( w->inherits( "QTabWidget" ) ) { QTabWidget *tw = (QTabWidget*)w; AddTabPageCommand *cmd = new AddTabPageCommand( i18n("Add Page to %1" ).arg( tw->name() ), formWindow, tw, "Tab" ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } else if ( w->inherits( "QWizard" ) ) { QWizard *wiz = (QWizard*)formWindow->mainContainer(); AddWizardPageCommand *cmd = new AddWizardPageCommand( i18n("Add Page to %1" ).arg( wiz->name() ), formWindow, wiz, "Page" ); formWindow->commandHistory()->addCommand( cmd ); cmd->execute(); } }
void AddResult::finishEnable(bool state) { QWizard *w = NULL; for (QWidget *p = parentWidget(); p; p = p->parentWidget()){ if (p->inherits("QWizard")){ w = static_cast<QWizard*>(p); break; } } if (w == NULL) return; if (state != m_bConnect){ m_bConnect = state; if (m_bConnect){ connect(w->finishButton(), SIGNAL(clicked()), this, SLOT(finish())); }else{ disconnect(w->finishButton(), SIGNAL(clicked()), this, SLOT(finish())); } } w->setFinishEnabled(this, state); }
ICQSearchResult::ICQSearchResult(QWidget *parent, ICQClient *client) : ICQSearchResultBase(parent) { m_id1 = SEARCH_DONE; m_id2 = SEARCH_DONE; m_nFound = 0; m_client = client; int wChar = QFontMetrics(font()).width('0'); tblUser->addColumn("", -10*wChar); tblUser->setColumnAlignment(0, AlignRight); tblUser->addColumn(i18n("Alias"), 20*wChar); tblUser->addColumn(i18n("Name")); tblUser->setExpandingColumn(COL_NAME); tblUser->setSorting(COL_SCREEN); tblUser->setMenu(MenuSearchResult); tblUser->header()->hide(); connect(tblUser, SIGNAL(dragStart()), this, SLOT(dragStart())); connect(tblUser, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(doubleClicked(QListViewItem*))); connect(tblUser, SIGNAL(selectionChanged()), this, SLOT(selectChanged())); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); connect(wizard->finishButton(), SIGNAL(clicked()), this, SLOT(finishClicked())); }
//! [9] //! [10] int main(int argc, char *argv[]) //! [9] //! [11] { QApplication app(argc, argv); QString translatorFileName = QLatin1String("qt_"); translatorFileName += QLocale::system().name(); QTranslator *translator = new QTranslator(&app); if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath))) app.installTranslator(translator); QWizard wizard; wizard.addPage(createIntroPage()); wizard.addPage(createRegistrationPage()); wizard.addPage(createConclusionPage()); wizard.setWindowTitle("Trivial Wizard"); wizard.show(); return app.exec(); }
void ICQSearchResult::selectionChanged() { QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, (tblUser->selectedItem() != NULL)); }
void QEbuMainWindow::actionWizard() { QWizard *wizard = new QWizard(this); wizard->setWindowTitle(QObject::tr("Getting started")); wizard->setWizardStyle(QWizard::ModernStyle); wizard->adjustSize(); // INTRO QWizardPage *intro = new QWizardPage; { intro->setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/watermark.png")); intro->setTitle(QObject::tr("Introduction")); QVBoxLayout *layout = new QVBoxLayout; QLabel *label = new QLabel(QObject::tr("This brief tutorial will give an overview " "of the main components of the editor and their " "meaning. A couple of aspects of the GUI are pointed out " "in every page and small insight is given about the most " "relevant elements.")); label->setWordWrap(true); layout->addWidget(label); intro->setLayout(layout); } // FIRST PAGE - Basic Layout Description I // Breadcrumb // Grouping attributes/elements QWizardPage *page1 = new QWizardPage; { page1->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); page1->setTitle(QObject::tr("Basic Layout I")); page1->setSubTitle(QObject::tr("Breadcrumb and grouping")); QVBoxLayout *layout = new QVBoxLayout; QLabel *image = new QLabel; image->setPixmap(QPixmap(":/images/page0.png")); image->setAlignment(Qt::AlignHCenter); QLabel *firstParagraph = new QLabel("(1) A simple to read breadcrumb at the top of each page will help you remember at which level of the tree you are"); firstParagraph->setWordWrap(true); QLabel *secondParagraph = new QLabel("(2) All the fields within a form are grouped together, or at least sorted in a meaningful way. For any given types all the attributes are stacked at the top of the page, whereas inner elements occupy lower positions."); secondParagraph->setWordWrap(true); layout->addWidget(image); layout->addWidget(firstParagraph); layout->addWidget(secondParagraph); page1->setLayout(layout); } // SECOND PAGE - Basic Layout Description II // [0..1] // TAB QWizardPage *page2 = new QWizardPage; { page2->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); page2->setTitle(QObject::tr("Basic Layout II")); page2->setSubTitle(QObject::tr("Simple elements and Tabs")); QVBoxLayout *layout = new QVBoxLayout; QLabel *image = new QLabel; image->setPixmap(QPixmap(":/images/page1.png")); image->setAlignment(Qt::AlignHCenter); QLabel *firstParagraph = new QLabel("(1) Inner elements with cardinality of [0..1] are hadlled with a couple of buttons to add the element, or edit the existing one, and to remove it. An immutable edit box gives a direct feedback of the status of said element."); firstParagraph->setWordWrap(true); QLabel *secondParagraph = new QLabel("(2) To have a nicer and tidier appearence, in case of very rich panels, the content is divided among several tabs, with the aim to keep together correlated elements."); secondParagraph->setWordWrap(true); layout->addWidget(image); layout->addWidget(firstParagraph); layout->addWidget(secondParagraph); page2->setLayout(layout); } // THIRD PAGE - Basic Layout Description III // The Amazing ListView // Mention to New Form vs Simple Dialog QWizardPage *page3 = new QWizardPage; { page3->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); page3->setTitle(QObject::tr("Basic Layout III")); page3->setSubTitle(QObject::tr("Listview")); QVBoxLayout *layout = new QVBoxLayout; QLabel *image = new QLabel; image->setPixmap(QPixmap(":/images/page2.png")); image->setAlignment(Qt::AlignHCenter); QLabel *firstParagraph = new QLabel("In case of inner elements with [0..*] cardinality a custom list manager is provided, to manage the contents."); firstParagraph->setWordWrap(true); QLabel *secondParagraph = new QLabel("In presence of both single and multiple cardinality elements within the same form, to keep a coherent appearence all the items are managed with the proposed list view, that automatically forbids the insertion of more than one element, if needed."); secondParagraph->setWordWrap(true); layout->addWidget(image); layout->addWidget(firstParagraph); layout->addWidget(secondParagraph); page3->setLayout(layout); } // FOURTH PAGE - Dates & Numbers // Optional fields // Checkboxes // Compliance Check QWizardPage *page4 = new QWizardPage; { page4->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); page4->setTitle(QObject::tr("About data")); page4->setSubTitle(QObject::tr("Dates, numbers and validation")); QVBoxLayout *layout = new QVBoxLayout; QLabel *image = new QLabel; image->setPixmap(QPixmap(":/images/page3.png").scaledToWidth(500, Qt::SmoothTransformation)); image->setAlignment(Qt::AlignHCenter); QLabel *firstParagraph = new QLabel("(1) Unlike simple text fields, data and numeric related fields come with a checkbox to enable/disable its content from being saved to the XML files in creation. Upon a change of the represented value the checkboxes are automatically ticked off, whilst if unchecked their value is ignored or cleared if previusly modified."); firstParagraph->setWordWrap(true); QLabel *secondParagraph = new QLabel("(2) Upon clicking Apply a compliance check is run on the form contents, and an error message, preventing the user from continuing, appears in case of mistakes or shortcomings."); secondParagraph->setWordWrap(true); layout->addWidget(image); layout->addWidget(firstParagraph); layout->addWidget(secondParagraph); page4->setLayout(layout); } // END OF TUTORIAL wizard->addPage(intro); wizard->addPage(page1); page1->setFixedHeight(420); wizard->addPage(page2); wizard->addPage(page3); wizard->addPage(page4); wizard->exec(); }