diff --git a/src/plugins/designer/designercontext.cpp b/src/plugins/designer/designercontext.cpp index df3fb11b333..0ea7808bc06 100644 --- a/src/plugins/designer/designercontext.cpp +++ b/src/plugins/designer/designercontext.cpp @@ -31,12 +31,7 @@ #include "formeditorw.h" #include - -#if QT_VERSION >= 0x050000 -# include -#else -# include "qt_private/qdesigner_integration_p.h" -#endif +#include #include #include @@ -57,17 +52,7 @@ DesignerContext::DesignerContext(const Core::Context &context, QString DesignerContext::contextHelpId() const { const QDesignerFormEditorInterface *core = FormEditorW::instance()->designerEditor(); -#if QT_VERSION >= 0x050000 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(core->integration())) - helpId = integration->contextHelpId(); - return helpId; -#endif } } // namespace Internal diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index 4a39c8f33b3..e4c2e7dfe76 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -54,16 +54,7 @@ #include #include #include - -#if QT_VERSION >= 0x050000 -# include -#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 #include #include #include @@ -101,11 +92,7 @@ static const char settingsGroupC[] = "Designer"; static inline QIcon designerIcon(const QString &iconName) { -#if QT_VERSION >= 0x050000 const QIcon icon = QDesignerFormEditorInterface::createIcon(iconName); -#else - const QIcon icon = qdesigner_internal::createIconSet(iconName); -#endif if (icon.isNull()) qWarning() << "Unable to locate " << iconName; return icon; @@ -151,11 +138,7 @@ FormEditorW::FormEditorW() : m_formeditor->setTopLevel(ICore::mainWindow()); m_formeditor->setSettingsManager(new SettingsManager()); -#if QT_VERSION >= 0x050000 m_fwm = m_formeditor->formWindowManager(); -#else - m_fwm = qobject_cast(m_formeditor->formWindowManager()); -#endif QTC_ASSERT(m_fwm, return); 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. */ QList plugins = QPluginLoader::staticInstances(); -#if QT_VERSION >= 0x050000 plugins += m_formeditor->pluginInstances(); -#else - plugins += m_formeditor->pluginManager()->instances(); -#endif foreach (QObject *plugin, plugins) { if (QDesignerFormEditorPluginInterface *formEditorPlugin = qobject_cast(plugin)) { if (!formEditorPlugin->isInitialized()) @@ -490,20 +469,12 @@ void FormEditorW::setupActions() // Commands that do not go into the editor toolbar mformtools->addSeparator(m_contexts); -#if QT_VERSION >= 0x050000 m_actionPreview = m_fwm->action(QDesignerFormWindowManagerInterface::DefaultPreviewAction); -#else - m_actionPreview = m_fwm->actionDefaultPreview(); -#endif QTC_ASSERT(m_actionPreview, return); addToolAction(m_actionPreview, m_contexts, "FormEditor.Preview", mformtools, tr("Alt+Shift+R")); // Preview in style... -#if QT_VERSION >= 0x050000 m_actionGroupPreviewInStyle = m_fwm->actionGroup(QDesignerFormWindowManagerInterface::StyledPreviewActionGroup); -#else - m_actionGroupPreviewInStyle = m_fwm->actionGroupPreviewInStyle(); -#endif ActionContainer *previewAC = createPreviewStyleMenu(m_actionGroupPreviewInStyle); m_previewInStyleMenu = previewAC->menu(); @@ -516,11 +487,7 @@ void FormEditorW::setupActions() mformtools->addSeparator(m_contexts); mformtools->addSeparator(m_contexts, Core::Constants::G_DEFAULT_THREE); -#if QT_VERSION >= 0x050000 QAction *actionFormSettings = m_fwm->action(QDesignerFormWindowManagerInterface::FormWindowSettingsDialogAction); -#else - QAction *actionFormSettings = m_fwm->actionShowFormWindowSettingsDialog(); -#endif addToolAction(actionFormSettings, m_contexts, "FormEditor.FormSettings", mformtools, QString(), Core::Constants::G_DEFAULT_THREE); @@ -529,13 +496,7 @@ void FormEditorW::setupActions() m_actionAboutPlugins->setMenuRole(QAction::NoRole); addToolAction(m_actionAboutPlugins, m_contexts, "FormEditor.AboutPlugins", mformtools, QString(), Core::Constants::G_DEFAULT_THREE); - connect(m_actionAboutPlugins, SIGNAL(triggered()), m_fwm, -#if QT_VERSION >= 0x050000 - SLOT(showPluginDialog()) -#else - SLOT(aboutPlugins()) -#endif - ); + connect(m_actionAboutPlugins, SIGNAL(triggered()), m_fwm, SLOT(showPluginDialog())); m_actionAboutPlugins->setEnabled(false); // FWM @@ -669,18 +630,10 @@ EditorData FormEditorW::createEditor() // Create and associate form and text editor. EditorData data; m_fwm->closeAllPreviews(); -#if QT_VERSION >= 0x050000 QDesignerFormWindowInterface *form = m_fwm->createFormWindow(0); -#else - qdesigner_internal::FormWindowBase *form = qobject_cast(m_fwm->createFormWindow(0)); -#endif QTC_ASSERT(form, return data); connect(form, SIGNAL(toolChanged(int)), this, SLOT(toolChanged(int))); 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); DesignerXmlEditorWidget *xmlEditor = new DesignerXmlEditorWidget(form); data.formWindowEditor = xmlEditor->designerEditor(); @@ -783,11 +736,7 @@ void FormEditorW::print() do { // Grab the image to be able to a suggest suitable orientation QString errorMessage; -#if QT_VERSION >= 0x050000 const QPixmap pixmap = m_fwm->createPreviewPixmap(); -#else - const QPixmap pixmap = m_fwm->createPreviewPixmap(&errorMessage); -#endif if (pixmap.isNull()) { critical(tr("The image could not be created: %1").arg(errorMessage)); break; diff --git a/src/plugins/designer/formeditorw.h b/src/plugins/designer/formeditorw.h index 3f03c932fa8..a20066234c7 100644 --- a/src/plugins/designer/formeditorw.h +++ b/src/plugins/designer/formeditorw.h @@ -43,6 +43,7 @@ QT_BEGIN_NAMESPACE class QDesignerIntegrationInterface; class QDesignerFormEditorInterface; class QDesignerFormWindowInterface; +class QDesignerFormWindowManagerInterface; class QAction; class QActionGroup; @@ -51,12 +52,6 @@ class QSignalMapper; class QSettings; class QToolBar; -#if QT_VERSION >= 0x050000 -class QDesignerFormWindowManagerInterface; -#else -namespace qdesigner_internal { class QDesignerFormWindowManager; } -#endif - QT_END_NAMESPACE namespace Core { @@ -167,12 +162,7 @@ private: QDesignerFormEditorInterface *m_formeditor; QDesignerIntegrationInterface *m_integration; - -#if QT_VERSION >= 0x050000 QDesignerFormWindowManagerInterface *m_fwm; -#else - qdesigner_internal::QDesignerFormWindowManager *m_fwm; -#endif InitializationStage m_initStage; QWidget *m_designerSubWindows[Designer::Constants::DesignerSubWindowCount]; diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index 1697a347cf7..d52d41d1309 100644 --- a/src/plugins/designer/formtemplatewizardpage.cpp +++ b/src/plugins/designer/formtemplatewizardpage.cpp @@ -32,12 +32,7 @@ #include -#if QT_VERSION >= 0x050000 -# include -#else -# include "qt_private/abstractnewformwidget_p.h" -#endif - +#include #include #include #include diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index 60383680641..40079d01d7c 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -93,18 +93,12 @@ bool FormWindowEditor::open(QString *errorString, const QString &fileName, const return false; form->setFileName(absfileName); -#if QT_VERSION >= 0x050000 const QByteArray contentsBA = contents.toUtf8(); QBuffer str; str.setData(contentsBA); str.open(QIODevice::ReadOnly); if (!form->setContents(&str, errorString)) return false; -#else - form->setContents(contents); - if (!form->mainContainer()) - return false; -#endif form->setDirty(fileName != realFileName); d->m_widget->formWindowFile()->syncXmlFromFormWindow(); diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp index 24d2da9b458..f6208a83467 100644 --- a/src/plugins/designer/formwindowfile.cpp +++ b/src/plugins/designer/formwindowfile.cpp @@ -36,14 +36,8 @@ #include #include #include -#if QT_VERSION < 0x050000 -# include "qt_private/qsimpleresource_p.h" -# include "qt_private/formwindowbase_p.h" -#endif - #include #include - #include #include #include @@ -84,13 +78,7 @@ bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSa const QString oldFormName = m_formWindow->fileName(); if (!autoSave) m_formWindow->setFileName(fi.absoluteFilePath()); -#if QT_VERSION >= 0x050000 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; if (autoSave) return writeOK; @@ -128,12 +116,7 @@ bool FormWindowFile::setContents(const QByteArray &contents) QApplication::restoreOverrideCursor(); } -#if QT_VERSION >= 0x050000 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) QApplication::setOverrideCursor(overrideCursor); diff --git a/src/plugins/designer/gotoslot_test.cpp b/src/plugins/designer/gotoslot_test.cpp index 4ce7517d152..def152e9857 100644 --- a/src/plugins/designer/gotoslot_test.cpp +++ b/src/plugins/designer/gotoslot_test.cpp @@ -29,9 +29,6 @@ #include "formeditorplugin.h" -#if QT_VERSION < 0x050000 -#include -#else #include "formeditorw.h" #include @@ -228,23 +225,17 @@ public: }; } // anonymous namespace -#endif /// Check: Executes "Go To Slot..." on a QPushButton in a *.ui file and checks if the respective /// header and source files are correctly updated. void Designer::Internal::FormEditorPlugin::test_gotoslot() { -#if QT_VERSION >= 0x050000 QFETCH(QStringList, files); (GoToSlotTestCase(files)); -#else - QSKIP("Available only with >= Qt5", SkipSingle); -#endif } void Designer::Internal::FormEditorPlugin::test_gotoslot_data() { -#if QT_VERSION >= 0x050000 typedef QLatin1String _; QTest::addColumn("files"); @@ -282,5 +273,4 @@ void Designer::Internal::FormEditorPlugin::test_gotoslot_data() << testDataDir.file(_("form.cpp")) << testDataDir.file(_("form.h")) << testDataDir.file(_("form.ui"))); -#endif } diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index c1aabdf7d05..89ade1f8587 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -77,24 +77,14 @@ static QString msgClassNotFound(const QString &uiClassName, const QList= 0x050000 QDesignerIntegration(core, parent), -#else - qdesigner_internal::QDesignerIntegration(core, parent), -#endif m_few(parent) { -#if QT_VERSION >= 0x050000 setResourceFileWatcherBehaviour(ReloadResourceFileSilently); Feature f = features(); f |= SlotNavigationFeature; f &= ~ResourceEditorFeature; setFeatures(f); -#else - setResourceFileWatcherBehaviour(QDesignerIntegration::ReloadSilently); - setResourceEditingEnabled(false); - setSlotNavigationEnabled(true); -#endif connect(this, SIGNAL(navigateToSlot(QString,QString,QStringList)), this, SLOT(slotNavigateToSlot(QString,QString,QStringList))); connect(this, SIGNAL(helpRequested(QString,QString)), @@ -115,11 +105,7 @@ void QtCreatorIntegration::updateSelection() { if (const EditorData ed = m_few->activeEditor()) ed.widgetHost->updateFormWindowSelectionHandles(true); -#if QT_VERSION >= 0x050000 QDesignerIntegration::updateSelection(); -#else - qdesigner_internal::QDesignerIntegration::updateSelection(); -#endif } QWidget *QtCreatorIntegration::containerWindow(QWidget * /*widget*/) const diff --git a/src/plugins/designer/qtcreatorintegration.h b/src/plugins/designer/qtcreatorintegration.h index 92f89ee8b49..57489e4eec2 100644 --- a/src/plugins/designer/qtcreatorintegration.h +++ b/src/plugins/designer/qtcreatorintegration.h @@ -31,12 +31,7 @@ #define QTCREATORINTEGRATION_H #include - -#if QT_VERSION >= 0x050000 -# include -#else -# include "qt_private/qdesigner_integration_p.h" -#endif +#include QT_FORWARD_DECLARE_CLASS(QUrl) @@ -45,12 +40,8 @@ namespace Internal { class FormEditorW; -class QtCreatorIntegration : -#if QT_VERSION >= 0x050000 - public QDesignerIntegration { -#else - public qdesigner_internal::QDesignerIntegration { -#endif +class QtCreatorIntegration : public QDesignerIntegration +{ Q_OBJECT public: explicit QtCreatorIntegration(QDesignerFormEditorInterface *core, FormEditorW *parent = 0); diff --git a/src/plugins/designer/resourcehandler.cpp b/src/plugins/designer/resourcehandler.cpp index e131fc88a78..c8ec9148adf 100644 --- a/src/plugins/designer/resourcehandler.cpp +++ b/src/plugins/designer/resourcehandler.cpp @@ -37,12 +37,7 @@ #include #include -#if QT_VERSION >= 0x050000 -# include -#else -# include "qt_private/formwindowbase_p.h" -# include "qt_private/qtresourcemodel_p.h" -#endif +#include #include @@ -84,11 +79,7 @@ void QrcFilesVisitor::visitFolderNode(FolderNode *folderNode) } // ------------ ResourceHandler -#if QT_VERSION >= 0x050000 ResourceHandler::ResourceHandler(QDesignerFormWindowInterface *fw) : -#else -ResourceHandler::ResourceHandler(qdesigner_internal::FormWindowBase *fw) : -#endif QObject(fw), m_form(fw), m_sessionNode(0), @@ -110,11 +101,7 @@ void ResourceHandler::ensureInitialized() connect(m_sessionWatcher, SIGNAL(foldersAdded()), this, SLOT(updateResources())); connect(m_sessionWatcher, SIGNAL(foldersRemoved()), this, SLOT(updateResources())); m_sessionNode->registerWatcher(m_sessionWatcher); -#if QT_VERSION >= 0x050000 m_originalUiQrcPaths = m_form->activeResourceFilePaths(); -#else - m_originalUiQrcPaths = m_form->resourceSet()->activeQrcPaths(); -#endif if (Designer::Constants::Internal::debug) 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->setResourceFileSaveMode(QDesignerFormWindowInterface::SaveOnlyUsedResourceFiles); -#else - m_form->resourceSet()->activateQrcPaths(projectQrcFiles); - m_form->setSaveResourcesBehaviour(qdesigner_internal::FormWindowBase::SaveOnlyUsedQrcFiles); -#endif if (Designer::Constants::Internal::debug) qDebug() << "ResourceHandler::updateResources()" << fileName << " associated with project" << project->rootProjectNode()->path() << " using project qrc files" << projectQrcFiles.size(); } else { // Use resource file originally used in form -#if QT_VERSION >= 0x050000 m_form->activateResourceFilePaths(m_originalUiQrcPaths); 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) qDebug() << "ResourceHandler::updateResources()" << fileName << " not associated with project, using loaded qrc files."; } diff --git a/src/plugins/designer/resourcehandler.h b/src/plugins/designer/resourcehandler.h index c6d74efe015..97abfc1ad81 100644 --- a/src/plugins/designer/resourcehandler.h +++ b/src/plugins/designer/resourcehandler.h @@ -34,11 +34,7 @@ #include QT_BEGIN_NAMESPACE -#if QT_VERSION >= 0x050000 class QDesignerFormWindowInterface; -#else -namespace qdesigner_internal { class FormWindowBase; } -#endif QT_END_NAMESPACE namespace ProjectExplorer { @@ -63,11 +59,7 @@ class ResourceHandler : public QObject { Q_OBJECT public: -#if QT_VERSION >= 0x050000 - explicit ResourceHandler(QDesignerFormWindowInterface *fw); -#else - explicit ResourceHandler(qdesigner_internal::FormWindowBase *fw); -#endif + explicit ResourceHandler(QDesignerFormWindowInterface *fw); virtual ~ResourceHandler(); public slots: @@ -75,11 +67,7 @@ public slots: private: void ensureInitialized(); -#if QT_VERSION >= 0x050000 QDesignerFormWindowInterface * const m_form; -#else - qdesigner_internal::FormWindowBase * const m_form; -#endif QStringList m_originalUiQrcPaths; ProjectExplorer::SessionNode *m_sessionNode; ProjectExplorer::NodesWatcher *m_sessionWatcher; diff --git a/src/plugins/designer/settingsmanager.h b/src/plugins/designer/settingsmanager.h index 94e3da512b6..b8403bd493e 100644 --- a/src/plugins/designer/settingsmanager.h +++ b/src/plugins/designer/settingsmanager.h @@ -30,11 +30,7 @@ #ifndef SETTINGSMANAGER_H #define SETTINGSMANAGER_H -#if QT_VERSION >= 0x050000 -# include -#else -# include "qt_private/abstractsettings_p.h" -#endif +#include namespace Designer { namespace Internal { diff --git a/src/plugins/designer/settingspage.cpp b/src/plugins/designer/settingspage.cpp index b513027a449..ef471f08080 100644 --- a/src/plugins/designer/settingspage.cpp +++ b/src/plugins/designer/settingspage.cpp @@ -30,12 +30,7 @@ #include "settingspage.h" #include "formeditorw.h" -#if QT_VERSION >= 0x050000 -# include -#else -# include "qt_private/abstractoptionspage_p.h" -#endif - +#include #include using namespace Designer::Internal;