diff options
author | Eike Ziller <eike.ziller@digia.com> | 2012-11-27 11:50:56 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2012-11-27 11:50:56 +0100 |
commit | ba1d5f2cdf7d31eb862f02bd42885cdba13a7f15 (patch) | |
tree | 5c9d0551e67612724a2ca0328636b091653c1f00 /share | |
parent | c384f52b49f0eddc7a7f8e622e1485ebb1018028 (diff) | |
parent | deeef5308f1b3d59581aa1a65e781d434719a40d (diff) | |
download | qt-creator-ba1d5f2cdf7d31eb862f02bd42885cdba13a7f15.tar.gz |
Merge remote-tracking branch 'origin/2.6'
Conflicts:
share/share.qbs
src/plugins/cpptools/cppchecksymbols.cpp
src/plugins/texteditor/behaviorsettingswidget.cpp
Change-Id: Ia34060984f9c036b2f28a6411d796d41f55a3e37
Diffstat (limited to 'share')
17 files changed, 174 insertions, 6 deletions
diff --git a/share/qtcreator/templates/wizards/qml-extension/lib.png b/share/qtcreator/templates/wizards/qtquick1-extension/lib.png Binary files differindex a4e818d986..a4e818d986 100644 --- a/share/qtcreator/templates/wizards/qml-extension/lib.png +++ b/share/qtcreator/templates/wizards/qtquick1-extension/lib.png diff --git a/share/qtcreator/templates/wizards/qml-extension/object.cpp b/share/qtcreator/templates/wizards/qtquick1-extension/object.cpp index b78c708016..b78c708016 100644 --- a/share/qtcreator/templates/wizards/qml-extension/object.cpp +++ b/share/qtcreator/templates/wizards/qtquick1-extension/object.cpp diff --git a/share/qtcreator/templates/wizards/qml-extension/object.h b/share/qtcreator/templates/wizards/qtquick1-extension/object.h index 594491e67c..594491e67c 100644 --- a/share/qtcreator/templates/wizards/qml-extension/object.h +++ b/share/qtcreator/templates/wizards/qtquick1-extension/object.h diff --git a/share/qtcreator/templates/wizards/qtquick1-extension/plugin.cpp b/share/qtcreator/templates/wizards/qtquick1-extension/plugin.cpp new file mode 100644 index 0000000000..62a9a94de0 --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick1-extension/plugin.cpp @@ -0,0 +1,14 @@ +#include "%ProjectName:l%_plugin.%CppHeaderSuffix%" +#include "%ObjectName:l%.%CppHeaderSuffix%" + +#include <qdeclarative.h> + +void %ProjectName:s%Plugin::registerTypes(const char *uri) +{ + // @uri %Uri% + qmlRegisterType<%ObjectName%>(uri, 1, 0, "%ObjectName%"); +} + +#if QT_VERSION < 0x050000 + Q_EXPORT_PLUGIN2(%ProjectName:s%, %ProjectName:s%Plugin) +#endif diff --git a/share/qtcreator/templates/wizards/qml-extension/plugin.h b/share/qtcreator/templates/wizards/qtquick1-extension/plugin.h index 8eaa62384a..d487a8339d 100644 --- a/share/qtcreator/templates/wizards/qml-extension/plugin.h +++ b/share/qtcreator/templates/wizards/qtquick1-extension/plugin.h @@ -6,6 +6,9 @@ class %ProjectName:s%Plugin : public QDeclarativeExtensionPlugin { Q_OBJECT +#if QT_VERSION >= 0x050000 + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") +#endif public: void registerTypes(const char *uri); diff --git a/share/qtcreator/templates/wizards/qml-extension/project.pro b/share/qtcreator/templates/wizards/qtquick1-extension/project.pro index bf028c6a28..bf028c6a28 100644 --- a/share/qtcreator/templates/wizards/qml-extension/project.pro +++ b/share/qtcreator/templates/wizards/qtquick1-extension/project.pro diff --git a/share/qtcreator/templates/wizards/qml-extension/qmldir b/share/qtcreator/templates/wizards/qtquick1-extension/qmldir index ee07ff6b10..ee07ff6b10 100644 --- a/share/qtcreator/templates/wizards/qml-extension/qmldir +++ b/share/qtcreator/templates/wizards/qtquick1-extension/qmldir diff --git a/share/qtcreator/templates/wizards/qml-extension/wizard.xml b/share/qtcreator/templates/wizards/qtquick1-extension/wizard.xml index ed57064dca..d8fa31f425 100644 --- a/share/qtcreator/templates/wizards/qml-extension/wizard.xml +++ b/share/qtcreator/templates/wizards/qtquick1-extension/wizard.xml @@ -36,11 +36,11 @@ leave room for the Qt 4 target page. --> <wizard version="1" kind="project" class="qt4project" firstpage="10" - id="QmlExtensionPlugin" category="G.Libraries" + id="QtQuick1ExtensionPlugin" category="G.Libraries" featuresRequired="QtSupport.Wizards.FeatureQtQuick,QtSupport.Wizards.FeatureQtQuick.1"> <icon>lib.png</icon> <description>Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QDeclarativeEngine class.</description> - <displayname>Custom QML Extension Plugin</displayname> + <displayname>Qt Quick 1 Extension Plugin</displayname> <displaycategory>Libraries</displaycategory> <files> <file source="qmldir" target="qmldir"/> diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/lib.png b/share/qtcreator/templates/wizards/qtquick2-extension/lib.png Binary files differnew file mode 100644 index 0000000000..a4e818d986 --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/lib.png diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/object.cpp b/share/qtcreator/templates/wizards/qtquick2-extension/object.cpp new file mode 100644 index 0000000000..15fe405242 --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/object.cpp @@ -0,0 +1,15 @@ +#include "%ObjectName:l%.%CppHeaderSuffix%" + +%ObjectName%::%ObjectName%(QQuickItem *parent): + QQuickItem(parent) +{ + // By default, QQuickItem does not draw anything. If you subclass + // QQuickItem to create a visual item, you will need to uncomment the + // following line and re-implement updatePaintNode() + + // setFlag(ItemHasContents, true); +} + +%ObjectName%::~%ObjectName%() +{ +} diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/object.h b/share/qtcreator/templates/wizards/qtquick2-extension/object.h new file mode 100644 index 0000000000..8297957b49 --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/object.h @@ -0,0 +1,18 @@ +#ifndef %ObjectName:u%_H +#define %ObjectName:u%_H + +#include <QQuickItem> + +class %ObjectName% : public QQuickItem +{ + Q_OBJECT + Q_DISABLE_COPY(%ObjectName%) + +public: + %ObjectName%(QQuickItem *parent = 0); + ~%ObjectName%(); +}; + +QML_DECLARE_TYPE(%ObjectName%) + +#endif // %ObjectName:u%_H diff --git a/share/qtcreator/templates/wizards/qml-extension/plugin.cpp b/share/qtcreator/templates/wizards/qtquick2-extension/plugin.cpp index 3d92c31f19..a3715b5515 100644 --- a/share/qtcreator/templates/wizards/qml-extension/plugin.cpp +++ b/share/qtcreator/templates/wizards/qtquick2-extension/plugin.cpp @@ -1,7 +1,7 @@ #include "%ProjectName:l%_plugin.%CppHeaderSuffix%" #include "%ObjectName:l%.%CppHeaderSuffix%" -#include <qdeclarative.h> +#include <qqml.h> void %ProjectName:s%Plugin::registerTypes(const char *uri) { @@ -9,4 +9,3 @@ void %ProjectName:s%Plugin::registerTypes(const char *uri) qmlRegisterType<%ObjectName%>(uri, 1, 0, "%ObjectName%"); } -Q_EXPORT_PLUGIN2(%ProjectName:s%, %ProjectName:s%Plugin) diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h b/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h new file mode 100644 index 0000000000..3b0bc2a355 --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/plugin.h @@ -0,0 +1,15 @@ +#ifndef %ProjectName:h%_PLUGIN_H +#define %ProjectName:h%_PLUGIN_H + +#include <QQmlExtensionPlugin> + +class %ProjectName:s%Plugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri); +}; + +#endif // %ProjectName:h%_PLUGIN_H diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/project.pro b/share/qtcreator/templates/wizards/qtquick2-extension/project.pro new file mode 100644 index 0000000000..7c7794671b --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/project.pro @@ -0,0 +1,34 @@ +TEMPLATE = lib +TARGET = %ProjectName% +QT += qml quick +CONFIG += qt plugin + +TARGET = $$qtLibraryTarget($$TARGET) +uri = %Uri% + +# Input +SOURCES += \ + %ProjectName:l%_plugin.%CppSourceSuffix% \ + %ObjectName:l%.%CppSourceSuffix% + +HEADERS += \ + %ProjectName:l%_plugin.%CppHeaderSuffix% \ + %ObjectName:l%.%CppHeaderSuffix% + +OTHER_FILES = qmldir + +!equals(_PRO_FILE_PWD_, $$OUT_PWD) { + copy_qmldir.target = $$OUT_PWD/qmldir + copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir + copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\" + QMAKE_EXTRA_TARGETS += copy_qmldir + PRE_TARGETDEPS += $$copy_qmldir.target +} + +qmldir.files = qmldir +unix { + installPath = $$[QT_INSTALL_IMPORTS]/$$replace(uri, \\., /) + qmldir.path = $$installPath + target.path = $$installPath + INSTALLS += target qmldir +} diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/qmldir b/share/qtcreator/templates/wizards/qtquick2-extension/qmldir new file mode 100644 index 0000000000..f1f54802f3 --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/qmldir @@ -0,0 +1,2 @@ +module %Uri% +plugin %ProjectName% diff --git a/share/qtcreator/templates/wizards/qtquick2-extension/wizard.xml b/share/qtcreator/templates/wizards/qtquick2-extension/wizard.xml new file mode 100644 index 0000000000..c2754e95eb --- /dev/null +++ b/share/qtcreator/templates/wizards/qtquick2-extension/wizard.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +****************************************************************************/ + +Custom project wizard configuration example file. Note that by convention, +the project file goes last. +The "class" and "firstpage" attributes specify that it is a Qt 4 wizard and +leave room for the Qt 4 target page. +--> +<wizard version="1" kind="project" + class="qt4project" firstpage="10" + id="QtQuick2ExtensionPlugin" category="G.Libraries" + featuresRequired="QtSupport.Wizards.FeatureQtQuick,QtSupport.Wizards.FeatureQtQuick.2"> + <icon>lib.png</icon> + <description>Creates a C++ plugin that makes it possible to offer extensions that can be loaded dynamically into applications using the QQmlEngine class.</description> + <displayname>Qt Quick 2 Extension Plugin</displayname> + <displaycategory>Libraries</displaycategory> + <files> + <file source="qmldir" target="qmldir"/> + <file source="plugin.h" target="%ProjectName:l%_plugin.%CppHeaderSuffix%"/> + <file source="plugin.cpp" target="%ProjectName:l%_plugin.%CppSourceSuffix%"/> + <file source="object.h" target="%ObjectName:l%.%CppHeaderSuffix%"/> + <file source="object.cpp" target="%ObjectName:l%.%CppSourceSuffix%" openeditor="true"/> + <file source="project.pro" target="%ProjectName:l%.pro" openproject="true"/> + </files> + <!-- Create a 2nd wizard page with parameters --> + <fieldpagetitle>Custom QML Extension Plugin Parameters</fieldpagetitle> + <fields> + <field mandatory="true" name="ObjectName"> + <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9_]+$' defaulttext="MyItem"/> + <fielddescription>Object Class-name:</fielddescription> + </field> + <field mandatory="true" name="Uri"> + <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9]+([A-Za-z0-9-]*[A-Za-z0-9]+)?(\.[A-Za-z0-9]+([-A-Za-z0-9]*[A-Za-z0-9]+)?)*$' defaulttext="com.mycompany.qmlcomponents"/> + <fielddescription>URI:</fielddescription> + </field> + </fields> + <validationrules> + <validationrule condition='"%ObjectName%" != "%ProjectName%_plugin"'> + <message>The project name and the object class-name cannot be the same.</message> + </validationrule> + </validationrules> +</wizard> diff --git a/share/share.qbs b/share/share.qbs index f2fa15eaa4..fcfc8e5b66 100644 --- a/share/share.qbs +++ b/share/share.qbs @@ -19,8 +19,6 @@ Product { } Group { - condition: qbs.targetOS == "macx" - qbs.installDir: "share/qtcreator/scripts" fileTags: ["install"] files: "qtcreator/scripts/openTerminal.command" } |