forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.6'
Conflicts: src/plugins/qt4projectmanager/wizards/qtquickapp.cpp Change-Id: I6ece61c73bc32e93912ad1b489871c597ab60d5b
This commit is contained in:
24
share/qtcreator/templates/qtquick2app/app.pro
Normal file
24
share/qtcreator/templates/qtquick2app/app.pro
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Add more folders to ship with the application, here
|
||||||
|
# DEPLOYMENTFOLDERS #
|
||||||
|
folder_01.source = qml/app
|
||||||
|
folder_01.target = qml
|
||||||
|
DEPLOYMENTFOLDERS = folder_01
|
||||||
|
# DEPLOYMENTFOLDERS_END #
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules in Creator's code model
|
||||||
|
# QML_IMPORT_PATH #
|
||||||
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# If your application uses the Qt Mobility libraries, uncomment the following
|
||||||
|
# lines and add the respective components to the MOBILITY variable.
|
||||||
|
# CONFIG += mobility
|
||||||
|
# MOBILITY +=
|
||||||
|
|
||||||
|
# The .cpp file which was generated for your project. Feel free to hack it.
|
||||||
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
# Please do not modify the following two lines. Required for deployment.
|
||||||
|
include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
|
||||||
|
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qmlapplicationviewer.pri, instead) #
|
||||||
|
include(../shared/deployment.pri)
|
||||||
|
qtcAddDeployment()
|
13
share/qtcreator/templates/qtquick2app/main.cpp
Normal file
13
share/qtcreator/templates/qtquick2app/main.cpp
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#include <QtGui/QGuiApplication>
|
||||||
|
#include "qtquick2applicationviewer.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
QtQuick2ApplicationViewer viewer;
|
||||||
|
viewer.setMainQmlFile(QStringLiteral("qml/app/qtquick20/main.qml")); // MAINQML
|
||||||
|
viewer.showExpanded();
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
}
|
@@ -0,0 +1,16 @@
|
|||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 360
|
||||||
|
height: 360
|
||||||
|
Text {
|
||||||
|
text: qsTr("Hello World")
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
Qt.quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
|
||||||
|
QtQuick2ApplicationViewer is a convenience class containing mobile device specific
|
||||||
|
code such as screen orientation handling. Also QML paths and debugging are
|
||||||
|
handled here.
|
||||||
|
It is recommended not to modify this file, since newer versions of Qt Creator
|
||||||
|
may offer an updated version of it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "qtquick2applicationviewer.h"
|
||||||
|
|
||||||
|
#include <QtCore/QCoreApplication>
|
||||||
|
#include <QtCore/QDir>
|
||||||
|
#include <QtQml/QQmlEngine>
|
||||||
|
|
||||||
|
class QtQuick2ApplicationViewerPrivate
|
||||||
|
{
|
||||||
|
QString mainQmlFile;
|
||||||
|
friend class QtQuick2ApplicationViewer;
|
||||||
|
static QString adjustPath(const QString &path);
|
||||||
|
};
|
||||||
|
|
||||||
|
QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path)
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_UNIX
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
if (!QDir::isAbsolutePath(path))
|
||||||
|
return QString::fromLatin1("%1/../Resources/%2")
|
||||||
|
.arg(QCoreApplication::applicationDirPath(), path);
|
||||||
|
#elif !defined(Q_OS_ANDROID)
|
||||||
|
const QString pathInInstallDir =
|
||||||
|
QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path);
|
||||||
|
if (QFileInfo(pathInInstallDir).exists())
|
||||||
|
return pathInInstallDir;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
QtQuick2ApplicationViewer::QtQuick2ApplicationViewer(QWindow *parent)
|
||||||
|
: QQuickView(parent)
|
||||||
|
, d(new QtQuick2ApplicationViewerPrivate())
|
||||||
|
{
|
||||||
|
connect(engine(), SIGNAL(quit()), SLOT(close()));
|
||||||
|
setResizeMode(QQuickView::SizeRootObjectToView);
|
||||||
|
|
||||||
|
#ifdef Q_OS_ANDROID
|
||||||
|
engine()->setBaseUrl(QUrl::fromLocalFile("/"));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer()
|
||||||
|
{
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file)
|
||||||
|
{
|
||||||
|
d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file);
|
||||||
|
setSource(QUrl::fromLocalFile(d->mainQmlFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtQuick2ApplicationViewer::addImportPath(const QString &path)
|
||||||
|
{
|
||||||
|
engine()->addImportPath(QtQuick2ApplicationViewerPrivate::adjustPath(path));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtQuick2ApplicationViewer::showExpanded()
|
||||||
|
{
|
||||||
|
#if defined(Q_WS_SIMULATOR)
|
||||||
|
showFullScreen();
|
||||||
|
#else
|
||||||
|
show();
|
||||||
|
#endif
|
||||||
|
}
|
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
|
||||||
|
QtQuick2ApplicationViewer is a convenience class containing mobile device specific
|
||||||
|
code such as screen orientation handling. Also QML paths and debugging are
|
||||||
|
handled here.
|
||||||
|
It is recommended not to modify this file, since newer versions of Qt Creator
|
||||||
|
may offer an updated version of it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef QTQUICK2APPLICATIONVIEWER_H
|
||||||
|
#define QTQUICK2APPLICATIONVIEWER_H
|
||||||
|
|
||||||
|
#include <QtQuick/QQuickView>
|
||||||
|
|
||||||
|
class QtQuick2ApplicationViewer : public QQuickView
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit QtQuick2ApplicationViewer(QWindow *parent = 0);
|
||||||
|
virtual ~QtQuick2ApplicationViewer();
|
||||||
|
|
||||||
|
void setMainQmlFile(const QString &file);
|
||||||
|
void addImportPath(const QString &path);
|
||||||
|
|
||||||
|
void showExpanded();
|
||||||
|
|
||||||
|
private:
|
||||||
|
class QtQuick2ApplicationViewerPrivate *d;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // QTQUICK2APPLICATIONVIEWER_H
|
@@ -0,0 +1,11 @@
|
|||||||
|
# This file was generated by the Qt Quick 2 Application wizard of Qt Creator.
|
||||||
|
# The code below adds the QtQuick2ApplicationViewer to the project and handles
|
||||||
|
# the activation of QML debugging.
|
||||||
|
# It is recommended not to modify this file, since newer versions of Qt Creator
|
||||||
|
# may offer an updated version of it.
|
||||||
|
|
||||||
|
QT += qml quick
|
||||||
|
|
||||||
|
SOURCES += $$PWD/qtquick2applicationviewer.cpp
|
||||||
|
HEADERS += $$PWD/qtquick2applicationviewer.h
|
||||||
|
INCLUDEPATH += $$PWD
|
@@ -1,26 +1,18 @@
|
|||||||
#include <QWindow>
|
#include <QGuiApplication>
|
||||||
#include <QtDeclarative>
|
|
||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
|
#include <QQmlEngine>
|
||||||
|
|
||||||
int main( int argc, char** argv )
|
int main( int argc, char** argv )
|
||||||
{
|
{
|
||||||
QGuiApplication app( argc, argv );
|
QGuiApplication app( argc, argv );
|
||||||
|
|
||||||
QWindow *window = 0;
|
QQuickView view;
|
||||||
int exitCode = 0;
|
view.setResizeMode( QQuickView::SizeRootObjectToView );
|
||||||
|
view.setSource( QUrl( "app/native/qml/main.qml" ) );
|
||||||
|
|
||||||
QQuickView* view = new QQuickView();
|
QObject::connect( view.engine(), SIGNAL( quit() ),
|
||||||
view->setResizeMode( QQuickView::SizeRootObjectToView );
|
QCoreApplication::instance(), SLOT( quit() ) );
|
||||||
view->setSource( QUrl( "app/native/qml/main.qml" ) );
|
view.show();
|
||||||
|
|
||||||
QDeclarativeEngine* engine = view->engine();
|
return app.exec();
|
||||||
QObject::connect( engine, SIGNAL(quit()),
|
|
||||||
QCoreApplication::instance(), SLOT(quit()) );
|
|
||||||
window = view;
|
|
||||||
window->showMaximized();
|
|
||||||
|
|
||||||
exitCode = app.exec();
|
|
||||||
|
|
||||||
delete window;
|
|
||||||
return exitCode;
|
|
||||||
}
|
}
|
||||||
|
@@ -418,9 +418,10 @@ void AutotoolsProject::updateCppCodeModel()
|
|||||||
QByteArray macros;
|
QByteArray macros;
|
||||||
|
|
||||||
if (activeTarget()) {
|
if (activeTarget()) {
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
ProjectExplorer::Kit *k = activeTarget()->kit();
|
||||||
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
||||||
if (tc) {
|
if (tc) {
|
||||||
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths();
|
const QList<HeaderPath> allHeaderPaths = tc->systemHeaderPaths(SysRootKitInformation::sysRoot(k));
|
||||||
foreach (const HeaderPath &headerPath, allHeaderPaths) {
|
foreach (const HeaderPath &headerPath, allHeaderPaths) {
|
||||||
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
|
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
|
||||||
allFrameworkPaths.append(headerPath.path());
|
allFrameworkPaths.append(headerPath.path());
|
||||||
|
@@ -425,7 +425,7 @@ void CMakeRunPage::initializePage()
|
|||||||
} else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
|
} else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) {
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
|
if (cachedGenerator.isEmpty() || cachedGenerator == "MinGW Makefiles")
|
||||||
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(p->displayName()), kitVariant);
|
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(k->displayName()), kitVariant);
|
||||||
#else
|
#else
|
||||||
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
|
if (cachedGenerator.isEmpty() || cachedGenerator == "Unix Makefiles")
|
||||||
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
|
m_generatorComboBox->addItem(tr("Unix Generator (%1)").arg(k->displayName()), kitVariant);
|
||||||
|
@@ -286,7 +286,8 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
|
|
||||||
createUiCodeModelSupport();
|
createUiCodeModelSupport();
|
||||||
|
|
||||||
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
Kit *k = activeTarget()->kit();
|
||||||
|
ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
|
||||||
if (!tc) {
|
if (!tc) {
|
||||||
emit buildTargetsChanged();
|
emit buildTargetsChanged();
|
||||||
emit fileListChanged();
|
emit fileListChanged();
|
||||||
@@ -304,7 +305,7 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
|
|
||||||
QStringList allFrameworkPaths;
|
QStringList allFrameworkPaths;
|
||||||
QList<ProjectExplorer::HeaderPath> allHeaderPaths;
|
QList<ProjectExplorer::HeaderPath> allHeaderPaths;
|
||||||
allHeaderPaths = tc->systemHeaderPaths();
|
allHeaderPaths = tc->systemHeaderPaths(SysRootKitInformation::sysRoot(k));
|
||||||
foreach (const ProjectExplorer::HeaderPath &headerPath, allHeaderPaths) {
|
foreach (const ProjectExplorer::HeaderPath &headerPath, allHeaderPaths) {
|
||||||
if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath)
|
if (headerPath.kind() == ProjectExplorer::HeaderPath::FrameworkHeaderPath)
|
||||||
allFrameworkPaths.append(headerPath.path());
|
allFrameworkPaths.append(headerPath.path());
|
||||||
|
@@ -249,13 +249,13 @@ void GenericProject::refresh(RefreshOptions options)
|
|||||||
CPlusPlus::CppModelManagerInterface::ProjectPart::Ptr part(
|
CPlusPlus::CppModelManagerInterface::ProjectPart::Ptr part(
|
||||||
new CPlusPlus::CppModelManagerInterface::ProjectPart);
|
new CPlusPlus::CppModelManagerInterface::ProjectPart);
|
||||||
|
|
||||||
ToolChain *tc = activeTarget() ?
|
Kit *k = activeTarget() ? activeTarget()->kit() : KitManager::instance()->defaultKit();
|
||||||
ToolChainKitInformation::toolChain(activeTarget()->kit()) : 0;
|
ToolChain *tc = k ? ToolChainKitInformation::toolChain(k) : 0;
|
||||||
if (tc) {
|
if (tc) {
|
||||||
part->defines = tc->predefinedMacros(QStringList());
|
part->defines = tc->predefinedMacros(QStringList());
|
||||||
part->defines += '\n';
|
part->defines += '\n';
|
||||||
|
|
||||||
foreach (const HeaderPath &headerPath, tc->systemHeaderPaths()) {
|
foreach (const HeaderPath &headerPath, tc->systemHeaderPaths(SysRootKitInformation::sysRoot(k))) {
|
||||||
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
|
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
|
||||||
part->frameworkPaths.append(headerPath.path());
|
part->frameworkPaths.append(headerPath.path());
|
||||||
else
|
else
|
||||||
|
@@ -98,11 +98,19 @@ QByteArray AbstractMsvcToolChain::predefinedMacros(const QStringList &cxxflags)
|
|||||||
ToolChain::CompilerFlags AbstractMsvcToolChain::compilerFlags(const QStringList &cxxflags) const
|
ToolChain::CompilerFlags AbstractMsvcToolChain::compilerFlags(const QStringList &cxxflags) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(cxxflags);
|
Q_UNUSED(cxxflags);
|
||||||
return NO_FLAGS;
|
|
||||||
|
switch (m_abi.osFlavor()) {
|
||||||
|
case ProjectExplorer::Abi::WindowsMsvc2010Flavor:
|
||||||
|
case ProjectExplorer::Abi::WindowsMsvc2012Flavor:
|
||||||
|
return STD_CXX11;
|
||||||
|
default:
|
||||||
|
return NO_FLAGS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<HeaderPath> AbstractMsvcToolChain::systemHeaderPaths() const
|
QList<HeaderPath> AbstractMsvcToolChain::systemHeaderPaths(const Utils::FileName &sysRoot) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(sysRoot);
|
||||||
if (m_headerPaths.isEmpty()) {
|
if (m_headerPaths.isEmpty()) {
|
||||||
Utils::Environment env(m_lastEnvironment);
|
Utils::Environment env(m_lastEnvironment);
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
|
@@ -53,7 +53,7 @@ public:
|
|||||||
|
|
||||||
QByteArray predefinedMacros(const QStringList &cxxflags) const;
|
QByteArray predefinedMacros(const QStringList &cxxflags) const;
|
||||||
CompilerFlags compilerFlags(const QStringList &cxxflags) const;
|
CompilerFlags compilerFlags(const QStringList &cxxflags) const;
|
||||||
QList<HeaderPath> systemHeaderPaths() const;
|
QList<HeaderPath> systemHeaderPaths(const Utils::FileName &sysRoot) const;
|
||||||
void addToEnvironment(Utils::Environment &env) const;
|
void addToEnvironment(Utils::Environment &env) const;
|
||||||
|
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
|
@@ -149,12 +149,12 @@ static QByteArray gccPredefinedMacros(const FileName &gcc, const QStringList &ar
|
|||||||
return predefinedMacros;
|
return predefinedMacros;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<HeaderPath> GccToolChain::gccHeaderPaths(const FileName &gcc, const QStringList &env, const QString &sysrootPath)
|
QList<HeaderPath> GccToolChain::gccHeaderPaths(const FileName &gcc, const QStringList &env, const FileName &sysrootPath)
|
||||||
{
|
{
|
||||||
QList<HeaderPath> systemHeaderPaths;
|
QList<HeaderPath> systemHeaderPaths;
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
if (!sysrootPath.isEmpty())
|
if (!sysrootPath.isEmpty())
|
||||||
arguments.append(QString::fromLatin1("--sysroot=%1").arg(sysrootPath));
|
arguments.append(QString::fromLatin1("--sysroot=%1").arg(sysrootPath.toString()));
|
||||||
arguments << QLatin1String("-xc++")
|
arguments << QLatin1String("-xc++")
|
||||||
<< QLatin1String("-E")
|
<< QLatin1String("-E")
|
||||||
<< QLatin1String("-v")
|
<< QLatin1String("-v")
|
||||||
@@ -388,18 +388,19 @@ QByteArray GccToolChain::predefinedMacros(const QStringList &cxxflags) const
|
|||||||
|
|
||||||
ToolChain::CompilerFlags GccToolChain::compilerFlags(const QStringList &cxxflags) const
|
ToolChain::CompilerFlags GccToolChain::compilerFlags(const QStringList &cxxflags) const
|
||||||
{
|
{
|
||||||
if (cxxflags.contains("-std=c++0x") || cxxflags.contains("-std=gnu++0x"))
|
if (cxxflags.contains("-std=c++0x") || cxxflags.contains("-std=gnu++0x") ||
|
||||||
|
cxxflags.contains("-std=c++11") || cxxflags.contains("-std=gnu++11"))
|
||||||
return STD_CXX11;
|
return STD_CXX11;
|
||||||
return NO_FLAGS;
|
return NO_FLAGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<HeaderPath> GccToolChain::systemHeaderPaths() const
|
QList<HeaderPath> GccToolChain::systemHeaderPaths(const Utils::FileName &sysRoot) const
|
||||||
{
|
{
|
||||||
if (m_headerPaths.isEmpty()) {
|
if (m_headerPaths.isEmpty()) {
|
||||||
// Using a clean environment breaks ccache/distcc/etc.
|
// Using a clean environment breaks ccache/distcc/etc.
|
||||||
Environment env = Environment::systemEnvironment();
|
Environment env = Environment::systemEnvironment();
|
||||||
addToEnvironment(env);
|
addToEnvironment(env);
|
||||||
m_headerPaths = gccHeaderPaths(m_compilerCommand, env.toStringList());
|
m_headerPaths = gccHeaderPaths(m_compilerCommand, env.toStringList(), sysRoot);
|
||||||
}
|
}
|
||||||
return m_headerPaths;
|
return m_headerPaths;
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,7 @@ public:
|
|||||||
QByteArray predefinedMacros(const QStringList &cxxflags) const;
|
QByteArray predefinedMacros(const QStringList &cxxflags) const;
|
||||||
CompilerFlags compilerFlags(const QStringList &cxxflags) const;
|
CompilerFlags compilerFlags(const QStringList &cxxflags) const;
|
||||||
|
|
||||||
QList<HeaderPath> systemHeaderPaths() const;
|
QList<HeaderPath> systemHeaderPaths(const Utils::FileName &sysRoot) const;
|
||||||
void addToEnvironment(Utils::Environment &env) const;
|
void addToEnvironment(Utils::Environment &env) const;
|
||||||
QString makeCommand() const;
|
QString makeCommand() const;
|
||||||
QList<Utils::FileName> suggestedMkspecList() const;
|
QList<Utils::FileName> suggestedMkspecList() const;
|
||||||
@@ -91,7 +91,7 @@ protected:
|
|||||||
virtual QList<Abi> detectSupportedAbis() const;
|
virtual QList<Abi> detectSupportedAbis() const;
|
||||||
virtual QString detectVersion() const;
|
virtual QString detectVersion() const;
|
||||||
|
|
||||||
static QList<HeaderPath> gccHeaderPaths(const Utils::FileName &gcc, const QStringList &env, const QString &sysrootPath = QString());
|
static QList<HeaderPath> gccHeaderPaths(const Utils::FileName &gcc, const QStringList &env, const Utils::FileName &sysrootPath);
|
||||||
|
|
||||||
mutable QByteArray m_predefinedMacros;
|
mutable QByteArray m_predefinedMacros;
|
||||||
|
|
||||||
|
@@ -124,7 +124,7 @@ QString ToolChain::id() const
|
|||||||
return d->m_id;
|
return d->m_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FileName ToolChain::suggestedDebugger()
|
Utils::FileName ToolChain::suggestedDebugger() const
|
||||||
{
|
{
|
||||||
return ToolChainManager::instance()->defaultDebugger(targetAbi());
|
return ToolChainManager::instance()->defaultDebugger(targetAbi());
|
||||||
}
|
}
|
||||||
|
@@ -73,7 +73,7 @@ public:
|
|||||||
QString id() const;
|
QString id() const;
|
||||||
|
|
||||||
virtual QList<Utils::FileName> suggestedMkspecList() const { return QList<Utils::FileName>(); }
|
virtual QList<Utils::FileName> suggestedMkspecList() const { return QList<Utils::FileName>(); }
|
||||||
virtual Utils::FileName suggestedDebugger();
|
virtual Utils::FileName suggestedDebugger() const;
|
||||||
|
|
||||||
virtual QString type() const = 0;
|
virtual QString type() const = 0;
|
||||||
virtual QString typeDisplayName() const = 0;
|
virtual QString typeDisplayName() const = 0;
|
||||||
@@ -88,7 +88,7 @@ public:
|
|||||||
STD_CXX11 = 1
|
STD_CXX11 = 1
|
||||||
};
|
};
|
||||||
virtual CompilerFlags compilerFlags(const QStringList &cxxflags) const = 0;
|
virtual CompilerFlags compilerFlags(const QStringList &cxxflags) const = 0;
|
||||||
virtual QList<HeaderPath> systemHeaderPaths() const = 0;
|
virtual QList<HeaderPath> systemHeaderPaths(const Utils::FileName &sysRoot) const = 0;
|
||||||
virtual void addToEnvironment(Utils::Environment &env) const = 0;
|
virtual void addToEnvironment(Utils::Environment &env) const = 0;
|
||||||
virtual QString makeCommand() const = 0;
|
virtual QString makeCommand() const = 0;
|
||||||
|
|
||||||
|
@@ -527,7 +527,7 @@ void Qt4Project::updateCppCodeModel()
|
|||||||
|
|
||||||
QList<HeaderPath> headers;
|
QList<HeaderPath> headers;
|
||||||
if (tc)
|
if (tc)
|
||||||
headers = tc->systemHeaderPaths(); // todo pass cxxflags?
|
headers = tc->systemHeaderPaths(SysRootKitInformation::sysRoot(k)); // todo pass cxxflags?
|
||||||
if (qtVersion) {
|
if (qtVersion) {
|
||||||
headers.append(qtVersion->systemHeaderPathes(k));
|
headers.append(qtVersion->systemHeaderPathes(k));
|
||||||
}
|
}
|
||||||
|
@@ -265,7 +265,9 @@ ProjectExplorer::Project *Qt4Manager::openProject(const QString &fileName, QStri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QtQuickApp qtQuickApp;
|
QtQuickApp qtQuickApp;
|
||||||
|
updateBoilerPlateCodeFiles(&qtQuickApp, canonicalFilePath);
|
||||||
|
qtQuickApp.setComponentSet(QtQuickApp::QtQuick20Components);
|
||||||
updateBoilerPlateCodeFiles(&qtQuickApp, canonicalFilePath);
|
updateBoilerPlateCodeFiles(&qtQuickApp, canonicalFilePath);
|
||||||
const Html5App html5App;
|
const Html5App html5App;
|
||||||
updateBoilerPlateCodeFiles(&html5App, canonicalFilePath);
|
updateBoilerPlateCodeFiles(&html5App, canonicalFilePath);
|
||||||
|
@@ -43,12 +43,6 @@
|
|||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
const QString appViewerBaseName(QLatin1String("qmlapplicationviewer"));
|
|
||||||
const QString appViewerPriFileName(appViewerBaseName + QLatin1String(".pri"));
|
|
||||||
const QString appViewerCppFileName(appViewerBaseName + QLatin1String(".cpp"));
|
|
||||||
const QString appViewerHFileName(appViewerBaseName + QLatin1String(".h"));
|
|
||||||
const QString appViewerOriginsSubDir(appViewerBaseName + QLatin1Char('/'));
|
|
||||||
|
|
||||||
QtQuickApp::QtQuickApp()
|
QtQuickApp::QtQuickApp()
|
||||||
: AbstractMobileApp()
|
: AbstractMobileApp()
|
||||||
, m_mainQmlMode(ModeGenerate)
|
, m_mainQmlMode(ModeGenerate)
|
||||||
@@ -85,7 +79,7 @@ QString QtQuickApp::pathExtended(int fileType) const
|
|||||||
const QString qmlSubDir = QLatin1String("qml/")
|
const QString qmlSubDir = QLatin1String("qml/")
|
||||||
+ (importQmlFile ? m_mainQmlFile.dir().dirName() : projectName())
|
+ (importQmlFile ? m_mainQmlFile.dir().dirName() : projectName())
|
||||||
+ QLatin1Char('/');
|
+ QLatin1Char('/');
|
||||||
const QString appViewerTargetSubDir = appViewerOriginsSubDir;
|
const QString appViewerTargetSubDir = appViewerOriginSubDir();
|
||||||
|
|
||||||
const QString mainQmlFile = QLatin1String("main.qml");
|
const QString mainQmlFile = QLatin1String("main.qml");
|
||||||
const QString mainPageQmlFile = QLatin1String("MainPage.qml");
|
const QString mainPageQmlFile = QLatin1String("MainPage.qml");
|
||||||
@@ -104,12 +98,12 @@ QString QtQuickApp::pathExtended(int fileType) const
|
|||||||
case MainQmlOrigin: return qmlOriginDir + mainQmlFile;
|
case MainQmlOrigin: return qmlOriginDir + mainQmlFile;
|
||||||
case MainPageQml: return pathBase + qmlSubDir + mainPageQmlFile;
|
case MainPageQml: return pathBase + qmlSubDir + mainPageQmlFile;
|
||||||
case MainPageQmlOrigin: return qmlOriginDir + mainPageQmlFile;
|
case MainPageQmlOrigin: return qmlOriginDir + mainPageQmlFile;
|
||||||
case AppViewerPri: return pathBase + appViewerTargetSubDir + appViewerPriFileName;
|
case AppViewerPri: return pathBase + appViewerTargetSubDir + fileName(AppViewerPri);
|
||||||
case AppViewerPriOrigin: return originsRoot() + appViewerOriginsSubDir + appViewerPriFileName;
|
case AppViewerPriOrigin: return originsRoot() + appViewerOriginSubDir() + fileName(AppViewerPri);
|
||||||
case AppViewerCpp: return pathBase + appViewerTargetSubDir + appViewerCppFileName;
|
case AppViewerCpp: return pathBase + appViewerTargetSubDir + fileName(AppViewerCpp);
|
||||||
case AppViewerCppOrigin: return originsRoot() + appViewerOriginsSubDir + appViewerCppFileName;
|
case AppViewerCppOrigin: return originsRoot() + appViewerOriginSubDir() + fileName(AppViewerCpp);
|
||||||
case AppViewerH: return pathBase + appViewerTargetSubDir + appViewerHFileName;
|
case AppViewerH: return pathBase + appViewerTargetSubDir + fileName(AppViewerH);
|
||||||
case AppViewerHOrigin: return originsRoot() + appViewerOriginsSubDir + appViewerHFileName;
|
case AppViewerHOrigin: return originsRoot() + appViewerOriginSubDir() + fileName(AppViewerH);
|
||||||
case QmlDir: return pathBase + qmlSubDir;
|
case QmlDir: return pathBase + qmlSubDir;
|
||||||
case QmlDirProFileRelative: return importQmlFile ? appProFilePath.relativeFilePath(m_mainQmlFile.canonicalPath())
|
case QmlDirProFileRelative: return importQmlFile ? appProFilePath.relativeFilePath(m_mainQmlFile.canonicalPath())
|
||||||
: QString(qmlSubDir).remove(qmlSubDir.length() - 1, 1);
|
: QString(qmlSubDir).remove(qmlSubDir.length() - 1, 1);
|
||||||
@@ -120,7 +114,8 @@ QString QtQuickApp::pathExtended(int fileType) const
|
|||||||
|
|
||||||
QString QtQuickApp::originsRoot() const
|
QString QtQuickApp::originsRoot() const
|
||||||
{
|
{
|
||||||
return templatesRoot() + QLatin1String("qtquickapp/");
|
const bool isQtQuick2 = m_componentSet == QtQuick20Components;
|
||||||
|
return templatesRoot() + QLatin1String(isQtQuick2 ? "qtquick2app/" : "qtquickapp/");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QtQuickApp::mainWindowClassName() const
|
QString QtQuickApp::mainWindowClassName() const
|
||||||
@@ -180,6 +175,27 @@ bool QtQuickApp::useExistingMainQml() const
|
|||||||
return !m_mainQmlFile.filePath().isEmpty();
|
return !m_mainQmlFile.filePath().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QtQuickApp::appViewerBaseName() const
|
||||||
|
{
|
||||||
|
return QLatin1String(m_componentSet == QtQuick20Components ?
|
||||||
|
"qtquick2applicationviewer" : "qmlapplicationviewer");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtQuickApp::fileName(QtQuickApp::ExtendedFileType type) const
|
||||||
|
{
|
||||||
|
switch (type) {
|
||||||
|
case AppViewerPri: return appViewerBaseName() + QLatin1String(".pri");
|
||||||
|
case AppViewerH: return appViewerBaseName() + QLatin1String(".h");
|
||||||
|
case AppViewerCpp: return appViewerBaseName() + QLatin1String(".cpp");
|
||||||
|
default: return QString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QtQuickApp::appViewerOriginSubDir() const
|
||||||
|
{
|
||||||
|
return appViewerBaseName() + QLatin1Char('/');
|
||||||
|
}
|
||||||
|
|
||||||
QByteArray QtQuickApp::generateFileExtended(int fileType,
|
QByteArray QtQuickApp::generateFileExtended(int fileType,
|
||||||
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const
|
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const
|
||||||
{
|
{
|
||||||
@@ -212,7 +228,7 @@ QByteArray QtQuickApp::generateFileExtended(int fileType,
|
|||||||
|
|
||||||
int QtQuickApp::stubVersionMinor() const
|
int QtQuickApp::stubVersionMinor() const
|
||||||
{
|
{
|
||||||
return StubVersion;
|
return m_componentSet == QtQuick20Components ? 1 : 22;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<AbstractGeneratedFileInfo> QtQuickApp::updateableFiles(const QString &mainProFile) const
|
QList<AbstractGeneratedFileInfo> QtQuickApp::updateableFiles(const QString &mainProFile) const
|
||||||
@@ -222,21 +238,21 @@ QList<AbstractGeneratedFileInfo> QtQuickApp::updateableFiles(const QString &main
|
|||||||
int fileType;
|
int fileType;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
} files[] = {
|
} files[] = {
|
||||||
{QtQuickAppGeneratedFileInfo::AppViewerPriFile, appViewerPriFileName},
|
{QtQuickAppGeneratedFileInfo::AppViewerPriFile, fileName(AppViewerPri)},
|
||||||
{QtQuickAppGeneratedFileInfo::AppViewerHFile, appViewerHFileName},
|
{QtQuickAppGeneratedFileInfo::AppViewerHFile, fileName(AppViewerH)},
|
||||||
{QtQuickAppGeneratedFileInfo::AppViewerCppFile, appViewerCppFileName}
|
{QtQuickAppGeneratedFileInfo::AppViewerCppFile, fileName(AppViewerCpp)}
|
||||||
};
|
};
|
||||||
const QFileInfo mainProFileInfo(mainProFile);
|
const QFileInfo mainProFileInfo(mainProFile);
|
||||||
const int size = sizeof(files) / sizeof(files[0]);
|
const int size = sizeof(files) / sizeof(files[0]);
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
const QString fileName = mainProFileInfo.dir().absolutePath()
|
const QString fileName = mainProFileInfo.dir().absolutePath()
|
||||||
+ QLatin1Char('/') + appViewerOriginsSubDir + files[i].fileName;
|
+ QLatin1Char('/') + appViewerOriginSubDir() + files[i].fileName;
|
||||||
if (!QFile::exists(fileName))
|
if (!QFile::exists(fileName))
|
||||||
continue;
|
continue;
|
||||||
QtQuickAppGeneratedFileInfo file;
|
QtQuickAppGeneratedFileInfo file;
|
||||||
file.fileType = files[i].fileType;
|
file.fileType = files[i].fileType;
|
||||||
file.fileInfo = QFileInfo(fileName);
|
file.fileInfo = QFileInfo(fileName);
|
||||||
file.currentVersion = AbstractMobileApp::makeStubVersion(QtQuickApp::StubVersion);
|
file.currentVersion = AbstractMobileApp::makeStubVersion(stubVersionMinor());
|
||||||
result.append(file);
|
result.append(file);
|
||||||
}
|
}
|
||||||
if (result.count() != size)
|
if (result.count() != size)
|
||||||
@@ -256,13 +272,13 @@ QString QtQuickApp::componentSetDir(ComponentSet componentSet) const
|
|||||||
switch (componentSet) {
|
switch (componentSet) {
|
||||||
case Meego10Components:
|
case Meego10Components:
|
||||||
return QLatin1String("meego10");
|
return QLatin1String("meego10");
|
||||||
|
case QtQuick20Components:
|
||||||
|
return QLatin1String("qtquick20");
|
||||||
case QtQuick10Components:
|
case QtQuick10Components:
|
||||||
default:
|
default:
|
||||||
return QLatin1String("qtquick10");
|
return QLatin1String("qtquick10");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QtQuickApp::StubVersion = 22;
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
@@ -78,7 +78,8 @@ public:
|
|||||||
|
|
||||||
enum ComponentSet {
|
enum ComponentSet {
|
||||||
QtQuick10Components,
|
QtQuick10Components,
|
||||||
Meego10Components
|
Meego10Components,
|
||||||
|
QtQuick20Components
|
||||||
};
|
};
|
||||||
|
|
||||||
QtQuickApp();
|
QtQuickApp();
|
||||||
@@ -98,6 +99,11 @@ public:
|
|||||||
|
|
||||||
static const int StubVersion;
|
static const int StubVersion;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual QString appViewerBaseName() const;
|
||||||
|
QString fileName(ExtendedFileType type) const;
|
||||||
|
QString appViewerOriginSubDir() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual QByteArray generateFileExtended(int fileType,
|
virtual QByteArray generateFileExtended(int fileType,
|
||||||
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const;
|
bool *versionAndCheckSum, QString *comment, QString *errorMessage) const;
|
||||||
|
@@ -72,7 +72,7 @@ QtQuickAppWizardDialog::QtQuickAppWizardDialog(QWidget *parent,
|
|||||||
QtQuickAppWizard::Kind kind)
|
QtQuickAppWizard::Kind kind)
|
||||||
: AbstractMobileAppWizardDialog(parent,
|
: AbstractMobileAppWizardDialog(parent,
|
||||||
QtSupport::QtVersionNumber(4, 7, 0),
|
QtSupport::QtVersionNumber(4, 7, 0),
|
||||||
QtSupport::QtVersionNumber(4, INT_MAX, INT_MAX), parameters)
|
QtSupport::QtVersionNumber(5, INT_MAX, INT_MAX), parameters)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("New Qt Quick Application"));
|
setWindowTitle(tr("New Qt Quick Application"));
|
||||||
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
setIntroDescription(tr("This wizard generates a Qt Quick application project."));
|
||||||
@@ -143,13 +143,23 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
|||||||
basicFeatures = Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1);
|
basicFeatures = Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_1);
|
||||||
|
|
||||||
parameter = base;
|
parameter = base;
|
||||||
parameter.setDisplayName(tr("Qt Quick Application (Built-in Elements)"));
|
parameter.setDisplayName(tr("Qt Quick 1 Application (Built-in Elements)"));
|
||||||
parameter.setDescription(basicDescription + tr("The built-in elements in the QtQuick namespace allow "
|
parameter.setDescription(basicDescription + tr("The built-in elements in the QtQuick 1 namespace allow "
|
||||||
"you to write cross-platform applications with "
|
"you to write cross-platform applications with "
|
||||||
"a custom look and feel.\n\nRequires <b>Qt 4.7.0</b> or newer."));
|
"a custom look and feel.\n\nRequires <b>Qt 4.7.0</b> or newer."));
|
||||||
parameter.setRequiredFeatures(basicFeatures);
|
parameter.setRequiredFeatures(basicFeatures);
|
||||||
list << parameter;
|
list << parameter;
|
||||||
|
|
||||||
|
parameter = base;
|
||||||
|
parameter.setDisplayName(tr("Qt Quick 2 Application (Built-in Elements)"));
|
||||||
|
parameter.setDescription(tr("Creates a Qt Quick application project that can contain "
|
||||||
|
"both QML and C++ code and includes a QQuickView.\n\n"
|
||||||
|
"The built-in elements in the QtQuick 2 namespace allow "
|
||||||
|
"you to write cross-platform applications with "
|
||||||
|
"a custom look and feel.\n\nRequires <b>Qt 5.0</b> or newer."));
|
||||||
|
parameter.setRequiredFeatures(Core::Feature(QtSupport::Constants::FEATURE_QT_QUICK_2));
|
||||||
|
list << parameter;
|
||||||
|
|
||||||
parameter = base;
|
parameter = base;
|
||||||
parameter.setDisplayName(tr("Qt Quick Application for MeeGo Harmattan"));
|
parameter.setDisplayName(tr("Qt Quick Application for MeeGo Harmattan"));
|
||||||
parameter.setDescription(basicDescription + tr("The Qt Quick Components for MeeGo Harmattan are "
|
parameter.setDescription(basicDescription + tr("The Qt Quick Components for MeeGo Harmattan are "
|
||||||
@@ -173,7 +183,7 @@ void QtQuickAppWizard::createInstances(ExtensionSystem::IPlugin *plugin)
|
|||||||
|
|
||||||
QList<QtQuickAppWizard*> wizardList = Core::createMultipleBaseFileWizardInstances<QtQuickAppWizard>(list, plugin);
|
QList<QtQuickAppWizard*> wizardList = Core::createMultipleBaseFileWizardInstances<QtQuickAppWizard>(list, plugin);
|
||||||
|
|
||||||
Q_ASSERT(wizardList.count() == 3);
|
Q_ASSERT(wizardList.count() == 4);
|
||||||
|
|
||||||
for (int i = 0; i < wizardList.count(); i++) {
|
for (int i = 0; i < wizardList.count(); i++) {
|
||||||
wizardList.at(i)->setQtQuickKind(Kind(i));
|
wizardList.at(i)->setQtQuickKind(Kind(i));
|
||||||
@@ -209,6 +219,10 @@ AbstractMobileAppWizardDialog *QtQuickAppWizard::createWizardDialogInternal(QWid
|
|||||||
d->app->setComponentSet(QtQuickApp::QtQuick10Components);
|
d->app->setComponentSet(QtQuickApp::QtQuick10Components);
|
||||||
d->app->setMainQml(QtQuickApp::ModeImport);
|
d->app->setMainQml(QtQuickApp::ModeImport);
|
||||||
break;
|
break;
|
||||||
|
case QtQuick2_0:
|
||||||
|
d->app->setComponentSet(QtQuickApp::QtQuick20Components);
|
||||||
|
d->app->setMainQml(QtQuickApp::ModeGenerate);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning() << "QtQuickAppWizard illegal subOption:" << qtQuickKind();
|
qWarning() << "QtQuickAppWizard illegal subOption:" << qtQuickKind();
|
||||||
break;
|
break;
|
||||||
|
@@ -43,8 +43,9 @@ public:
|
|||||||
|
|
||||||
enum Kind {
|
enum Kind {
|
||||||
QtQuick1_1 = 0,
|
QtQuick1_1 = 0,
|
||||||
MeegoComponents = 1,
|
QtQuick2_0 = 1,
|
||||||
ImportQml = 2
|
MeegoComponents = 2,
|
||||||
|
ImportQml = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
QtQuickAppWizard();
|
QtQuickAppWizard();
|
||||||
|
@@ -50,6 +50,15 @@ int main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
QtQuickApp sAppNew;
|
||||||
|
sAppNew.setProjectPath(projectPath);
|
||||||
|
sAppNew.setComponentSet(QtQuickApp::ComponentSetQtQuick2_0);
|
||||||
|
sAppNew.setProjectName(QLatin1String("new_qtquick2_app"));
|
||||||
|
if (!sAppNew.generateFiles(&errorMessage))
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QtQuickApp sAppImport01;
|
QtQuickApp sAppImport01;
|
||||||
sAppImport01.setProjectPath(projectPath);
|
sAppImport01.setProjectPath(projectPath);
|
||||||
|
Reference in New Issue
Block a user