55 setIntrospection(
new QDesignerIntrospection);
56 setDialogGui(
new DialogGui);
57 auto *pluginManager =
new QDesignerPluginManager(pluginPaths,
this);
58 setPluginManager(pluginManager);
60 WidgetDataBase *widgetDatabase =
new WidgetDataBase(
this,
this);
61 setWidgetDataBase(widgetDatabase);
63 MetaDataBase *metaDataBase =
new MetaDataBase(
this,
this);
64 setMetaDataBase(metaDataBase);
66 WidgetFactory *widgetFactory =
new WidgetFactory(
this,
this);
67 setWidgetFactory(widgetFactory);
69 FormWindowManager *formWindowManager =
new FormWindowManager(
this,
this);
70 setFormManager(formWindowManager);
71 connect(formWindowManager, &QDesignerFormWindowManagerInterface::formWindowAdded,
72 widgetFactory, &WidgetFactory::formWindowAdded);
73 connect(formWindowManager, &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
74 widgetFactory, &WidgetFactory::activeFormWindowChanged);
76 QExtensionManager *mgr =
new QExtensionManager(
this);
77 const QString containerExtensionId = Q_TYPEID(QDesignerContainerExtension);
79 QDesignerStackedWidgetContainerFactory::registerExtension(mgr, containerExtensionId);
80 QDesignerTabWidgetContainerFactory::registerExtension(mgr, containerExtensionId);
81 QDesignerToolBoxContainerFactory::registerExtension(mgr, containerExtensionId);
82 QMainWindowContainerFactory::registerExtension(mgr, containerExtensionId);
83 QDockWidgetContainerFactory::registerExtension(mgr, containerExtensionId);
84 QScrollAreaContainerFactory::registerExtension(mgr, containerExtensionId);
85 QMdiAreaContainerFactory::registerExtension(mgr, containerExtensionId);
86 QWizardContainerFactory::registerExtension(mgr, containerExtensionId);
88 mgr->registerExtensions(
new QDesignerLayoutDecorationFactory(mgr),
89 Q_TYPEID(QDesignerLayoutDecorationExtension));
91 const QString actionProviderExtensionId = Q_TYPEID(QDesignerActionProviderExtension);
92 QToolBarActionProviderFactory::registerExtension(mgr, actionProviderExtensionId);
93 QMenuBarActionProviderFactory::registerExtension(mgr, actionProviderExtensionId);
94 QMenuActionProviderFactory::registerExtension(mgr, actionProviderExtensionId);
96 QDesignerDefaultPropertySheetFactory::registerExtension(mgr);
97 QDockWidgetPropertySheetFactory::registerExtension(mgr);
98 QLayoutWidgetPropertySheetFactory::registerExtension(mgr);
99 SpacerPropertySheetFactory::registerExtension(mgr);
100 LinePropertySheetFactory::registerExtension(mgr);
101 LayoutPropertySheetFactory::registerExtension(mgr);
102 QStackedWidgetPropertySheetFactory::registerExtension(mgr);
103 QToolBoxWidgetPropertySheetFactory::registerExtension(mgr);
104 QTabWidgetPropertySheetFactory::registerExtension(mgr);
105 QMdiAreaPropertySheetFactory::registerExtension(mgr);
106 QWizardPagePropertySheetFactory::registerExtension(mgr);
107 QWizardPropertySheetFactory::registerExtension(mgr);
109 QTreeViewPropertySheetFactory::registerExtension(mgr);
110 QTableViewPropertySheetFactory::registerExtension(mgr);
112 QDesignerTaskMenuFactory::registerExtension(mgr, u"QDesignerInternalTaskMenuExtension"_s);
114 mgr->registerExtensions(
new QDesignerMemberSheetFactory(mgr),
115 Q_TYPEID(QDesignerMemberSheetExtension));
117 setExtensionManager(mgr);
119 setPromotion(
new QDesignerPromotion(
this));
121 QtResourceModel *resourceModel =
new QtResourceModel(
this);
122 setResourceModel(resourceModel);
123 connect(resourceModel, &QtResourceModel::qrcFileModifiedExternally,
124 this, &FormEditor::slotQrcFileChangedExternally);
126 QList<QDesignerOptionsPageInterface*> optionsPages;
127 optionsPages <<
new TemplateOptionsPage(
this) <<
new FormEditorOptionsPage(
this) <<
new EmbeddedOptionsPage(
this);
128 setOptionsPages(optionsPages);
130 setSettingsManager(
new QDesignerQSettings());
135void FormEditor::slotQrcFileChangedExternally(
const QString &path)
140 QDesignerIntegration::ResourceFileWatcherBehaviour behaviour = integration()->resourceFileWatcherBehaviour();
141 if (behaviour == QDesignerIntegration::NoResourceFileWatcher)
143 if (behaviour == QDesignerIntegration::PromptToReloadResourceFile) {
144 QMessageBox::StandardButton button = dialogGui()->message(topLevel(), QDesignerDialogGuiInterface::FileChangedMessage, QMessageBox::Warning,
145 tr(
"Resource File Changed"),
146 tr(
"The file \"%1\" has changed outside Designer. Do you want to reload it?").arg(path),
147 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
149 if (button != QMessageBox::Yes)
153 resourceModel()->reload(path);