Designer: Remove compatibility code for Qt < 5.0

Change-Id: I3ebe69b2c56635d1978da994fc772536a2839304
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
hjk
2014-08-20 16:09:26 +02:00
committed by Eike Ziller
parent 48157ccb53
commit 208865dd0a
13 changed files with 12 additions and 193 deletions

View File

@@ -31,12 +31,7 @@
#include "formeditorw.h" #include "formeditorw.h"
#include <QDesignerFormEditorInterface> #include <QDesignerFormEditorInterface>
#include <QDesignerIntegration>
#if QT_VERSION >= 0x050000
# include <QDesignerIntegration>
#else
# include "qt_private/qdesigner_integration_p.h"
#endif
#include <QWidget> #include <QWidget>
#include <QDebug> #include <QDebug>
@@ -57,17 +52,7 @@ DesignerContext::DesignerContext(const Core::Context &context,
QString DesignerContext::contextHelpId() const QString DesignerContext::contextHelpId() const
{ {
const QDesignerFormEditorInterface *core = FormEditorW::instance()->designerEditor(); const QDesignerFormEditorInterface *core = FormEditorW::instance()->designerEditor();
#if QT_VERSION >= 0x050000
return core->integration()->contextHelpId(); return core->integration()->contextHelpId();
#else
QString helpId;
// Present from Qt 4.5.1 onwards. This will show the class documentation
// scrolled to the current property.
if (const qdesigner_internal::QDesignerIntegration *integration =
qobject_cast<const qdesigner_internal::QDesignerIntegration*>(core->integration()))
helpId = integration->contextHelpId();
return helpId;
#endif
} }
} // namespace Internal } // namespace Internal

View File

