247void QDesignerIntegrationInterface::emitObjectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object,
const QString &newName,
const QString &oldName)
249 emit objectNameChanged(formWindow, object, newName, oldName);
252void QDesignerIntegrationInterface::emitNavigateToSlot(
const QString &objectName,
253 const QString &signalSignature,
254 const QStringList ¶meterNames)
256 emit navigateToSlot(objectName, signalSignature, parameterNames);
335 QDesignerFormEditorInterface *core =
q->core();
336 if (QDesignerPropertyEditor *designerPropertyEditor= qobject_cast<QDesignerPropertyEditor *>(core->propertyEditor())) {
337 QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::propertyValueChanged,
338 q, QOverload<
const QString &,
const QVariant &,
bool>::of(&QDesignerIntegration::updateProperty));
339 QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::resetProperty,
340 q, &QDesignerIntegration::resetProperty);
341 QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::addDynamicProperty,
342 q, &QDesignerIntegration::addDynamicProperty);
343 QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::removeDynamicProperty,
344 q, &QDesignerIntegration::removeDynamicProperty);
347 QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::formWindowAdded,
348 q, &QDesignerIntegrationInterface::setupFormWindow);
350 QObject::connect(core->formWindowManager(), &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
351 q, &QDesignerIntegrationInterface::updateActiveFormWindow);
353 m_gradientManager =
new QtGradientManager(q);
356 const QString gradientsFile = u"/gradients.xml"_s;
357 m_gradientsPath = dataDirectory() + gradientsFile;
361#if QT_VERSION >= QT_VERSION_CHECK(7
, 0
, 0
)
362 const QString source = QFileInfo::exists(m_gradientsPath)
363 ? m_gradientsPath : legacyDataDirectory() + gradientsFile;
365 const QString source = m_gradientsPath;
369 if (f.open(QIODevice::ReadOnly)) {
373 QFile defaultGradients(u":/qt-project.org/designer/defaultgradients.xml"_s);
374 if (defaultGradients.open(QIODevice::ReadOnly)) {
376 defaultGradients.close();
380 if (WidgetDataBase *widgetDataBase = qobject_cast<WidgetDataBase*>(core->widgetDataBase()))
381 widgetDataBase->grabStandardWidgetBoxIcons();
386 QDesignerFormWindowInterface *formWindow =
q->core()->formWindowManager()->activeFormWindow();
391 getSelection(selection);
392 if (selection.empty())
395 SetPropertyCommand *cmd =
new SetPropertyCommand(formWindow);
397 if (cmd->init(selection.selection(), name, value, propertyEditorObject(), enableSubPropertyHandling)) {
398 formWindow->commandHistory()->push(cmd);
401 qDebug() <<
"Unable to set property " << name <<
'.';
407 QDesignerFormWindowInterface *formWindow =
q->core()->formWindowManager()->activeFormWindow();
412 getSelection(selection);
413 if (selection.empty())
416 ResetPropertyCommand *cmd =
new ResetPropertyCommand(formWindow);
418 if (cmd->init(selection.selection(), name, propertyEditorObject())) {
419 formWindow->commandHistory()->push(cmd);
422 qDebug() <<
"** WARNING Unable to reset property " << name <<
'.';
428 QDesignerFormWindowInterface *formWindow =
q->core()->formWindowManager()->activeFormWindow();
433 getSelection(selection);
434 if (selection.empty())
437 AddDynamicPropertyCommand *cmd =
new AddDynamicPropertyCommand(formWindow);
438 if (cmd->init(selection.selection(), propertyEditorObject(), name, value)) {
439 formWindow->commandHistory()->push(cmd);
442 qDebug() <<
"** WARNING Unable to add dynamic property " << name <<
'.';
448 QDesignerFormWindowInterface *formWindow =
q->core()->formWindowManager()->activeFormWindow();
453 getSelection(selection);
454 if (selection.empty())
457 RemoveDynamicPropertyCommand *cmd =
new RemoveDynamicPropertyCommand(formWindow);
458 if (cmd->init(selection.selection(), propertyEditorObject(), name)) {
459 formWindow->commandHistory()->push(cmd);
462 qDebug() <<
"** WARNING Unable to remove dynamic property " << name <<
'.';
475 QDesignerFormEditorInterface *core =
q->core();
476 QDesignerFormWindowInterface *formWindow = core->formWindowManager()->activeFormWindow();
480 selection = formWindow->cursor()->current();
483 if (QDesignerActionEditorInterface *actionEditor = core->actionEditor())
484 actionEditor->setFormWindow(formWindow);
486 if (QDesignerPropertyEditorInterface *propertyEditor = core->propertyEditor())
487 propertyEditor->setObject(selection);
489 if (QDesignerObjectInspectorInterface *objectInspector = core->objectInspector())
490 objectInspector->setFormWindow(formWindow);
554 qdesigner_internal::WidgetDataBase *widgetDataBase = qobject_cast<qdesigner_internal::WidgetDataBase*>(formEditor->widgetDataBase());
555 if (widgetDataBase) {
556 widgetDataBase->loadPlugins();
559 if (qdesigner_internal::WidgetFactory *widgetFactory = qobject_cast<qdesigner_internal::WidgetFactory*>(formEditor->widgetFactory())) {
560 widgetFactory->loadPlugins();
563 if (widgetDataBase) {
564 widgetDataBase->grabDefaultPropertyValues();
570 QDesignerFormEditorInterface *formEditor =
q->core();
571 if (QDesignerPluginManager *pm = formEditor->pluginManager())
572 pm->registerNewPlugins();
578 if (QDesignerWidgetBox *wb = qobject_cast<QDesignerWidgetBox*>(formEditor->widgetBox())) {
579 const QDesignerWidgetBox::LoadMode oldLoadMode = wb->loadMode();
580 wb->setLoadMode(QDesignerWidgetBox::LoadCustomWidgetsOnly);
582 wb->setLoadMode(oldLoadMode);
613 QDesignerFormEditorInterface *core =
q->core();
614 QObject *currentObject = core->propertyEditor()->object();
619 QString currentPropertyName = core->propertyEditor()->currentPropertyName();
620 if (!currentPropertyName.isEmpty())
621 className = classForProperty(core, currentObject, currentPropertyName);
622 if (className.isEmpty()) {
623 currentPropertyName.clear();
624 className = qdesigner_internal::WidgetFactory::classNameOf(core, currentObject);
626 QString helpId = fixHelpClassName(className);
627 if (!currentPropertyName.isEmpty()) {
629 helpId += currentPropertyName;
639QDesignerIntegration::QDesignerIntegration(QDesignerFormEditorInterface *core, QObject *parent) :
640 QDesignerIntegrationInterface(core, parent),
641 d(
new qdesigner_internal::QDesignerIntegrationPrivate(
this))
690void QDesignerIntegration::setResourceFileWatcherBehaviour(ResourceFileWatcherBehaviour behaviour)
692 if (d->m_resourceFileWatcherBehaviour != behaviour) {
693 d->m_resourceFileWatcherBehaviour = behaviour;
694 core()->resourceModel()->setWatcherEnabled(behaviour != QDesignerIntegrationInterface::NoResourceFileWatcher);
698void QDesignerIntegration::updateProperty(
const QString &name,
const QVariant &value,
bool enableSubPropertyHandling)
700 d->updateProperty(name, value, enableSubPropertyHandling);
701 emit propertyChanged(core()->formWindowManager()->activeFormWindow(), name, value);
729void QDesignerIntegration::setupFormWindow(QDesignerFormWindowInterface *formWindow)
731 d->setupFormWindow(formWindow);
732 connect(formWindow, &QDesignerFormWindowInterface::selectionChanged,
733 this, &QDesignerIntegrationInterface::updateSelection);
virtual QString propertyGroup(int index) const =0
virtual int indexOf(const QString &name) const =0