本文整理汇总了C++中QCheckBox::name方法的典型用法代码示例。如果您正苦于以下问题:C++ QCheckBox::name方法的具体用法?C++ QCheckBox::name怎么用?C++ QCheckBox::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCheckBox
的用法示例。
在下文中一共展示了QCheckBox::name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: condition
QString JabberSearch::condition()
{
QString res;
if (m_bXData)
res += "x:data";
QObjectList *l = queryList("QLineEdit");
QObjectListIt it( *l );
QObject *obj;
while ((obj = it.current()) != 0 ){
QLineEdit *edit = static_cast<QLineEdit*>(obj);
if (!edit->text().isEmpty()){
if (!res.isEmpty())
res += ";";
res += edit->name();
res += "=";
res += quoteChars(edit->text(), ";");
}
++it;
}
delete l;
l = queryList("QComboBox");
QObjectListIt it1( *l );
while ((obj = it1.current()) != 0 ){
CComboBox *box = static_cast<CComboBox*>(obj);
if (box->currentText().isEmpty())
continue;
if (!res.isEmpty())
res += ";";
res += box->name();
res += "=";
res += quoteChars(box->value(), ";");
++it1;
}
delete l;
l = queryList("QCheckBox");
QObjectListIt it2( *l );
while ((obj = it2.current()) != 0 ){
QCheckBox *box = static_cast<QCheckBox*>(obj);
if (!box->isChecked())
continue;
if (!res.isEmpty())
res += ";";
res += box->name();
res += "=1";
++it2;
}
delete l;
if (!m_key.empty()){
if (!res.isEmpty())
res += ";";
res += "key=";
res += quoteChars(QString::fromUtf8(m_key.c_str()), ";");
}
return res;
}
示例2: condition
QString JabberSearch::condition(QWidget *w)
{
QString res;
if (m_bXData && (w == NULL))
res += "x:data";
if (w == NULL)
w = this;
QObjectList *l = w->queryList("QLineEdit");
QObjectListIt it( *l );
QObject *obj;
while ((obj = it.current()) != 0 ){
QLineEdit *edit = static_cast<QLineEdit*>(obj);
if (!edit->text().isEmpty()){
if (!res.isEmpty())
res += ';';
res += edit->name();
res += '=';
res += quoteChars(edit->text(), ";");
}
++it;
}
delete l;
l = w->queryList("QComboBox");
QObjectListIt it1( *l );
while ((obj = it1.current()) != 0 ){
CComboBox *box = static_cast<CComboBox*>(obj);
if (box->currentText().isEmpty()){
++it1;
continue;
}
if (!res.isEmpty())
res += ';';
res += box->name();
res += '=';
res += quoteChars(box->value(), ";");
++it1;
}
delete l;
l = w->queryList("QCheckBox");
QObjectListIt it2( *l );
while ((obj = it2.current()) != 0 ){
QCheckBox *box = static_cast<QCheckBox*>(obj);
if (!res.isEmpty())
res += ';';
res += box->name();
res += box->isChecked() ? "=1" : "=0";
++it2;
}
delete l;
l = w->queryList("QMultiLineEdit");
QObjectListIt it3( *l );
while ((obj = it3.current()) != 0 ){
QMultiLineEdit *edit = static_cast<QMultiLineEdit*>(obj);
if (!edit->text().isEmpty()){
if (!res.isEmpty())
res += ';';
res += edit->name();
res += '=';
res += quoteChars(edit->text(), ";");
}
++it3;
}
delete l;
if (!m_key.isEmpty() && (w == NULL)){
if (!res.isEmpty())
res += ';';
res += "key=";
res += quoteChars(m_key, ";");
}
return res;
}