diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2012-11-19 18:03:36 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2012-11-22 15:10:46 +0100 |
commit | 56058307f5f2a6f2323379fcef8ee0ea708d4b48 (patch) | |
tree | 64319521fca796cc9f43836771284c079e5a5ee6 /src/app/qbs-qmltypes | |
parent | 3bf0894d284ee1d05118431c60ea67191bec4657 (diff) |
Add a way to dump QML type information
Add a executable that can be used to generate a dump of the QML types
used by QBS.
This information can then be used in an IDE to help with
code completion/syntax highlighting.
Change-Id: I8cebe9cd6618b93a1144dd27d17d8d3b5834e03f
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/app/qbs-qmltypes')
-rw-r--r-- | src/app/qbs-qmltypes/main.cpp | 50 | ||||
-rw-r--r-- | src/app/qbs-qmltypes/qbs-qmltypes.pro | 16 |
2 files changed, 66 insertions, 0 deletions
diff --git a/src/app/qbs-qmltypes/main.cpp b/src/app/qbs-qmltypes/main.cpp new file mode 100644 index 000000000..f79b1623c --- /dev/null +++ b/src/app/qbs-qmltypes/main.cpp @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Build Suite. +** +** 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. +** +****************************************************************************/ + +#include <language/scriptengine.h> +#include <language/loader.h> + +#include <QCoreApplication> +#include <QByteArray> + +#include <iostream> + +using namespace qbs; + +int main(int argc, char *argv[]) +{ + QCoreApplication app(argc, argv); + + Internal::ScriptEngine engine; + QByteArray typeData = Internal::Loader(&engine).qmlTypeInfo(); + + std::cout << typeData.constData(); + + return 0; +} diff --git a/src/app/qbs-qmltypes/qbs-qmltypes.pro b/src/app/qbs-qmltypes/qbs-qmltypes.pro new file mode 100644 index 000000000..a01914235 --- /dev/null +++ b/src/app/qbs-qmltypes/qbs-qmltypes.pro @@ -0,0 +1,16 @@ +QT += core +QT -= gui + +TARGET = qbs-qmltypes +CONFIG += console +CONFIG -= app_bundle +DESTDIR = ../../../bin + +TEMPLATE = app + +SOURCES += \ + main.cpp \ + +HEADERS += \ + +include(../../lib/use.pri) |