本文整理汇总了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);
}
}
示例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;
}
示例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();
}