137QDesignerWidgetBoxInterface *QDesignerComponents::createWidgetBox(QDesignerFormEditorInterface *core, QWidget *parent)
139 qdesigner_internal::WidgetBox *widgetBox =
new qdesigner_internal::WidgetBox(core, parent);
141 const QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core);
145 const QString languageWidgetBox = lang->widgetBoxContents();
146 if (!languageWidgetBox.isEmpty()) {
147 widgetBox->loadContents(lang->widgetBoxContents());
152 widgetBox->setFileName(u":/qt-project.org/widgetbox/widgetbox.xml"_s);
156 const QString userWidgetBoxFile = widgetBoxFileName(QT_VERSION, lang);
158 widgetBox->setFileName(userWidgetBoxFile);
159 if (!QFileInfo::exists(userWidgetBoxFile)) {
162 if (
const int minv = qtMinorVersion(QT_VERSION)) {
163 int oldVersion = QT_VERSION;
164 setMinorVersion(minv - 1, &oldVersion);
165 const QString oldWidgetBoxFile = widgetBoxFileName(oldVersion, lang);
166 if (QFileInfo::exists(oldWidgetBoxFile))
167 QFile::copy(oldWidgetBoxFile, userWidgetBoxFile);
198QWidget *QDesignerComponents::createResourceEditor(QDesignerFormEditorInterface *core, QWidget *parent)
200 if (QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core)) {
201 QWidget *w = lang->createResourceBrowser(parent);
205 QtResourceView *resourceView =
new QtResourceView(core, parent);
206 resourceView->setResourceModel(core->resourceModel());
207 resourceView->setSettingsKey(u"ResourceBrowser"_s);
210 const QDesignerIntegrationInterface *integration = core->integration();
211 if (integration && !integration->hasFeature(QDesignerIntegrationInterface::ResourceEditorFeature))
212 resourceView->setResourceEditingEnabled(
false);