本文整理汇总了C++中QDesignerFormEditorInterface::objectInspector方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormEditorInterface::objectInspector方法的具体用法?C++ QDesignerFormEditorInterface::objectInspector怎么用?C++ QDesignerFormEditorInterface::objectInspector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormEditorInterface
的用法示例。
在下文中一共展示了QDesignerFormEditorInterface::objectInspector方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: handleMousePressEvent
bool ToolBarEventFilter::handleMousePressEvent(QMouseEvent *event)
{
if (event->button() != Qt::LeftButton || withinHandleArea(m_toolBar, event->pos()))
return false;
if (QDesignerFormWindowInterface *fw = formWindow()) {
QDesignerFormEditorInterface *core = fw->core();
// Keep selection in sync
fw->clearSelection(false);
if (QDesignerObjectInspector *oi = qobject_cast<QDesignerObjectInspector *>(core->objectInspector())) {
oi->clearSelection();
oi->selectObject(m_toolBar);
}
core->propertyEditor()->setObject(m_toolBar);
}
m_startPosition = m_toolBar->mapFromGlobal(event->globalPos());
event->accept();
return true;
}
示例3: updateSelection
void QDesignerIntegrationPrivate::updateSelection()
{
QDesignerFormEditorInterface *core = q->core();
QDesignerFormWindowInterface *formWindow = core->formWindowManager()->activeFormWindow();
QWidget *selection = 0;
if (formWindow) {
selection = formWindow->cursor()->current();
}
if (QDesignerActionEditorInterface *actionEditor = core->actionEditor())
actionEditor->setFormWindow(formWindow);
if (QDesignerPropertyEditorInterface *propertyEditor = core->propertyEditor())
propertyEditor->setObject(selection);
if (QDesignerObjectInspectorInterface *objectInspector = core->objectInspector())
objectInspector->setFormWindow(formWindow);
}
示例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: promotionSelectionList
PromotionTaskMenu::PromotionSelectionList PromotionTaskMenu::promotionSelectionList(QDesignerFormWindowInterface *formWindow) const
{
// In multi selection mode, check for a homogenous selection (same class, same promotion state)
// and return the list if this is the case. Also make sure m_widget
// is the last widget in the list so that it is re-selected as the last
// widget by the promotion commands.
PromotionSelectionList rc;
if (m_mode != ModeSingleWidget) {
QDesignerFormEditorInterface *core = formWindow->core();
const QDesignerIntrospectionInterface *intro = core->introspection();
const QString className = intro->metaObject(m_widget)->className();
const bool promoted = isPromoted(formWindow->core(), m_widget);
// Just in case someone plugged an old-style Object Inspector
if (QDesignerObjectInspector *designerObjectInspector = qobject_cast<QDesignerObjectInspector *>(core->objectInspector())) {
Selection s;
designerObjectInspector->getSelection(s);
// Find objects of similar state
const QWidgetList &source = m_mode == ModeManagedMultiSelection ? s.managed : s.unmanaged;
const QWidgetList::const_iterator cend = source.constEnd();
for (QWidgetList::const_iterator it = source.constBegin(); it != cend; ++it) {
QWidget *w = *it;
if (w != m_widget) {
// Selection state mismatch
if (intro->metaObject(w)->className() != className || isPromoted(core, w) != promoted)
return PromotionSelectionList();
rc.push_back(w);
}
}
}
}
rc.push_back(m_widget);
return rc;
}
示例6: getSelection
void QDesignerIntegrationPrivate::getSelection(Selection &s)
{
QDesignerFormEditorInterface *core = q->core();
// Get multiselection from object inspector
if (QDesignerObjectInspector *designerObjectInspector = qobject_cast<QDesignerObjectInspector *>(core->objectInspector())) {
designerObjectInspector->getSelection(s);
// Action editor puts actions that are not on the form yet
// into the property editor only.
if (s.empty())
if (QObject *object = core->propertyEditor()->object())
s.objects.push_back(object);
} else {
// Just in case someone plugs in an old-style object inspector: Emulate selection
s.clear();
QDesignerFormWindowInterface *formWindow = core->formWindowManager()->activeFormWindow();
if (!formWindow)
return;
QObject *object = core->propertyEditor()->object();
if (object->isWidgetType()) {
QWidget *widget = static_cast<QWidget*>(object);
QDesignerFormWindowCursorInterface *cursor = formWindow->cursor();
if (cursor->isWidgetSelected(widget)) {
s.managed.push_back(widget);
} else {
s.unmanaged.push_back(widget);
}
} else {
s.objects.push_back(object);
}
}
}