56 setIntrospection(
new QDesignerIntrospection);
57 setDialogGui(
new DialogGui);
58 auto *pluginManager =
new QDesignerPluginManager(pluginPaths,
this);
59 setPluginManager(pluginManager);
61 WidgetDataBase *widgetDatabase =
new WidgetDataBase(
this,
this);
62 setWidgetDataBase(widgetDatabase);
64 MetaDataBase *metaDataBase =
new MetaDataBase(
this,
this);
65 setMetaDataBase(metaDataBase);
67 WidgetFactory *widgetFactory =
new WidgetFactory(
this,
this);
68 setWidgetFactory(widgetFactory);
71 setFormManager(formWindowManager);
72 connect(formWindowManager, &QDesignerFormWindowManagerInterface::formWindowAdded,
73 widgetFactory, &WidgetFactory::formWindowAdded);
74 connect(formWindowManager, &QDesignerFormWindowManagerInterface::activeFormWindowChanged,
75 widgetFactory, &WidgetFactory::activeFormWindowChanged);
77 QExtensionManager *mgr =
new QExtensionManager(
this);
78 const QString containerExtensionId = Q_TYPEID(QDesignerContainerExtension);
80 QDesignerStackedWidgetContainerFactory::registerExtension(mgr, containerExtensionId);
81 QDesignerTabWidgetContainerFactory::registerExtension(mgr, containerExtensionId);
82 QDesignerToolBoxContainerFactory::registerExtension(mgr, containerExtensionId);
83 QMainWindowContainerFactory::registerExtension(mgr, containerExtensionId);
84 QDockWidgetContainerFactory::registerExtension(mgr, containerExtensionId);
85 QScrollAreaContainerFactory::registerExtension(mgr, containerExtensionId);
86 QMdiAreaContainerFactory::registerExtension(mgr, containerExtensionId);
87 QWizardContainerFactory::registerExtension(mgr, containerExtensionId);
90 Q_TYPEID(QDesignerLayoutDecorationExtension));
92 const QString actionProviderExtensionId = Q_TYPEID(QDesignerActionProviderExtension);
93 QToolBarActionProviderFactory::registerExtension(mgr, actionProviderExtensionId);
94 QMenuBarActionProviderFactory::registerExtension(mgr, actionProviderExtensionId);
95 QMenuActionProviderFactory::registerExtension(mgr, actionProviderExtensionId);
97 QDesignerDefaultPropertySheetFactory::registerExtension(mgr);
98 QDockWidgetPropertySheetFactory::registerExtension(mgr);
99 QLayoutWidgetPropertySheetFactory::registerExtension(mgr);
100 SpacerPropertySheetFactory::registerExtension(mgr);
101 LinePropertySheetFactory::registerExtension(mgr);
102 LayoutPropertySheetFactory::registerExtension(mgr);
103 QStackedWidgetPropertySheetFactory::registerExtension(mgr);
104 QToolBoxWidgetPropertySheetFactory::registerExtension(mgr);
105 QTabWidgetPropertySheetFactory::registerExtension(mgr);
106 QMdiAreaPropertySheetFactory::registerExtension(mgr);
107 QWizardPagePropertySheetFactory::registerExtension(mgr);
108 QWizardPropertySheetFactory::registerExtension(mgr);
110 QTreeViewPropertySheetFactory::registerExtension(mgr);
111 QTableViewPropertySheetFactory::registerExtension(mgr);
113 QDesignerTaskMenuFactory::registerExtension(mgr, u"QDesignerInternalTaskMenuExtension"_s);
115 mgr->registerExtensions(
new QDesignerMemberSheetFactory(mgr),
116 Q_TYPEID(QDesignerMemberSheetExtension));
118 setExtensionManager(mgr);
120 setPromotion(
new QDesignerPromotion(
this));
122 QtResourceModel *resourceModel =
new QtResourceModel(
this);
123 setResourceModel(resourceModel);
124 connect(resourceModel, &QtResourceModel::qrcFileModifiedExternally,
125 this, &FormEditor::slotQrcFileChangedExternally);
127 QList<QDesignerOptionsPageInterface*> optionsPages;
128 optionsPages <<
new TemplateOptionsPage(
this) <<
new FormEditorOptionsPage(
this) <<
new EmbeddedOptionsPage(
this);
129 setOptionsPages(optionsPages);
131 setSettingsManager(
new QDesignerQSettings());
136void FormEditor::slotQrcFileChangedExternally(
const QString &path)
141 QDesignerIntegration::ResourceFileWatcherBehaviour behaviour = integration()->resourceFileWatcherBehaviour();
142 if (behaviour == QDesignerIntegration::NoResourceFileWatcher)
144 if (behaviour == QDesignerIntegration::PromptToReloadResourceFile) {
145 QMessageBox::StandardButton button = dialogGui()->message(topLevel(), QDesignerDialogGuiInterface::FileChangedMessage, QMessageBox::Warning,
146 tr(
"Resource File Changed"),
147 tr(
"The file \"%1\" has changed outside Designer. Do you want to reload it?").arg(path),
148 QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
150 if (button != QMessageBox::Yes)
154 resourceModel()->reload(path);