void NewWakuSettingsWindow::on_presets_regist_clicked() { QString text = QInputDialog::getText(this, QStringLiteral("プリセット登録"), QStringLiteral("プリセット名:"), QLineEdit::Normal, ui->presetes->currentText()); if (!text.isEmpty()) { int indexNew = ui->presetes->findText(text); if (indexNew == -1) { ui->presetes->addItem(text, makeJsonFromForm()); ui->presetes->setCurrentText(text); } else { QMessageBox msgBox(this); msgBox.setText(QStringLiteral("上書きしますか?")); msgBox.setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); if (msgBox.exec() == QMessageBox::Ok) { ui->presetes->setItemData(indexNew, makeJsonFromForm()); } } } }
//----------------------------------------------------------------------------- // Function: DrawingBoard::shouldSave() //----------------------------------------------------------------------------- bool DrawingBoard::shouldSave(TabDocument* doc) { bool save = true; QStringList errorList; if (!doc->validate(errorList)) { // If the document contained errors, inform the user and give options to save or cancel. QMessageBox msgBox(QMessageBox::Warning, QCoreApplication::applicationName(), tr("Document %1 contained %2 error(s). The document can be saved but " "may not be opened with other IP-XACT tools. Continue save?").arg(doc->getDocumentName(), QString::number(errorList.size())), QMessageBox::Yes | QMessageBox::No, this); msgBox.setDetailedText("The document contained the following error(s):\n* " + errorList.join("\n* ")); save = (msgBox.exec() == QMessageBox::Yes); } return save; }
void PresentationAudioListItem::showErrorDialog() { QMessageBox msgBox(QApplication::activeWindow()); msgBox.setWindowTitle(i18n("Error")); msgBox.setText(i18n("%1 may not be playable.", d->url.fileName())); msgBox.setDetailedText(d->mediaObject->errorString()); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); msgBox.setIcon(QMessageBox::Critical); msgBox.exec(); d->artist = d->url.fileName(); d->title = i18n("This file may not be playable."); setText(i18nc("artist - title", "%1 - %2", artist(), title())); setBackground(QBrush(Qt::red)); setForeground(QBrush(Qt::white)); QFont errorFont = font(); errorFont.setBold(true); errorFont.setItalic(true); setFont(errorFont); }
bool MainWnd::AskSave() //returns true if user has cancelled close { if(Modified) { QMessageBox msgBox(this); msgBox.setText("Сохранить изменения?"); msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Save); msgBox.setIcon(QMessageBox::Question); msgBox.setWindowTitle("Редактор"); int ret = msgBox.exec(); if(ret == QMessageBox::Save) { return !Save(curFile); } return (ret == QMessageBox::Cancel); } return false; }
bool FileFormatManager::importFile(Score &score, const std::string &filename, const FileFormat &format, QWidget *parentWindow) { if (myImporters.find(format) != myImporters.end()) { try { myImporters.at(format).load(filename, score); return true; } catch (const std::exception &e) { QMessageBox msgBox(parentWindow); msgBox.setText(QObject::tr("Error importing file - ") + QString(e.what())); msgBox.exec(); return false; } } return false; }
//---------------------------------------------------------------- int MessageHandler::showMessage(int type,QString message,QWidget* parent) { QMessageBox msgBox(parent); int ret=-1; switch (type) { case Debug: msgBox.setWindowTitle("Отладка"); msgBox.setText(message); ret=msgBox.exec(); break; case Error: msgBox.setWindowTitle("Ошибка"); msgBox.setText(message); ret=msgBox.exec(); break; case Message: break; case CloseWindow: msgBox.setWindowTitle("Закрыть окно"); msgBox.setText(message); msgBox.setStandardButtons(QMessageBox::Save|QMessageBox::Discard|QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Save); ret=msgBox.exec(); break; case ExitApp: msgBox.setWindowTitle("Закрыть окно"); msgBox.setText(message); msgBox.setStandardButtons(QMessageBox::Ok|QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Cancel); ret=msgBox.exec(); break; default: msgBox.setWindowTitle("Ошибка"); msgBox.setText("Неверный тип сообщения"); ret=msgBox.exec(); break; } return ret; }
bool DBConfigDialog::readFromFile(QString &line) { QFile initFile(QDir::currentPath()+"/init.bin"); if (!initFile.open(QIODevice::ReadOnly)) { QMessageBox msgBox(QMessageBox::Critical, tr("Błąd!"), tr("<font face=""Calibri"" size=""3"" color=""gray"">Nie można otworzyć pliku konfiguracji bazy danych.</font>")); msgBox.setStyleSheet("QMessageBox {background: white;}" "QPushButton:hover {" "border-radius: 5px;" "background: rgb(255,140,0);" "}" "QPushButton{" "color: white;" "border-radius: 5px;" "background: qlineargradient(x1:0, y1:0, x2:0, y2:1," "stop: 0 rgba(255,140,0), stop: 0.7 rgb(255,105,0));" "min-width: 70px;" "min-height: 30px;" "font-family: Calibri;" "font-size: 14;" "font-weight: bold;" "}" "QPushButton:pressed {" "color: white;" "border-radius: 5px;" "background: rgb(255,105,0);" "}" ); msgBox.setWindowIcon(QIcon(":/images/images/icon.ico")); msgBox.exec(); return false; } QDataStream in(&initFile); QString host,port,name,user,password; in >> host >> port >> name >> user >> password; line = host + ";" + port + ";" + name + ";" + user + ";" + password; initFile.close(); return true; }
void CWizEmailShareDialog::on_toolButton_send_clicked() { Q_ASSERT(!m_note.strGUID.isEmpty()); QString strToken = WizService::Token::token(); QString strKS = WizService::ApiEntry::kUrlFromGuid(strToken, m_note.strKbGUID); QString strExInfo = getExInfo(); QString strUrl = WizService::ApiEntry::mailShareUrl(strKS, strExInfo); // strUrl += strExInfo; // QUrl url(strKS); // strUrl.remove("http://{ks_host}"); // strUrl = url.scheme() + "://" + url.host() + strUrl; QNetworkAccessManager net; QNetworkReply* reply = net.get(QNetworkRequest(strUrl)); // QEventLoop loop; QMessageBox msgBox(this); msgBox.setText(tr("Sending...")); msgBox.setWindowTitle(tr("Info")); connect(reply, SIGNAL(finished()), &msgBox, SLOT(accept())); msgBox.exec(); if (reply->error() != QNetworkReply::NoError) { QMessageBox::information(this, tr("Info"), reply->errorString()); reply->deleteLater(); return; } QString strReply = QString::fromUtf8(reply->readAll()); int nCode; QString returnMessage; processReturnMessage(strReply, nCode, returnMessage); mailShareFinished(nCode, returnMessage); reply->deleteLater(); }
/** * \brief Naplnenie okna s informaciami o repozitari. */ void browseWindow::get_projects() { ui->progressBar->setMaximum(0); // Zapnutie progressbaru. // Prebratie zoznamu. Connection::instance()->req_list(); if (Connection::instance()->error()) { my_error = true; QMessageBox msgBox(QMessageBox::Critical, tr("Failed"), Connection::instance()->msg()); msgBox.exec(); return; } // Vymazanie zoznamov. ui->projectView->clear(); ui->projectView->reset(); // Prebranie projektov for (ProjectRecord_iter it = Connection::instance()->req_list_begin(); it != Connection::instance()->req_list_end(); ++it) { QTreeWidgetItem * item = new QTreeWidgetItem(ui->projectView); item->setText(PROJ_NAME_IDX, it->name); item->setText(5, QString::number(IDENT_PROJ)); ui->projectView->addTopLevelItem(item); QApplication::processEvents(); // aktualizuj progressbar } // Prebranie verzii int count = ui->projectView->topLevelItemCount(); for (int i = 0; i < count; ++i) { get_versionView(ui->projectView->topLevelItem(i));; QApplication::processEvents(); // aktualizuj progressbar } ui->progressBar->setMaximum(100); // Vypnutie progressbaru. }
void ShowUsage() { const char helpMessage[] = "Cppcheck GUI.\n\n" "Syntax:\n" " cppcheck-gui [OPTIONS] [files or paths]\n\n" "Options:\n" " -h, --help Print this help\n" " -p <file> Open given project file and start checking it\n" " -l <file> Open given results xml file\n" " -d <directory> Specify the directory that was checked to generate the results xml specified with -l\n"; #if defined(_WIN32) QMessageBox msgBox(QMessageBox::Information, "Cppcheck GUI", helpMessage, QMessageBox::Ok ); (void)msgBox.exec(); #else std::cout << helpMessage; #endif }
void GermCellSimulator::startRecording() { if (this->picFileName == "") { this->stopSimulation(); this->picFileName = QFileDialog::getSaveFileName(this, tr("Picture Save Location"), "", tr("JPEG Files (*.jpeg)")).toStdString(); if (this->picFileName == "") return; QDir().mkpath(this->picFileName.c_str()); if (!QDir(this->picFileName.c_str()).exists()) { QMessageBox msgBox(QMessageBox::Warning, tr("Picture Save Location Error"), tr("Files cannot be saved to the specified location")); msgBox.exec(); return; } } ui->pushButtonRecordStart->setEnabled(false); ui->pushButtonRecordStop->setEnabled(true); }
int MessageBox::questionYesNo(QWidget *parent, const QString &text, const QString &caption, const QString &yesButtonText, const QString &noButtonText) { QMessageBox::StandardButton result; if (!yesButtonText.isEmpty()) { QMessageBox msgBox(QMessageBox::Question, caption, text, QMessageBox::NoButton, parent); QPushButton *yesButton = msgBox.addButton(yesButtonText, QMessageBox::YesRole); if (!noButtonText.isEmpty()) msgBox.addButton(noButtonText, QMessageBox::NoRole); else msgBox.addButton(QMessageBox::No); msgBox.setDefaultButton(yesButton); msgBox.exec(); return (msgBox.clickedButton() == yesButton) ? Yes : No; } else // result = QMessageBox::question(parent, caption, text, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape); result = QMessageBox::question(parent, caption, text, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); return (result == QMessageBox::Yes) ? Yes : No; }
//------------------------------------------------------------------ // //------------------------------------------------------------------ UINT8 YesNoBox(string strMsg) { DBG_ENTER("YesNoBox(string strMsg)"); // INT8 value[256]; // memset((void*)value, 0, sizeof(value)); // sprintf(value,"%u卷发票未导入,查看吗?",nNum); CaMsgBox msgBox(strMsg.c_str(),CaMsgBox::MB_YESNO); msgBox.ShowBox(); if ((msgBox.m_iStatus == NO_PRESSED)||(msgBox.m_iStatus == CANCEL_PRESSED)) { DBG_PRINT((" YesNoBox(string strMsg) FAILURE")); DBG_RETURN(FAILURE); } if(msgBox.m_iStatus == OK_PRESSED) { DBG_PRINT((" YesNoBox(string strMsg) SUCCESS")); DBG_RETURN(SUCCESS); } }
void cqDialogGraph::savetodotfile() { QString fileName = QFileDialog::getSaveFileName( this, tr("Export DOT file"), QDir::currentPath(), "Graphviz DOT (*.dot)"); if (fileName.isEmpty()) return; QFile outfile(fileName); QMessageBox msgBox(this); msgBox.setIcon(QMessageBox::Warning); msgBox.setStandardButtons(QMessageBox::Ok); if (outfile.open(QIODevice::WriteOnly | QIODevice::Text) == false) { msgBox.setText(tr("File could not be saved!")); msgBox.exec(); return; } QTextStream out(&outfile); out << m_dot; outfile.close(); }
int main(int argc, char* argv[]) { setConsoleFlag(); LPTSTR cmdLine = GetCommandLine(); if (*cmdLine == '"') { if (*(cmdLine = strchr(cmdLine + 1, '"') + 1)) { cmdLine++; } } else if ((cmdLine = strchr(cmdLine, ' ')) != NULL) { cmdLine++; } else { cmdLine = ""; } HMODULE hLibrary = NULL; int result = prepare(hLibrary, cmdLine); if (result == ERROR_ALREADY_EXISTS) { char errMsg[BIG_STR] = {0}; loadString(hLibrary, INSTANCE_ALREADY_EXISTS_MSG, errMsg); msgBox(errMsg); FreeLibrary(hLibrary); return 2; } if (result != TRUE) { signalError(); if (hLibrary != NULL) { FreeLibrary(hLibrary); } return 1; } FreeLibrary(hLibrary); result = (int) execute(TRUE); if (result == -1) { signalError(); } else { return result; } }
int GwtCallback::showMessageBox(int type, QString caption, QString message, QString buttons, int defaultButton, int cancelButton) { QMessageBox msgBox(safeMessageBoxIcon(static_cast<QMessageBox::Icon>(type)), caption, message, QMessageBox::NoButton, pOwnerWindow_, Qt::Dialog | Qt::Sheet); msgBox.setWindowModality(Qt::WindowModal); msgBox.setTextFormat(Qt::PlainText); QStringList buttonList = buttons.split(QChar::fromAscii('|')); for (int i = 0; i != buttonList.size(); i++) { QPushButton* pBtn = msgBox.addButton(buttonList.at(i), captionToRole(buttonList.at(i))); if (defaultButton == i) msgBox.setDefaultButton(pBtn); } msgBox.exec(); QAbstractButton* button = msgBox.clickedButton(); if (!button) return cancelButton; for (int i = 0; i < buttonList.size(); i++) if (buttonList.at(i) == button->text()) return i; return cancelButton; }
void searchhandler::OpenDB_indexChanged(const int& idx) { if (idx < 0) return; sqlquery::en_filereadstatus sqstatus; if (m_autocompBusy) { m_autocompBusy = false; m_autocompFutureWatcher.waitForFinished(); } if (m_declarBusy) { m_declarBusy = false; m_declarFutureWatcher.waitForFinished(); } sq->close_dbfile(); QFileInfo dbfile(m_comboBoxDB->itemText(idx)); sqstatus = sq->open_dbfile(qt2str(m_comboBoxDB->itemText(idx))); if (sqstatus != sqlquery::sqlfileOK) { QMessageBox msgBox((QWidget*)mw); msgBox.setText(sqlerrormsg(sqstatus)); msgBox.exec(); m_comboBoxDB->removeItem(idx); } else { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); m_comboBoxSearch->clear(); m_comboBoxSearch->lineEdit()->clear(); m_searchMemoryList.clear(); m_iter = m_searchMemoryList.begin(); m_pushButtonSearchPrev->setEnabled(false); m_pushButtonSearchNext->setEnabled(false); emit sendDBtimestamp(dbfile.lastModified()); emit DBreset(); QApplication::restoreOverrideCursor(); } }
void MainWindow::deleteNote(QString note) { if (note.isEmpty()) note = getCurrentNoteGuid(); if (note.isEmpty()) return; Note *n = Note::fromGUID(note); if (n == NULL) return; QMessageBox msgBox(this); msgBox.setText("Are you sure you want to delete this Note?"); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); msgBox.setDefaultButton(QMessageBox::No); msgBox.setIcon(QMessageBox::Warning); msgBox.setWindowTitle(n->getTitle()); msgBox.exec(); if(msgBox.result() != QMessageBox::Yes) return; saveSelectionState(); Note::NoteUpdates updates; updates[Note::T_ACTIVE] = false; updates[Note::T_DELETED] = QDateTime::currentDateTime().toMSecsSinceEpoch(); n->update(updates); delete n; ui->notebooks->reload(); ui->tags->reload(); loadSelectionState(); searchIndex->dropNoteIndex(note); }
void BaseCheckoutWizard::runWizard(const QString &path, QWidget *parent, const QString & /*platform*/, const QVariantMap &extraValues) { Q_UNUSED(extraValues) // Create dialog and launch d->parameterPages = createParameterPages(path); Internal::CheckoutWizardDialog dialog(d->parameterPages, parent); d->dialog = &dialog; connect(&dialog, SIGNAL(progressPageShown()), this, SLOT(slotProgressPageShown())); dialog.setWindowTitle(displayName()); if (dialog.exec() != QDialog::Accepted) return; // Now try to find the project file and open const QString checkoutPath = d->checkoutPath; d->clear(); QString errorMessage; const QString projectFile = openProject(checkoutPath, &errorMessage); if (projectFile.isEmpty()) { QMessageBox msgBox(QMessageBox::Warning, tr("Cannot Open Project"), tr("Failed to open project in '%1'.").arg(QDir::toNativeSeparators(checkoutPath))); msgBox.setDetailedText(errorMessage); msgBox.exec(); } }
void ShowUsage() { QString helpMessage = MainWindow::tr( "Cppcheck GUI.\n\n" "Syntax:\n" " cppcheck-gui [OPTIONS] [files or paths]\n\n" "Options:\n" " -h, --help Print this help\n" " -p <file> Open given project file and start checking it\n" " -l <file> Open given results xml file\n" " -d <directory> Specify the directory that was checked to generate the results xml specified with -l\n" " -v, --version Show program version"); #if defined(_WIN32) QMessageBox msgBox(QMessageBox::Information, MainWindow::tr("Cppcheck GUI - Command line parameters"), helpMessage, QMessageBox::Ok ); (void)msgBox.exec(); #else std::cout << helpMessage.toStdString() << std::endl; #endif }
void DesignerMainWnd::openFile(QString& fileName, bool url) { DesignerDocComponent* pDoc = new DesignerDocComponent(); if (!(!url ? pDoc->loadFromDiskFile(fileName) : pDoc->loadFromUrl(fileName))) { QMessageBox msgBox(QMessageBox::Critical, tr("Lachesis Designer"), tr("Cannot open the file."), QMessageBox::Ok, this); msgBox.exec(); pDoc->deleteLater(); return; } DesignerMainWnd* pFrame = (currentModel ? globalCreateNewMainWnd() : this); pFrame->currentModel = pDoc->getCurrentModel(); pFrame->createView("FileDescriptionView", true); updateTabInfo(); }
void MainWindow::on_action_about_triggered() { QMessageBox msgBox(this); msgBox.setWindowTitle("关于 CCR Plus"); msgBox.setStyleSheet("QMessageBox{background-color:rgb(250,250,250);}"); msgBox.setText(QString( "<h2>CCR Plus 测评器<br/></h2>" "<p>版本:%1</p>" "<p>构建时间:%2 - %3</p>" "<p>Copyright © %4 绍兴一中 贾越凯。保留所有权利。<br/></p>" "<p>项目主页:<a href=\"https://github.com/sxyzccr/CCR-Plus\">https://github.com/sxyzccr/CCR-Plus</a></p>" "<p>下载地址: <a href=\"https://github.com/sxyzccr/CCR-Plus/releases\">https://github.com/sxyzccr/CCR-Plus/releases</a></p>" "<p>Bug 汇报: <a href=\"https://github.com/sxyzccr/CCR-Plus/issues\">https://github.com/sxyzccr/CCR-Plus/issues</a></p>" "<p>GitHub 贡献者: <a href=\"https://github.com/equation314\">equation314</a>, <a href=\"https://github.com/wwt17\">wwt17</a><br/></p>" "<p>本项目使用 <a href=\"http://www.gnu.org/licenses/gpl-3.0.html\">GNU 通用公共许可证</a>。</p>" "<p>感谢原版 CCR 以及 <a href=\"http://code.google.com/p/project-lemon\">project-lemon</a>,<a href=\"http://www.hustoj.com\">HUSTOJ</a> 等开源项目。</p>" ).arg(VERSION_LONGER).arg(__DATE__).arg(__TIME__).arg(YEAR_STRING)); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.setIconPixmap(QPixmap(":/image/logo.png")); msgBox.exec(); }
//----------------------------------------------------------------------------- // Function: DrawingBoard::refreshCurrentDocument() //----------------------------------------------------------------------------- void DrawingBoard::refreshCurrentDocument() { TabDocument* doc = static_cast<TabDocument*>(currentWidget()); if (doc == 0) { return; } if (doc->isModified()) { QMessageBox msgBox(QMessageBox::Warning, QCoreApplication::applicationName(), tr("The document has been modified. Save changes before refresh?"), QMessageBox::Yes | QMessageBox::No, this); if (msgBox.exec() == QMessageBox::Yes) { doc->save(); } } doc->refresh(); }
void Notepadqq::showQtVersionWarning(bool showCheckBox, QWidget *parent) { QSettings settings; QString dir = QDir::toNativeSeparators(QDir::homePath() + "/Qt"); QString altDir = "/opt/Qt"; QMessageBox msgBox(parent); msgBox.setWindowTitle(QCoreApplication::applicationName()); msgBox.setIcon(QMessageBox::Warning); msgBox.setText("<h3>" + QObject::tr("You are using an old version of Qt (%1)").arg(qVersion()) + "</h3>"); msgBox.setInformativeText("<html><body>" "<p>" + QObject::tr("Notepadqq will try to do its best, but <b>some things will not work properly</b>.") + "</p>" + QObject::tr( "Install a newer Qt version (≥ %1) from the official repositories " "of your distribution.<br><br>" "If it's not available, download Qt (≥ %1) from %2 and install it to \"%3\" or to \"%4\"."). arg("5.3"). arg("<nobr><a href=\"http://qt-project.org/\">http://qt-project.org/</a></nobr>"). arg("<nobr>" + dir + "</nobr>"). arg("<nobr>" + altDir + "</nobr>") + "</body></html>"); QCheckBox *chkDontShowAgain; if (showCheckBox) { chkDontShowAgain = new QCheckBox(); chkDontShowAgain->setText(QObject::tr("Don't show me this warning again")); msgBox.setCheckBox(chkDontShowAgain); } msgBox.exec(); if (showCheckBox) { settings.setValue("checkQtVersionAtStartup", !chkDontShowAgain->isChecked()); chkDontShowAgain->deleteLater(); } }
UINT8 CProductSaleWin::TotalCancelProc() { UINT8 ret; CaMsgBox msgBox("是否整单取消?",CaMsgBox::MB_YESNO); msgBox.ShowBox(); if ((msgBox.m_iStatus == NO_PRESSED)||(msgBox.m_iStatus == CANCEL_PRESSED)) { return SUCCESS; } if(msgBox.m_iStatus == OK_PRESSED) { this->ReFresh(); ret = pSaleData->TotalCancel(); if (ret != SUCCESS) { return(ErrMsgBox(ret)); } m_strSuffix = ""; m_pInput2->Clear(); ChangeWin(PRODUCT_SALE_MAIN_MENU); //返回销售档主界面 } return SUCCESS; }
void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel) { QString msg = tr("This sync would remove all the files in the sync folder '%1'.\n" "This might be because the folder was silently reconfigured, or that all " "the files were manually removed.\n" "Are you sure you want to perform this operation?"); QMessageBox msgBox(QMessageBox::Warning, tr("Remove All Files?"), msg.arg(alias())); msgBox.addButton(tr("Remove all files"), QMessageBox::DestructiveRole); QPushButton* keepBtn = msgBox.addButton(tr("Keep files"), QMessageBox::AcceptRole); if (msgBox.exec() == -1) { *cancel = true; return; } *cancel = msgBox.clickedButton() == keepBtn; if (*cancel) { wipe(); // speed up next sync _lastEtag.clear(); _forceSyncOnPollTimeout = true; QTimer::singleShot(50, this, SLOT(slotRunEtagJob())); } }
void TimeSignatureDialog::accept() { // Save the new beaming pattern values. TimeSignature::BeamingPattern pattern = {{0, 0, 0, 0}}; for (size_t i = 0; i < myBeamingPatterns.size(); ++i) { QLineEdit *value = myBeamingPatterns[i]; if (value->isEnabled()) pattern[i] = value->text().toUInt(); } if (pattern[0] == 0) { QMessageBox msgBox(this); msgBox.setIcon(QMessageBox::Warning); msgBox.setWindowTitle(tr("Time Signature")); msgBox.setText(tr("Invalid beaming pattern.")); msgBox.exec(); return; } myTimeSignature.setBeamingPattern(pattern); done(Accepted); }
void AddTulpaWidget::refreshPersonality() { QMessageBox msgBox(QMessageBox::Question,"Clean Personality", "Do you want to clean empty entries ?", QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); msgBox.setButtonText(QMessageBox::Cancel,"Clear All"); int reponse = msgBox.exec(); if (reponse == QMessageBox::Yes) { QStringList buffer = model->stringList(); personalityTraits.clear(); int size = buffer.size(); for(int i=0;i<size;i++) { if(buffer.at(i).isEmpty()) { } else { personalityTraits.push_back(buffer.at(i)); } } model->setStringList(personalityTraits); } else if(reponse == QMessageBox::Cancel) { personalityTraits = model->stringList(); personalityTraits.clear(); model->setStringList(personalityTraits); } }
UINT8 INV_MediumType(UINT8 &uJZlx) { INT32 status; CaMsgBox msgBox("介质(1报税盘2金税盘):",CaMsgBox::MB_INPUT); msgBox.SetInputType(CaInput::aINT); msgBox.SetMaxInputLen(1); msgBox.ShowBox(); status = msgBox.m_iStatus; if (status != OK_PRESSED) { //strErr= "请输入介质类型"; return FAILURE; } uJZlx = atoi((INT8 *)msgBox.GetInputContent()); DBG_PRINT(("uJZlx = %d", uJZlx)); if( (uJZlx > 2)||(uJZlx == 0) ) { CaMsgBox::ShowMsg("请输入正确的介质类型"); return FAILURE; } return SUCCESS; }
void QtWindow::keyboardShortcuts() { QMessageBox msgBox(this); msgBox.setWindowTitle (tr("PC Keyboard Short Cuts")); QString msg = tr( "<h2><center>Keyboard short cuts</center></h2>" "<p>The following PC keyboard short cuts have been defined.</p>" "<center><table border='1' cellspacing='0' cellpadding='4' >" ); msg += tr( "<tr>" "<th>Action</th>" "<th>Key</th>" "</tr>" ); msg += displayShortCut("ShortCuts/RightHand","Choose the right hand"); msg += displayShortCut("ShortCuts/BothHands","Choose both hands"); msg += displayShortCut("ShortCuts/LeftHand","Choose the left Hand"); msg += displayShortCut("ShortCuts/PlayFromStart","Play from start toggle"); msg += displayShortCut("ShortCuts/PlayPause","Play Pause Toggle"); msg += displayShortCut("ShortCuts/Faster","Increase the speed by 5%"); msg += displayShortCut("ShortCuts/Slower","Increase the speed by 5%"); msg += displayShortCut("ShortCuts/NextSong","Change to the Next Song"); msg += displayShortCut("ShortCuts/PreviousSong","Change to the Previous Song"); msg += tr( "<tr><td>Fake Piano keys</td><td>X is middle C</td></tr>" "</table> </center><br>" ); msgBox.setText(msg); msgBox.setMinimumWidth(600); msgBox.exec(); }