138QDesignerWidgetBoxInterface *QDesignerComponents::createWidgetBox(QDesignerFormEditorInterface *core, QWidget *parent)
140 qdesigner_internal::WidgetBox *widgetBox =
new qdesigner_internal::WidgetBox(core, parent);
142 const QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core);
146 const QString languageWidgetBox = lang->widgetBoxContents();
147 if (!languageWidgetBox.isEmpty()) {
148 widgetBox->loadContents(lang->widgetBoxContents());
153 widgetBox->setFileName(u":/qt-project.org/widgetbox/widgetbox.xml"_s);
157 const QString userWidgetBoxFile = widgetBoxFileName(QT_VERSION, lang);
159 widgetBox->setFileName(userWidgetBoxFile);
160 if (!QFileInfo::exists(userWidgetBoxFile)) {
163 if (
const int minv = qtMinorVersion(QT_VERSION)) {
164 int oldVersion = QT_VERSION;
165 setMinorVersion(minv - 1, &oldVersion);
166 const QString oldWidgetBoxFile = widgetBoxFileName(oldVersion, lang);
167 if (QFileInfo::exists(oldWidgetBoxFile))
168 QFile::copy(oldWidgetBoxFile, userWidgetBoxFile);
199QWidget *QDesignerComponents::createResourceEditor(QDesignerFormEditorInterface *core, QWidget *parent)
201 if (QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core)) {
202 QWidget *w = lang->createResourceBrowser(parent);
206 QtResourceView *resourceView =
new QtResourceView(core, parent);
207 resourceView->setResourceModel(core->resourceModel());
208 resourceView->setSettingsKey(u"ResourceBrowser"_s);
211 const QDesignerIntegrationInterface *integration = core->integration();
212 if (integration && !integration->hasFeature(QDesignerIntegrationInterface::ResourceEditorFeature))
213 resourceView->setResourceEditingEnabled(
false);