@@ -54,16 +54,7 @@
#include <QDesignerFormEditorPluginInterface> #include <QDesignerFormEditorPluginInterface>
#include <QDesignerFormEditorInterface> #include <QDesignerFormEditorInterface>
#include <QDesignerComponents> #include <QDesignerComponents>
#include <QDesignerFormWindowManagerInterface>
#if QT_VERSION >= 0x050000
# include <QDesignerFormWindowManagerInterface>
#else
# include "qt_private/pluginmanager_p.h"
# include "qt_private/iconloader_p.h" // createIconSet
# include "qt_private/qdesigner_formwindowmanager_p.h"
# include "qt_private/formwindowbase_p.h"
#endif
#include <QDesignerWidgetBoxInterface> #include <QDesignerWidgetBoxInterface>
#include <abstractobjectinspector.h> #include <abstractobjectinspector.h>
#include <QDesignerPropertyEditorInterface> #include <QDesignerPropertyEditorInterface>
@@ -101,11 +92,7 @@ static const char settingsGroupC[] = "Designer";
static inline QIcon designerIcon(const QString &iconName) static inline QIcon designerIcon(const QString &iconName)
{ {
#if QT_VERSION >= 0x050000
const QIcon icon = QDesignerFormEditorInterface::createIcon(iconName); const QIcon icon = QDesignerFormEditorInterface::createIcon(iconName);
#else
const QIcon icon = qdesigner_internal::createIconSet(iconName);
#endif
if (icon.isNull()) if (icon.isNull())
qWarning() << "Unable to locate " << iconName; qWarning() << "Unable to locate " << iconName;
return icon; return icon;
@@ -151,11 +138,7 @@ FormEditorW::FormEditorW() :
m_formeditor->setTopLevel(ICore::mainWindow()); m_formeditor->setTopLevel(ICore::mainWindow());
m_formeditor->setSettingsManager(new SettingsManager()); m_formeditor->setSettingsManager(new SettingsManager());
#if QT_VERSION >= 0x050000
m_fwm = m_formeditor->formWindowManager(); m_fwm = m_formeditor->formWindowManager();
#else
m_fwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager*>(m_formeditor->formWindowManager());
#endif
QTC_ASSERT(m_fwm, return); QTC_ASSERT(m_fwm, return);
m_contexts.add(Designer::Constants::C_FORMEDITOR); m_contexts.add(Designer::Constants::C_FORMEDITOR);
@@ -261,11 +244,7 @@ void FormEditorW::fullInit()
* This will initialize our TabOrder, Signals and slots and Buddy editors. * This will initialize our TabOrder, Signals and slots and Buddy editors.
*/ */
QList<QObject*> plugins = QPluginLoader::staticInstances(); QList<QObject*> plugins = QPluginLoader::staticInstances();
#if QT_VERSION >= 0x050000
plugins += m_formeditor->pluginInstances(); plugins += m_formeditor->pluginInstances();
#else
plugins += m_formeditor->pluginManager()->instances();
#endif
foreach (QObject *plugin, plugins) { foreach (QObject *plugin, plugins) {
if (QDesignerFormEditorPluginInterface *formEditorPlugin = qobject_cast<QDesignerFormEditorPluginInterface*>(plugin)) { if (QDesignerFormEditorPluginInterface *formEditorPlugin = qobject_cast<QDesignerFormEditorPluginInterface*>(plugin)) {
if (!formEditorPlugin->isInitialized()) if (!formEditorPlugin->isInitialized())
@@ -490,20 +469,12 @@ void FormEditorW::setupActions()
// Commands that do not go into the editor toolbar // Commands that do not go into the editor toolbar
mformtools->addSeparator(m_contexts); mformtools->addSeparator(m_contexts);
#if QT_VERSION >= 0x050000
m_actionPreview = m_fwm->action(QDesignerFormWindowManagerInterface::DefaultPreviewAction); m_actionPreview = m_fwm->action(QDesignerFormWindowManagerInterface::DefaultPreviewAction);
#else
m_actionPreview = m_fwm->actionDefaultPreview();
#endif
QTC_ASSERT(m_actionPreview, return); QTC_ASSERT(m_actionPreview, return);
addToolAction(m_actionPreview, m_contexts, "FormEditor.Preview", mformtools, tr("Alt+Shift+R")); addToolAction(m_actionPreview, m_contexts, "FormEditor.Preview", mformtools, tr("Alt+Shift+R"));
// Preview in style... // Preview in style...
#if QT_VERSION >= 0x050000
m_actionGroupPreviewInStyle = m_fwm->actionGroup(QDesignerFormWindowManagerInterface::StyledPreviewActionGroup); m_actionGroupPreviewInStyle = m_fwm->actionGroup(QDesignerFormWindowManagerInterface::StyledPreviewActionGroup);
#else
m_actionGroupPreviewInStyle = m_fwm->actionGroupPreviewInStyle();
#endif
ActionContainer *previewAC = createPreviewStyleMenu(m_actionGroupPreviewInStyle); ActionContainer *previewAC = createPreviewStyleMenu(m_actionGroupPreviewInStyle);
m_previewInStyleMenu = previewAC->menu(); m_previewInStyleMenu = previewAC->menu();
@@ -516,11 +487,7 @@ void FormEditorW::setupActions()
mformtools->addSeparator(m_contexts); mformtools->addSeparator(m_contexts);
mformtools->addSeparator(m_contexts, Core::Constants::G_DEFAULT_THREE); mformtools->addSeparator(m_contexts, Core::Constants::G_DEFAULT_THREE);
#if QT_VERSION >= 0x050000
QAction *actionFormSettings = m_fwm->action(QDesignerFormWindowManagerInterface::FormWindowSettingsDialogAction); QAction *actionFormSettings = m_fwm->action(QDesignerFormWindowManagerInterface::FormWindowSettingsDialogAction);
#else
QAction *actionFormSettings = m_fwm->actionShowFormWindowSettingsDialog();
#endif
addToolAction(actionFormSettings, m_contexts, "FormEditor.FormSettings", mformtools, addToolAction(actionFormSettings, m_contexts, "FormEditor.FormSettings", mformtools,
QString(), Core::Constants::G_DEFAULT_THREE); QString(), Core::Constants::G_DEFAULT_THREE);
@@ -529,13 +496,7 @@ void FormEditorW::setupActions()
m_actionAboutPlugins->setMenuRole(QAction::NoRole); m_actionAboutPlugins->setMenuRole(QAction::NoRole);
addToolAction(m_actionAboutPlugins, m_contexts, "FormEditor.AboutPlugins", mformtools, addToolAction(m_actionAboutPlugins, m_contexts, "FormEditor.AboutPlugins", mformtools,
QString(), Core::Constants::G_DEFAULT_THREE); QString(), Core::Constants::G_DEFAULT_THREE);
connect(m_actionAboutPlugins, SIGNAL(triggered()), m_fwm, connect(m_actionAboutPlugins, SIGNAL(triggered()), m_fwm, SLOT(showPluginDialog()));
#if QT_VERSION >= 0x050000
SLOT(showPluginDialog())
#else
SLOT(aboutPlugins())
#endif
);
m_actionAboutPlugins->setEnabled(false); m_actionAboutPlugins->setEnabled(false);
// FWM // FWM
@@ -669,18 +630,10 @@ EditorData FormEditorW::createEditor()
// Create and associate form and text editor. // Create and associate form and text editor.
EditorData data; EditorData data;
m_fwm->closeAllPreviews(); m_fwm->closeAllPreviews();
#if QT_VERSION >= 0x050000
QDesignerFormWindowInterface *form = m_fwm->createFormWindow(0); QDesignerFormWindowInterface *form = m_fwm->createFormWindow(0);
#else
qdesigner_internal::FormWindowBase *form = qobject_cast<qdesigner_internal::FormWindowBase *>(m_fwm->createFormWindow(0));
#endif
QTC_ASSERT(form, return data); QTC_ASSERT(form, return data);
connect(form, SIGNAL(toolChanged(int)), this, SLOT(toolChanged(int))); connect(form, SIGNAL(toolChanged(int)), this, SLOT(toolChanged(int)));
ResourceHandler *resourceHandler = new ResourceHandler(form); ResourceHandler *resourceHandler = new ResourceHandler(form);
#if QT_VERSION < 0x050000
form->setDesignerGrid(qdesigner_internal::FormWindowBase::defaultDesignerGrid());
qdesigner_internal::FormWindowBase::setupDefaultAction(form);
#endif
data.widgetHost = new SharedTools::WidgetHost( /* parent */ 0, form); data.widgetHost = new SharedTools::WidgetHost( /* parent */ 0, form);
DesignerXmlEditorWidget *xmlEditor = new DesignerXmlEditorWidget(form); DesignerXmlEditorWidget *xmlEditor = new DesignerXmlEditorWidget(form);
data.formWindowEditor = xmlEditor->designerEditor(); data.formWindowEditor = xmlEditor->designerEditor();
@@ -783,11 +736,7 @@ void FormEditorW::print()
do { do {
// Grab the image to be able to a suggest suitable orientation // Grab the image to be able to a suggest suitable orientation
QString errorMessage; QString errorMessage;
#if QT_VERSION >= 0x050000
const QPixmap pixmap = m_fwm->createPreviewPixmap(); const QPixmap pixmap = m_fwm->createPreviewPixmap();
#else
const QPixmap pixmap = m_fwm->createPreviewPixmap(&errorMessage);
#endif
if (pixmap.isNull()) { if (pixmap.isNull()) {
critical(tr("The image could not be created: %1").arg(errorMessage)); critical(tr("The image could not be created: %1").arg(errorMessage));
break; break;

View File

@@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE
class QDesignerIntegrationInterface; class QDesignerIntegrationInterface;
class QDesignerFormEditorInterface; class QDesignerFormEditorInterface;
class QDesignerFormWindowInterface; class QDesignerFormWindowInterface;
class QDesignerFormWindowManagerInterface;
class QAction; class QAction;
class QActionGroup; class QActionGroup;
@@ -51,12 +52,6 @@ class QSignalMapper;
class QSettings; class QSettings;
class QToolBar; class QToolBar;
#if QT_VERSION >= 0x050000
class QDesignerFormWindowManagerInterface;
#else
namespace qdesigner_internal { class QDesignerFormWindowManager; }
#endif
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { namespace Core {
@@ -167,12 +162,7 @@ private:
QDesignerFormEditorInterface *m_formeditor; QDesignerFormEditorInterface *m_formeditor;
QDesignerIntegrationInterface *m_integration; QDesignerIntegrationInterface *m_integration;
#if QT_VERSION >= 0x050000
QDesignerFormWindowManagerInterface *m_fwm; QDesignerFormWindowManagerInterface *m_fwm;
#else
qdesigner_internal::QDesignerFormWindowManager *m_fwm;
#endif
InitializationStage m_initStage; InitializationStage m_initStage;
QWidget *m_designerSubWindows[Designer::Constants::DesignerSubWindowCount]; QWidget *m_designerSubWindows[Designer::Constants::DesignerSubWindowCount];

View File

@@ -32,12 +32,7 @@
#include <utils/wizard.h> #include <utils/wizard.h>
#if QT_VERSION >= 0x050000 #include <QDesignerNewFormWidgetInterface>
# include <QDesignerNewFormWidgetInterface>
#else
# include "qt_private/abstractnewformwidget_p.h"
#endif
#include <QDebug> #include <QDebug>
#include <QXmlStreamReader> #include <QXmlStreamReader>
#include <QXmlStreamAttributes> #include <QXmlStreamAttributes>

View File

@@ -93,18 +93,12 @@ bool FormWindowEditor::open(QString *errorString, const QString &fileName, const
return false; return false;
form->setFileName(absfileName); form->setFileName(absfileName);
#if QT_VERSION >= 0x050000
const QByteArray contentsBA = contents.toUtf8(); const QByteArray contentsBA = contents.toUtf8();
QBuffer str; QBuffer str;
str.setData(contentsBA); str.setData(contentsBA);
str.open(QIODevice::ReadOnly); str.open(QIODevice::ReadOnly);
if (!form->setContents(&str, errorString)) if (!form->setContents(&str, errorString))
return false; return false;
#else
form->setContents(contents);
if (!form->mainContainer())
return false;
#endif
form->setDirty(fileName != realFileName); form->setDirty(fileName != realFileName);
d->m_widget->formWindowFile()->syncXmlFromFormWindow(); d->m_widget->formWindowFile()->syncXmlFromFormWindow();

View File

@@ -36,14 +36,8 @@
#include <QDesignerFormWindowInterface> #include <QDesignerFormWindowInterface>
#include <QDesignerFormWindowManagerInterface> #include <QDesignerFormWindowManagerInterface>
#include <QDesignerFormEditorInterface> #include <QDesignerFormEditorInterface>
#if QT_VERSION < 0x050000
# include "qt_private/qsimpleresource_p.h"
# include "qt_private/formwindowbase_p.h"
#endif
#include <QTextDocument> #include <QTextDocument>
#include <QUndoStack> #include <QUndoStack>
#include <QFileInfo> #include <QFileInfo>
#include <QDebug> #include <QDebug>
#include <QTextCodec> #include <QTextCodec>
@@ -84,13 +78,7 @@ bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSa
const QString oldFormName = m_formWindow->fileName(); const QString oldFormName = m_formWindow->fileName();
if (!autoSave) if (!autoSave)
m_formWindow->setFileName(fi.absoluteFilePath()); m_formWindow->setFileName(fi.absoluteFilePath());
#if QT_VERSION >= 0x050000
const bool writeOK = writeFile(actualName, errorString); const bool writeOK = writeFile(actualName, errorString);
#else
const bool warningsEnabled = qdesigner_internal::QSimpleResource::setWarningsEnabled(false);
const bool writeOK = writeFile(actualName, errorString);
qdesigner_internal::QSimpleResource::setWarningsEnabled(warningsEnabled);
#endif
m_shouldAutoSave = false; m_shouldAutoSave = false;
if (autoSave) if (autoSave)
return writeOK; return writeOK;
@@ -128,12 +116,7 @@ bool FormWindowFile::setContents(const QByteArray &contents)
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
} }
#if QT_VERSION >= 0x050000
const bool success = m_formWindow->setContents(QString::fromUtf8(contents)); const bool success = m_formWindow->setContents(QString::fromUtf8(contents));
#else
m_formWindow->setContents(QString::fromUtf8(contents));
const bool success = m_formWindow->mainContainer() != 0;
#endif
if (hasOverrideCursor) if (hasOverrideCursor)
QApplication::setOverrideCursor(overrideCursor); QApplication::setOverrideCursor(overrideCursor);

View File

@@ -29,9 +29,6 @@
#include "formeditorplugin.h" #include "formeditorplugin.h"
#if QT_VERSION < 0x050000
#include <QtTest>
#else
#include "formeditorw.h" #include "formeditorw.h"
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
@@ -228,23 +225,17 @@ public:
}; };
} // anonymous namespace } // anonymous namespace
#endif
/// Check: Executes "Go To Slot..." on a QPushButton in a *.ui file and checks if the respective /// Check: Executes "Go To Slot..." on a QPushButton in a *.ui file and checks if the respective
/// header and source files are correctly updated. /// header and source files are correctly updated.
void Designer::Internal::FormEditorPlugin::test_gotoslot() void Designer::Internal::FormEditorPlugin::test_gotoslot()
{ {
#if QT_VERSION >= 0x050000
QFETCH(QStringList, files); QFETCH(QStringList, files);
(GoToSlotTestCase(files)); (GoToSlotTestCase(files));
#else
QSKIP("Available only with >= Qt5", SkipSingle);
#endif
} }
void Designer::Internal::FormEditorPlugin::test_gotoslot_data() void Designer::Internal::FormEditorPlugin::test_gotoslot_data()
{ {
#if QT_VERSION >= 0x050000
typedef QLatin1String _; typedef QLatin1String _;
QTest::addColumn<QStringList>("files"); QTest::addColumn<QStringList>("files");
@@ -282,5 +273,4 @@ void Designer::Internal::FormEditorPlugin::test_gotoslot_data()
<< testDataDir.file(_("form.cpp")) << testDataDir.file(_("form.cpp"))
<< testDataDir.file(_("form.h")) << testDataDir.file(_("form.h"))
<< testDataDir.file(_("form.ui"))); << testDataDir.file(_("form.ui")));
#endif
} }

View File

@@ -77,24 +77,14 @@ static QString msgClassNotFound(const QString &uiClassName, const QList<Document
} }
QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, FormEditorW *parent) : QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, FormEditorW *parent) :
#if QT_VERSION >= 0x050000
QDesignerIntegration(core, parent), QDesignerIntegration(core, parent),
#else
qdesigner_internal::QDesignerIntegration(core, parent),
#endif
m_few(parent) m_few(parent)
{ {
#if QT_VERSION >= 0x050000
setResourceFileWatcherBehaviour(ReloadResourceFileSilently); setResourceFileWatcherBehaviour(ReloadResourceFileSilently);
Feature f = features(); Feature f = features();
f |= SlotNavigationFeature; f |= SlotNavigationFeature;
f &= ~ResourceEditorFeature; f &= ~ResourceEditorFeature;
setFeatures(f); setFeatures(f);
#else
setResourceFileWatcherBehaviour(QDesignerIntegration::ReloadSilently);
setResourceEditingEnabled(false);
setSlotNavigationEnabled(true);
#endif
connect(this, SIGNAL(navigateToSlot(QString,QString,QStringList)), connect(this, SIGNAL(navigateToSlot(QString,QString,QStringList)),
this, SLOT(slotNavigateToSlot(QString,QString,QStringList))); this, SLOT(slotNavigateToSlot(QString,QString,QStringList)));
connect(this, SIGNAL(helpRequested(QString,QString)), connect(this, SIGNAL(helpRequested(QString,QString)),
@@ -115,11 +105,7 @@ void QtCreatorIntegration::updateSelection()
{ {
if (const EditorData ed = m_few->activeEditor()) if (const EditorData ed = m_few->activeEditor())
ed.widgetHost->updateFormWindowSelectionHandles(true); ed.widgetHost->updateFormWindowSelectionHandles(true);
#if QT_VERSION >= 0x050000
QDesignerIntegration::updateSelection(); QDesignerIntegration::updateSelection();
#else
qdesigner_internal::QDesignerIntegration::updateSelection();
#endif
} }
QWidget *QtCreatorIntegration::containerWindow(QWidget * /*widget*/) const QWidget *QtCreatorIntegration::containerWindow(QWidget * /*widget*/) const

View File

@@ -31,12 +31,7 @@
#define QTCREATORINTEGRATION_H #define QTCREATORINTEGRATION_H
#include <QtGlobal> #include <QtGlobal>
#include <QDesignerIntegration>
#if QT_VERSION >= 0x050000
# include <QDesignerIntegration>
#else
# include "qt_private/qdesigner_integration_p.h"
#endif
QT_FORWARD_DECLARE_CLASS(QUrl) QT_FORWARD_DECLARE_CLASS(QUrl)
@@ -45,12 +40,8 @@ namespace Internal {
class FormEditorW; class FormEditorW;
class QtCreatorIntegration : class QtCreatorIntegration : public QDesignerIntegration
#if QT_VERSION >= 0x050000 {
public QDesignerIntegration {
#else
public qdesigner_internal::QDesignerIntegration {
#endif
Q_OBJECT Q_OBJECT
public: public:
explicit QtCreatorIntegration(QDesignerFormEditorInterface *core, FormEditorW *parent = 0); explicit QtCreatorIntegration(QDesignerFormEditorInterface *core, FormEditorW *parent = 0);

View File

@@ -37,12 +37,7 @@
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <resourceeditor/resourcenode.h> #include <resourceeditor/resourcenode.h>
#if QT_VERSION >= 0x050000 #include <QDesignerFormWindowInterface>
# include <QDesignerFormWindowInterface>
#else
# include "qt_private/formwindowbase_p.h"
# include "qt_private/qtresourcemodel_p.h"
#endif
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -84,11 +79,7 @@ void QrcFilesVisitor::visitFolderNode(FolderNode *folderNode)
} }
// ------------ ResourceHandler // ------------ ResourceHandler
#if QT_VERSION >= 0x050000
ResourceHandler::ResourceHandler(QDesignerFormWindowInterface *fw) : ResourceHandler::ResourceHandler(QDesignerFormWindowInterface *fw) :
#else
ResourceHandler::ResourceHandler(qdesigner_internal::FormWindowBase *fw) :
#endif
QObject(fw), QObject(fw),
m_form(fw), m_form(fw),
m_sessionNode(0), m_sessionNode(0),
@@ -110,11 +101,7 @@ void ResourceHandler::ensureInitialized()
connect(m_sessionWatcher, SIGNAL(foldersAdded()), this, SLOT(updateResources())); connect(m_sessionWatcher, SIGNAL(foldersAdded()), this, SLOT(updateResources()));
connect(m_sessionWatcher, SIGNAL(foldersRemoved()), this, SLOT(updateResources())); connect(m_sessionWatcher, SIGNAL(foldersRemoved()), this, SLOT(updateResources()));
m_sessionNode->registerWatcher(m_sessionWatcher); m_sessionNode->registerWatcher(m_sessionWatcher);
#if QT_VERSION >= 0x050000
m_originalUiQrcPaths = m_form->activeResourceFilePaths(); m_originalUiQrcPaths = m_form->activeResourceFilePaths();
#else
m_originalUiQrcPaths = m_form->resourceSet()->activeQrcPaths();
#endif
if (Designer::Constants::Internal::debug) if (Designer::Constants::Internal::debug)
qDebug() << "ResourceHandler::ensureInitialized() origPaths=" << m_originalUiQrcPaths; qDebug() << "ResourceHandler::ensureInitialized() origPaths=" << m_originalUiQrcPaths;
} }
@@ -169,26 +156,16 @@ void ResourceHandler::updateResources(bool updateProjectResources)
} }
} }
#if QT_VERSION >= 0x050000
m_form->activateResourceFilePaths(projectQrcFiles); m_form->activateResourceFilePaths(projectQrcFiles);
m_form->setResourceFileSaveMode(QDesignerFormWindowInterface::SaveOnlyUsedResourceFiles); m_form->setResourceFileSaveMode(QDesignerFormWindowInterface::SaveOnlyUsedResourceFiles);
#else
m_form->resourceSet()->activateQrcPaths(projectQrcFiles);
m_form->setSaveResourcesBehaviour(qdesigner_internal::FormWindowBase::SaveOnlyUsedQrcFiles);
#endif
if (Designer::Constants::Internal::debug) if (Designer::Constants::Internal::debug)
qDebug() << "ResourceHandler::updateResources()" << fileName qDebug() << "ResourceHandler::updateResources()" << fileName
<< " associated with project" << project->rootProjectNode()->path() << " associated with project" << project->rootProjectNode()->path()
<< " using project qrc files" << projectQrcFiles.size(); << " using project qrc files" << projectQrcFiles.size();
} else { } else {
// Use resource file originally used in form // Use resource file originally used in form
#if QT_VERSION >= 0x050000
m_form->activateResourceFilePaths(m_originalUiQrcPaths); m_form->activateResourceFilePaths(m_originalUiQrcPaths);
m_form->setResourceFileSaveMode(QDesignerFormWindowInterface::SaveAllResourceFiles); m_form->setResourceFileSaveMode(QDesignerFormWindowInterface::SaveAllResourceFiles);
#else
m_form->resourceSet()->activateQrcPaths(m_originalUiQrcPaths);
m_form->setSaveResourcesBehaviour(qdesigner_internal::FormWindowBase::SaveAll);
#endif
if (Designer::Constants::Internal::debug) if (Designer::Constants::Internal::debug)
qDebug() << "ResourceHandler::updateResources()" << fileName << " not associated with project, using loaded qrc files."; qDebug() << "ResourceHandler::updateResources()" << fileName << " not associated with project, using loaded qrc files.";
} }

