当前位置: 首页>>代码示例>>C++>>正文


C++ QCheckBox::name方法代码示例

本文整理汇总了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;
}
开发者ID:,项目名称:,代码行数:61,代码来源:

示例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;
}
开发者ID:BackupTheBerlios,项目名称:sim-im-svn,代码行数:77,代码来源:jabbersearch.cpp


注:本文中的QCheckBox::name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。