Commit 41e13d37 authored by Caroline Chao's avatar Caroline Chao Committed by The Qt Project
Browse files

Add qml/js files in resource files


To make deployment of Qt Quick Controls based
applications easier.

Task-number: QTBUG-31565

Change-Id: I0b8af2864ef0dc9121eed3189ced64712bdb3d20
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
parent 3b10c17e
No related merge requests found
Showing with 78 additions and 29 deletions
...@@ -319,6 +319,7 @@ ApplicationWindow { ...@@ -319,6 +319,7 @@ ApplicationWindow {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: document.text text: document.text
textFormat: Qt.RichText textFormat: Qt.RichText
baseUrl: "qrc:/"
Component.onCompleted: forceActiveFocus() Component.onCompleted: forceActiveFocus()
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype Button \qmltype Button
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype CheckBox \qmltype CheckBox
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype ComboBox \qmltype ComboBox
......
...@@ -42,6 +42,7 @@ import QtQuick 2.1 ...@@ -42,6 +42,7 @@ import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype MenuBar \qmltype MenuBar
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype ProgressBar \qmltype ProgressBar
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype RadioButton \qmltype RadioButton
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype Slider \qmltype Slider
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype SpinBox \qmltype SpinBox
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import "Private/StackView.js" as JSArray import "../private/StackView.js" as JSArray
/*! /*!
\qmltype StackView \qmltype StackView
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype StatusBar \qmltype StatusBar
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype TabView \qmltype TabView
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import "Styles" import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype TextField \qmltype TextField
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype ToolBar \qmltype ToolBar
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype ToolButton \qmltype ToolButton
......
...@@ -5,7 +5,7 @@ QT += qml quick gui-private core-private ...@@ -5,7 +5,7 @@ QT += qml quick gui-private core-private
QMAKE_DOCS = $$PWD/doc/qtquickcontrols.qdocconf QMAKE_DOCS = $$PWD/doc/qtquickcontrols.qdocconf
QML_FILES = \ OTHER_FILES = \
ApplicationWindow.qml \ ApplicationWindow.qml \
Button.qml \ Button.qml \
CheckBox.qml \ CheckBox.qml \
...@@ -37,3 +37,6 @@ include(plugin.pri) ...@@ -37,3 +37,6 @@ include(plugin.pri)
CONFIG += no_cxx_module CONFIG += no_cxx_module
load(qml_plugin) load(qml_plugin)
RESOURCES += \
resources.qrc
...@@ -98,6 +98,34 @@ void QtQuickControlsPlugin::registerTypes(const char *uri) ...@@ -98,6 +98,34 @@ void QtQuickControlsPlugin::registerTypes(const char *uri)
QLatin1String("Do not create objects of type MenuBase")); QLatin1String("Do not create objects of type MenuBase"));
qmlRegisterUncreatableType<QQuickStack>(uri, 1, 0, "Stack", QLatin1String("Do not create objects of type Stack")); qmlRegisterUncreatableType<QQuickStack>(uri, 1, 0, "Stack", QLatin1String("Do not create objects of type Stack"));
// Controls in resources file
qmlRegisterType(QUrl("qrc:/controls/ApplicationWindow.qml"), uri, 1, 0, "ApplicationWindow");
qmlRegisterType(QUrl("qrc:/controls/Button.qml"), uri, 1, 0, "Button");
qmlRegisterType(QUrl("qrc:/controls/CheckBox.qml"), uri, 1, 0, "CheckBox");
qmlRegisterType(QUrl("qrc:/controls/ComboBox.qml"), uri, 1, 0, "ComboBox");
qmlRegisterType(QUrl("qrc:/controls/GroupBox.qml"), uri, 1, 0, "GroupBox");
qmlRegisterType(QUrl("qrc:/controls/Label.qml"), uri, 1, 0, "Label");
qmlRegisterType(QUrl("qrc:/controls/Menu.qml"), uri, 1, 0, "Menu");
qmlRegisterType(QUrl("qrc:/controls/MenuBar.qml"), uri, 1, 0, "MenuBar");
qmlRegisterType(QUrl("qrc:/controls/ProgressBar.qml"), uri, 1, 0, "ProgressBar");
qmlRegisterType(QUrl("qrc:/controls/RadioButton.qml"), uri, 1, 0, "RadioButton");
qmlRegisterType(QUrl("qrc:/controls/ScrollView.qml"), uri, 1, 0, "ScrollView");
qmlRegisterType(QUrl("qrc:/controls/Slider.qml"), uri, 1, 0, "Slider");
qmlRegisterType(QUrl("qrc:/controls/SpinBox.qml"), uri, 1, 0, "SpinBox");
qmlRegisterType(QUrl("qrc:/controls/SplitView.qml"), uri, 1, 0, "SplitView");
qmlRegisterType(QUrl("qrc:/controls/StackView.qml"), uri, 1, 0, "StackView");
qmlRegisterType(QUrl("qrc:/controls/StackViewDelegate.qml"), uri, 1, 0, "StackViewDelegate");
qmlRegisterType(QUrl("qrc:/controls/StackViewTransition.qml"), uri, 1, 0, "StackViewTransition");
qmlRegisterType(QUrl("qrc:/controls/StatusBar.qml"), uri, 1, 0, "StatusBar");
qmlRegisterType(QUrl("qrc:/controls/Tab.qml"), uri, 1, 0, "Tab");
qmlRegisterType(QUrl("qrc:/controls/TableView.qml"), uri, 1, 0, "TableView");
qmlRegisterType(QUrl("qrc:/controls/TableViewColumn.qml"), uri, 1, 0, "TableViewColumn");
qmlRegisterType(QUrl("qrc:/controls/TextField.qml"), uri, 1, 0, "TextField");
qmlRegisterType(QUrl("qrc:/controls/TabView.qml"), uri, 1, 0, "TabView");
qmlRegisterType(QUrl("qrc:/controls/TextArea.qml"), uri, 1, 0, "TextArea");
qmlRegisterType(QUrl("qrc:/controls/ToolBar.qml"), uri, 1, 0, "ToolBar");
qmlRegisterType(QUrl("qrc:/controls/ToolButton.qml"), uri, 1, 0, "ToolButton");
} }
void QtQuickControlsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) void QtQuickControlsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
......
module QtQuick.Controls module QtQuick.Controls
plugin qtquickcontrolsplugin plugin qtquickcontrolsplugin
ApplicationWindow 1.0 ApplicationWindow.qml
Button 1.0 Button.qml
CheckBox 1.0 CheckBox.qml
ComboBox 1.0 ComboBox.qml
GroupBox 1.0 GroupBox.qml
Label 1.0 Label.qml
MenuBar 1.0 MenuBar.qml
Menu 1.0 Menu.qml
StackView 1.0 StackView.qml
ProgressBar 1.0 ProgressBar.qml
RadioButton 1.0 RadioButton.qml
ScrollView 1.0 ScrollView.qml
Slider 1.0 Slider.qml
SpinBox 1.0 SpinBox.qml
SplitView 1.0 SplitView.qml
StackViewDelegate 1.0 StackViewDelegate.qml
StackViewTransition 1.0 StackViewTransition.qml
StatusBar 1.0 StatusBar.qml
Tab 1.0 Tab.qml
TabView 1.0 TabView.qml
TableView 1.0 TableView.qml
TableViewColumn 1.0 TableViewColumn.qml
TextArea 1.0 TextArea.qml
TextField 1.0 TextField.qml
ToolBar 1.0 ToolBar.qml
ToolButton 1.0 ToolButton.qml
<RCC>
<qresource prefix="/controls">
<file>ApplicationWindow.qml</file>
<file>Button.qml</file>
<file>CheckBox.qml</file>
<file>ComboBox.qml</file>
<file>GroupBox.qml</file>
<file>Label.qml</file>
<file>Menu.qml</file>
<file>MenuBar.qml</file>
<file>ProgressBar.qml</file>
<file>RadioButton.qml</file>
<file>ScrollView.qml</file>
<file>Slider.qml</file>
<file>SpinBox.qml</file>
<file>SplitView.qml</file>
<file>StackView.qml</file>
<file>StackViewDelegate.qml</file>
<file>StackViewTransition.qml</file>
<file>StatusBar.qml</file>
<file>Tab.qml</file>
<file>TableView.qml</file>
<file>TableViewColumn.qml</file>
<file>TabView.qml</file>
<file>TextArea.qml</file>
<file>TextField.qml</file>
<file>ToolBar.qml</file>
<file>ToolButton.qml</file>
</qresource>
</RCC>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls.Private 1.0 import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
/*! /*!
\qmltype FocusFrame \qmltype FocusFrame
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment