本文整理汇总了C++中QDesignerFormEditorInterface::propertyEditor方法的典型用法代码示例。如果您正苦于以下问题:C++ QDesignerFormEditorInterface::propertyEditor方法的具体用法?C++ QDesignerFormEditorInterface::propertyEditor怎么用?C++ QDesignerFormEditorInterface::propertyEditor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDesignerFormEditorInterface
的用法示例。
在下文中一共展示了QDesignerFormEditorInterface::propertyEditor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
示例2: 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();
}
示例3: contextHelpId
QString QDesignerIntegrationPrivate::contextHelpId() const
{
QDesignerFormEditorInterface *core = q->core();
QObject *currentObject = core->propertyEditor()->object();
if (!currentObject)
return QString();
// Return a help index id consisting of "class::property"
QString className;
QString currentPropertyName = core->propertyEditor()->currentPropertyName();
if (!currentPropertyName.isEmpty())
className = classForProperty(core, currentObject, currentPropertyName);
if (className.isEmpty()) {
currentPropertyName.clear(); // We hit on some fake property.
className = qdesigner_internal::WidgetFactory::classNameOf(core, currentObject);
}
QString helpId = fixHelpClassName(className);
if (!currentPropertyName.isEmpty()) {
helpId += QStringLiteral("::");
helpId += currentPropertyName;
}
return helpId;
}
示例4: 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;
}
示例5: 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);
}
示例6: 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);
}
示例7: reloadPropertySheet
void QAxWidgetPropertySheet::reloadPropertySheet(const struct SavedProperties &properties, QDesignerFormWindowInterface *formWin)
{
QDesignerFormEditorInterface *core = formWin->core();
//Recreation of the property sheet
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension *>(core->extensionManager(), properties.widget);
bool foundGeometry = false;
const QString geometryProperty = QLatin1String(geometryPropertyC);
const SavedProperties::NamePropertyMap::const_iterator cend = properties.changedProperties.constEnd();
for (SavedProperties::NamePropertyMap::const_iterator i = properties.changedProperties.constBegin(); i != cend; ++i) {
const QString name = i.key();
const int index = sheet->indexOf(name);
if (index == -1)
continue;
// filter out geometry as this will resize the control
// to is default size even if it is attached to an layout
// but set the changed flag to work around preview bug...
if (name == geometryProperty) {
sheet->setChanged(index, true);
foundGeometry = true;
continue;
}
if (name == QLatin1String(controlPropertyName)) {
sheet->setChanged(index, !i.value().toString().isEmpty());
continue;
}
sheet->setChanged(index, true);
sheet->setProperty(index, i.value());
}
if (!foundGeometry) // Make sure geometry is always changed in Designer
sheet->setChanged(sheet->indexOf(geometryProperty), true);
if (core->propertyEditor()->object() == properties.widget) {
formWin->clearSelection(true);
formWin->selectWidget(properties.widget);
}
}