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


C++ QDesignerFormWindowInterface::ensureUniqueObjectName方法代码示例

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


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

示例1: fileNameChanged

void MainWindowDsgnPlugin::fileNameChanged(const QString& fileName)
{
    if (fileName.isEmpty() && m_mainWindow)
    {
        QDesignerContainerExtension* c = qt_extension<QDesignerContainerExtension*>(m_core->extensionManager(), m_mainWindow);
        QDesignerFormWindowInterface* formWindow = QDesignerFormWindowInterface::findFormWindow(m_mainWindow->parentWidget());
        disconnect(formWindow, SIGNAL(fileNameChanged(const QString&)), this, SLOT(fileNameChanged(const QString&)));

        if (QWidget* ribbonBar = qobject_cast<QWidget*>(m_core->widgetFactory()->createWidget(QLatin1String("Qtitan::RibbonBar"), m_mainWindow)))
        {
            m_core->widgetFactory()->initialize(ribbonBar);
            c->addWidget(ribbonBar);
            m_core->metaDataBase()->add(ribbonBar);
            ribbonBar->setObjectName(QLatin1String("ribbonBar"));
            formWindow->ensureUniqueObjectName(ribbonBar);
        }

        if (QWidget* statusBar = m_mainWindow->statusBar())
        {
            c->addWidget(statusBar);
            m_core->metaDataBase()->add(statusBar);
            statusBar->setObjectName(QLatin1String("statusBar"));
            formWindow->ensureUniqueObjectName(statusBar);
        }

        if (QWidget* style = m_core->widgetFactory()->createWidget(QLatin1String("Qtitan::RibbonStyle"), m_mainWindow))
        {
            m_core->widgetFactory()->initialize(style);
            c->addWidget(style);
            m_core->metaDataBase()->add(style);
            style->setObjectName(QLatin1String("ribbonStyle"));
            formWindow->ensureUniqueObjectName(style);
        }
    }
开发者ID:lixunguang,项目名称:myhelloworld,代码行数:34,代码来源:QtnMainWindowDsgnPlugin.cpp

示例2: init

bool CreateButtonGroupCommand::init(const ButtonList &bl)
{
    if (bl.empty())
        return false;
    QDesignerFormWindowInterface *fw = formWindow();
    QButtonGroup *buttonGroup = new QButtonGroup(fw->mainContainer());
    buttonGroup->setObjectName(QLatin1String("buttonGroup"));
    fw->ensureUniqueObjectName(buttonGroup);
    initialize(bl, buttonGroup);
    return true;
}
开发者ID:phen89,项目名称:rtqt,代码行数:11,代码来源:button_taskmenu.cpp

示例3: leaveEditMode

void QDesignerMenuBar::leaveEditMode(LeaveEditMode mode)
{
    m_editor->releaseKeyboard();

    if (mode == Default)
        return;

    if (m_editor->text().isEmpty())
        return;

    QAction *action = 0;

    QDesignerFormWindowInterface *fw = formWindow();
    Q_ASSERT(fw);

    if (m_currentIndex >= 0 && m_currentIndex < realActionCount()) {
        action = safeActionAt(m_currentIndex);
        fw->beginCommand(QApplication::translate("Command", "Change Title"));
    } else {
        fw->beginCommand(QApplication::translate("Command", "Insert Menu"));
        const QString niceObjectName = ActionEditor::actionTextToName(m_editor->text(), QStringLiteral("menu"));
        QMenu *menu = qobject_cast<QMenu*>(fw->core()->widgetFactory()->createWidget(QStringLiteral("QMenu"), this));
        fw->core()->widgetFactory()->initialize(menu);
        menu->setObjectName(niceObjectName);
        menu->setTitle(tr("Menu"));
        fw->ensureUniqueObjectName(menu);
        action = menu->menuAction();
        AddMenuActionCommand *cmd = new AddMenuActionCommand(fw);
        cmd->init(action, m_addMenu, this, this);
        fw->commandHistory()->push(cmd);
    }

    SetPropertyCommand *cmd = new SetPropertyCommand(fw);
    cmd->init(action, QStringLiteral("text"), m_editor->text());
    fw->commandHistory()->push(cmd);
    fw->endCommand();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:37,代码来源:qdesigner_menubar.cpp


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