summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/utils/iwelcomepage.h4
-rw-r--r--src/plugins/plugins.pro4
-rw-r--r--src/plugins/plugins.qbs8
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp23
-rw-r--r--src/plugins/projectexplorer/projectexplorer.pro9
-rw-r--r--src/plugins/projectexplorer/projectexplorer.qbs12
-rw-r--r--src/plugins/projectexplorer/projectwelcomepage.cpp8
-rw-r--r--src/plugins/projectexplorer/projectwelcomepage.h4
-rw-r--r--src/plugins/qtsupport/gettingstartedwelcomepage.cpp16
-rw-r--r--src/plugins/qtsupport/gettingstartedwelcomepage.h10
-rw-r--r--src/plugins/qtsupport/qtsupport.pro10
-rw-r--r--src/plugins/qtsupport/qtsupport.qbs13
-rw-r--r--src/plugins/qtsupport/qtsupportplugin.cpp12
-rw-r--r--src/plugins/welcome/welcome.pro2
-rw-r--r--src/plugins/welcome/welcome.qbs2
-rw-r--r--src/plugins/welcome/welcomeplugin.cpp70
-rw-r--r--src/plugins/welcome/welcomeplugin.h2
17 files changed, 130 insertions, 79 deletions
diff --git a/src/libs/utils/iwelcomepage.h b/src/libs/utils/iwelcomepage.h
index d05e8b9520..2a7db33974 100644
--- a/src/libs/utils/iwelcomepage.h
+++ b/src/libs/utils/iwelcomepage.h
@@ -35,7 +35,7 @@
#include <QObject>
QT_FORWARD_DECLARE_CLASS(QUrl)
-QT_FORWARD_DECLARE_CLASS(QDeclarativeEngine)
+QT_FORWARD_DECLARE_CLASS(QQmlEngine)
namespace Utils {
@@ -63,7 +63,7 @@ public:
virtual QUrl pageLocation() const = 0;
virtual QString title() const = 0;
virtual int priority() const { return 0; }
- virtual void facilitateQml(QDeclarativeEngine *) {}
+ virtual void facilitateQml(QQmlEngine *) {}
virtual bool hasSearchBar() const { return false; }
virtual Id id() const = 0;
};
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 592481aac1..51cd8994d1 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -4,7 +4,6 @@ TEMPLATE = subdirs
SUBDIRS = \
coreplugin \
- welcome \
find \
texteditor \
cppeditor \
@@ -70,7 +69,8 @@ contains(QT_CONFIG, declarative)|!isEmpty(QT.declarative.name) {
greaterThan(QT_MAJOR_VERSION, 4) {
SUBDIRS += \
- qmldesigner
+ qmldesigner \
+ welcome
} else {
include(../private_headers.pri)
exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs
index 0f0d044122..7c49ff9e2f 100644
--- a/src/plugins/plugins.qbs
+++ b/src/plugins/plugins.qbs
@@ -2,6 +2,7 @@ import qbs
Project {
name: "Plugins"
+
references: [
"analyzerbase/analyzerbase.qbs",
"android/android.qbs",
@@ -56,6 +57,11 @@ Project {
"updateinfo/updateinfo.qbs",
"valgrind/valgrind.qbs",
"vcsbase/vcsbase.qbs",
- "welcome/welcome.qbs"
]
+
+ Group {
+ condition: qtcore.versionMajor >= 5
+ references: [ "welcome/welcome.qbs" ]
+ }
+
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 7f1644ad4c..93a7950966 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -70,7 +70,6 @@
#include "projectnodes.h"
#include "sessiondialog.h"
#include "projectexplorersettingspage.h"
-#include "projectwelcomepage.h"
#include "corelistenercheckingforrunningbuild.h"
#include "buildconfiguration.h"
#include "miniprojecttargetselector.h"
@@ -90,6 +89,10 @@
# include "wincetoolchain.h"
#endif
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+#include "projectwelcomepage.h"
+#endif
+
#include <extensionsystem/pluginspec.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/ieditor.h>
@@ -228,8 +231,11 @@ struct ProjectExplorerPluginPrivate {
QString m_projectFilterString;
Internal::MiniProjectTargetSelector * m_targetSelector;
Internal::ProjectExplorerSettings m_projectExplorerSettings;
- Internal::ProjectWelcomePage *m_welcomePage;
+
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+ Internal::ProjectWelcomePage *m_welcomePage;
+#endif
IMode *m_projectsMode;
TaskHub *m_taskHub;
@@ -284,8 +290,10 @@ ProjectExplorerPlugin::ProjectExplorerPlugin()
ProjectExplorerPlugin::~ProjectExplorerPlugin()
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
removeObject(d->m_welcomePage);
delete d->m_welcomePage;
+#endif
removeObject(this);
// Force sequence of deletion:
delete d->m_kitManager; // remove all the profile informations
@@ -348,9 +356,11 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(ICore::instance(), SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards()));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
d->m_welcomePage = new ProjectWelcomePage;
connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
addObject(d->m_welcomePage);
+#endif
connect(DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
this, SLOT(setCurrentFile(QString)));
@@ -1085,7 +1095,9 @@ void ProjectExplorerPlugin::closeAllProjects()
SessionManager::closeAllProjects();
updateActions();
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
ModeManager::activateMode(Core::Constants::MODE_WELCOME);
+#endif
}
void ProjectExplorerPlugin::extensionsInitialized()
@@ -1212,9 +1224,11 @@ void ProjectExplorerPlugin::showSessionManager()
updateActions();
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
IMode *welcomeMode = ModeManager::mode(Core::Constants::MODE_WELCOME);
if (ModeManager::currentMode() == welcomeMode)
updateWelcomePage();
+#endif
}
void ProjectExplorerPlugin::setStartupProject(Project *project)
@@ -1443,7 +1457,9 @@ void ProjectExplorerPlugin::setCurrentNode(Node *node)
void ProjectExplorerPlugin::updateWelcomePage()
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
d->m_welcomePage->reloadWelcomeScreenData();
+#endif
}
void ProjectExplorerPlugin::currentModeChanged(IMode *mode, IMode *oldMode)
@@ -1564,9 +1580,10 @@ void ProjectExplorerPlugin::restoreSession()
connect(ModeManager::instance(),
SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)),
SLOT(currentModeChanged(Core::IMode*,Core::IMode*)));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString)));
-
+#endif
d->m_arguments = arguments;
QTimer::singleShot(0, this, SLOT(restoreSession2()));
updateActions();
diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro
index 324d8c2d2e..0c0eae361d 100644
--- a/src/plugins/projectexplorer/projectexplorer.pro
+++ b/src/plugins/projectexplorer/projectexplorer.pro
@@ -1,4 +1,4 @@
-QT += xml script declarative
+QT += xml script
include(../../qtcreatorplugin.pri)
include(customwizard/customwizard.pri)
@@ -84,7 +84,6 @@ HEADERS += projectexplorer.h \
cesdkhandler.h \
gccparser.h \
projectexplorersettingspage.h \
- projectwelcomepage.h \
baseprojectwizarddialog.h \
miniprojecttargetselector.h \
targetselector.h \
@@ -214,7 +213,6 @@ SOURCES += projectexplorer.cpp \
cesdkhandler.cpp \
gccparser.cpp \
projectexplorersettingspage.cpp \
- projectwelcomepage.cpp \
corelistenercheckingforrunningbuild.cpp \
baseprojectwizarddialog.cpp \
miniprojecttargetselector.cpp \
@@ -302,6 +300,11 @@ equals(TEST, 1) {
outputparser_test.h
}
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QT += quick
+ HEADERS += projectwelcomepage.h
+ SOURCES += projectwelcomepage.cpp
+}
macx:LIBS += -framework Carbon
RESOURCES += projectexplorer.qrc
diff --git a/src/plugins/projectexplorer/projectexplorer.qbs b/src/plugins/projectexplorer/projectexplorer.qbs
index 449e3975c0..3faba5ea1a 100644
--- a/src/plugins/projectexplorer/projectexplorer.qbs
+++ b/src/plugins/projectexplorer/projectexplorer.qbs
@@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "ProjectExplorer"
- Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "script", "declarative"] }
+ Depends { name: "Qt"; submodules: ["widgets", "xml", "network", "script", "quick"] }
Depends { name: "Core" }
Depends { name: "Locator" }
Depends { name: "Find" }
@@ -109,7 +109,6 @@ QtcPlugin {
"projectmodels.cpp", "projectmodels.h",
"projectnodes.cpp", "projectnodes.h",
"projecttreewidget.cpp", "projecttreewidget.h",
- "projectwelcomepage.cpp", "projectwelcomepage.h",
"projectwindow.cpp", "projectwindow.h",
"projectwizardpage.cpp", "projectwizardpage.h", "projectwizardpage.ui",
"removetaskhandler.cpp", "removetaskhandler.h",
@@ -136,6 +135,15 @@ QtcPlugin {
"toolchainoptionspage.cpp", "toolchainoptionspage.h",
"vcsannotatetaskhandler.cpp", "vcsannotatetaskhandler.h",
]
+
+ Group {
+ condition: qtcore.versionMajor >= 5
+ references: [
+ "projectwelcomepage.cpp",
+ "projectwelcomepage.h"
+ ]
+ }
+
}
Group {
diff --git a/src/plugins/projectexplorer/projectwelcomepage.cpp b/src/plugins/projectexplorer/projectwelcomepage.cpp
index 9578c88df9..db71fccfa8 100644
--- a/src/plugins/projectexplorer/projectwelcomepage.cpp
+++ b/src/plugins/projectexplorer/projectwelcomepage.cpp
@@ -31,8 +31,8 @@
#include <utils/stringutils.h>
-#include <QDeclarativeEngine>
-#include <QDeclarativeContext>
+#include <QQmlContext>
+#include <QQmlEngine>
#include <QFileInfo>
#include <QDir>
@@ -212,12 +212,12 @@ ProjectWelcomePage::ProjectWelcomePage() :
{
}
-void ProjectWelcomePage::facilitateQml(QDeclarativeEngine *engine)
+void ProjectWelcomePage::facilitateQml(QQmlEngine *engine)
{
m_sessionModel = new SessionModel(this);
m_projectModel = new ProjectModel(ProjectExplorerPlugin::instance(), this);
- QDeclarativeContext *ctx = engine->rootContext();
+ QQmlContext *ctx = engine->rootContext();
ctx->setContextProperty(QLatin1String("sessionList"), m_sessionModel);
ctx->setContextProperty(QLatin1String("projectList"), m_projectModel);
ctx->setContextProperty(QLatin1String("projectWelcomePage"), this);
diff --git a/src/plugins/projectexplorer/projectwelcomepage.h b/src/plugins/projectexplorer/projectwelcomepage.h
index 6ce2f856e3..96a6f6c027 100644
--- a/src/plugins/projectexplorer/projectwelcomepage.h
+++ b/src/plugins/projectexplorer/projectwelcomepage.h
@@ -35,7 +35,7 @@
#include <utils/iwelcomepage.h>
QT_BEGIN_NAMESPACE
-class QDeclarativeEngine;
+class QQmlEngine;
QT_END_NAMESPACE
namespace ProjectExplorer {
@@ -87,7 +87,7 @@ class ProjectWelcomePage : public Utils::IWelcomePage
public:
ProjectWelcomePage();
- void facilitateQml(QDeclarativeEngine *engine);
+ void facilitateQml(QQmlEngine *engine);
QUrl pageLocation() const;
QWidget *page() { return 0; }
QString title() const { return tr("Develop"); }
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
index d6cbedb306..71286c838e 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp
@@ -61,9 +61,9 @@
#include <QPushButton>
#include <QMessageBox>
#include <QApplication>
-#include <QDeclarativeImageProvider>
-#include <QDeclarativeEngine>
-#include <QDeclarativeContext>
+#include <QQuickImageProvider>
+#include <QQmlEngine>
+#include <QQmlContext>
#include <QDesktopServices>
using namespace Utils;
@@ -170,11 +170,11 @@ public:
bool m_shutdown;
};
-class HelpImageProvider : public QDeclarativeImageProvider
+class HelpImageProvider : public QQuickImageProvider
{
public:
HelpImageProvider()
- : QDeclarativeImageProvider(QDeclarativeImageProvider::Image)
+ : QQuickImageProvider(QQuickImageProvider::Image)
{
}
@@ -231,7 +231,7 @@ int GettingStartedWelcomePage::priority() const
return 4;
}
-void GettingStartedWelcomePage::facilitateQml(QDeclarativeEngine *engine)
+void GettingStartedWelcomePage::facilitateQml(QQmlEngine *engine)
{
m_engine = engine;
}
@@ -288,7 +288,7 @@ QUrl ExamplesWelcomePage::pageLocation() const
return QUrl::fromLocalFile(resourcePath + QLatin1String("/welcomescreen/tutorials.qml"));
}
-void ExamplesWelcomePage::facilitateQml(QDeclarativeEngine *engine)
+void ExamplesWelcomePage::facilitateQml(QQmlEngine *engine)
{
m_engine = engine;
m_engine->addImageProvider(QLatin1String("helpimage"), new HelpImageProvider);
@@ -299,7 +299,7 @@ void ExamplesWelcomePage::facilitateQml(QDeclarativeEngine *engine)
proxy->sort(0);
proxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
- QDeclarativeContext *rootContenxt = m_engine->rootContext();
+ QQmlContext *rootContenxt = m_engine->rootContext();
if (m_showExamples) {
proxy->setShowTutorialsOnly(false);
rootContenxt->setContextProperty(QLatin1String("examplesModel"), proxy);
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.h b/src/plugins/qtsupport/gettingstartedwelcomepage.h
index b35a4cd6d5..515cac9b5d 100644
--- a/src/plugins/qtsupport/gettingstartedwelcomepage.h
+++ b/src/plugins/qtsupport/gettingstartedwelcomepage.h
@@ -35,7 +35,7 @@
#include <QStringList>
QT_BEGIN_NAMESPACE
-class QDeclarativeEngine;
+class QQmlEngine;
class QFileInfo;
QT_END_NAMESPACE
@@ -54,11 +54,11 @@ public:
QUrl pageLocation() const;
QString title() const;
int priority() const;
- void facilitateQml(QDeclarativeEngine *);
+ void facilitateQml(QQmlEngine *);
Id id() const;
private:
- QDeclarativeEngine *m_engine;
+ QQmlEngine *m_engine;
};
@@ -74,7 +74,7 @@ public:
QString title() const;
int priority() const;
bool hasSearchBar() const;
- void facilitateQml(QDeclarativeEngine *);
+ void facilitateQml(QQmlEngine *);
Id id() const;
Q_INVOKABLE QStringList tagList() const;
Q_INVOKABLE void openUrl(const QUrl &url);
@@ -92,7 +92,7 @@ public slots:
private:
ExamplesListModel *examplesModel() const;
QString copyToAlternativeLocation(const QFileInfo &fileInfo, QStringList &filesToOpen, const QStringList &dependencies);
- QDeclarativeEngine *m_engine;
+ QQmlEngine *m_engine;
bool m_showExamples;
};
diff --git a/src/plugins/qtsupport/qtsupport.pro b/src/plugins/qtsupport/qtsupport.pro
index d98993eddd..af48b82a6f 100644
--- a/src/plugins/qtsupport/qtsupport.pro
+++ b/src/plugins/qtsupport/qtsupport.pro
@@ -1,5 +1,5 @@
DEFINES += QTSUPPORT_LIBRARY
-QT += network declarative
+QT += network
include(../../qtcreatorplugin.pri)
@@ -27,7 +27,6 @@ HEADERS += \
qtsupportconstants.h \
profilereader.h \
qtparser.h \
- gettingstartedwelcomepage.h \
exampleslistmodel.h \
screenshotcropper.h \
qtconfigwidget.h \
@@ -52,11 +51,16 @@ SOURCES += \
debugginghelperbuildtask.cpp \
profilereader.cpp \
qtparser.cpp \
- gettingstartedwelcomepage.cpp \
exampleslistmodel.cpp \
screenshotcropper.cpp \
qtconfigwidget.cpp
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QT += quick
+ HEADERS += gettingstartedwelcomepage.h
+ SOURCES += gettingstartedwelcomepage.cpp
+}
+
FORMS += \
showbuildlog.ui \
qtversioninfo.ui \
diff --git a/src/plugins/qtsupport/qtsupport.qbs b/src/plugins/qtsupport/qtsupport.qbs
index e09ef1d726..74924118c0 100644
--- a/src/plugins/qtsupport/qtsupport.qbs
+++ b/src/plugins/qtsupport/qtsupport.qbs
@@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "QtSupport"
- Depends { name: "Qt"; submodules: ["widgets", "declarative"] }
+ Depends { name: "Qt"; submodules: ["widgets", "quick"] }
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "TextEditor" }
@@ -70,8 +70,6 @@ QtcPlugin {
"debugginghelperbuildtask.h",
"exampleslistmodel.cpp",
"exampleslistmodel.h",
- "gettingstartedwelcomepage.cpp",
- "gettingstartedwelcomepage.h",
"profilereader.cpp",
"profilereader.h",
"qmldebugginglibrary.cpp",
@@ -112,6 +110,15 @@ QtcPlugin {
"images/qt_qrc.png",
]
+ Group {
+ condition: qtcore.versionMajor >= 5
+ files: [
+ "gettingstartedwelcomepage.cpp",
+ "gettingstartedwelcomepage.h"
+ ]
+ }
+
+
Export {
Depends { name: "cpp" }
cpp.includePaths: "../../shared"
diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp
index ac2bccae38..ada53bc614 100644
--- a/src/plugins/qtsupport/qtsupportplugin.cpp
+++ b/src/plugins/qtsupport/qtsupportplugin.cpp
@@ -38,8 +38,6 @@
#include "profilereader.h"
-#include "gettingstartedwelcomepage.h"
-
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <coreplugin/variablemanager.h>
@@ -47,6 +45,10 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/target.h>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
+#include "gettingstartedwelcomepage.h"
+#endif
+
#include <QtPlugin>
static const char kHostBins[] = "CurrentProject:QT_HOST_BINS";
@@ -75,18 +77,16 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
addAutoReleasedObject(new QtOptionsPage);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
ExamplesWelcomePage *welcomePage;
welcomePage = new ExamplesWelcomePage;
addAutoReleasedObject(welcomePage);
-
- welcomePage = new ExamplesWelcomePage;
welcomePage->setShowExamples(true);
- addAutoReleasedObject(welcomePage);
GettingStartedWelcomePage *gettingStartedWelcomePage = new GettingStartedWelcomePage;
addAutoReleasedObject(gettingStartedWelcomePage);
-
addAutoReleasedObject(new CustomExecutableRunConfigurationFactory);
+#endif
ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation);
diff --git a/src/plugins/welcome/welcome.pro b/src/plugins/welcome/welcome.pro
index 9920c75f68..b201120c74 100644
--- a/src/plugins/welcome/welcome.pro
+++ b/src/plugins/welcome/welcome.pro
@@ -1,4 +1,4 @@
-QT += network declarative
+QT += network quick
include(../../qtcreatorplugin.pri)
diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs
index 20b0400f54..93ca3f4e61 100644
--- a/src/plugins/welcome/welcome.qbs
+++ b/src/plugins/welcome/welcome.qbs
@@ -5,7 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "Welcome"
- Depends { name: "Qt"; submodules: ["widgets", "network", "declarative"] }
+ Depends { name: "Qt"; submodules: ["widgets", "network", "quick"] }
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index befdf9d5dc..3ade9ca053 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -61,10 +61,10 @@
#include <QUrl>
#include <QtPlugin>
-#include <QDeclarativeView>
-#include <QDeclarativeContext>
-#include <QDeclarativeEngine>
-#include <QDeclarativeNetworkAccessManagerFactory>
+#include <QtQuick/QQuickView>
+#include <QtQml/QQmlContext>
+#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlNetworkAccessManagerFactory>
enum { debug = 0 };
@@ -76,10 +76,10 @@ static const char currentPageSettingsKeyC[] = "WelcomeTab";
namespace Welcome {
namespace Internal {
-class NetworkAccessManagerFactory : public QDeclarativeNetworkAccessManagerFactory
+class NetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
{
public:
- NetworkAccessManagerFactory(): QDeclarativeNetworkAccessManagerFactory() {}
+ NetworkAccessManagerFactory(): QQmlNetworkAccessManagerFactory() {}
QNetworkAccessManager* create(QObject *parent) { return new Utils::NetworkAccessManager(parent); }
};
@@ -103,7 +103,7 @@ public:
Q_SCRIPTABLE QString platform() const;
- bool eventFilter(QObject *, QEvent *);
+// bool eventFilter(QObject *, QEvent *);
public slots:
void setActivePlugin(int pos)
@@ -121,10 +121,10 @@ private slots:
void welcomePluginAdded(QObject*);
private:
- void facilitateQml(QDeclarativeEngine *engine);
+ void facilitateQml(QQmlEngine *engine);
QWidget *m_modeWidget;
- QDeclarativeView *m_welcomePage;
+ QQuickView *m_welcomePage;
QList<QObject*> m_pluginList;
int m_activePlugin;
NetworkAccessManagerFactory *m_networkAccessManagerFactory;
@@ -146,40 +146,46 @@ WelcomeMode::WelcomeMode() :
setContextHelpId(QLatin1String("Qt Creator Manual"));
setContext(Core::Context(Core::Constants::C_WELCOME_MODE));
- m_welcomePage = new QDeclarativeView;
- m_welcomePage->setResizeMode(QDeclarativeView::SizeRootObjectToView);
- // filter to forward dragEnter events
- m_welcomePage->installEventFilter(this);
- m_welcomePage->viewport()->installEventFilter(this);
+ m_welcomePage = new QQuickView;
+ m_welcomePage->setResizeMode(QQuickView::SizeRootObjectToView);
+
+// filter to forward dragEnter events
+// m_welcomePage->installEventFilter(this);
+// m_welcomePage->viewport()->installEventFilter(this);
m_modeWidget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
layout->setMargin(0);
layout->setSpacing(0);
- m_modeWidget->setLayout(layout);
Utils::StyledBar* styledBar = new Utils::StyledBar(m_modeWidget);
layout->addWidget(styledBar);
- QScrollArea *scrollArea = new QScrollArea(m_modeWidget);
- scrollArea->setFrameShape(QFrame::NoFrame);
- layout->addWidget(scrollArea);
- scrollArea->setWidget(m_welcomePage);
- scrollArea->setWidgetResizable(true);
+
+ // QScrollArea *scrollArea = new QScrollArea(m_modeWidget);
+ // scrollArea->setFrameShape(QFrame::NoFrame);
+ // layout->addWidget(scrollArea);
+ // scrollArea->setWidget(m_welcomePage);
+ // scrollArea->setWidgetResizable(true);
+
m_welcomePage->setMinimumWidth(880);
m_welcomePage->setMinimumHeight(548);
+ QWidget *container = QWidget::createWindowContainer(m_welcomePage, m_modeWidget);
+ layout->addWidget(container);
+ m_modeWidget->setLayout(layout);
+
connect(PluginManager::instance(), SIGNAL(objectAdded(QObject*)), SLOT(welcomePluginAdded(QObject*)));
setWidget(m_modeWidget);
}
-bool WelcomeMode::eventFilter(QObject *, QEvent *e)
-{
- if (e->type() == QEvent::DragEnter) {
- e->ignore();
- return true;
- }
- return false;
-}
+//bool WelcomeMode::eventFilter(QObject *, QEvent *e)
+//{
+// if (e->type() == QEvent::DragEnter) {
+// e->ignore();
+// return true;
+// }
+// return false;
+//}
WelcomeMode::~WelcomeMode()
{
@@ -194,7 +200,7 @@ bool sortFunction(Utils::IWelcomePage * a, Utils::IWelcomePage *b)
return a->priority() < b->priority();
}
-void WelcomeMode::facilitateQml(QDeclarativeEngine * /*engine*/)
+void WelcomeMode::facilitateQml(QQmlEngine * /*engine*/)
{
}
@@ -227,7 +233,7 @@ void WelcomeMode::initPlugins()
if (activePlugin() > 1)
setActivePlugin(1);
- QDeclarativeContext *ctx = m_welcomePage->rootContext();
+ QQmlContext *ctx = m_welcomePage->rootContext();
ctx->setContextProperty(QLatin1String("welcomeMode"), this);
QList<Utils::IWelcomePage*> duplicatePlugins = PluginManager::getObjects<Utils::IWelcomePage>();
@@ -255,7 +261,7 @@ void WelcomeMode::initPlugins()
}
- QDeclarativeEngine *engine = m_welcomePage->engine();
+ QQmlEngine *engine = m_welcomePage->engine();
QStringList importPathList = engine->importPathList();
importPathList << resourcePath() + QLatin1String("/welcomescreen");
engine->setImportPathList(importPathList);
@@ -322,7 +328,7 @@ void WelcomeMode::welcomePluginAdded(QObject *obj)
}
m_pluginList.insert(insertPos, plugin);
// update model through reset
- QDeclarativeContext *ctx = m_welcomePage->rootContext();
+ QQmlContext *ctx = m_welcomePage->rootContext();
ctx->setContextProperty(QLatin1String("pagesModel"), QVariant::fromValue(m_pluginList));
}
}
diff --git a/src/plugins/welcome/welcomeplugin.h b/src/plugins/welcome/welcomeplugin.h
index c320d1f711..c69eff7f38 100644
--- a/src/plugins/welcome/welcomeplugin.h
+++ b/src/plugins/welcome/welcomeplugin.h
@@ -33,7 +33,7 @@
#include <extensionsystem/iplugin.h>
QT_BEGIN_NAMESPACE
-class QDeclarativeEngine;
+class QQmlEngine;
QT_END_NAMESPACE
namespace Welcome {