View File

@@ -34,11 +34,7 @@
#include <QStringList> #include <QStringList>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if QT_VERSION >= 0x050000
class QDesignerFormWindowInterface; class QDesignerFormWindowInterface;
#else
namespace qdesigner_internal { class FormWindowBase; }
#endif
QT_END_NAMESPACE QT_END_NAMESPACE
namespace ProjectExplorer { namespace ProjectExplorer {
@@ -63,11 +59,7 @@ class ResourceHandler : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
#if QT_VERSION >= 0x050000 explicit ResourceHandler(QDesignerFormWindowInterface *fw);
explicit ResourceHandler(QDesignerFormWindowInterface *fw);
#else
explicit ResourceHandler(qdesigner_internal::FormWindowBase *fw);
#endif
virtual ~ResourceHandler(); virtual ~ResourceHandler();
public slots: public slots:
@@ -75,11 +67,7 @@ public slots:
private: private:
void ensureInitialized(); void ensureInitialized();
#if QT_VERSION >= 0x050000
QDesignerFormWindowInterface * const m_form; QDesignerFormWindowInterface * const m_form;
#else
qdesigner_internal::FormWindowBase * const m_form;
#endif
QStringList m_originalUiQrcPaths; QStringList m_originalUiQrcPaths;
ProjectExplorer::SessionNode *m_sessionNode; ProjectExplorer::SessionNode *m_sessionNode;
ProjectExplorer::NodesWatcher *m_sessionWatcher; ProjectExplorer::NodesWatcher *m_sessionWatcher;

View File

@@ -30,11 +30,7 @@
#ifndef SETTINGSMANAGER_H #ifndef SETTINGSMANAGER_H
#define SETTINGSMANAGER_H #define SETTINGSMANAGER_H
#if QT_VERSION >= 0x050000 #include <QDesignerSettingsInterface>
# include <QDesignerSettingsInterface>
#else
# include "qt_private/abstractsettings_p.h"
#endif
namespace Designer { namespace Designer {
namespace Internal { namespace Internal {

View File

@@ -30,12 +30,7 @@
#include "settingspage.h" #include "settingspage.h"
#include "formeditorw.h" #include "formeditorw.h"
#if QT_VERSION >= 0x050000 #include <QDesignerOptionsPageInterface>
# include <QDesignerOptionsPageInterface>
#else
# include "qt_private/abstractoptionspage_p.h"
#endif
#include <QCoreApplication> #include <QCoreApplication>
using namespace Designer::Internal; using namespace Designer::Internal;