本文整理汇总了C++中QDesignerFormEditorInterface::metaDataBase方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormEditorInterface::metaDataBase方法的具体用法?C++ QDesignerFormEditorInterface::metaDataBase怎么用?C++ QDesignerFormEditorInterface::metaDataBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormEditorInterface
的用法示例。
在下文中一共展示了QDesignerFormEditorInterface::metaDataBase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasLayout
bool QDesignerFormWindowCommand::hasLayout(QWidget *widget) const
{
QDesignerFormEditorInterface *core = formWindow()->core();
if (widget && LayoutInfo::layoutType(core, widget) != LayoutInfo::NoLayout) {
const QDesignerMetaDataBaseItemInterface *item = core->metaDataBase()->item(widget);
return item != 0;
}
return false;
}
示例2: createButtonGroup
void ButtonGroupCommand::createButtonGroup()
{
if (debugButtonMenu)
qDebug() << "Creating " << m_buttonGroup << " from " << m_buttonList;
QDesignerFormWindowInterface *fw = formWindow();
QDesignerFormEditorInterface *core = fw->core();
core->metaDataBase()->add(m_buttonGroup);
addButtonsToGroup();
// Make button group visible
core->objectInspector()->setFormWindow(fw);
}
示例3: initTabOrder
void TabOrderEditor::initTabOrder()
{
m_tab_order_list.clear();
QDesignerFormEditorInterface *core = formWindow()->core();
if (const QDesignerMetaDataBaseItemInterface *item = core->metaDataBase()->item(formWindow())) {
m_tab_order_list = item->tabOrder();
}
// Remove any widgets that have been removed form the form
for (int i = 0; i < m_tab_order_list.size(); ) {
QWidget *w = m_tab_order_list.at(i);
if (!formWindow()->mainContainer()->isAncestorOf(w) || skipWidget(w))
m_tab_order_list.removeAt(i);
else
++i;
}
// Append any widgets that are in the form but are not in the tab order
QDesignerFormWindowCursorInterface *cursor = formWindow()->cursor();
for (int i = 0; i < cursor->widgetCount(); ++i) {
QWidget *widget = cursor->widget(i);
if (skipWidget(widget))
continue;
if (!m_tab_order_list.contains(widget))
m_tab_order_list.append(widget);
}
m_indicator_region = QRegion();
for (int i = 0; i < m_tab_order_list.size(); ++i) {
if (m_tab_order_list.at(i)->isVisible())
m_indicator_region |= indicatorRect(i);
}
if (m_current_index >= m_tab_order_list.size())
m_current_index = m_tab_order_list.size() - 1;
if (m_current_index < 0)
m_current_index = 0;
}
示例4: breakButtonGroup
void ButtonGroupCommand::breakButtonGroup()
{
if (debugButtonMenu)
qDebug() << "Removing " << m_buttonGroup << " consisting of " << m_buttonList;
QDesignerFormWindowInterface *fw = formWindow();
QDesignerFormEditorInterface *core = fw->core();
// Button group was selected, that is, break was invoked via its context menu. Remove it from property editor, select the buttons
if (core->propertyEditor()->object() == m_buttonGroup) {
fw->clearSelection(false);
const ButtonList::const_iterator cend = m_buttonList.constEnd();
for (ButtonList::const_iterator it = m_buttonList.constBegin(); it != cend; ++it)
fw->selectWidget(*it, true);
}
// Now remove and refresh object inspector
removeButtonsFromGroup();
// Notify components (for example, signal slot editor)
if (qdesigner_internal::FormWindowBase *fwb = qobject_cast<qdesigner_internal::FormWindowBase *>(fw))
fwb->emitObjectRemoved(m_buttonGroup);
core->metaDataBase()->remove(m_buttonGroup);
core->objectInspector()->setFormWindow(fw);
}
示例5: event
bool DsgnOfficeStyleWidget::event(QEvent* event)
{
bool res = QWidget::event(event);
if (event->type() == QEvent::ParentChange)
{
if (DsgnOfficeStyle* desStyle = dynamic_cast<DsgnOfficeStyle *>(m_targetStyle))
desStyle->setParentStyle(parentWidget());
}
else if (event->type() == QEvent::Hide && isHidden())
{
QDesignerFormWindowInterface* formWindow = QDesignerFormWindowInterface::findFormWindow(parentWidget());
QDesignerFormEditorInterface* core = formWindow->core();
QDesignerContainerExtension* container = qt_extension<QDesignerContainerExtension*>(core->extensionManager(), formWindow->mainContainer());
if (container->widget(container->count() - 1) == this)
{
container->remove(container->count() - 1);
core->metaDataBase()->remove(this);
formWindow->emitSelectionChanged();
}
}
return res;
}