本文整理汇总了C++中Query::getEditText方法的典型用法代码示例。如果您正苦于以下问题:C++ Query::getEditText方法的具体用法?C++ Query::getEditText怎么用?C++ Query::getEditText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::getEditText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setShade
void ShadeButton::setShade(QAction *act)
{
bool ok = false;
int a;
int c;
int b = 100;
for (a = 0; a < FillSh->actions().count(); ++a)
{
FillSh->actions()[a]->setChecked(false);
}
act->setChecked(true);
QList<QAction*> actList = FillSh->actions();
c = actList.indexOf(act);
if (c < 0)
return;
if (c > 0)
b = (c-1) * 10;
if (b > 100)
return; // no need for > 100%, fix needed by SM, Riku
if (c == 0)
{
Query* dia = new Query(this, "New", 1, 0, tr("&Shade:"), tr("Shade"));
if (dia->exec())
{
c = dia->getEditText().toInt(&ok);
if (ok)
b = qMax(qMin(c, 100),0);
else
b = 100;
delete dia;
}
else
{
delete dia;
return;
}
}
setText(QString::number(b)+" %");
emit clicked();
}
示例2: slotAdd
void JavaDocs::slotAdd()
{
QString nam;
Query *dia = new Query(this, "tt", 1, 0, tr("&New Script:"), tr("New Script"));
dia->setEditText( tr("New Script"), false );
dia->setTestList(Doc->JavaScripts.keys());
if (dia->exec())
{
nam = dia->getEditText();
nam.replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" );
Editor* dia2 = new Editor(this, "", View);
dia2->EditTex->setText("function "+nam+"()\n{\n}");
if (dia2->exec())
{
EditScript->setEnabled(true);
DeleteScript->setEnabled(true);
Doc->JavaScripts[nam] = dia2->EditTex->toPlainText();
Scripts->addItem(nam);
emit docChanged(false);
}
delete dia2;
}
delete dia;
}