157QDesignerWidgetBoxInterface *QDesignerComponents::createWidgetBox(QDesignerFormEditorInterface *core, QWidget *parent)
159 qdesigner_internal::WidgetBox *widgetBox =
new qdesigner_internal::WidgetBox(core, parent);
161 const QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core);
165 const QString languageWidgetBox = lang->widgetBoxContents();
166 if (!languageWidgetBox.isEmpty()) {
167 widgetBox->loadContents(lang->widgetBoxContents());
172 widgetBox->setFileName(u":/qt-project.org/widgetbox/widgetbox.xml"_s);
176 const QString userWidgetBoxFile = widgetBoxFileName(QT_VERSION, lang);
178 widgetBox->setFileName(userWidgetBoxFile);
179 if (!QFileInfo::exists(userWidgetBoxFile)) {
182 if (
const int minv = qtMinorVersion(QT_VERSION)) {
183 int oldVersion = QT_VERSION;
184 setMinorVersion(minv - 1, &oldVersion);
185 const QString oldWidgetBoxFile = widgetBoxFileName(oldVersion, lang);
186 if (QFileInfo::exists(oldWidgetBoxFile))
187 QFile::copy(oldWidgetBoxFile, userWidgetBoxFile);
218QWidget *QDesignerComponents::createResourceEditor(QDesignerFormEditorInterface *core, QWidget *parent)
220 if (QDesignerLanguageExtension *lang = qt_extension<QDesignerLanguageExtension*>(core->extensionManager(), core)) {
221 QWidget *w = lang->createResourceBrowser(parent);
225 QtResourceView *resourceView =
new QtResourceView(core, parent);
226 resourceView->setResourceModel(core->resourceModel());
227 resourceView->setSettingsKey(u"ResourceBrowser"_s);
230 const QDesignerIntegrationInterface *integration = core->integration();
231 if (integration && !integration->hasFeature(QDesignerIntegrationInterface::ResourceEditorFeature))
232 resourceView->setResourceEditingEnabled(
false);