本文整理汇总了C++中QDesignerFormEditorInterface::formWindowManager方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormEditorInterface::formWindowManager方法的具体用法?C++ QDesignerFormEditorInterface::formWindowManager怎么用?C++ QDesignerFormEditorInterface::formWindowManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormEditorInterface
的用法示例。
在下文中一共展示了QDesignerFormEditorInterface::formWindowManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void QDesignerIntegrationPrivate::initialize()
{
typedef void (QDesignerIntegration::*QDesignerIntegrationUpdatePropertySlot3)(const QString &, const QVariant &, bool);
//
// integrate the `Form Editor component'
//
// Extensions
QDesignerFormEditorInterface *core = q->core();
if (QDesignerPropertyEditor *designerPropertyEditor= qobject_cast<QDesignerPropertyEditor *>(core->propertyEditor())) {
QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::propertyValueChanged,
q, static_cast<QDesignerIntegrationUpdatePropertySlot3>(&QDesignerIntegration::updateProperty));
QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::resetProperty,
q, &QDesignerIntegration::resetProperty);
QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::addDynamicProperty,
q, &QDesignerIntegration::addDynamicProperty);
QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::removeDynamicProperty,
q, &QDesignerIntegration::removeDynamicProperty);
} else {
QObject::connect(core->propertyEditor(), SIGNAL(propertyChanged(QString,QVariant)),
q, SLOT(updatePropertyPrivate(QString,QVariant))); // ### fixme: VS Integration leftover?
}
QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded,
q, &QDesignerIntegrationInterface::setupFormWindow);
QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
q, &QDesignerIntegrationInterface::updateActiveFormWindow);
m_gradientManager = new QtGradientManager(q);
core->setGradientManager(m_gradientManager);
QString designerFolder = QDir::homePath();
designerFolder += QDir::separator();
designerFolder += QStringLiteral(".designer");
m_gradientsPath = designerFolder;
m_gradientsPath += QDir::separator();
m_gradientsPath += QStringLiteral("gradients.xml");
QFile f(m_gradientsPath);
if (f.open(QIODevice::ReadOnly)) {
QtGradientUtils::restoreState(m_gradientManager, QString::fromLatin1(f.readAll()));
f.close();
} else {
QFile defaultGradients(QStringLiteral(":/qt-project.org/designer/defaultgradients.xml"));
if (defaultGradients.open(QIODevice::ReadOnly)) {
QtGradientUtils::restoreState(m_gradientManager, QString::fromLatin1(defaultGradients.readAll()));
defaultGradients.close();
}
}
if (WidgetDataBase *widgetDataBase = qobject_cast<WidgetDataBase*>(core->widgetDataBase()))
widgetDataBase->grabStandardWidgetBoxIcons();
}
示例2: QWidget
QT_BEGIN_NAMESPACE
QDesignerFormWindow::QDesignerFormWindow(QDesignerFormWindowInterface *editor, QDesignerWorkbench *workbench, QWidget *parent, Qt::WindowFlags flags)
: QWidget(parent, flags),
m_editor(editor),
m_workbench(workbench),
m_action(new QAction(this)),
m_initialized(false),
m_windowTitleInitialized(false)
{
Q_ASSERT(workbench);
setMaximumSize(0xFFF, 0xFFF);
QDesignerFormEditorInterface *core = workbench->core();
if (m_editor) {
m_editor->setParent(this);
} else {
m_editor = core->formWindowManager()->createFormWindow(this);
}
QVBoxLayout *l = new QVBoxLayout(this);
l->setMargin(0);
l->addWidget(m_editor);
m_action->setCheckable(true);
connect(m_editor->commandHistory(), SIGNAL(indexChanged(int)), this, SLOT(updateChanged()));
connect(m_editor, SIGNAL(geometryChanged()), this, SLOT(geometryChanged()));
qdesigner_internal::FormWindowBase::setupDefaultAction(m_editor);
}
示例3: 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);
}
}
}
示例4: 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);
}