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


C++ GridBox::setObjectName方法代码示例

本文整理汇总了C++中GridBox::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ GridBox::setObjectName方法的具体用法?C++ GridBox::setObjectName怎么用?C++ GridBox::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridBox的用法示例。


在下文中一共展示了GridBox::setObjectName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TabDialog

SettingsDialog::SettingsDialog(StateSpecVector * st, ColorSpecVector * co,
                               bool nodefault, bool unchanged, QString title)
    : TabDialog(0, title.toLatin1().constData(), TRUE),
      states(st), colors(co), first_visible_page(0),
      several(unchanged), did_apply(FALSE)
{
    setWindowTitle((title.isEmpty()) ? QObject::tr("Diagram Drawing Settings dialog") : title);

    QString s_diagram = QObject::tr("diagram");

    QWidget * grid = 0;

    QString tabname;
    unsigned i;
    unsigned n;

    if (states != 0) {
        n = states->size();
        cbstates = new QHash<int,ComboStates*>;

        for (i = 0; i != n; i += 1) {
            StateSpec & st = states->at(i);
            QString s = st.name;
            int index = s.indexOf('#');
            QString tbn;

            if (index != -1) {
                tbn = s.left(index);
                s = s.mid(index + 1);
            }
            else
                tbn = s_diagram;

            if ((grid == 0) || (tabname != tbn)) {
                if (grid != 0) {
                    addTab(grid, tabname);
                    grid->setObjectName(tabname);
                    if (tabname == previous_active_tab)
                        first_visible_page = grid;
                }

                grid = WidgetWithLayout::gridBox(5, this);
                grid->layout()->setMargin(0);
                grid->layout()->setSpacing(0);
                tabname = tbn;
            }

            QGridLayout *gridLayout = (QGridLayout *)grid->layout();
            int currentRow = gridLayout->rowCount();
            //gridLayout->addWidget(new QLabel("", grid), currentRow, 0);
            gridLayout->addWidget(new QLabel(s + " : ", grid), currentRow, 1);
            QWidget * hb = WidgetWithLayout::hBox( grid);
            QHBoxLayout* hLayout;
            hLayout = (QHBoxLayout*)hb->layout();
            hLayout->setMargin(0);
            gridLayout->addWidget(hb,  currentRow, 2);

            ComboStates* widget;
            switch (st.who) {
            case StateSpec::is3states:
                cbstates->insert(i, widget = new ComboStates(hb, *((Uml3States *) st.state), nodefault, unchanged));
                break;

            case StateSpec::isClassDrawingMode:
                cbstates->insert(i, widget = new ComboStates(hb, *((ClassDrawingMode *) st.state),
                                                    nodefault, unchanged));
                break;

            case StateSpec::isDrawingLanguage:
                cbstates->insert(i, widget = new ComboStates(hb, *((DrawingLanguage *) st.state),
                                                    nodefault, unchanged));
                break;

            case StateSpec::isShowContextMode:
                cbstates->insert(i, widget = new ComboStates(hb, *((ShowContextMode *) st.state),
                                                    nodefault, unchanged));
                break;

            default:
                cbstates->insert(i, widget = new ComboStates(hb, *((char *) st.state),
                                                    nodefault, unchanged));
            }
            hLayout->addWidget(widget);
            hLayout->addWidget(new QLabel("", hb));
            gridLayout->addWidget(new QLabel("", grid),currentRow, 3);
            gridLayout->addWidget(new QLabel("", grid),currentRow, 4);
        }

        addTab(grid, tabname);
        grid->setObjectName(tabname);
        if (tabname == previous_active_tab)
            first_visible_page = grid;
    }

    if (colors != 0) {
        QString lbl = QObject::tr("color");
        QString s_default = QObject::tr("default ");

        n = colors->size();
        cbcolors = new QHash<int, ComboColor*>;
//.........这里部分代码省略.........
开发者ID:javrillon,项目名称:douml,代码行数:101,代码来源:SettingsDialog.cpp


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