本文整理汇总了C++中MessageBox::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageBox::SetText方法的具体用法?C++ MessageBox::SetText怎么用?C++ MessageBox::SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageBox
的用法示例。
在下文中一共展示了MessageBox::SetText方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteGymnast
void dbInterface::deleteGymnast(QString& p_strFirstName, QString& p_strLastName)
{
if (m_bInitialized)
{
QSqlDatabase db = QSqlDatabase::database("ConnMG");
QSqlQuery query(db);
QString strQuery = "DELETE FROM athlete WHERE first_name='" + p_strFirstName
+ "' AND last_name='" + p_strLastName.trimmed() + "'";
bool bRet = query.exec(strQuery);
if (bRet)
{
qInfo() << "Athlete removed: " << p_strFirstName << " " << p_strLastName;
}
else
{
QString strErr = "Athlete NOT removed: " + p_strFirstName + " " + p_strLastName
+ "\n" + query.lastError().text();
qCritical() << strErr;
MessageBox cMsgBox;
cMsgBox.SetTitle("Warning");
cMsgBox.SetText(strErr);
cMsgBox.Show();
}
}
else
{
qInfo() << "dbInterface::deleteGymnast(): Db not initialized";
}
}
示例2: ShowMessageBox
void GUISystem::ShowMessageBox(const CEGUI::String& text, MessageBox::eMessageBoxType type, MessageBox::Callback callback, int32 tag)
{
MessageBox* messageBox = new MessageBox(type, tag);
messageBox->SetText(text);
messageBox->RegisterCallback(callback);
messageBox->Show();
}
示例3: onSaveScore
void SaveScore::onSaveScore(QString p_strGymnastFullTxt,
QString p_strApparatus,
QString p_strStartScore,
QString p_strFinalScore,
bool p_bFinalApparatus)
{
QString strFinalApparatus = p_bFinalApparatus ? "FinalApparatus" : "";
qDebug() << "onSaveScore(): " << p_strGymnastFullTxt << ", "
<< p_strApparatus << ", "
<< p_strStartScore << ", "
<< p_strFinalScore << ", "
<< strFinalApparatus;
QString strErr = "";
bool bConvStartScoreOk = false;
float fStartScore = CheckStartScore(p_strStartScore, &bConvStartScoreOk);
if (!bConvStartScoreOk)
{
strErr = "Nota di partenza non é tra 0 e 10";
}
bool bConvFinalScoreOk = false;
float fFinalScore = CheckFinalScore(p_strFinalScore, &bConvFinalScoreOk);
if (!bConvFinalScoreOk)
{
if (!strErr.isEmpty())
strErr += "\n";
strErr += "Nota finale non é tra 0 e 20";
}
// save it to DB
SendToDb(p_strGymnastFullTxt, p_strApparatus, fStartScore, fFinalScore, p_bFinalApparatus);
// Show it to the user
if ((!bConvStartScoreOk) || (!bConvFinalScoreOk))
{
MessageBox cMsgBox;
cMsgBox.SetTitle("Warning");
cMsgBox.SetText(strErr);
cMsgBox.Show();
}
}