Skip to main content
summaryrefslogtreecommitdiffstats
path: root/qt
diff options
context:
space:
mode:
authorDoug Schaefer2014-01-16 16:06:53 -0500
committerDoug Schaefer2014-01-17 10:06:53 -0500
commit801c10d789a5d4e5460a16084506e960200b6c08 (patch)
tree61ad15d74af438584f99def53013b1e492a542c5 /qt
parent81ebdf8e82df76dc10bdf11315796f5dc875dea9 (diff)
downloadorg.eclipse.cdt-801c10d789a5d4e5460a16084506e960200b6c08.tar.gz
org.eclipse.cdt-801c10d789a5d4e5460a16084506e960200b6c08.tar.xz
org.eclipse.cdt-801c10d789a5d4e5460a16084506e960200b6c08.zip
Bug 425938 - Make Qt5 template work with 5.2. Remove Qt4 template.
Change-Id: I422a907e9db51be26acd0857d3e9e409bbd3ba2e Reviewed-on: https://git.eclipse.org/r/20728 Tested-by: Hudson CI Reviewed-by: Doug Schaefer <dschaefer@qnx.com> IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Diffstat (limited to 'qt')
-rw-r--r--qt/org.eclipse.cdt.qt.core/plugin.xml17
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.cpp17
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.hh22
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/Makefile29
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.cpp22
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.pro7
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.qml38
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.properties14
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.xml103
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.cpp2
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.h (renamed from qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.hh)0
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt5/Makefile29
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.cpp4
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.pro5
-rw-r--r--qt/org.eclipse.cdt.qt.core/templates/project/Qt5/template.xml25
15 files changed, 27 insertions, 307 deletions
diff --git a/qt/org.eclipse.cdt.qt.core/plugin.xml b/qt/org.eclipse.cdt.qt.core/plugin.xml
index 7d16712a7d..74ecc70a82 100644
--- a/qt/org.eclipse.cdt.qt.core/plugin.xml
+++ b/qt/org.eclipse.cdt.qt.core/plugin.xml
@@ -7,32 +7,15 @@
point="org.eclipse.cdt.core.templates">
<template
filterPattern=".*g\+\+"
- id="org.eclipse.cdt.qt.core.template.helloWorld.Qt4"
- location="templates/project/Qt4/template.xml"
- projectType="org.eclipse.cdt.build.makefile.projectType"/>
- <template
- filterPattern=".*g\+\+"
id="org.eclipse.cdt.qt.core.template.helloWorld.Qt5"
location="templates/project/Qt5/template.xml"
projectType="org.eclipse.cdt.build.makefile.projectType"/>
</extension>
-
<extension
point="org.eclipse.cdt.core.templateAssociations">
- <template id="org.eclipse.cdt.qt.core.template.helloWorld.Qt4">
- <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.solaris.base"/>
- <toolChain id="cdt.managedbuild.toolchain.llvm.clang.macosx.base"/>
- </template>
<template id="org.eclipse.cdt.qt.core.template.helloWorld.Qt5">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.base"/>
<toolChain id="cdt.managedbuild.toolchain.gnu.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.macosx.base"/>
- <toolChain id="cdt.managedbuild.toolchain.gnu.solaris.base"/>
<toolChain id="cdt.managedbuild.toolchain.llvm.clang.macosx.base"/>
</template>
</extension>
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.cpp b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.cpp
deleted file mode 100644
index eb5c18318c..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#include "DateTime.hh"
-#include <QDateTime>
-
-DateTime::DateTime()
-{
- startTimer( 500 );
-}
-
-DateTime::~DateTime()
-{
-}
-
-void DateTime::timerEvent( QTimerEvent * )
-{
- emit changed( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );
-}
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.hh b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.hh
deleted file mode 100644
index c3959b4117..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/DateTime.hh
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#ifndef DATETIME_H
-#define DATETIME_H
-
-#include <QObject>
-
-class DateTime : public QObject
-{
-Q_OBJECT
-
-public:
- DateTime();
- virtual ~DateTime();
-
-protected:
- virtual void timerEvent( QTimerEvent * );
-
-private:
- Q_SIGNAL void changed( QString now );
-};
-
-#endif
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/Makefile b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/Makefile
deleted file mode 100644
index 348cb3b7be..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-
-PRO = {{baseName}}.pro
-QMAKE = {{qmake.Qt4}}
-
-all: debug release
-
-clean: clean-debug clean-release
-
-build-debug/Makefile: $(PRO)
- @mkdir -p $(dir $@)
- $(QMAKE) -o $@ $(PRO) CONFIG+=debug
-
-debug: build-debug/Makefile
- $(MAKE) -wC build-debug all
-
-clean-debug:
- rm -fr build-debug
-
-build-release/Makefile: $(PRO)
- @mkdir -p $(dir $@)
- $(QMAKE) -o $@ $(PRO) CONFIG+=release
-
-release: build-release/Makefile
- $(MAKE) -wC build-release
-
-clean-release:
- rm -fr build-release
-
-.PHONY: all clean debug clean-debug release clean-release
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.cpp b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.cpp
deleted file mode 100644
index 90d1fff3a0..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-
-#include "DateTime.hh"
-#include <QtDeclarative/QDeclarativeContext>
-#include <QtDeclarative/QDeclarativeEngine>
-#include <QtDeclarative/QDeclarativeView>
-#include <QtGui/QApplication>
-
-int main( int argc, char * argv[] )
-{
- QApplication app( argc, argv );
-
- DateTime datetime;
-
- QDeclarativeView view;
- view.rootContext()->setContextProperty( "datetimeModel", &datetime );
- view.setSource( QUrl::fromLocalFile( "$(baseName).qml" ) );
-
- app.connect( view.engine(), SIGNAL( quit() ), SLOT( quit() ) );
-
- view.show();
- return app.exec();
-}
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.pro b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.pro
deleted file mode 100644
index e580229734..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-
-QT += declarative
-HEADERS = DateTime.hh
-SOURCES = DateTime.cpp {{baseName}}.cpp
-RESOURCES =
-
-sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.qml b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.qml
deleted file mode 100644
index 90192eab1f..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/baseName.qml
+++ /dev/null
@@ -1,38 +0,0 @@
-import QtQuick 1.0
-
-Rectangle {
- width: 480
- height: 320
- color: "lightgreen"
-
- MouseArea {
- anchors.fill: parent
- onClicked: Qt.quit()
- }
-
- Text {
- id: title
- text: "Hello World from Qt4"
- font.family: "Helvetica"
- font.pointSize: 24
- anchors.centerIn: parent
- }
-
- Text {
- id: datetime
- objectName: "datetime"
- font.family: "Helvetica"
- font.pointSize: 16
- anchors {
- horizontalCenter: title.horizontalCenter
- top: title.bottom
- }
-
- Connections {
- target: datetimeModel
- onChanged: {
- datetime.text = now
- }
- }
- }
-}
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.properties b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.properties
deleted file mode 100644
index 833a289fee..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2013 QNX Software Systems and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html"
-###############################################################################
-
-Qt4HelloWorld.label=Qt4 Hello World Project
-Qt4HelloWorld.description=A sample Qt4 declarative project
-Qt4HelloWorld.basics.label=Basic Settings
-Qt4HelloWorld.basics.description=Basic properties of a project
-Qt4HelloWorld.qmake.label=Qt4 qmake location
-Qt4HelloWorld.qmake.description=Location of the qmake executable
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.xml b/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.xml
deleted file mode 100644
index efa99afb62..0000000000
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt4/template.xml
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0"
- copyright="Copyright (c) 2013 QNX Software Systems and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html"
- id="Qt4HelloWorldProject" label="%Qt4HelloWorld.label" description="%Qt4HelloWorld.description" help="help.html">
-
- <property-group id="basics" label="%Qt4HelloWorld.basics.label" description="%Qt4HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
- <property id="qmake.Qt4"
- label="%Qt4HelloWorld.qmake.label"
- description="%Qt4HelloWorld.qmake.description"
- type="browse"
- pattern=".*"
- default="qmake"
- hidden="false"
- persist="true"/>
- </property-group>
-
- <process type="org.eclipse.cdt.managedbuilder.core.AddLanguageSettingsProvider">
- <simple name="projectName" value="$(projectName)"/>
- <simple-array name="languageSettingsProviderIds">
- <element value="org.eclipse.cdt.qt.core.QtPathsProvider"/>
- </simple-array>
- </process>
-
- <process type="org.eclipse.cdt.core.SetEnvironmentVariable">
- <simple name="projectName" value="$(projectName)"/>
- <complex-array name="variables">
- <element>
- <simple name="name" value="QMAKE"/>
- <simple name="value" value="$(qmake.Qt4)"/>
- </element>
- </complex-array>
- </process>
-
- <process type="org.eclipse.cdt.core.AddFiles">
- <simple name="projectName" value="$(projectName)"/>
- <complex-array name="files">
- <element>
- <simple name="source" value="baseName.cpp"/>
- <simple name="target" value="$(projectName).cpp"/>
- <simple name="replaceable" value="true"/>
- </element>
- <element>
- <simple name="source" value="baseName.qml"/>
- <simple name="target" value="$(projectName).qml"/>
- <simple name="replaceable" value="true"/>
- </element>
- <element>
- <simple name="source" value="DateTime.hh"/>
- <simple name="target" value="DateTime.hh"/>
- <simple name="replaceable" value="true"/>
- </element>
- <element>
- <simple name="source" value="DateTime.cpp"/>
- <simple name="target" value="DateTime.cpp"/>
- <simple name="replaceable" value="true"/>
- </element>
- </complex-array>
- </process>
-
- <process type="org.eclipse.cdt.core.AddFiles2">
- <simple name="projectName" value="$(projectName)"/>
- <simple name="startPattern" value="{{"/>
- <simple name="endPattern" value="}}"/>
- <complex-array name="files">
- <element>
- <simple name="source" value="baseName.pro"/>
- <simple name="target" value="$(projectName).pro"/>
- <simple name="replaceable" value="true"/>
- </element>
- <element>
- <simple name="source" value="Makefile"/>
- <simple name="target" value="Makefile"/>
- <simple name="replaceable" value="true"/>
- </element>
- </complex-array>
- </process>
-
- <process type="org.eclipse.cdt.ui.OpenFiles">
- <simple name="projectName" value="$(projectName)"/>
- <complex-array name="files">
- <element>
- <simple name="target" value="$(projectName).cpp"/>
- </element>
- </complex-array>
- </process>
-
- <process type="org.eclipse.cdt.core.AddNature">
- <simple name="projectName" value="$(projectName)"/>
- <simple name="natureId" value="org.eclipse.cdt.qt.core.qtNature"/>
- </process>
-
- <process type="org.eclipse.cdt.make.core.AddMakeTarget">
- <simple name="projectName" value="$(projectName)"/>
- <simple name="targetName" value="clean-debug"/>
- </process>
-
- <process type="org.eclipse.cdt.make.core.AddMakeTarget">
- <simple name="projectName" value="$(projectName)"/>
- <simple name="targetName" value="build-debug"/>
- <simple name="makeTarget" value="debug"/>
- </process>
-
-</template>
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.cpp b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.cpp
index eb5c18318c..45e79c7c61 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.cpp
+++ b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.cpp
@@ -1,5 +1,5 @@
-#include "DateTime.hh"
+#include "DateTime.h"
#include <QDateTime>
DateTime::DateTime()
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.hh b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.h
index fca23e2c78..fca23e2c78 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.hh
+++ b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/DateTime.h
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/Makefile b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/Makefile
index a77d655957..37330a949e 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/Makefile
+++ b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/Makefile
@@ -2,28 +2,19 @@
PRO = {{baseName}}.pro
QMAKE = {{qmake.Qt5}}
-all: debug release
+all: QtMakefile
+ $(MAKE) -f QtMakefile
-clean: clean-debug clean-release
+clean:
+ rm -fr QtMakefile QtMakefile.debug QtMakefile.release debug release
-build-debug/Makefile: $(PRO)
- @mkdir -p $(dir $@)
- $(QMAKE) -o $@ $(PRO) CONFIG+=debug
+QtMakefile:
+ $(QMAKE) -o QtMakefile $(PRO) CONFIG+=debug_and_release
-debug: build-debug/Makefile
- $(MAKE) -wC build-debug all
+debug: QtMakefile
+ $(MAKE) -f QtMakefile debug
-clean-debug:
- rm -fr build-debug
-
-build-release/Makefile: $(PRO)
- @mkdir -p $(dir $@)
- $(QMAKE) -o $@ $(PRO) CONFIG+=release
-
-release: build-release/Makefile
- $(MAKE) -wC build-release
-
-clean-release:
- rm -fr build-release
+release: QtMakefile
+ $(MAKE) -f QtMakefile release
.PHONY: all clean debug clean-debug release clean-release
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.cpp b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.cpp
index 9b271b68b0..cea282c8f7 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.cpp
+++ b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.cpp
@@ -1,5 +1,5 @@
-#include "DateTime.hh"
+#include "DateTime.h"
#include <QGuiApplication>
#include <QtQuick>
@@ -11,7 +11,7 @@ int main( int argc, char * argv[] )
QQuickView view;
view.rootContext()->setContextProperty( "datetimeModel", &datetime );
- view.setSource( QStringLiteral( "$(baseName).qml" ) );
+ view.setSource( QStringLiteral( "src/$(baseName).qml" ) );
view.show();
app.connect( view.engine(), SIGNAL( quit() ), SLOT( quit() ) );
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.pro b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.pro
index 13ce5ce371..91020460b8 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.pro
+++ b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/baseName.pro
@@ -1,5 +1,4 @@
-
QT += qml quick
-HEADERS = DateTime.hh
-SOURCES = DateTime.cpp {{baseName}}.cpp
+HEADERS = src/DateTime.h
+SOURCES = src/DateTime.cpp src/{{baseName}}.cpp
RESOURCES =
diff --git a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/template.xml b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/template.xml
index 25baf4badd..3dcb0dfaa5 100644
--- a/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/template.xml
+++ b/qt/org.eclipse.cdt.qt.core/templates/project/Qt5/template.xml
@@ -21,6 +21,11 @@
</simple-array>
</process>
+ <process type="org.eclipse.cdt.core.CreateSourceFolder">
+ <simple name="projectName" value="$(projectName)"/>
+ <simple name="path" value="src"/>
+ </process>
+
<process type="org.eclipse.cdt.core.SetEnvironmentVariable">
<simple name="projectName" value="$(projectName)"/>
<complex-array name="variables">
@@ -36,22 +41,22 @@
<complex-array name="files">
<element>
<simple name="source" value="baseName.cpp"/>
- <simple name="target" value="$(projectName).cpp"/>
+ <simple name="target" value="src/$(projectName).cpp"/>
<simple name="replaceable" value="true"/>
</element>
<element>
<simple name="source" value="baseName.qml"/>
- <simple name="target" value="$(projectName).qml"/>
+ <simple name="target" value="src/$(projectName).qml"/>
<simple name="replaceable" value="true"/>
</element>
<element>
- <simple name="source" value="DateTime.hh"/>
- <simple name="target" value="DateTime.hh"/>
+ <simple name="source" value="DateTime.h"/>
+ <simple name="target" value="src/DateTime.h"/>
<simple name="replaceable" value="true"/>
</element>
<element>
<simple name="source" value="DateTime.cpp"/>
- <simple name="target" value="DateTime.cpp"/>
+ <simple name="target" value="src/DateTime.cpp"/>
<simple name="replaceable" value="true"/>
</element>
</complex-array>
@@ -79,7 +84,7 @@
<simple name="projectName" value="$(projectName)"/>
<complex-array name="files">
<element>
- <simple name="target" value="$(projectName).cpp"/>
+ <simple name="target" value="src/$(projectName).cpp"/>
</element>
</complex-array>
</process>
@@ -91,13 +96,7 @@
<process type="org.eclipse.cdt.make.core.AddMakeTarget">
<simple name="projectName" value="$(projectName)"/>
- <simple name="targetName" value="clean-debug"/>
- </process>
-
- <process type="org.eclipse.cdt.make.core.AddMakeTarget">
- <simple name="projectName" value="$(projectName)"/>
- <simple name="targetName" value="build-debug"/>
- <simple name="makeTarget" value="debug"/>
+ <simple name="targetName" value="debug"/>
</process>
</template>

Back to the top