From d259d29158f0c7404ca9c93b9e9598d314dde494 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Tue, 19 Mar 2013 21:10:02 +0100 Subject: Add changes-5.0.2 file Change-Id: I75fe0526bb3698cbbe6555cbb13eb32fd1bfa3c6 Reviewed-by: Iikka Eklund --- dist/changes-5.0.2 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dist/changes-5.0.2 diff --git a/dist/changes-5.0.2 b/dist/changes-5.0.2 new file mode 100644 index 00000000..708a3826 --- /dev/null +++ b/dist/changes-5.0.2 @@ -0,0 +1,22 @@ +Qt 5.0.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.0.0 and 5.0.1. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.0/ + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + +**************************************************************************** +* General * +**************************************************************************** + + - This release contains only minor code improvements. -- cgit v1.2.3 From 5ed36a9fe84f78c66692bb4a0395cb09eaf31d66 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sat, 24 Nov 2012 19:37:18 +0900 Subject: disable module when widgets is not available Change-Id: I3849f3dfb1d33bf15053fae864393d5755a2ea8d Reviewed-by: Sergio Ahumada Reviewed-by: Oswald Buddenhagen --- qtquick1.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qtquick1.pro b/qtquick1.pro index 58c33f27..318861f4 100644 --- a/qtquick1.pro +++ b/qtquick1.pro @@ -1 +1,3 @@ +requires(qtHaveModule(widgets)) + load(qt_parts) -- cgit v1.2.3 From 5c1b30c5f3947bc8227330681bba5ad9d127dfc6 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 11 Apr 2013 13:21:43 +0200 Subject: test: Remove CONFIG+=parallel_test from tst_examples This fails quite often on Mac because it gets mixed with the same test in qtdeclarative.git while testing qt5.git Change-Id: I58f3f9d8e64b080a2a78fdedb409acd68324c8f8 Reviewed-by: Frederik Gladhorn --- tests/auto/declarative/examples/examples.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/declarative/examples/examples.pro b/tests/auto/declarative/examples/examples.pro index 043fa5d0..c960b8fd 100644 --- a/tests/auto/declarative/examples/examples.pro +++ b/tests/auto/declarative/examples/examples.pro @@ -14,6 +14,4 @@ include(../../../../tools/qml/qml.pri) DEFINES += SRCDIR=\\\"$$PWD\\\" -CONFIG += parallel_test - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -- cgit v1.2.3 From 4fb85a7d4d9cec253be37fa5cbf744c783902757 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 12 Apr 2013 12:01:36 +0200 Subject: Doc: Remove instructions for using qtdemo from examples README The Qt Examples and Demos Launcher is not maintained anymore. Edit the README to mention Qt Creator as the way to find and launch examples. Task-number: QTBUG-28388 Change-Id: I507b0af3888185a0cb86a3e71cab9115b9275892 Reviewed-by: Leena Miettinen --- examples/declarative/README | 40 +++++----------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/examples/declarative/README b/examples/declarative/README index 578c2458..42d88772 100644 --- a/examples/declarative/README +++ b/examples/declarative/README @@ -1,41 +1,11 @@ The Qt Declarative module provides the ability to specify and implement -your user interface declaratively, using the Qt Meta-Object Language (QML). This -language is very expressive and human readable, and can be used by +your user interface declaratively, using the Qt Meta-Object Language (QML). +This language is very expressive and human readable, and can be used by designers to actually implement their UI vision. QML UIs can integrate with C++ code in many ways, including being loaded as a part of a C++ UI and loading data models from C++ and interacting with them. -The example launcher provided with Qt can be used to explore each of the -examples in this directory. But most can also be viewed directly with the -QML viewer utility, without requiring compilation. +Documentation for examples can be found via the Examples and Tutorials link +in the main Qt documentation. The examples and their documentation can also +be opened from the Examples tab of Qt Creator's Welcome mode. -Documentation for these examples can be found via the Tutorials and Examples -link in the main Qt documentation. - - -Finding the Qt Examples and Demos launcher -========================================== - -On Windows: - -The launcher can be accessed via the Windows Start menu. Select the menu -entry entitled "Qt Examples and Demos" entry in the submenu containing -the Qt tools. - -On Mac OS X: - -For the binary distribution, the qtdemo executable is installed in the -/Developer/Applications/Qt directory. For the source distribution, it is -installed alongside the other Qt tools on the path specified when Qt is -configured. - -On Unix/Linux: - -The qtdemo executable is installed alongside the other Qt tools on the path -specified when Qt is configured. - -On all platforms: - -The source code for the launcher can be found in the demos/qtdemo directory -in the Qt package. This example is built at the same time as the Qt libraries, -tools, examples, and demonstrations. -- cgit v1.2.3 From d868a13fbf66111d43fc3a74e9063f7f4d1bee14 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 30 Apr 2013 08:19:21 +0200 Subject: Fix bic baseline data Caused by https://codereview.qt-project.org/54820 I actually tried to avoid this with https://codereview.qt-project.org/54837 but my assumption was wrong. Change-Id: Ibf8ba1031a84745dfec65d300a73e10c6728393d Reviewed-by: Sergio Ahumada --- .../data/QtDeclarative.5.0.0.linux-gcc-ia32.txt | 31 +++------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/tests/auto/bic/data/QtDeclarative.5.0.0.linux-gcc-ia32.txt b/tests/auto/bic/data/QtDeclarative.5.0.0.linux-gcc-ia32.txt index 5dd9860c..5a04c2ab 100644 --- a/tests/auto/bic/data/QtDeclarative.5.0.0.linux-gcc-ia32.txt +++ b/tests/auto/bic/data/QtDeclarative.5.0.0.linux-gcc-ia32.txt @@ -3986,40 +3986,15 @@ QScreenOrientationChangeEvent (0xb39637bc) 0 QEvent (0xb3a0dea8) 0 primary-for QScreenOrientationChangeEvent (0xb39637bc) -Class QAccessible::QPrivateSignal - size=1 align=1 - base size=0 base align=1 -QAccessible::QPrivateSignal (0xb3a0df50) 0 empty - Class QAccessible::State size=8 align=4 base size=5 base align=4 QAccessible::State (0xb3a2f000) 0 -Vtable for QAccessible -QAccessible::_ZTV11QAccessible: 14u entries -0 (int (*)(...))0 -4 (int (*)(...))(& _ZTI11QAccessible) -8 (int (*)(...))QAccessible::metaObject -12 (int (*)(...))QAccessible::qt_metacast -16 (int (*)(...))QAccessible::qt_metacall -20 (int (*)(...))QAccessible::~QAccessible -24 (int (*)(...))QAccessible::~QAccessible -28 (int (*)(...))QObject::event -32 (int (*)(...))QObject::eventFilter -36 (int (*)(...))QObject::timerEvent -40 (int (*)(...))QObject::childEvent -44 (int (*)(...))QObject::customEvent -48 (int (*)(...))QObject::connectNotify -52 (int (*)(...))QObject::disconnectNotify - Class QAccessible - size=8 align=4 - base size=8 base align=4 -QAccessible (0xb39637f8) 0 - vptr=((& QAccessible::_ZTV11QAccessible) + 8u) - QObject (0xb3a0df88) 0 - primary-for QAccessible (0xb39637f8) + size=1 align=1 + base size=0 base align=1 +QAccessible (0xb39637f8) 0 empty Vtable for QAccessibleInterface QAccessibleInterface::_ZTV20QAccessibleInterface: 23u entries -- cgit v1.2.3 From 31c3dec9fe1341d412830eb1163e252112f9765c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 3 May 2013 09:20:52 +0200 Subject: Make sure correct files are bundled on Android The imports must be bundled in the apk. Change-Id: I44cd4b442f9f3c8b6bf3534ffbfb8866475599e4 Reviewed-by: Paul Olav Tvete --- src/declarative/declarative.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index c5741c2b..7a8a32f1 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -4,6 +4,10 @@ qtHaveModule(xmlpatterns): QT_PRIVATE = xmlpatterns else: DEFINES += QT_NO_XMLPATTERNS MODULE=declarative + +ANDROID_BUNDLED_FILES = \ + imports + load(qt_module) DEFINES += QT_NO_URL_CAST_FROM_STRING -- cgit v1.2.3 From 100cfb7c71b5dfb507d7b470bf60df49c36d9e40 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 10 May 2013 11:07:32 +0200 Subject: tst_qdeclarativeimage: it's OK to receive a network image in chunks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and if so, there can be more than 2 signals to update progress. Task-number: QTBUG-31065 Change-Id: I36294eb8a40c0e8d4beac29a8484260d5cfe6e73 Reviewed-by: Simo Fält Reviewed-by: Liang Qi --- tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 859df145..d0c60043 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -575,7 +575,7 @@ void tst_qdeclarativeimage::noLoading() QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 2); - QTRY_COMPARE(progressSpy.count(), 2); + QTRY_VERIFY(progressSpy.count() > 1); QTRY_COMPARE(statusSpy.count(), 2); // Loading remote file again - should not go through 'Loading' state. @@ -584,7 +584,7 @@ void tst_qdeclarativeimage::noLoading() QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 4); - QTRY_COMPARE(progressSpy.count(), 2); + QTRY_VERIFY(progressSpy.count() > 1); QTRY_COMPARE(statusSpy.count(), 2); } -- cgit v1.2.3 From 8c02d79c5b7d769c848c0441c4e9a6f1e0a41912 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 7 May 2013 09:45:27 +0200 Subject: Move exports conflicting with QtQml into namespace Move exported qml* symbols that conflict with QtQml into an - automatically imported - namespace. This ensures apps can link against both QtDeclarative and QtQml. To keep the BC promise the old symbols are still exported. Task-number: QTBUG-29584 Change-Id: Icf4e586fee51d2bd82125398e2bb96d6dd355cc5 Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira Reviewed-by: Alan Alpert --- src/declarative/qml/qdeclarative.h | 17 +++++++++---- src/declarative/qml/qdeclarativeengine.cpp | 40 +++++++++++++++++++++++++++++- src/declarative/qml/qdeclarativeinfo.cpp | 26 +++++++++++++++++++ src/declarative/qml/qdeclarativeinfo.h | 25 +++++++++++++------ 4 files changed, 94 insertions(+), 14 deletions(-) diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index dd08105e..95cef935 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -404,11 +404,18 @@ inline int qmlRegisterType(const QUrl &url, const char *uri, int versionMajor, i class QDeclarativeContext; class QDeclarativeEngine; -Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *); -Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *); -Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *); -Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true); -Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create); + +namespace QtDeclarative { + // declared in namespace to avoid symbol conflicts with QtQml + Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *); + Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *); + Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *); + Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, + bool create = true); + Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, + const QMetaObject *, bool create); +} +using namespace QtDeclarative; template QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 691fb713..fe33cc3d 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -1020,6 +1020,8 @@ QDeclarativeEngine::ObjectOwnership QDeclarativeEngine::objectOwnership(QObject return ddata->indestructible?CppOwnership:JavaScriptOwnership; } +namespace QtDeclarative { + void qmlExecuteDeferred(QObject *object) { QDeclarativeData *data = QDeclarativeData::get(object); @@ -1088,9 +1090,45 @@ QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, if (*idCache == -1 || !object) return 0; - return qmlAttachedPropertiesObjectById(*idCache, object, create); + return QtDeclarative::qmlAttachedPropertiesObjectById(*idCache, object, create); +} + +} // namespace QtDeclarative + +#if QT_DEPRECATED_SINCE(5, 1) + +// Also define symbols outside namespace to keep binary compatibility with 5.0 + +Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *obj) +{ + QtDeclarative::qmlExecuteDeferred(obj); +} + +Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *obj) +{ + return QtDeclarative::qmlContext(obj); +} + +Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *obj) +{ + return QtDeclarative::qmlEngine(obj); +} + +Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int id, const QObject * obj, + bool create) +{ + return QtDeclarative::qmlAttachedPropertiesObjectById(id, obj, create); } +Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object, + const QMetaObject *attachedMetaObject, + bool create) +{ + return QtDeclarative::qmlAttachedPropertiesObject(idCache, object, attachedMetaObject, create); +} + +#endif // QT_DEPRECATED_SINCE(5, 1) + QDeclarativeDebuggingEnabler::QDeclarativeDebuggingEnabler() { #ifndef QDECLARATIVE_NO_DEBUG_PROTOCOL diff --git a/src/declarative/qml/qdeclarativeinfo.cpp b/src/declarative/qml/qdeclarativeinfo.cpp index 30c89d8e..960cc352 100644 --- a/src/declarative/qml/qdeclarativeinfo.cpp +++ b/src/declarative/qml/qdeclarativeinfo.cpp @@ -152,6 +152,8 @@ QDeclarativeInfo::~QDeclarativeInfo() } } +namespace QtDeclarative { + QDeclarativeInfo qmlInfo(const QObject *me) { QDeclarativeInfoPrivate *d = new QDeclarativeInfoPrivate; @@ -175,5 +177,29 @@ QDeclarativeInfo qmlInfo(const QObject *me, const QList &erro return QDeclarativeInfo(d); } +} // namespace QtDeclarative + +#if QT_DEPRECATED_SINCE(5, 1) + +// Also define symbols outside namespace to keep binary compatibility with 5.0 + +Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me) +{ + return QtDeclarative::qmlInfo(me); +} + +Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, + const QDeclarativeError &error) +{ + return QtDeclarative::qmlInfo(me, error); +} + +Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, + const QList &errors) +{ + return QtDeclarative::qmlInfo(me, errors); +} + +#endif // QT_DEPRECATED_SINCE(5, 1) QT_END_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeinfo.h b/src/declarative/qml/qdeclarativeinfo.h index 7b23a341..2db5d960 100644 --- a/src/declarative/qml/qdeclarativeinfo.h +++ b/src/declarative/qml/qdeclarativeinfo.h @@ -50,6 +50,18 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QDeclarativeInfo; + +namespace QtDeclarative { + // declared in namespace to avoid symbol conflicts with QtQml + Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); + Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, + const QDeclarativeError &error); + Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, + const QList &errors); +} +using namespace QtDeclarative; + class QDeclarativeInfoPrivate; class Q_DECLARATIVE_EXPORT QDeclarativeInfo : public QDebug { @@ -83,18 +95,15 @@ public: #endif private: - friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); - friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); - friend Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors); - + friend Q_DECLARATIVE_EXPORT QDeclarativeInfo QtDeclarative::qmlInfo(const QObject *me); + friend Q_DECLARATIVE_EXPORT QDeclarativeInfo QtDeclarative::qmlInfo(const QObject *me, + const QDeclarativeError &error); + friend Q_DECLARATIVE_EXPORT QDeclarativeInfo QtDeclarative::qmlInfo(const QObject *me, + const QList &errors); QDeclarativeInfo(QDeclarativeInfoPrivate *); QDeclarativeInfoPrivate *d; }; -Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me); -Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QDeclarativeError &error); -Q_DECLARATIVE_EXPORT QDeclarativeInfo qmlInfo(const QObject *me, const QList &errors); - QT_END_NAMESPACE #endif // QDECLARATIVEINFO_H -- cgit v1.2.3 From f47715f0a41eba3a965b56dac3157ee1f59defc7 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 14 May 2013 10:32:36 +0200 Subject: iOS: fix build on iOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, apps for iOS needs to be build through Xcode. So disable building tools for now, until a proper solution is ready. Change-Id: Ib31ad29d83c9043be94881e536975682adca4061 Reviewed-by: Tor Arne Vestbø --- tools/tools.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tools.pro b/tools/tools.pro index 02a1e201..5d3fa37b 100644 --- a/tools/tools.pro +++ b/tools/tools.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS += qml qmlplugindump +!ios: SUBDIRS += qml qmlplugindump -- cgit v1.2.3 From fbb7ee568befc58c9d301c1064a1c7d0b7ce3462 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 14 May 2013 15:28:49 +0200 Subject: Cleanup and fix the Getting Started tutorial The tutorial got messed up by 04cb8ef1. This change restores the core/ folder from within the gsQml/ backup folder and then deletes it. Task-number: QTBUG-31082 Change-Id: Ie18af90dbc70812dc7e74fdd1389a8734cf62fd4 Reviewed-by: Oliver Wolff Reviewed-by: Friedemann Kleint --- .../tutorials/gettingStarted/core/button.qml | 108 ++++++++++ .../tutorials/gettingStarted/core/editMenu.qml | 105 ++++++++++ .../tutorials/gettingStarted/core/fileDialog.qml | 163 +++++++++++++++ .../tutorials/gettingStarted/core/fileMenu.qml | 232 +++++++++++++++++++++ .../tutorials/gettingStarted/core/menuBar.qml | 147 +++++++++++++ .../tutorials/gettingStarted/core/qmldir | 9 + .../tutorials/gettingStarted/core/textArea.qml | 87 ++++++++ .../tutorials/gettingStarted/gettingStarted.pro | 3 +- .../tutorials/gettingStarted/gsQml/core/button.qml | 108 ---------- .../gettingStarted/gsQml/core/editMenu.qml | 105 ---------- .../gettingStarted/gsQml/core/fileDialog.qml | 163 --------------- .../gettingStarted/gsQml/core/fileMenu.qml | 232 --------------------- .../gettingStarted/gsQml/core/menuBar.qml | 147 ------------- .../tutorials/gettingStarted/gsQml/core/qmldir | 9 - .../gettingStarted/gsQml/core/textArea.qml | 87 -------- .../gsQml/filedialog/dialogPlugin.cpp | 51 ----- .../gettingStarted/gsQml/filedialog/dialogPlugin.h | 58 ------ .../gettingStarted/gsQml/filedialog/directory.cpp | 224 -------------------- .../gettingStarted/gsQml/filedialog/directory.h | 107 ---------- .../gettingStarted/gsQml/filedialog/file.cpp | 57 ----- .../gettingStarted/gsQml/filedialog/file.h | 67 ------ .../gsQml/filedialog/filedialog.json | 1 - .../gettingStarted/gsQml/filedialog/filedialog.pro | 17 -- .../gettingStarted/gsQml/filedialog/qmldir | 1 - .../gettingStarted/gsQml/images/arrow.png | Bin 583 -> 0 bytes .../gettingStarted/gsQml/parts/part0/Button.qml | 55 ----- .../gettingStarted/gsQml/parts/part1/Button.qml | 97 --------- .../gettingStarted/gsQml/parts/part1/EditMenu.qml | 76 ------- .../gettingStarted/gsQml/parts/part1/FileMenu.qml | 91 -------- .../gsQml/parts/part1/SimpleButton.qml | 73 ------- .../parts/part1/pics/qml-texteditor1_button.png | Bin 1670 -> 0 bytes .../parts/part1/pics/qml-texteditor1_editmenu.png | Bin 6177 -> 0 bytes .../parts/part1/pics/qml-texteditor1_filemenu.png | Bin 6062 -> 0 bytes .../part1/pics/qml-texteditor1_simplebutton.png | Bin 1055 -> 0 bytes .../gsQml/parts/part1/qml-texteditor.qmlproject | 16 -- .../gettingStarted/gsQml/parts/part2/Button.qml | 99 --------- .../gettingStarted/gsQml/parts/part2/EditMenu.qml | 77 ------- .../gettingStarted/gsQml/parts/part2/FileMenu.qml | 92 -------- .../gettingStarted/gsQml/parts/part2/MenuBar.qml | 140 ------------- .../parts/part2/pics/qml-texteditor2_menubar.png | Bin 6079 -> 0 bytes .../gsQml/parts/part2/qml-texteditor2.qmlproject | 16 -- .../gettingStarted/gsQml/parts/part3/Button.qml | 99 --------- .../gettingStarted/gsQml/parts/part3/EditMenu.qml | 77 ------- .../gettingStarted/gsQml/parts/part3/FileMenu.qml | 92 -------- .../gettingStarted/gsQml/parts/part3/MenuBar.qml | 140 ------------- .../gettingStarted/gsQml/parts/part3/TextArea.qml | 80 ------- .../gsQml/parts/part3/TextEditor.qml | 68 ------ .../gsQml/parts/part3/images/arrow.png | Bin 583 -> 0 bytes .../part3/pics/qml-texteditor3_texteditor.png | Bin 59345 -> 0 bytes .../gsQml/parts/part3/qml-texteditor3.qmlproject | 16 -- .../gettingStarted/gsQml/parts/part4/Button.qml | 109 ---------- .../gettingStarted/gsQml/parts/part4/EditMenu.qml | 81 ------- .../gettingStarted/gsQml/parts/part4/FileMenu.qml | 96 --------- .../gettingStarted/gsQml/parts/part4/MenuBar.qml | 146 ------------- .../gsQml/parts/part4/SimpleButton.qml | 59 ------ .../gettingStarted/gsQml/parts/part4/TextArea.qml | 80 ------- .../gsQml/parts/part4/TextEditor.qml | 146 ------------- .../gsQml/parts/part4/images/arrow.png | Bin 583 -> 0 bytes .../part4/pics/qml-texteditor4_texteditor.png | Bin 63629 -> 0 bytes .../gsQml/parts/part4/qml-texteditor4.qmlproject | 16 -- .../gsQml/parts/part5/TextEditor.qml | 127 ----------- .../gsQml/parts/part5/core/Button.qml | 109 ---------- .../gsQml/parts/part5/core/EditMenu.qml | 110 ---------- .../gsQml/parts/part5/core/FileDialog.qml | 170 --------------- .../gsQml/parts/part5/core/FileMenu.qml | 232 --------------------- .../gsQml/parts/part5/core/MenuBar.qml | 148 ------------- .../gsQml/parts/part5/core/TextArea.qml | 86 -------- .../gettingStarted/gsQml/parts/part5/core/qmldir | 13 -- .../gsQml/parts/part5/filedialog/dialogPlugin.cpp | 54 ----- .../gsQml/parts/part5/filedialog/dialogPlugin.h | 58 ------ .../gsQml/parts/part5/filedialog/directory.cpp | 219 ------------------- .../gsQml/parts/part5/filedialog/directory.h | 108 ---------- .../gsQml/parts/part5/filedialog/file.cpp | 56 ----- .../gsQml/parts/part5/filedialog/file.h | 67 ------ .../gsQml/parts/part5/filedialog/filedialog.json | 1 - .../gsQml/parts/part5/filedialog/filedialog.pro | 17 -- .../gsQml/parts/part5/filedialog/qmldir | 1 - .../gsQml/parts/part5/images/arrow.png | Bin 583 -> 0 bytes .../parts/part5/pics/qml-texteditor5_editmenu.png | Bin 65123 -> 0 bytes .../parts/part5/pics/qml-texteditor5_filemenu.png | Bin 21367 -> 0 bytes .../parts/part5/pics/qml-texteditor5_newfile.png | Bin 76693 -> 0 bytes .../gsQml/parts/part5/qml-texteditor5.qmlproject | 18 -- .../gsQml/pics/qml-texteditor5_editmenu.png | Bin 65123 -> 0 bytes .../gsQml/pics/qml-texteditor5_filemenu.png | Bin 21367 -> 0 bytes .../gsQml/pics/qml-texteditor5_newfile.png | Bin 76693 -> 0 bytes .../tutorials/gettingStarted/gsQml/texteditor.pro | 4 - .../tutorials/gettingStarted/gsQml/texteditor.qml | 132 ------------ .../gettingStarted/parts/part5/core/button.qml | 108 ++++++++++ .../gettingStarted/parts/part5/core/editMenu.qml | 105 ++++++++++ .../gettingStarted/parts/part5/core/fileDialog.qml | 163 +++++++++++++++ .../gettingStarted/parts/part5/core/fileMenu.qml | 232 +++++++++++++++++++++ .../gettingStarted/parts/part5/core/menuBar.qml | 147 +++++++++++++ .../gettingStarted/parts/part5/core/qmldir | 9 + .../gettingStarted/parts/part5/core/textArea.qml | 87 ++++++++ 94 files changed, 1704 insertions(+), 5302 deletions(-) create mode 100644 examples/declarative/tutorials/gettingStarted/core/button.qml create mode 100644 examples/declarative/tutorials/gettingStarted/core/editMenu.qml create mode 100644 examples/declarative/tutorials/gettingStarted/core/fileDialog.qml create mode 100644 examples/declarative/tutorials/gettingStarted/core/fileMenu.qml create mode 100644 examples/declarative/tutorials/gettingStarted/core/menuBar.qml create mode 100644 examples/declarative/tutorials/gettingStarted/core/qmldir create mode 100644 examples/declarative/tutorials/gettingStarted/core/textArea.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/editMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/fileDialog.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/fileMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/menuBar.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/qmldir delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/core/textArea.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.cpp delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.h delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.cpp delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.h delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.json delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/filedialog/qmldir delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/images/arrow.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part0/Button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/Button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/Button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/Button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/Button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.json delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/texteditor.pro delete mode 100644 examples/declarative/tutorials/gettingStarted/gsQml/texteditor.qml create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/button.qml create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/editMenu.qml create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/fileDialog.qml create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/fileMenu.qml create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/menuBar.qml create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/qmldir create mode 100644 examples/declarative/tutorials/gettingStarted/parts/part5/core/textArea.qml diff --git a/examples/declarative/tutorials/gettingStarted/core/button.qml b/examples/declarative/tutorials/gettingStarted/core/button.qml new file mode 100644 index 00000000..aaf619b5 --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/button.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +import QtQuick 1.0 + +Rectangle { + //identifier of the item + id: button + + //these properties act as constants, useable outside this QML file + property int buttonHeight: 75 + property int buttonWidth: 150 + + //attaches to the Text element's text content + property string label + property color textColor: buttonLabel.color + + //the color highlight when the mouse hovers on the rectangle + property color onHoverColor: "lightsteelblue" + property color borderColor: "transparent" + + //buttonColor is set to the button's main color + property color buttonColor: "lightblue" + + property real labelSize: 14 + + //set appearance properties + radius: 6 + smooth: true + border { width: 2; color: borderColor } + width: buttonWidth; height: buttonHeight + + Text { + id: buttonLabel + anchors.centerIn: parent + text: label //bind the text to the parent's text + color: "#DCDCCC" + font.pointSize: labelSize + } + + //buttonClick() is callable and a signal handler, onButtonClick is automatically created + signal buttonClick() + + //define the clickable area to be the whole rectangle + MouseArea { + id: buttonMouseArea + anchors.fill: parent //stretch the area to the parent's dimension + onClicked: buttonClick() + + //if true, then onEntered and onExited called if mouse hovers in the mouse area + //if false, a button must be clicked to detect the mouse hover + hoverEnabled: true + + //display a border if the mouse hovers on the button mouse area + onEntered: parent.border.color = onHoverColor + //remove the border if the mouse exits the button mouse area + onExited: parent.border.color = borderColor + } + + //change the color of the button when pressed + color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor + //animate the color whenever the color property changes + Behavior on color { ColorAnimation{ duration: 55 } } + + //scale the button when pressed + scale: buttonMouseArea.pressed ? 1.1 : 1.00 + //Animate the scale property change + Behavior on scale { NumberAnimation{ duration: 55 } } + +} diff --git a/examples/declarative/tutorials/gettingStarted/core/editMenu.qml b/examples/declarative/tutorials/gettingStarted/core/editMenu.qml new file mode 100644 index 00000000..cc8e345d --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/editMenu.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +import QtQuick 1.0 + +Rectangle { + id: editMenu + height: 480; width:1000 + color: "powderblue" + property color buttonBorderColor: "#7A8182" + property color buttonFillColor: "#61BDCACD" + property string menuName:"Edit" + gradient: Gradient { + GradientStop { position: 0.0; color: "#6A7570" } + GradientStop { position: 1.0; color: Qt.darker("#6A7570") } + } + + Rectangle { + id:actionContainer + color:"transparent" + anchors.centerIn: parent + width: parent.width; height: parent.height / 5 + Row { + anchors.centerIn: parent + spacing: parent.width/9 + Button { + id: loadButton + buttonColor: buttonFillColor + label: "Copy" + labelSize: 16 + borderColor: buttonBorderColor + height: actionContainer.height; width: actionContainer.width/6 + onButtonClick: textArea.copy() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: saveButton + height: actionContainer.height; width: actionContainer.width/6 + buttonColor: buttonFillColor + label: "Paste" + borderColor: buttonBorderColor + labelSize: 16 + onButtonClick: textArea.paste() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: exitButton + label: "Select All" + height: actionContainer.height; width: actionContainer.width/6 + labelSize: 16 + buttonColor: buttonFillColor + borderColor:buttonBorderColor + onButtonClick: textArea.selectAll() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/core/fileDialog.qml b/examples/declarative/tutorials/gettingStarted/core/fileDialog.qml new file mode 100644 index 00000000..9f50c73f --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/fileDialog.qml @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id:dialog + height: 200 * partition; width: 200 + color: "transparent" + + signal selectChanged() + signal notifyRefresh() + onNotifyRefresh:dirView.model = directory.files + + property string selectedFile + property int selectedIndex: 0 + + Rectangle { + id: dirBox + radius: 10 + anchors.centerIn:parent + height: parent.height -15; width: parent.width -30 + + Rectangle { + id:header + height: parent.height*0.1; width: parent.width + radius:3 + z:1 + gradient: Gradient { + GradientStop { position: 0.0; color: "#8C8F8C" } + GradientStop { position: 0.17; color: "#6A6D6A" } + GradientStop { position: 0.98;color: "#3F3F3F" } + GradientStop { position: 1.0; color: "#0e1B20" } + } + Text { + height: header.height; anchors.centerIn: header + text: "files:" + color: "lightblue" + font.weight: Font.Light + font.italic: true + } + } + GridView { + id:dirView + width:parent.width; height:parent.height*.9 + anchors.top: header.bottom + cellWidth: 100; cellHeight: 75 + model: directory.files + delegate: dirDelegate + clip: true + highlightMoveDuration: 40 + } + Component { + id: dirDelegate + Rectangle { + id:file + color: "transparent" + width: file.GridView.view.cellWidth; height: file.GridView.view.cellHeight + + Text { + id:fileName + width: parent.width + anchors.centerIn: parent + text: name + color: "#BDCACD" + font.weight: file.GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal + font.pointSize: file.GridView.view.currentIndex == index ? 12 : 10 + elide: Text.ElideMiddle + horizontalAlignment: Text.AlignHCenter + } + Rectangle { + id: selection + width: parent.width; height: parent.height + anchors.centerIn: parent + radius: 10 + smooth: true + scale: file.GridView.view.currentIndex == index ? 1 : 0.5 + opacity: file.GridView.view.currentIndex == index ? 1 : 0 + Text { + id: overlay + width: parent.width + anchors.centerIn: parent + text: name + color: "#696167" + font.weight: Font.DemiBold + font.pointSize: 12 + smooth: true + elide: Text.ElideMiddle + horizontalAlignment: Text.AlignHCenter + } + Behavior on opacity { NumberAnimation{ duration: 45 } } + Behavior on scale { NumberAnimation{ duration: 45 } } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) } + GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) } + } + border.color: "lightsteelblue" + border.width: 1 + } + MouseArea { + id:fileMouseArea + anchors.fill:parent + hoverEnabled: true + + onClicked: { + file.GridView.view.currentIndex = index + selectedFile = directory.files[index].name + selectChanged() + } + onEntered: { + fileName.color = "lightsteelblue" + fileName.font.weight = Font.DemiBold + } + onExited: { + fileName.font.weight = Font.Normal + fileName.color = "#BDCACD" + } + } + } + } + gradient: Gradient { + GradientStop { position: 0.0; color: "#A5333333" } + GradientStop { position: 1.0; color: "#03333333" } + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/core/fileMenu.qml b/examples/declarative/tutorials/gettingStarted/core/fileMenu.qml new file mode 100644 index 00000000..b2a34b9b --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/fileMenu.qml @@ -0,0 +1,232 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: fileMenu + height: 480; width:1000 + property color buttonBorderColor: "#7F8487" + property color buttonFillColor: "#8FBDCACD" + property string fileContent:directory.fileContent + + //the menuName is accessible from outside this QML file + property string menuName: "File" + + //used to divide the screen into parts. + property real partition: 1/3 + + color: "#6C646A" + gradient: Gradient { + GradientStop { position: 0.0; color: "#6C646A" } + GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") } + } + + Directory { + id:directory + filename: textInput.text + onDirectoryChanged:fileDialog.notifyRefresh() + } + + Rectangle { + id:actionContainer + + //make this rectangle invisible + color:"transparent" + anchors.left: parent.left + + //the height is a good proportion that creates more space at the top of + //the column of buttons + width: fileMenu.width * partition; height: fileMenu.height + + Column { + anchors.centerIn: parent + spacing: parent.height/32 + Button { + id: saveButton + label: "Save" + borderColor: buttonBorderColor + buttonColor: buttonFillColor + width: actionContainer.width/ 1.3 + height:actionContainer.height / 8 + labelSize:24 + onButtonClick: { + directory.fileContent = textArea.textContent + directory.filename = textInput.text + directory.saveFile() + } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: loadButton + width: actionContainer.width/ 1.3 + height:actionContainer.height/ 8 + buttonColor: buttonFillColor + borderColor: buttonBorderColor + label: "Load" + labelSize:24 + onButtonClick:{ + directory.filename = textInput.text + directory.loadFile() + textArea.textContent = directory.fileContent + } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: newButton + width: actionContainer.width/ 1.3 + height: actionContainer.height/ 8 + buttonColor: buttonFillColor + borderColor: buttonBorderColor + label: "New" + labelSize: 24 + onButtonClick:{ + textArea.textContent = "" + textInput.text = "" + } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + + } + Rectangle { + id: space + width: actionContainer.width/ 1.3 + height: actionContainer.height / 16 + color: "transparent" + } + Button { + id: exitButton + width: actionContainer.width/ 1.3 + height: actionContainer.height/ 8 + label: "Exit" + labelSize: 24 + buttonColor: buttonFillColor + borderColor: buttonBorderColor + onButtonClick: Qt.quit() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + } + } + Rectangle { + id:dialogContainer + + width: 2*fileMenu.width * partition; height: fileMenu.height + anchors.right:parent.right + color: "transparent" + + Column { + anchors.centerIn: parent + spacing: parent.height /640 + FileDialog { + id:fileDialog + height: 2*dialogContainer.height * partition + width: dialogContainer.width + onSelectChanged: textInput.text = selectedFile + } + + Rectangle { + id:lowerPartition + height: dialogContainer.height * partition; width: dialogContainer.width + color: "transparent" + + Rectangle { + id: nameField + gradient: Gradient { + GradientStop { position: 0.0; color: "#806F6F6F" } + GradientStop { position: 1.0; color: "#136F6F6F" } + } + radius: 10 + anchors { centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15 } + height: parent.height-15 + width: parent.width -20 + border { color: "#4A4A4A"; width:1 } + + TextInput { + id: textInput + z:2 + anchors { bottom: parent.bottom; topMargin: 10; horizontalCenter: parent.horizontalCenter } + width: parent.width - 10 + height: parent.height -10 + font.pointSize: 40 + color: "lightsteelblue" + focus: true + } + Text { + id: textInstruction + anchors.centerIn: parent + text: "Select file name and press save or load" + font {pointSize: 11; weight: Font.Light; italic: true} + color: "lightblue" + z: 2 + opacity: (textInput.text == "") ? 1 : 0 + } + Text { + id:fieldLabel + anchors { top: parent.top; left: parent.left } + text: " file name: " + font { pointSize: 11; weight: Font.Light; italic: true } + color: "lightblue" + z:2 + } + MouseArea { + anchors.centerIn:parent + width: nameField.width; height: nameField.height + onClicked: { + textInput.text = "" + textInput.focus = true + textInput.forceFocus() + } + } + } + } + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/core/menuBar.qml b/examples/declarative/tutorials/gettingStarted/core/menuBar.qml new file mode 100644 index 00000000..49dc0e0d --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/menuBar.qml @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: menuBar + width: 1000; height:300 + color:"transparent" + property color fileColor: "plum" + property color editColor: "powderblue" + + property real partition: 1/10 + + Column { + anchors.fill: parent + //container for the header and the buttons + z: 1 + Rectangle { + id: labelList + height:menuBar.height*partition + width: menuBar.width + color: "beige" + gradient: Gradient { + GradientStop { position: 0.0; color: "#8C8F8C" } + GradientStop { position: 0.17; color: "#6A6D6A" } + GradientStop { position: 0.98;color: "#3F3F3F" } + GradientStop { position: 1.0; color: "#0e1B20" } + } + Text { + height: parent.height + anchors { right: labelRow.left ; verticalCenter: parent.bottom } + text: "menu: " + color: "lightblue" + font { weight: Font.Light; italic: true } + smooth: true + } + //row displays its children in a vertical row + Row { + id: labelRow + anchors.centerIn: parent + spacing:40 + Button { + id: fileButton + height: 20; width: 50 + label: "File" + buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) + scale: menuListView.currentIndex == 0? 1.25: 1 + labelSize: menuListView.currentIndex == 0? 16:12 + radius: 1 + smooth:true + //on a button click, change the list's currently selected item to FileMenu + onButtonClick: menuListView.currentIndex = 0 + gradient: Gradient { + GradientStop { position: 0.0; color: fileColor } + GradientStop { position: 1.0; color: "#136F6F6F" } + } + } + Button { + id: editButton + height: 20; width: 50 + buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9) + scale: menuListView.currentIndex == 1? 1.25: 1 + label: "Edit" + radius: 1 + labelSize: menuListView.currentIndex == 1? 16:12 + smooth:true + //on a button click, change the list's currently selected item to EditMenu + onButtonClick: menuListView.currentIndex = 1 + gradient: Gradient { + GradientStop { position: 0.0; color: editColor } + GradientStop { position: 1.0; color: "#136F6F6F" } + } + } + } + } + + //list view will display a model according to a delegate + ListView { + id: menuListView + width:menuBar.width; height: 9*menuBar.height*partition + + //the model contains the data + model: menuListModel + + //control the movement of the menu switching + snapMode: ListView.SnapOneItem + orientation: ListView.Horizontal + boundsBehavior: Flickable.StopAtBounds + flickDeceleration: 5000 + highlightFollowsCurrentItem: true + highlightMoveDuration:240 + highlightRangeMode: ListView.StrictlyEnforceRange + } + } + //a list of visual items already have delegates handling their display + VisualItemModel { + id: menuListModel + + FileMenu { + id:fileMenu + width: menuListView.width; height: menuListView.height + color: fileColor + } + EditMenu { + color: editColor + width: menuListView.width; height: menuListView.height + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/core/qmldir b/examples/declarative/tutorials/gettingStarted/core/qmldir new file mode 100644 index 00000000..32dc8071 --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/qmldir @@ -0,0 +1,9 @@ +Button ./button.qml +FileDialog ./fileDialog.qml +TextArea ./textArea.qml +TextEditor ./textEditor.qml +EditMenu ./editMenu.qml +MenuBar ./menuBar.qml +FileMenu ./fileMenu.qml + +plugin FileDialog ../plugins diff --git a/examples/declarative/tutorials/gettingStarted/core/textArea.qml b/examples/declarative/tutorials/gettingStarted/core/textArea.qml new file mode 100644 index 00000000..fc122523 --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/core/textArea.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id:textArea + + function paste() { textEdit.paste() } + function copy() { textEdit.copy() } + function selectAll() { textEdit.selectAll() } + + width :400; height:400 + + property color fontColor: "white" + property alias textContent: textEdit.text + Flickable { + id: flickArea + width: parent.width; height: parent.height + anchors.fill:parent + + boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.HorizontalFlick + interactive: true + //Will move the text Edit area to make the area visible when + //scrolled with keyboard strokes + function ensureVisible(r) { + if (contentX >= r.x) + contentX = r.x; + else if (contentX+width <= r.x+r.width) + contentX = r.x+r.width-width; + if (contentY >= r.y) + contentY = r.y; + else if (contentY+height <= r.y+r.height) + contentY = r.y+r.height-height; + } + + TextEdit { + id: textEdit + anchors.fill:parent + width:parent.width; height:parent.height + color:fontColor + focus: true + wrapMode: TextEdit.Wrap + font.pointSize:10 + onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) + selectByMouse: true + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/gettingStarted.pro b/examples/declarative/tutorials/gettingStarted/gettingStarted.pro index 4fb010b8..92a920a9 100644 --- a/examples/declarative/tutorials/gettingStarted/gettingStarted.pro +++ b/examples/declarative/tutorials/gettingStarted/gettingStarted.pro @@ -1,6 +1,7 @@ TEMPLATE = subdirs SUBDIRS = \ - filedialog\ + filedialog \ + parts/part5/filedialog EXAMPLE_FILES = \ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/core/button.qml deleted file mode 100644 index aaf619b5..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/button.qml +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -import QtQuick 1.0 - -Rectangle { - //identifier of the item - id: button - - //these properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - //attaches to the Text element's text content - property string label - property color textColor: buttonLabel.color - - //the color highlight when the mouse hovers on the rectangle - property color onHoverColor: "lightsteelblue" - property color borderColor: "transparent" - - //buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - property real labelSize: 14 - - //set appearance properties - radius: 6 - smooth: true - border { width: 2; color: borderColor } - width: buttonWidth; height: buttonHeight - - Text { - id: buttonLabel - anchors.centerIn: parent - text: label //bind the text to the parent's text - color: "#DCDCCC" - font.pointSize: labelSize - } - - //buttonClick() is callable and a signal handler, onButtonClick is automatically created - signal buttonClick() - - //define the clickable area to be the whole rectangle - MouseArea { - id: buttonMouseArea - anchors.fill: parent //stretch the area to the parent's dimension - onClicked: buttonClick() - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - } - - //change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor - //animate the color whenever the color property changes - Behavior on color { ColorAnimation{ duration: 55 } } - - //scale the button when pressed - scale: buttonMouseArea.pressed ? 1.1 : 1.00 - //Animate the scale property change - Behavior on scale { NumberAnimation{ duration: 55 } } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/editMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/core/editMenu.qml deleted file mode 100644 index cc8e345d..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/editMenu.qml +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -import QtQuick 1.0 - -Rectangle { - id: editMenu - height: 480; width:1000 - color: "powderblue" - property color buttonBorderColor: "#7A8182" - property color buttonFillColor: "#61BDCACD" - property string menuName:"Edit" - gradient: Gradient { - GradientStop { position: 0.0; color: "#6A7570" } - GradientStop { position: 1.0; color: Qt.darker("#6A7570") } - } - - Rectangle { - id:actionContainer - color:"transparent" - anchors.centerIn: parent - width: parent.width; height: parent.height / 5 - Row { - anchors.centerIn: parent - spacing: parent.width/9 - Button { - id: loadButton - buttonColor: buttonFillColor - label: "Copy" - labelSize: 16 - borderColor: buttonBorderColor - height: actionContainer.height; width: actionContainer.width/6 - onButtonClick: textArea.copy() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button { - id: saveButton - height: actionContainer.height; width: actionContainer.width/6 - buttonColor: buttonFillColor - label: "Paste" - borderColor: buttonBorderColor - labelSize: 16 - onButtonClick: textArea.paste() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button { - id: exitButton - label: "Select All" - height: actionContainer.height; width: actionContainer.width/6 - labelSize: 16 - buttonColor: buttonFillColor - borderColor:buttonBorderColor - onButtonClick: textArea.selectAll() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/fileDialog.qml b/examples/declarative/tutorials/gettingStarted/gsQml/core/fileDialog.qml deleted file mode 100644 index 9f50c73f..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/fileDialog.qml +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:dialog - height: 200 * partition; width: 200 - color: "transparent" - - signal selectChanged() - signal notifyRefresh() - onNotifyRefresh:dirView.model = directory.files - - property string selectedFile - property int selectedIndex: 0 - - Rectangle { - id: dirBox - radius: 10 - anchors.centerIn:parent - height: parent.height -15; width: parent.width -30 - - Rectangle { - id:header - height: parent.height*0.1; width: parent.width - radius:3 - z:1 - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - Text { - height: header.height; anchors.centerIn: header - text: "files:" - color: "lightblue" - font.weight: Font.Light - font.italic: true - } - } - GridView { - id:dirView - width:parent.width; height:parent.height*.9 - anchors.top: header.bottom - cellWidth: 100; cellHeight: 75 - model: directory.files - delegate: dirDelegate - clip: true - highlightMoveDuration: 40 - } - Component { - id: dirDelegate - Rectangle { - id:file - color: "transparent" - width: file.GridView.view.cellWidth; height: file.GridView.view.cellHeight - - Text { - id:fileName - width: parent.width - anchors.centerIn: parent - text: name - color: "#BDCACD" - font.weight: file.GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal - font.pointSize: file.GridView.view.currentIndex == index ? 12 : 10 - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - } - Rectangle { - id: selection - width: parent.width; height: parent.height - anchors.centerIn: parent - radius: 10 - smooth: true - scale: file.GridView.view.currentIndex == index ? 1 : 0.5 - opacity: file.GridView.view.currentIndex == index ? 1 : 0 - Text { - id: overlay - width: parent.width - anchors.centerIn: parent - text: name - color: "#696167" - font.weight: Font.DemiBold - font.pointSize: 12 - smooth: true - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - } - Behavior on opacity { NumberAnimation{ duration: 45 } } - Behavior on scale { NumberAnimation{ duration: 45 } } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) } - GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) } - } - border.color: "lightsteelblue" - border.width: 1 - } - MouseArea { - id:fileMouseArea - anchors.fill:parent - hoverEnabled: true - - onClicked: { - file.GridView.view.currentIndex = index - selectedFile = directory.files[index].name - selectChanged() - } - onEntered: { - fileName.color = "lightsteelblue" - fileName.font.weight = Font.DemiBold - } - onExited: { - fileName.font.weight = Font.Normal - fileName.color = "#BDCACD" - } - } - } - } - gradient: Gradient { - GradientStop { position: 0.0; color: "#A5333333" } - GradientStop { position: 1.0; color: "#03333333" } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/fileMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/core/fileMenu.qml deleted file mode 100644 index b2a34b9b..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/fileMenu.qml +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: fileMenu - height: 480; width:1000 - property color buttonBorderColor: "#7F8487" - property color buttonFillColor: "#8FBDCACD" - property string fileContent:directory.fileContent - - //the menuName is accessible from outside this QML file - property string menuName: "File" - - //used to divide the screen into parts. - property real partition: 1/3 - - color: "#6C646A" - gradient: Gradient { - GradientStop { position: 0.0; color: "#6C646A" } - GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") } - } - - Directory { - id:directory - filename: textInput.text - onDirectoryChanged:fileDialog.notifyRefresh() - } - - Rectangle { - id:actionContainer - - //make this rectangle invisible - color:"transparent" - anchors.left: parent.left - - //the height is a good proportion that creates more space at the top of - //the column of buttons - width: fileMenu.width * partition; height: fileMenu.height - - Column { - anchors.centerIn: parent - spacing: parent.height/32 - Button { - id: saveButton - label: "Save" - borderColor: buttonBorderColor - buttonColor: buttonFillColor - width: actionContainer.width/ 1.3 - height:actionContainer.height / 8 - labelSize:24 - onButtonClick: { - directory.fileContent = textArea.textContent - directory.filename = textInput.text - directory.saveFile() - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button { - id: loadButton - width: actionContainer.width/ 1.3 - height:actionContainer.height/ 8 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - label: "Load" - labelSize:24 - onButtonClick:{ - directory.filename = textInput.text - directory.loadFile() - textArea.textContent = directory.fileContent - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button { - id: newButton - width: actionContainer.width/ 1.3 - height: actionContainer.height/ 8 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - label: "New" - labelSize: 24 - onButtonClick:{ - textArea.textContent = "" - textInput.text = "" - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - - } - Rectangle { - id: space - width: actionContainer.width/ 1.3 - height: actionContainer.height / 16 - color: "transparent" - } - Button { - id: exitButton - width: actionContainer.width/ 1.3 - height: actionContainer.height/ 8 - label: "Exit" - labelSize: 24 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - onButtonClick: Qt.quit() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - } - } - Rectangle { - id:dialogContainer - - width: 2*fileMenu.width * partition; height: fileMenu.height - anchors.right:parent.right - color: "transparent" - - Column { - anchors.centerIn: parent - spacing: parent.height /640 - FileDialog { - id:fileDialog - height: 2*dialogContainer.height * partition - width: dialogContainer.width - onSelectChanged: textInput.text = selectedFile - } - - Rectangle { - id:lowerPartition - height: dialogContainer.height * partition; width: dialogContainer.width - color: "transparent" - - Rectangle { - id: nameField - gradient: Gradient { - GradientStop { position: 0.0; color: "#806F6F6F" } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - radius: 10 - anchors { centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15 } - height: parent.height-15 - width: parent.width -20 - border { color: "#4A4A4A"; width:1 } - - TextInput { - id: textInput - z:2 - anchors { bottom: parent.bottom; topMargin: 10; horizontalCenter: parent.horizontalCenter } - width: parent.width - 10 - height: parent.height -10 - font.pointSize: 40 - color: "lightsteelblue" - focus: true - } - Text { - id: textInstruction - anchors.centerIn: parent - text: "Select file name and press save or load" - font {pointSize: 11; weight: Font.Light; italic: true} - color: "lightblue" - z: 2 - opacity: (textInput.text == "") ? 1 : 0 - } - Text { - id:fieldLabel - anchors { top: parent.top; left: parent.left } - text: " file name: " - font { pointSize: 11; weight: Font.Light; italic: true } - color: "lightblue" - z:2 - } - MouseArea { - anchors.centerIn:parent - width: nameField.width; height: nameField.height - onClicked: { - textInput.text = "" - textInput.focus = true - textInput.forceFocus() - } - } - } - } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/menuBar.qml b/examples/declarative/tutorials/gettingStarted/gsQml/core/menuBar.qml deleted file mode 100644 index 49dc0e0d..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/menuBar.qml +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: menuBar - width: 1000; height:300 - color:"transparent" - property color fileColor: "plum" - property color editColor: "powderblue" - - property real partition: 1/10 - - Column { - anchors.fill: parent - //container for the header and the buttons - z: 1 - Rectangle { - id: labelList - height:menuBar.height*partition - width: menuBar.width - color: "beige" - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - Text { - height: parent.height - anchors { right: labelRow.left ; verticalCenter: parent.bottom } - text: "menu: " - color: "lightblue" - font { weight: Font.Light; italic: true } - smooth: true - } - //row displays its children in a vertical row - Row { - id: labelRow - anchors.centerIn: parent - spacing:40 - Button { - id: fileButton - height: 20; width: 50 - label: "File" - buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) - scale: menuListView.currentIndex == 0? 1.25: 1 - labelSize: menuListView.currentIndex == 0? 16:12 - radius: 1 - smooth:true - //on a button click, change the list's currently selected item to FileMenu - onButtonClick: menuListView.currentIndex = 0 - gradient: Gradient { - GradientStop { position: 0.0; color: fileColor } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - } - Button { - id: editButton - height: 20; width: 50 - buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9) - scale: menuListView.currentIndex == 1? 1.25: 1 - label: "Edit" - radius: 1 - labelSize: menuListView.currentIndex == 1? 16:12 - smooth:true - //on a button click, change the list's currently selected item to EditMenu - onButtonClick: menuListView.currentIndex = 1 - gradient: Gradient { - GradientStop { position: 0.0; color: editColor } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - } - } - } - - //list view will display a model according to a delegate - ListView { - id: menuListView - width:menuBar.width; height: 9*menuBar.height*partition - - //the model contains the data - model: menuListModel - - //control the movement of the menu switching - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 5000 - highlightFollowsCurrentItem: true - highlightMoveDuration:240 - highlightRangeMode: ListView.StrictlyEnforceRange - } - } - //a list of visual items already have delegates handling their display - VisualItemModel { - id: menuListModel - - FileMenu { - id:fileMenu - width: menuListView.width; height: menuListView.height - color: fileColor - } - EditMenu { - color: editColor - width: menuListView.width; height: menuListView.height - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/qmldir b/examples/declarative/tutorials/gettingStarted/gsQml/core/qmldir deleted file mode 100644 index 32dc8071..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/qmldir +++ /dev/null @@ -1,9 +0,0 @@ -Button ./button.qml -FileDialog ./fileDialog.qml -TextArea ./textArea.qml -TextEditor ./textEditor.qml -EditMenu ./editMenu.qml -MenuBar ./menuBar.qml -FileMenu ./fileMenu.qml - -plugin FileDialog ../plugins diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/core/textArea.qml b/examples/declarative/tutorials/gettingStarted/gsQml/core/textArea.qml deleted file mode 100644 index fc122523..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/core/textArea.qml +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:textArea - - function paste() { textEdit.paste() } - function copy() { textEdit.copy() } - function selectAll() { textEdit.selectAll() } - - width :400; height:400 - - property color fontColor: "white" - property alias textContent: textEdit.text - Flickable { - id: flickArea - width: parent.width; height: parent.height - anchors.fill:parent - - boundsBehavior: Flickable.StopAtBounds - flickableDirection: Flickable.HorizontalFlick - interactive: true - //Will move the text Edit area to make the area visible when - //scrolled with keyboard strokes - function ensureVisible(r) { - if (contentX >= r.x) - contentX = r.x; - else if (contentX+width <= r.x+r.width) - contentX = r.x+r.width-width; - if (contentY >= r.y) - contentY = r.y; - else if (contentY+height <= r.y+r.height) - contentY = r.y+r.height-height; - } - - TextEdit { - id: textEdit - anchors.fill:parent - width:parent.width; height:parent.height - color:fontColor - focus: true - wrapMode: TextEdit.Wrap - font.pointSize:10 - onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) - selectByMouse: true - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp deleted file mode 100644 index e1870e98..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "dialogPlugin.h" -#include "directory.h" -#include "file.h" -#include - -void DialogPlugin::registerTypes(const char *uri) -{ - //register the class Directory into QML as a "Directory" element version 1.0 - qmlRegisterType(uri, 1, 0, "Directory"); - qmlRegisterType(uri,1,0,"File"); -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h deleted file mode 100644 index 0a5bc9ef..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/dialogPlugin.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DIALOGPLUGIN_H -#define DIALOGPLUGIN_H - -#include - -class DialogPlugin : public QDeclarativeExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "filedialog.json") - - public: - //registerTypes is inherited from QDeclarativeExtensionPlugin - void registerTypes(const char *uri); - -}; - -#endif - diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.cpp b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.cpp deleted file mode 100644 index 8bde1e3a..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "directory.h" -#include - -/* -Directory constructor - -Initialize the saves directory and creates the file list -*/ -Directory::Directory(QObject *parent) : QObject(parent) -{ - m_dir.cd( QDir::currentPath() ); - - //go to the saved directory. if not found, create save directory - m_saveDir = "saves"; - if ( m_dir.cd(m_saveDir) == 0 ) { - m_dir.mkdir(m_saveDir); - m_dir.cd(m_saveDir); - } - m_filterList << "*.txt"; - refresh(); -} - -/* -Directory::filesNumber -Return the number of Files -*/ -int Directory::filesCount() const -{ - return m_fileList.size(); -} - -/* -Function called to append data onto list property -*/ -void appendFiles(QDeclarativeListProperty * property, File * file) -{ - Q_UNUSED(property); - Q_UNUSED(file); - //Do nothing. can't add to a directory using this method -} - -/* -Function called to retrieve file in the list using an index -*/ -File* fileAt(QDeclarativeListProperty * property, int index) -{ - return static_cast< QList *>(property->data)->at(index); -} - -/* -Returns the number of files in the list -*/ -int filesSize(QDeclarativeListProperty * property) -{ - return static_cast< QList *>(property->data)->size(); -} - -/* -Function called to empty the list property contents -*/ -void clearFilesPtr(QDeclarativeListProperty *property) -{ - return static_cast< QList *>(property->data)->clear(); -} - -/* -Returns the list of files as a QDeclarativeListProperty. -*/ -QDeclarativeListProperty Directory::files() -{ - refresh(); - return QDeclarativeListProperty( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr ); -} - -/* -Return the name of the currently selected file -*/ -QString Directory::filename() const -{ - return currentFile.name(); -} - -/* -Return the file's content as a string. -*/ -QString Directory::fileContent() const -{ - return m_fileContent; -} - -/* -Set the file name of the current file -*/ -void Directory::setFilename(const QString &str) -{ - if( str != currentFile.name() ) { - currentFile.setName(str); - emit filenameChanged(); - } -} - -/* -Set the content of the file as a string -*/ -void Directory::setFileContent(const QString &str) -{ - if(str != m_fileContent){ - m_fileContent = str; - emit fileContentChanged(); - } -} - -/* -Called from QML to save the file using the filename and file content. -Saving makes sure that the file has a .txt extension. -*/ -void Directory::saveFile() -{ - if(currentFile.name().size() == 0){ - qWarning()<< "Empty filename. no save"; - return; - } - QString extendedName = currentFile.name(); - if(!currentFile.name().endsWith(".txt")){ - extendedName.append(".txt"); - } - QFile file( m_dir.filePath(extendedName) ); - if ( file.open(QFile::WriteOnly | QFile::Truncate) ) { - QTextStream outStream(&file); - outStream << m_fileContent; - } - file.close(); - refresh(); - emit directoryChanged(); -} - -/* -Load the contents of a file. -Only loads files with a .txt extension -*/ -void Directory::loadFile() -{ - m_fileContent.clear(); - QString extendedName = currentFile.name(); - if( !currentFile.name().endsWith(".txt") ) { - extendedName.append(".txt"); - } - - QFile file( m_dir.filePath(extendedName) ); - if ( file.open(QFile::ReadOnly ) ) { - QTextStream inStream(&file); - - QString line; - do { - line = inStream.read(75); - m_fileContent.append(line); - } while ( !line.isNull() ) ; - } - file.close(); -} - -/* -Reloads the content of the files list. This is to ensure that the newly -created files are added onto the list. -*/ -void Directory::refresh() -{ - m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name); - m_fileList.clear(); - - File * file; - for(int i = 0; i < m_dirFiles.size() ; i ++) { - file = new File(); - - if( m_dirFiles.at(i).endsWith(".txt") ) { - QString name = m_dirFiles.at(i); - file->setName( name.remove(".txt",Qt::CaseSensitive) ); - } - else { - file->setName(m_dirFiles.at(i)); - } - m_fileList.append(file); - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.h b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.h deleted file mode 100644 index a39ca3b3..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/directory.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DIRECTORY_H -#define DIRECTORY_H - -#include "file.h" - -#include -#include -#include -#include -#include - -class Directory : public QObject { - - Q_OBJECT - - //number of files in the directory - Q_PROPERTY(int filesCount READ filesCount) - - //list property containing file names as QString - Q_PROPERTY(QDeclarativeListProperty files READ files CONSTANT ) - - //file name of the text file to read/write - Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged) - - //text content of the file - Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged) - - public: - Directory(QObject *parent = 0); - - //properties' read functions - int filesCount() const; - QString filename() const; - QString fileContent() const; - QDeclarativeListProperty files(); - - //properties' write functions - void setFilename(const QString &str); - void setFileContent(const QString &str); - - //accessible from QML - Q_INVOKABLE void saveFile(); - Q_INVOKABLE void loadFile(); - - signals: - void directoryChanged(); - void filenameChanged(); - void fileContentChanged(); - - private: - QDir m_dir; - QStringList m_dirFiles; - File currentFile; - QString m_saveDir; - QStringList m_filterList; - - //contains the file data in QString format - QString m_fileContent; - - //Registered to QML in a plugin. Accessible from QML as a property of Directory - QList m_fileList; - - //refresh content of the directory - void refresh(); -}; - -#endif diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.cpp b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.cpp deleted file mode 100644 index 27277961..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include "file.h" - -File::File(QObject *parent) : QObject(parent) -{ - m_name = ""; -} - -QString File::name() const{ - return m_name; -} -void File::setName(const QString &str){ - if(str != m_name){ - m_name = str; - emit nameChanged(); - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.h b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.h deleted file mode 100644 index f3afb6ff..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/file.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILE_H -#define FILE_H - - -#include -#include - -class File : public QObject{ - - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - - public: - File(QObject *parent = 0); - - QString name() const; - void setName(const QString &str); - - signals: - void nameChanged(); - - private: - QString m_name; -}; - -#endif diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.json b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.json deleted file mode 100644 index 0967ef42..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro deleted file mode 100644 index f25c490b..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/filedialog.pro +++ /dev/null @@ -1,17 +0,0 @@ -TEMPLATE = lib -CONFIG += plugin -QT += declarative - -DESTDIR += ../plugins -OBJECTS_DIR = tmp -MOC_DIR = tmp - -TARGET = FileDialog - -HEADERS += directory.h \ - file.h \ - dialogPlugin.h - -SOURCES += directory.cpp \ - file.cpp \ - dialogPlugin.cpp diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/qmldir b/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/qmldir deleted file mode 100644 index c2b27dad..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/filedialog/qmldir +++ /dev/null @@ -1 +0,0 @@ -plugin FileDialog plugins diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/images/arrow.png b/examples/declarative/tutorials/gettingStarted/gsQml/images/arrow.png deleted file mode 100644 index 14978c2e..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/images/arrow.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part0/Button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part0/Button.qml deleted file mode 100644 index b7eed442..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part0/Button.qml +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [document] -import QtQuick 1.0 - -Rectangle { - id: simplebutton - color: "grey" - width: 150; height: 75 - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: "button label" - } -} -//! [document] diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/Button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/Button.qml deleted file mode 100644 index f4b9d1a3..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/Button.qml +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - //identifier of the item - id: button - - property string label: "button label" - - //these properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - //the color highlight when the mouse hovers on the rectangle - property color onHoverColor: "gold" - property color borderColor: "white" - - //buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - //set appearance properties - radius: 10 - smooth: true - border{color: "white"; width: 3} - width: buttonWidth; height: buttonHeight - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: label - } - - //buttonClick() is callable and a signal handler, onButtonClick is automatically created - signal buttonClick() - onButtonClick: { - console.log(buttonLabel.text + " clicked" ) - } - - //define the clickable area to be the whole rectangle - MouseArea{ - id: buttonMouseArea - anchors.fill: parent //stretch the area to the parent's dimension - onClicked: buttonClick() - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - } - - //change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml deleted file mode 100644 index eabf00b4..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/EditMenu.qml +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: editMenu - height: 480; width:1000 - color: "powderblue" - property string menuName:"Edit" - - Rectangle{ - id:actionContainer - color:"transparent" - anchors.centerIn: parent - - width: parent.width; height: parent.height / 5 - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Cut" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Paste" - } - Button{ - id: exitButton - label: "Select All" - buttonColor: "darkgrey" - } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml deleted file mode 100644 index 96b22a7b..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/FileMenu.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: fileMenu - - //the menuName is accessible from outside this QML file - property string menuName: "File" - - //generous amount of screen space that will allow the buttons to fit - height: 480; width:1000 - - color: "#6C646A" - - //a sub-rectangle allows the flexibility of setting the row area - Rectangle{ - id:actionContainer - - //make this rectangle invisible - color:"transparent" - anchors.centerIn: parent - - //the height is a good proportion that creates more space at the top of the row of buttons - width: parent.width; height: parent.height / 5 - - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Load" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Save" - } - Button{ - id: exitButton - label: "Exit" - buttonColor: "darkgrey" - - //exit the application if the exitButton is clicked - onButtonClick:{ - Qt.quit() - } - } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml deleted file mode 100644 index 203d911a..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/SimpleButton.qml +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - //identifier of the item - id: simplebutton - - //the rectangle's fill color - color: "grey" - - //dimensions of the button - width: 150; height: 75 - - //A text element contains functionalities for creating texts - Text { - id: buttonLabel - - //center the text inside the parent - anchors.centerIn: parent - - //text property binds to the label displayed on the button - text: "button label" - } - - //define the clickable area to be the whole rectangle - MouseArea { - id: buttonMouseArea - anchors.fill: parent //anchor all sides of the mouse area to the rectangle's anchors - - //onClicked handles valid mouse button clicks - onClicked: console.log(buttonLabel.text + " clicked" ) - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png deleted file mode 100644 index aab64bcf..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_button.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png deleted file mode 100644 index d3ff66f2..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_editmenu.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png deleted file mode 100644 index f2e2b0d9..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_filemenu.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png deleted file mode 100644 index 21ce5092..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/pics/qml-texteditor1_simplebutton.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject deleted file mode 100644 index d4909f86..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part1/qml-texteditor.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/Button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/Button.qml deleted file mode 100644 index 78b38aee..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/Button.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - //identifier of the item - id: button - - property string label: "button label" - - //these properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - //the color highlight when the mouse hovers on the rectangle - property color onHoverColor: "gold" - property color borderColor: "white" - - //buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - //set appearance properties - radius:10 - smooth: true - border{color: "white"; width: 3} - width: buttonWidth; height: buttonHeight - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: label - } - - //buttonClick() is callable and a signal handler, onButtonClick is automatically created - signal buttonClick() - onButtonClick: { - console.log(buttonLabel.text + " clicked" ) - } - - //define the clickable area to be the whole rectangle - MouseArea{ - id: buttonMouseArea - anchors.fill: parent //stretch the area to the parent's dimension - onClicked: buttonClick() - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - - } - - //change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml deleted file mode 100644 index 5e825755..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/EditMenu.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: editMenu - height: 480; width:1000 - color: "powderblue" - property string menuName:"Edit" - - Rectangle{ - id:actionContainer - color:"transparent" - anchors.centerIn: parent - - width: parent.width; height: parent.height / 5 - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Cut" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Paste" - } - Button{ - id: exitButton - label: "Select All" - buttonColor: "darkgrey" - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml deleted file mode 100644 index d53e1f3d..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/FileMenu.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: fileMenu - - //the menuName is accessible from outside this QML file - property string menuName: "File" - - //generous amount of screen space that will allow the buttons to fit - height: 480; width:1000 - - color: "#6C646A" - - //a sub-rectangle allows the flexibility of setting the row area - Rectangle{ - id:actionContainer - - //make this rectangle invisible - color:"transparent" - anchors.centerIn: parent - - //the height is a good proportion that creates more space at the top of the row of buttons - width: parent.width; height: parent.height / 5 - - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Load" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Save" - } - Button{ - id: exitButton - label: "Exit" - buttonColor: "darkgrey" - - //exit the application if the exitButton is clicked - onButtonClick:{ - Qt.quit() - } - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml deleted file mode 100644 index d2131eeb..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/MenuBar.qml +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: menuBar - width: 1000 - height:300 - - property color fileColor: "thistle" - property color editColor: "powderblue" - - //container for the header and the buttons - Rectangle{ - - id: labelList - height:parent.height/10 - width: parent.width - color: "steelblue" - - //default z is 0, items with higher z values are shown on top of items with lower z values - z: 1 - - //row displays its children in a vertical row - Row{ - anchors.centerIn: parent - spacing:40 - Button{ - height: 20 - width: 50 - label: "File" - id: fileButton - buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) - scale: menuListView.currentIndex == 0? 1.25: 1 - radius: 1 - - //on a button click, change the list's currently selected item to FileMenu - onButtonClick: { - menuListView.currentIndex = 0 - } - } - Button{ - height: 20 - width: 50 - id: editButton - buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5) - scale: menuListView.currentIndex == 1? 1.25: 1 - label: "Edit" - radius: 1 - - //on a button click, change the list's currently selected item to EditMenu - onButtonClick: { - menuListView.currentIndex = 1 - } - - - } - - - } - } - - //a list of visual items already have delegates handling their display - VisualItemModel{ - id: menuListModel - - FileMenu{ - width: menuListView.width - height: menuBar.height - color: fileColor - } - EditMenu{ - color: editColor - width: menuListView.width - height: menuBar.height - - } - } - - //list view will display a model according to a delegate - ListView{ - id: menuListView - anchors.fill:parent - anchors.bottom: parent.bottom - width:parent.width - height: parent.height - - //the model contains the data - model: menuListModel - - //control the movement of the menu switching - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 5000 - highlightFollowsCurrentItem: true - highlightMoveDuration:240 - highlightRangeMode: ListView.StrictlyEnforceRange - } - - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png deleted file mode 100644 index da959a34..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/pics/qml-texteditor2_menubar.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject deleted file mode 100644 index d4909f86..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part2/qml-texteditor2.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/Button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/Button.qml deleted file mode 100644 index 78b38aee..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/Button.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - //identifier of the item - id: button - - property string label: "button label" - - //these properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - //the color highlight when the mouse hovers on the rectangle - property color onHoverColor: "gold" - property color borderColor: "white" - - //buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - //set appearance properties - radius:10 - smooth: true - border{color: "white"; width: 3} - width: buttonWidth; height: buttonHeight - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: label - } - - //buttonClick() is callable and a signal handler, onButtonClick is automatically created - signal buttonClick() - onButtonClick: { - console.log(buttonLabel.text + " clicked" ) - } - - //define the clickable area to be the whole rectangle - MouseArea{ - id: buttonMouseArea - anchors.fill: parent //stretch the area to the parent's dimension - onClicked: buttonClick() - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - - } - - //change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml deleted file mode 100644 index 5e825755..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/EditMenu.qml +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: editMenu - height: 480; width:1000 - color: "powderblue" - property string menuName:"Edit" - - Rectangle{ - id:actionContainer - color:"transparent" - anchors.centerIn: parent - - width: parent.width; height: parent.height / 5 - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Cut" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Paste" - } - Button{ - id: exitButton - label: "Select All" - buttonColor: "darkgrey" - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml deleted file mode 100644 index d53e1f3d..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/FileMenu.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: fileMenu - - //the menuName is accessible from outside this QML file - property string menuName: "File" - - //generous amount of screen space that will allow the buttons to fit - height: 480; width:1000 - - color: "#6C646A" - - //a sub-rectangle allows the flexibility of setting the row area - Rectangle{ - id:actionContainer - - //make this rectangle invisible - color:"transparent" - anchors.centerIn: parent - - //the height is a good proportion that creates more space at the top of the row of buttons - width: parent.width; height: parent.height / 5 - - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Load" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Save" - } - Button{ - id: exitButton - label: "Exit" - buttonColor: "darkgrey" - - //exit the application if the exitButton is clicked - onButtonClick:{ - Qt.quit() - } - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml deleted file mode 100644 index d2131eeb..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/MenuBar.qml +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: menuBar - width: 1000 - height:300 - - property color fileColor: "thistle" - property color editColor: "powderblue" - - //container for the header and the buttons - Rectangle{ - - id: labelList - height:parent.height/10 - width: parent.width - color: "steelblue" - - //default z is 0, items with higher z values are shown on top of items with lower z values - z: 1 - - //row displays its children in a vertical row - Row{ - anchors.centerIn: parent - spacing:40 - Button{ - height: 20 - width: 50 - label: "File" - id: fileButton - buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) - scale: menuListView.currentIndex == 0? 1.25: 1 - radius: 1 - - //on a button click, change the list's currently selected item to FileMenu - onButtonClick: { - menuListView.currentIndex = 0 - } - } - Button{ - height: 20 - width: 50 - id: editButton - buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5) - scale: menuListView.currentIndex == 1? 1.25: 1 - label: "Edit" - radius: 1 - - //on a button click, change the list's currently selected item to EditMenu - onButtonClick: { - menuListView.currentIndex = 1 - } - - - } - - - } - } - - //a list of visual items already have delegates handling their display - VisualItemModel{ - id: menuListModel - - FileMenu{ - width: menuListView.width - height: menuBar.height - color: fileColor - } - EditMenu{ - color: editColor - width: menuListView.width - height: menuBar.height - - } - } - - //list view will display a model according to a delegate - ListView{ - id: menuListView - anchors.fill:parent - anchors.bottom: parent.bottom - width:parent.width - height: parent.height - - //the model contains the data - model: menuListModel - - //control the movement of the menu switching - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 5000 - highlightFollowsCurrentItem: true - highlightMoveDuration:240 - highlightRangeMode: ListView.StrictlyEnforceRange - } - - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml deleted file mode 100644 index ece97fec..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextArea.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:textArea - - width :400 - height:400 - color: "white" - - Flickable{ - id: flickArea - - width: parent.width - height: parent.height - anchors.fill:parent - - function ensureVisible(r){ - if (contentX >= r.x) - contentX = r.x; - else if (contentX+width <= r.x+r.width) - contentX = r.x+r.width-width; - if (contentY >= r.y) - contentY = r.y; - else if (contentY+height <= r.y+r.height) - contentY = r.y+r.height-height; - } - - TextEdit{ - id: textEditor - anchors.fill:parent - width:parent.width; height:parent.height - color:"midnightblue" - focus: true - - wrapMode: TextEdit.Wrap - - onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml deleted file mode 100644 index a535c0fc..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/TextEditor.qml +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - id: screen - width: 1000; height: 1000 - border.color:"black" - //the screen is partitioned into the MenuBar and TextArea. 1/3 of the screen is assigned to the MenuBar - property int partition: height/3 - - MenuBar{ - id:menuBar - height: partition - width:parent.width - z: 1 - } - - - TextArea{ - id:textArea - anchors.bottom:parent.bottom - y: partition - color: "azure" - height: partition*2 - width:parent.width - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png deleted file mode 100644 index 14978c2e..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/images/arrow.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png deleted file mode 100644 index d0623b5a..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/pics/qml-texteditor3_texteditor.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject deleted file mode 100644 index d4909f86..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part3/qml-texteditor3.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/Button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/Button.qml deleted file mode 100644 index 2ca436ba..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/Button.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - //identifier of the item - id: button - - //these properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - //attaches to the Text element's text content - property string label - property color textColor: buttonLabel.color - - //the color highlight when the mouse hovers on the rectangle - property color onHoverColor: "gold" - property color borderColor: "white" - - //buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - //set appearance properties - radius:10 - smooth: true - border.color: "white" - border.width: 3 - width: buttonWidth; height: buttonHeight - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: label //"button label" //bind the text to the parent's text - } - - //buttonClick() is callable and a signal handler, onButtonClick is automatically created - signal buttonClick() - onButtonClick: { - console.log(buttonLabel.text + " clicked" ) - } - - //define the clickable area to be the whole rectangle - MouseArea{ - id: buttonMouseArea - anchors.fill: parent //stretch the area to the parent's dimension - onClicked: buttonClick() - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - - } - - //change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor - //animate the color whenever the color property changes - Behavior on color { ColorAnimation{ duration: 55} } - - //scale the button when pressed - scale: buttonMouseArea.pressed ? 1.1 : 1.00 - //Animate the scale property change - Behavior on scale { NumberAnimation{ duration: 55} } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml deleted file mode 100644 index 64345ebd..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/EditMenu.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: editMenu - height: 480; width:1000 - color: "powderblue" - property string menuName:"Edit" - gradient: Gradient{ - GradientStop { position: 0.0; color: "#6A6F70" } - GradientStop { position: 1.0; color: Qt.darker("#6A6D67") } - } - - Rectangle{ - id:actionContainer - color:"transparent" - anchors.centerIn: parent - - width: parent.width; height: parent.height / 5 - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Cut" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Paste" - } - Button{ - id: exitButton - label: "Select All" - buttonColor: "darkgrey" - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml deleted file mode 100644 index 20acaa8a..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/FileMenu.qml +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: fileMenu - - //the menuName is accessible from outside this QML file - property string menuName: "File" - - //generous amount of screen space that will allow the buttons to fit - height: 480; width:1000 - - color: "#6C646A" - gradient: Gradient{ - GradientStop { position: 0.0; color: "#6C646A" } - GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") } - } - - //a sub-rectangle allows the flexibility of setting the row area - Rectangle{ - id:actionContainer - - //make this rectangle invisible - color:"transparent" - anchors.centerIn: parent - - //the height is a good proportion that creates more space at the top of the row of buttons - width: parent.width; height: parent.height / 5 - - Row{ - anchors.centerIn: parent - spacing: parent.width/6 - Button{ - id: loadButton - buttonColor: "lightgrey" - label: "Load" - } - - Button{ - buttonColor: "grey" - id: saveButton - label: "Save" - } - Button{ - id: exitButton - label: "Exit" - buttonColor: "darkgrey" - - //exit the application if the exitButton is clicked - onButtonClick:{ - Qt.quit() - } - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml deleted file mode 100644 index 9c027fc9..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/MenuBar.qml +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: menuBar - width: 1000 - height:300 - - property color fileColor: "plum" - property color editColor: "powderblue" - - //container for the header and the buttons - Rectangle{ - - id: labelList - height:parent.height/10 - width: parent.width - color: "beige" - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - - //default z is 0, items with higher z values are shown on top of items with lower z values - z: 1 - - //row displays its children in a vertical row - Row{ - anchors.centerIn: parent - spacing:40 - Button{ - height: 20 - width: 50 - label: "File" - id: fileButton - buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) - scale: menuListView.currentIndex == 0? 1.25: 1 - radius: 1 - - //on a button click, change the list's currently selected item to FileMenu - onButtonClick: { - menuListView.currentIndex = 0 - } - } - Button{ - height: 20 - width: 50 - id: editButton - buttonColor : menuListView.currentIndex == 1? editColor : Qt.darker(editColor, 1.5) - scale: menuListView.currentIndex == 1? 1.25: 1 - label: "Edit" - radius: 1 - - //on a button click, change the list's currently selected item to EditMenu - onButtonClick: { - menuListView.currentIndex = 1 - } - - - } - - - } - } - - //a list of visual items already have delegates handling their display - VisualItemModel{ - id: menuListModel - - FileMenu{ - width: menuListView.width - height: menuBar.height - color: fileColor - } - EditMenu{ - color: editColor - width: menuListView.width - height: menuBar.height - - } - } - - //list view will display a model according to a delegate - ListView{ - id: menuListView - anchors.fill:parent - anchors.bottom: parent.bottom - width:parent.width - height: parent.height - - //the model contains the data - model: menuListModel - - //control the movement of the menu switching - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 5000 - highlightFollowsCurrentItem: true - highlightMoveDuration:240 - highlightRangeMode: ListView.StrictlyEnforceRange - } - - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml deleted file mode 100644 index 384a6c52..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/SimpleButton.qml +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: simplebutton - color: "grey" - width: 150; height: 75 - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: "button label" - } - - MouseArea{ - id: buttonMouseArea - anchors.fill: parent - onClicked: console.log(buttonLabel.text + " clicked" ) - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml deleted file mode 100644 index 1e33bec9..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextArea.qml +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:textArea - - width :400 - height:400 - property color fontColor: "white" - - Flickable{ - id: flickArea - - width: parent.width - height: parent.height - anchors.fill:parent - - function ensureVisible(r){ - if (contentX >= r.x) - contentX = r.x; - else if (contentX+width <= r.x+r.width) - contentX = r.x+r.width-width; - if (contentY >= r.y) - contentY = r.y; - else if (contentY+height <= r.y+r.height) - contentY = r.y+r.height-height; - } - - TextEdit{ - id: textEditor - anchors.fill:parent - width:parent.width; height:parent.height - color:fontColor - focus: true - - wrapMode: TextEdit.Wrap - - onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml deleted file mode 100644 index 0fdce356..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/TextEditor.qml +++ /dev/null @@ -1,146 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: screen - width: 1000; height: 1000 - property int partition: height/3 - state: "DRAWER_CLOSED" - - - //Item 1: MenuBar on the top portion of the screen - MenuBar{ - id:menuBar - height: partition - //anchors.top:parent.top - width:parent.width - z:1 - } - - - //Item 2: The editable text area - TextArea{ - id:textArea - y:drawer.height - border.color: Qt.darker(color, 1.4) - border.width: 2 - color: "#3F3F3F" - fontColor: "#DCDCCC" - height: partition*2 - width:parent.width - } - - //Item 3: The drawer handle - Rectangle{ - id:drawer - height:15 - width: parent.width - border.color : "#6A6D6A" - border.width: 1 - - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.77; color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#6A6D6A" } - } - - Image{ - id: arrowIcon - source: "images/arrow.png" - anchors.horizontalCenter: parent.horizontalCenter - - Behavior{NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }} - } - - MouseArea{ - id: drawerMouseArea - anchors.fill:parent - onClicked:{ - if (screen.state == "DRAWER_CLOSED"){ - screen.state = "DRAWER_OPEN" - console.log("drawer OPEN") - } - else if (screen.state == "DRAWER_OPEN"){ - screen.state = "DRAWER_CLOSED" - console.log("drawer closed") - } - } - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = Qt.lighter("#6A6D6A") - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = "#6A6D6A" - } - - } - states:[ - State{ - name: "DRAWER_OPEN" - PropertyChanges { target: menuBar; y:0} - PropertyChanges { target: textArea; y: partition + drawer.height} - PropertyChanges { target: drawer; y: partition} - PropertyChanges { target: arrowIcon; rotation: 180} - }, - State{ - name: "DRAWER_CLOSED" - PropertyChanges { target: menuBar; y:-partition} - PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height} - PropertyChanges { target: drawer; y: 0} - PropertyChanges { target: arrowIcon; rotation: 0} - } - - ] - transitions: [ - Transition{ - to: "*" - NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo } - NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutExpo } - NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutExpo } - } - - ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png deleted file mode 100644 index 14978c2e..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/images/arrow.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png deleted file mode 100644 index a195fb87..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/pics/qml-texteditor4_texteditor.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject deleted file mode 100644 index d4909f86..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part4/qml-texteditor4.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - // importPaths: [ " ../exampleplugin " ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml deleted file mode 100644 index 7c63d752..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/TextEditor.qml +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "core" - -Rectangle { - id: screen - width: 1000; height: 1000 - property int partition: height/3 - state: "DRAWER_CLOSED" - - //Item 1: MenuBar on the top portion of the screen - MenuBar{ - id:menuBar - height: screen.partition; width: screen.width - z:1 - } - //Item 2: The editable text area - TextArea{ - id:textArea - y:drawer.height - color: "#3F3F3F" - fontColor: "#DCDCCC" - height: partition*2; width:parent.width - } - //Item 3: The drawer handle - Rectangle{ - id:drawer - height:15; width: parent.width - border.color : "#6A6D6A" - border.width: 1 - z:1 - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.77; color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#6A6D6A" } - } - Image{ - id: arrowIcon - source: "images/arrow.png" - anchors.horizontalCenter: parent.horizontalCenter - - Behavior{NumberAnimation{property: "rotation";easing.type: Easing.OutExpo }} - } - - MouseArea{ - id: drawerMouseArea - anchors.fill:parent - hoverEnabled: true - onEntered: parent.border.color = Qt.lighter("#6A6D6A") - onExited: parent.border.color = "#6A6D6A" - onClicked:{ - if (screen.state == "DRAWER_CLOSED"){ - screen.state = "DRAWER_OPEN" - } - else if (screen.state == "DRAWER_OPEN"){ - screen.state = "DRAWER_CLOSED" - } - } - } - } - - states:[ - State{ - name: "DRAWER_OPEN" - PropertyChanges { target: menuBar; y: 0} - PropertyChanges { target: textArea; y: partition + drawer.height} - PropertyChanges { target: drawer; y: partition} - PropertyChanges { target: arrowIcon; rotation: 180} - }, - State{ - name: "DRAWER_CLOSED" - PropertyChanges { target: menuBar; y:-height; } - PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height} - PropertyChanges { target: drawer; y: 0} - PropertyChanges { target: arrowIcon; rotation: 0} - } - ] - - transitions: [ - Transition{ - to: "*" - NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo } - NumberAnimation { target: menuBar; properties: "y"; duration: 100;easing.type: Easing.OutExpo } - NumberAnimation { target: drawer; properties: "y"; duration: 100;easing.type: Easing.OutExpo } - } - ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml deleted file mode 100644 index eca94dea..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/Button.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - - //identifier of the item - id: button - - //these properties act as constants, useable outside this QML file - property int buttonHeight: 75 - property int buttonWidth: 150 - - //attaches to the Text element's text content - property string label - property color textColor: buttonLabel.color - - //the color highlight when the mouse hovers on the rectangle - property color onHoverColor: "lightsteelblue" - property color borderColor: "transparent" - - //buttonColor is set to the button's main color - property color buttonColor: "lightblue" - - property real labelSize: 14 - //set appearance properties - radius:6 - smooth: true - border.width: 2 - border.color: borderColor - width: buttonWidth; height: buttonHeight - - Text{ - id: buttonLabel - anchors.centerIn: parent - text: label //bind the text to the parent's text - color: "#DCDCCC" - font.pointSize: labelSize - } - - //buttonClick() is callable and a signal handler, onButtonClick is automatically created - signal buttonClick() - - //define the clickable area to be the whole rectangle - MouseArea{ - id: buttonMouseArea - anchors.fill: parent //stretch the area to the parent's dimension - onClicked: buttonClick() - - //if true, then onEntered and onExited called if mouse hovers in the mouse area - //if false, a button must be clicked to detect the mouse hover - hoverEnabled: true - - //display a border if the mouse hovers on the button mouse area - onEntered: parent.border.color = onHoverColor - //remove the border if the mouse exits the button mouse area - onExited: parent.border.color = borderColor - - } - - //change the color of the button when pressed - color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor - //animate the color whenever the color property changes - Behavior on color { ColorAnimation{ duration: 55} } - - //scale the button when pressed - scale: buttonMouseArea.pressed ? 1.1 : 1.00 - //Animate the scale property change - Behavior on scale { NumberAnimation{ duration: 55} } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml deleted file mode 100644 index 7d535192..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/EditMenu.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: editMenu - height: 480; width:1000 - color: "powderblue" - property color buttonBorderColor: "#7A8182" - property color buttonFillColor: "#61BDCACD" - property string menuName:"Edit" - - gradient: Gradient{ - GradientStop { position: 0.0; color: "#6A7570" } - GradientStop { position: 1.0; color: Qt.darker("#6A7570") } - } - - Rectangle{ - id:actionContainer - color:"transparent" - anchors.centerIn: parent - width: parent.width; height: parent.height / 5 - Row{ - anchors.centerIn: parent - spacing: parent.width/9 - Button{ - id: loadButton - buttonColor: buttonFillColor - label: "Copy" - labelSize:16 - borderColor:buttonBorderColor - height: actionContainer.height - width: actionContainer.width/6 - onButtonClick:textArea.copy() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - - Button{ - id: saveButton - height: actionContainer.height - width: actionContainer.width/6 - buttonColor: buttonFillColor - label: "Paste" - borderColor:buttonBorderColor - labelSize:16 - onButtonClick:textArea.paste() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button{ - id: exitButton - label: "Select All" - height: actionContainer.height - width: actionContainer.width/6 - labelSize:16 - buttonColor: buttonFillColor - borderColor:buttonBorderColor - onButtonClick:textArea.selectAll() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - } - } - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml deleted file mode 100644 index af76cfe1..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileDialog.qml +++ /dev/null @@ -1,170 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:dialog - height: 200 * partition; width: 200 - color: "transparent" - - signal selectChanged() - signal notifyRefresh() - onNotifyRefresh:dirView.model = directory.files - - property string selectedFile - property int selectedIndex: 0 - - Rectangle{ - id: dirBox - radius: 10 - anchors.centerIn:parent - height: parent.height -15; width: parent.width -30 - - Rectangle{ - id:header - height:parent.height*0.1 - width: parent.width - radius:3 - z:1 - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - Text{ - height: header.height - anchors.centerIn: header - text: "files:" - color: "lightblue" - font.weight: Font.Light - font.italic: true - } - } - GridView{ - id:dirView - width:parent.width - height:parent.height*.9 - anchors.top: header.bottom - cellWidth: 100 - cellHeight: 75 -// highlight: Rectangle { width:cellWidth; height: cellHeight; color: "lightsteelblue" ;radius: 13} - model: directory.files - delegate: dirDelegate - clip: true - highlightMoveDuration:40 - } - - Component{ - id:dirDelegate - - Rectangle{ - id:file - color: "transparent" - width: file.GridView.view.cellWidth; height: file.GridView.view.cellHeight - - Text{ - id:fileName - width: parent.width - anchors.centerIn:parent - text: name - color: "#BDCACD" - font.weight: file.GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal - font.pointSize: file.GridView.view.currentIndex == index ? 12 : 10 - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - } - Rectangle{ - id:selection - width:parent.width; height:parent.height - anchors.centerIn: parent - radius: 10 - smooth: true - scale: file.GridView.view.currentIndex == index ? 1 : 0.5 - opacity: file.GridView.view.currentIndex == index ? 1 : 0 - Text{ - id:overlay - width: parent.width - anchors.centerIn:parent - text: name - color: "#696167" - font.weight: Font.DemiBold - font.pointSize: 12 - smooth:true - elide: Text.ElideMiddle - horizontalAlignment: Text.AlignHCenter - } - Behavior on opacity{ NumberAnimation{ duration: 45} } - Behavior on scale { NumberAnimation{ duration: 45} } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) } - GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) } - } - border.color:"lightsteelblue" - border.width:1 - } - MouseArea{ - id:fileMouseArea - anchors.fill:parent - hoverEnabled: true - - onClicked:{ - file.GridView.view.currentIndex = index - selectedFile = directory.files[index].name - selectChanged() - } - onEntered:{ - fileName.color = "lightsteelblue" - fileName.font.weight = Font.DemiBold - } - onExited: { - fileName.font.weight = Font.Normal - fileName.color = "#BDCACD" - } - } - } - } - gradient: Gradient{ - GradientStop { position: 0.0; color: "#A5333333" } - GradientStop { position: 1.0; color: "#03333333" } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml deleted file mode 100644 index 9ae8d1d9..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/FileMenu.qml +++ /dev/null @@ -1,232 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: fileMenu - height: 480; width:1000 - property color buttonBorderColor: "#7F8487" - property color buttonFillColor: "#8FBDCACD" - property string fileContent:directory.fileContent - - //the menuName is accessible from outside this QML file - property string menuName: "File" - - //used to divide the screen into parts. - property real partition: 1/3 - - color: "#6C646A" - gradient: Gradient{ - GradientStop { position: 0.0; color: "#6C646A" } - GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") } - } - - Directory{ - id:directory - filename: textInput.text - onDirectoryChanged:fileDialog.notifyRefresh() - } - - Rectangle{ - id:actionContainer - - //make this rectangle invisible - color:"transparent" - anchors.left: parent.left - - //the height is a good proportion that creates more space at the top of the column of buttons - width: fileMenu.width * partition; height: fileMenu.height - - Column{ - anchors.centerIn: parent - spacing: parent.height/32 - Button{ - id: saveButton - label: "Save" - borderColor: buttonBorderColor - buttonColor: buttonFillColor - width: actionContainer.width/ 1.3 - height:actionContainer.height / 8 - labelSize:24 - onButtonClick:{ - directory.fileContent = textArea.textContent - directory.filename = textInput.text - directory.saveFile() - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - - } - Button{ - id: loadButton - width: actionContainer.width/ 1.3 - height:actionContainer.height/ 8 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - label: "Load" - labelSize:24 - onButtonClick:{ - directory.filename = textInput.text - directory.loadFile() - textArea.textContent = directory.fileContent - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - Button{ - id: newButton - width: actionContainer.width/ 1.3 - height:actionContainer.height/ 8 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - label: "New" - labelSize:24 - onButtonClick:{ - textArea.textContent = "" - textInput.text = "" - } - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - - } - Rectangle{ - id: space - width: actionContainer.width/ 1.3 - height:actionContainer.height / 16 - color:"transparent" - } - Button{ - id: exitButton - width: actionContainer.width/ 1.3 - height:actionContainer.height/ 8 - label: "Exit" - labelSize:24 - buttonColor: buttonFillColor - borderColor: buttonBorderColor - onButtonClick:Qt.quit() - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } - GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } - } - } - } - } - - Rectangle{ - id:dialogContainer - - width: 2*fileMenu.width * partition; height: fileMenu.height - anchors.right:parent.right - color:"transparent" - - Column { - anchors.centerIn: parent - spacing: parent.height /640 - FileDialog{ - id:fileDialog - height: 2*dialogContainer.height * partition; width: dialogContainer.width - onSelectChanged: textInput.text = selectedFile - } - - Rectangle{ - id:lowerPartition - height: dialogContainer.height * partition; width: dialogContainer.width - color: "transparent" - - Rectangle{ - id: nameField - gradient: Gradient{ - GradientStop { position: 0.0; color: "#806F6F6F" } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - - radius: 10 - anchors {centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15} - height: parent.height-15; width: parent.width -20 - border {color:"#4A4A4A"; width:1} - - TextInput{ - id: textInput - z:2 - anchors {bottom: parent.bottom; topMargin: 10; horizontalCenter:parent.horizontalCenter} - width: parent.width - 10 - height: parent.height -10 - font.pointSize: 40 - color:"lightsteelblue" - focus:true - } - Text{ - id: textInstruction - anchors.centerIn:parent - text: "Select file name and press save or load" - font {pointSize: 11; weight:Font.Light; italic: true} - color: "lightblue" - z:2 - opacity: (textInput.text == "") ? 1: 0 - } - Text{ - id:fieldLabel - anchors {top: parent.top; left: parent.left} - text: " file name: " - font {pointSize: 11; weight: Font.Light; italic: true} - color: "lightblue" - z:2 - } - MouseArea{ - anchors.centerIn:parent - width: nameField.width; height: nameField.height - onClicked:{ - textInput.text = "" - textInput.focus = true - textInput.forceFocus() - } - } - } - } - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml deleted file mode 100644 index 23310757..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/MenuBar.qml +++ /dev/null @@ -1,148 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id: menuBar - width: 1000; height:300 - color:"transparent" - property color fileColor: "plum" - property color editColor: "powderblue" - - property real partition: 1/10 - - Column{ - anchors.fill: parent - //container for the header and the buttons - z: 1 - Rectangle{ - id: labelList - height:menuBar.height*partition - width: menuBar.width - color: "beige" - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.98;color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#0e1B20" } - } - Text{ - height: parent.height - anchors {right: labelRow.left ; verticalCenter: parent.bottom} - text: "menu: " - color: "lightblue" - font {weight: Font.Light; italic: true} - smooth: true - } - - //row displays its children in a vertical row - Row{ - id: labelRow - anchors.centerIn: parent - spacing:40 - Button{ - id: fileButton - height: 20; width: 50 - label: "File" - buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) - scale: menuListView.currentIndex == 0? 1.25: 1 - labelSize: menuListView.currentIndex == 0? 16:12 - radius: 1 - smooth:true - //on a button click, change the list's currently selected item to FileMenu - onButtonClick: menuListView.currentIndex = 0 - gradient: Gradient{ - GradientStop { position: 0.0; color: fileColor } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - } - Button{ - id: editButton - height: 20; width: 50 - buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9) - scale: menuListView.currentIndex == 1? 1.25: 1 - label: "Edit" - radius: 1 - labelSize: menuListView.currentIndex == 1? 16:12 - smooth:true - //on a button click, change the list's currently selected item to EditMenu - onButtonClick: menuListView.currentIndex = 1 - gradient: Gradient{ - GradientStop { position: 0.0; color: editColor } - GradientStop { position: 1.0; color: "#136F6F6F" } - } - } - } - } - - //list view will display a model according to a delegate - ListView{ - id: menuListView - width:menuBar.width; height: 9*menuBar.height*partition - - //the model contains the data - model: menuListModel - - //control the movement of the menu switching - snapMode: ListView.SnapOneItem - orientation: ListView.Horizontal - boundsBehavior: Flickable.StopAtBounds - flickDeceleration: 5000 - highlightFollowsCurrentItem: true - highlightMoveDuration:240 - highlightRangeMode: ListView.StrictlyEnforceRange - } - } - //a list of visual items already have delegates handling their display - VisualItemModel{ - id: menuListModel - - FileMenu{ - id:fileMenu - width: menuListView.width; height: menuListView.height - color: fileColor - } - EditMenu{ - color: editColor - width: menuListView.width; height: menuListView.height - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml deleted file mode 100644 index 6ae50d75..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/TextArea.qml +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 - -Rectangle { - id:textArea - - function paste(){ textEdit.paste()} - function copy() { textEdit.copy() } - function selectAll() { textEdit.selectAll() } - - width :400; height:400 - - property color fontColor: "white" - property alias textContent: textEdit.text - Flickable{ - id: flickArea - width: parent.width; height: parent.height - anchors.fill:parent - - boundsBehavior: Flickable.StopAtBounds - flickableDirection: Flickable.HorizontalFlick - interactive: true - //Will move the text Edit area to make the area visible when scrolled with keyboard strokes - function ensureVisible(r){ - if (contentX >= r.x) - contentX = r.x; - else if (contentX+width <= r.x+r.width) - contentX = r.x+r.width-width; - if (contentY >= r.y) - contentY = r.y; - else if (contentY+height <= r.y+r.height) - contentY = r.y+r.height-height; - } - - TextEdit{ - id: textEdit - anchors.fill:parent - width:parent.width; height:parent.height - color:fontColor - focus: true - wrapMode: TextEdit.Wrap - font.pointSize:10 - onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) - selectByMouse: true - } - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir deleted file mode 100644 index 3f22778a..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/core/qmldir +++ /dev/null @@ -1,13 +0,0 @@ - -Button ./Button.qml -FileDialog ./FileDialog.qml -TextArea ./TextArea.qml -TextEditor ./TextEditor.qml -EditMenu ./EditMenu.qml -MenuBar ./MenuBar.qml - -plugin FileDialog ../plugins - - - - diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp deleted file mode 100644 index 452124f5..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "dialogPlugin.h" -#include "directory.h" -#include "file.h" -#include - -void DialogPlugin::registerTypes(const char *uri){ - - //register the class Directory into QML as a "Directory" element version 1.0 - qmlRegisterType(uri, 1, 0, "Directory"); - qmlRegisterType(uri,1,0,"File"); - - //qRegisterMetaType > ("QDeclarativeListProperty"); - -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h deleted file mode 100644 index 68c6076e..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/dialogPlugin.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DIALOGPLUGIN_H -#define DIALOGPLUGIN_H - -#include - -class DialogPlugin : public QDeclarativeExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDeclarativeExtensionInterface" FILE "filedialog.json") - - public: - //registerTypes is inherited from QDeclarativeExtensionPlugin - void registerTypes(const char *uri); - -}; - -#endif - diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp deleted file mode 100644 index 0824e08c..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "directory.h" -#include - -/* -Directory constructor - -Initialize the saves directory and creates the file list -*/ -Directory::Directory(QObject *parent) : QObject(parent) -{ - - - m_dir.cd( QDir::currentPath()); - - //go to the saved directory. if not found, create save directory - m_saveDir = "saves"; - if (m_dir.cd(m_saveDir) == 0){ - m_dir.mkdir(m_saveDir); - m_dir.cd(m_saveDir); - } - m_filterList << "*.txt"; - - refresh(); -} - -/* -Directory::filesNumber -Return the number of Files -*/ -int Directory:: filesCount() const{ - return m_fileList.size(); -} - -/* -Function called to append data onto list property -*/ -void appendFiles(QDeclarativeListProperty * property, File * file){ - //Do nothing. can't add to a directory using this method -} - -/* -Function called to retrieve file in the list using an index -*/ -File* fileAt(QDeclarativeListProperty * property, int index){ - return static_cast< QList *>(property->data)->at(index); -} - -/* -Returns the number of files in the list -*/ -int filesSize(QDeclarativeListProperty * property){ - return static_cast< QList *>(property->data)->size(); -} - -/* -Function called to empty the list property contents -*/ -void clearFilesPtr(QDeclarativeListProperty *property){ - return static_cast< QList *>(property->data)->clear(); -} - -/* -Returns the list of files as a QDeclarativeListProperty. -*/ -QDeclarativeListProperty Directory::files(){ - - refresh(); -// return QDeclarativeListProperty(this,m_filePtrList); //not recommended in the docs - return QDeclarativeListProperty( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr ); -} - -/* -Return te name of the currently selected file -*/ -QString Directory::filename() const{ - return currentFile.name(); -} - -/* -Return the file's content as a string. -*/ -QString Directory::fileContent() const{ - return m_fileContent; -} - -/* -Set the file name of the current file -*/ -void Directory::setFilename(const QString &str){ - if(str != currentFile.name()){ - currentFile.setName(str); - emit filenameChanged(); - } -} - -/* -Set the content of the file as a string -*/ -void Directory::setFileContent(const QString &str){ - if(str != m_fileContent){ - m_fileContent = str; - emit fileContentChanged(); - } -} - -/* -Called from QML to save the file using the filename and file content. -Saving makes sure that the file has a .txt extension. -*/ -void Directory::saveFile(){ - - if(currentFile.name().size() == 0){ - qWarning()<< "Empty filename. no save"; - return; - } - - QString extendedName = currentFile.name(); - if(!currentFile.name().endsWith(".txt")){ - extendedName.append(".txt"); - } - - QFile file( m_dir.filePath(extendedName) ); - if (file.open(QFile::WriteOnly | QFile::Truncate)){ - QTextStream outStream(&file); - outStream << m_fileContent; - } - file.close(); - refresh(); - emit directoryChanged(); -} - -/* -Load the contents of a file. -Only loads files with a .txt extension -*/ -void Directory::loadFile(){ - - m_fileContent.clear(); - QString extendedName = currentFile.name(); - if(!currentFile.name().endsWith(".txt")){ - extendedName.append(".txt"); - } - - QFile file( m_dir.filePath(extendedName) ); - if (file.open(QFile::ReadOnly )){ - QTextStream inStream(&file); - - QString line; - do{ - line = inStream.read(75); - m_fileContent.append(line); - }while (!line .isNull()); - } - file.close(); -} - -/* -Reloads the content of the files list. This is to ensure that the newly -created files are added onto the list. -*/ -void Directory::refresh(){ - m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name); - m_fileList.clear(); - - File * file; - for(int i = 0; i < m_dirFiles.size() ; i ++){ - - file = new File(); - - if(m_dirFiles.at(i).endsWith(".txt")){ - QString name = m_dirFiles.at(i); - file->setName( name.remove(".txt",Qt::CaseSensitive)); - } - else{ - file->setName(m_dirFiles.at(i)); - } - m_fileList.append(file); - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h deleted file mode 100644 index b5a7bbe1..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/directory.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef DIRECTORY_H -#define DIRECTORY_H - -#include "file.h" - -#include -#include -#include -#include -#include - -class Directory : public QObject{ - - Q_OBJECT - - //number of files in the directory - Q_PROPERTY(int filesCount READ filesCount) - - //list property containing file names as QString - Q_PROPERTY(QDeclarativeListProperty files READ files CONSTANT ) - - //file name of the text file to read/write - Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged) - - //text content of the file - Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged) - - public: - Directory(QObject *parent = 0); - - //properties' read functions - int filesCount() const; - QString filename() const; - QString fileContent() const; - QDeclarativeListProperty files(); - - //properties' write functions - void setFilename(const QString &str); - void setFileContent(const QString &str); - - //accessible from QML - Q_INVOKABLE void saveFile(); - Q_INVOKABLE void loadFile(); - - signals: - void directoryChanged(); - void filenameChanged(); - void fileContentChanged(); - - private: - QDir m_dir; - QStringList m_dirFiles; - File currentFile; - QString m_saveDir; - QStringList m_filterList; - - //contains the file data in QString format - QString m_fileContent; - - //Registered to QML in a plugin. Accessible from QML as a property of Directory - QList m_fileList; - - //refresh content of the directory - void refresh(); -}; - - -#endif diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp deleted file mode 100644 index 65d42092..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "file.h" - -File::File(QObject *parent) : QObject(parent) -{ - m_name = ""; -} - -QString File::name() const{ - return m_name; -} -void File::setName(const QString &str){ - if(str != m_name){ - m_name = str; - emit nameChanged(); - } -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h deleted file mode 100644 index ef1551a3..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/file.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef FILE_H -#define FILE_H - - -#include -#include - -class File : public QObject{ - - Q_OBJECT - - Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) - - public: - File(QObject *parent = 0); - - QString name() const; - void setName(const QString &str); - - signals: - void nameChanged(); - - private: - QString m_name; -}; - -#endif diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.json b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.json deleted file mode 100644 index 0967ef42..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro deleted file mode 100644 index f9229a3b..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/filedialog.pro +++ /dev/null @@ -1,17 +0,0 @@ -TEMPLATE = lib -CONFIG += plugin -QT += declarative - -DESTDIR += ../plugins -OBJECTS_DIR = tmp -MOC_DIR = tmp - -TARGET = FileDialog - -HEADERS += directory.h \ - file.h \ - dialogPlugin.h - -SOURCES += directory.cpp \ - file.cpp \ - dialogPlugin.cpp diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir deleted file mode 100644 index c2b27dad..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/filedialog/qmldir +++ /dev/null @@ -1 +0,0 @@ -plugin FileDialog plugins diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png deleted file mode 100644 index 14978c2e..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/images/arrow.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png deleted file mode 100644 index 27feed5e..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_editmenu.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png deleted file mode 100644 index 4d8f9f22..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_filemenu.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png deleted file mode 100644 index 680acfe8..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/pics/qml-texteditor5_newfile.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject b/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject deleted file mode 100644 index ed034dff..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/parts/part5/qml-texteditor5.qmlproject +++ /dev/null @@ -1,18 +0,0 @@ -import QmlProject 1.0 - -Project { - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - directory: "core" - directory: "filedialog" - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } - /* List of plugin directories passed to QML runtime */ - importPaths: [ " ./plugins " ] -} diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png b/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png deleted file mode 100644 index 27feed5e..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_editmenu.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png b/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png deleted file mode 100644 index 4d8f9f22..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_filemenu.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png b/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png deleted file mode 100644 index 680acfe8..00000000 Binary files a/examples/declarative/tutorials/gettingStarted/gsQml/pics/qml-texteditor5_newfile.png and /dev/null differ diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/texteditor.pro b/examples/declarative/tutorials/gettingStarted/gsQml/texteditor.pro deleted file mode 100644 index aa5306cc..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/texteditor.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = \ - filedialog\ - diff --git a/examples/declarative/tutorials/gettingStarted/gsQml/texteditor.qml b/examples/declarative/tutorials/gettingStarted/gsQml/texteditor.qml deleted file mode 100644 index fae37148..00000000 --- a/examples/declarative/tutorials/gettingStarted/gsQml/texteditor.qml +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 1.0 -import "core" - -Rectangle { - id: screen - width: 1000; height: 1000 - property int partition: height/3 - border { width: 1; color: "#DCDCCC"} - state: "DRAWER_CLOSED" - - //Item 1: MenuBar on the top portion of the screen - MenuBar { - id:menuBar - height: screen.partition; width: screen.width - z: 1 - } - - //Item 2: The editable text area - TextArea { - id: textArea - y: drawer.height - color: "#3F3F3F" - fontColor: "#DCDCCC" - height: partition*2; width:parent.width - } - - //Item 3: The drawer handle - Rectangle { - id: drawer - height: 15; width: parent.width - border { color : "#6A6D6A"; width: 1 } - z: 1 - gradient: Gradient { - GradientStop { position: 0.0; color: "#8C8F8C" } - GradientStop { position: 0.17; color: "#6A6D6A" } - GradientStop { position: 0.77; color: "#3F3F3F" } - GradientStop { position: 1.0; color: "#6A6D6A" } - } - Image { - id: arrowIcon - source: "images/arrow.png" - anchors.horizontalCenter: parent.horizontalCenter - Behavior{ NumberAnimation { property: "rotation"; easing.type: Easing.OutExpo } } - } - - MouseArea { - id: drawerMouseArea - anchors.fill: parent - hoverEnabled: true - onEntered: parent.border.color = Qt.lighter("#6A6D6A") - onExited: parent.border.color = "#6A6D6A" - onClicked: { - if (screen.state == "DRAWER_CLOSED") { - screen.state = "DRAWER_OPEN" - } - else if (screen.state == "DRAWER_OPEN"){ - screen.state = "DRAWER_CLOSED" - } - } - } - } - -//! [states] - states:[ - State { - name: "DRAWER_OPEN" - PropertyChanges { target: menuBar; y: 0} - PropertyChanges { target: textArea; y: partition + drawer.height} - PropertyChanges { target: drawer; y: partition} - PropertyChanges { target: arrowIcon; rotation: 180} - }, - State { - name: "DRAWER_CLOSED" - PropertyChanges { target: menuBar; y:-height; } - PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height } - PropertyChanges { target: drawer; y: 0 } - PropertyChanges { target: arrowIcon; rotation: 0 } - } - ] -//! [states] - -//! [transitions] - transitions: [ - Transition { - to: "*" - NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo } - NumberAnimation { target: menuBar; properties: "y"; duration: 100; easing.type: Easing.OutExpo } - NumberAnimation { target: drawer; properties: "y"; duration: 100; easing.type: Easing.OutExpo } - } - ] -//! [transitions] -} diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/button.qml b/examples/declarative/tutorials/gettingStarted/parts/part5/core/button.qml new file mode 100644 index 00000000..aaf619b5 --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/button.qml @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +import QtQuick 1.0 + +Rectangle { + //identifier of the item + id: button + + //these properties act as constants, useable outside this QML file + property int buttonHeight: 75 + property int buttonWidth: 150 + + //attaches to the Text element's text content + property string label + property color textColor: buttonLabel.color + + //the color highlight when the mouse hovers on the rectangle + property color onHoverColor: "lightsteelblue" + property color borderColor: "transparent" + + //buttonColor is set to the button's main color + property color buttonColor: "lightblue" + + property real labelSize: 14 + + //set appearance properties + radius: 6 + smooth: true + border { width: 2; color: borderColor } + width: buttonWidth; height: buttonHeight + + Text { + id: buttonLabel + anchors.centerIn: parent + text: label //bind the text to the parent's text + color: "#DCDCCC" + font.pointSize: labelSize + } + + //buttonClick() is callable and a signal handler, onButtonClick is automatically created + signal buttonClick() + + //define the clickable area to be the whole rectangle + MouseArea { + id: buttonMouseArea + anchors.fill: parent //stretch the area to the parent's dimension + onClicked: buttonClick() + + //if true, then onEntered and onExited called if mouse hovers in the mouse area + //if false, a button must be clicked to detect the mouse hover + hoverEnabled: true + + //display a border if the mouse hovers on the button mouse area + onEntered: parent.border.color = onHoverColor + //remove the border if the mouse exits the button mouse area + onExited: parent.border.color = borderColor + } + + //change the color of the button when pressed + color: buttonMouseArea.pressed ? Qt.darker(buttonColor, 1.5) : buttonColor + //animate the color whenever the color property changes + Behavior on color { ColorAnimation{ duration: 55 } } + + //scale the button when pressed + scale: buttonMouseArea.pressed ? 1.1 : 1.00 + //Animate the scale property change + Behavior on scale { NumberAnimation{ duration: 55 } } + +} diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/editMenu.qml b/examples/declarative/tutorials/gettingStarted/parts/part5/core/editMenu.qml new file mode 100644 index 00000000..cc8e345d --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/editMenu.qml @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +import QtQuick 1.0 + +Rectangle { + id: editMenu + height: 480; width:1000 + color: "powderblue" + property color buttonBorderColor: "#7A8182" + property color buttonFillColor: "#61BDCACD" + property string menuName:"Edit" + gradient: Gradient { + GradientStop { position: 0.0; color: "#6A7570" } + GradientStop { position: 1.0; color: Qt.darker("#6A7570") } + } + + Rectangle { + id:actionContainer + color:"transparent" + anchors.centerIn: parent + width: parent.width; height: parent.height / 5 + Row { + anchors.centerIn: parent + spacing: parent.width/9 + Button { + id: loadButton + buttonColor: buttonFillColor + label: "Copy" + labelSize: 16 + borderColor: buttonBorderColor + height: actionContainer.height; width: actionContainer.width/6 + onButtonClick: textArea.copy() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: saveButton + height: actionContainer.height; width: actionContainer.width/6 + buttonColor: buttonFillColor + label: "Paste" + borderColor: buttonBorderColor + labelSize: 16 + onButtonClick: textArea.paste() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: exitButton + label: "Select All" + height: actionContainer.height; width: actionContainer.width/6 + labelSize: 16 + buttonColor: buttonFillColor + borderColor:buttonBorderColor + onButtonClick: textArea.selectAll() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/fileDialog.qml b/examples/declarative/tutorials/gettingStarted/parts/part5/core/fileDialog.qml new file mode 100644 index 00000000..9f50c73f --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/fileDialog.qml @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id:dialog + height: 200 * partition; width: 200 + color: "transparent" + + signal selectChanged() + signal notifyRefresh() + onNotifyRefresh:dirView.model = directory.files + + property string selectedFile + property int selectedIndex: 0 + + Rectangle { + id: dirBox + radius: 10 + anchors.centerIn:parent + height: parent.height -15; width: parent.width -30 + + Rectangle { + id:header + height: parent.height*0.1; width: parent.width + radius:3 + z:1 + gradient: Gradient { + GradientStop { position: 0.0; color: "#8C8F8C" } + GradientStop { position: 0.17; color: "#6A6D6A" } + GradientStop { position: 0.98;color: "#3F3F3F" } + GradientStop { position: 1.0; color: "#0e1B20" } + } + Text { + height: header.height; anchors.centerIn: header + text: "files:" + color: "lightblue" + font.weight: Font.Light + font.italic: true + } + } + GridView { + id:dirView + width:parent.width; height:parent.height*.9 + anchors.top: header.bottom + cellWidth: 100; cellHeight: 75 + model: directory.files + delegate: dirDelegate + clip: true + highlightMoveDuration: 40 + } + Component { + id: dirDelegate + Rectangle { + id:file + color: "transparent" + width: file.GridView.view.cellWidth; height: file.GridView.view.cellHeight + + Text { + id:fileName + width: parent.width + anchors.centerIn: parent + text: name + color: "#BDCACD" + font.weight: file.GridView.view.currentIndex == index ? Font.DemiBold : Font.Normal + font.pointSize: file.GridView.view.currentIndex == index ? 12 : 10 + elide: Text.ElideMiddle + horizontalAlignment: Text.AlignHCenter + } + Rectangle { + id: selection + width: parent.width; height: parent.height + anchors.centerIn: parent + radius: 10 + smooth: true + scale: file.GridView.view.currentIndex == index ? 1 : 0.5 + opacity: file.GridView.view.currentIndex == index ? 1 : 0 + Text { + id: overlay + width: parent.width + anchors.centerIn: parent + text: name + color: "#696167" + font.weight: Font.DemiBold + font.pointSize: 12 + smooth: true + elide: Text.ElideMiddle + horizontalAlignment: Text.AlignHCenter + } + Behavior on opacity { NumberAnimation{ duration: 45 } } + Behavior on scale { NumberAnimation{ duration: 45 } } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter("lightsteelblue",1.25) } + GradientStop { position: 0.67; color: Qt.darker("lightsteelblue",1.3) } + } + border.color: "lightsteelblue" + border.width: 1 + } + MouseArea { + id:fileMouseArea + anchors.fill:parent + hoverEnabled: true + + onClicked: { + file.GridView.view.currentIndex = index + selectedFile = directory.files[index].name + selectChanged() + } + onEntered: { + fileName.color = "lightsteelblue" + fileName.font.weight = Font.DemiBold + } + onExited: { + fileName.font.weight = Font.Normal + fileName.color = "#BDCACD" + } + } + } + } + gradient: Gradient { + GradientStop { position: 0.0; color: "#A5333333" } + GradientStop { position: 1.0; color: "#03333333" } + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/fileMenu.qml b/examples/declarative/tutorials/gettingStarted/parts/part5/core/fileMenu.qml new file mode 100644 index 00000000..b2a34b9b --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/fileMenu.qml @@ -0,0 +1,232 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: fileMenu + height: 480; width:1000 + property color buttonBorderColor: "#7F8487" + property color buttonFillColor: "#8FBDCACD" + property string fileContent:directory.fileContent + + //the menuName is accessible from outside this QML file + property string menuName: "File" + + //used to divide the screen into parts. + property real partition: 1/3 + + color: "#6C646A" + gradient: Gradient { + GradientStop { position: 0.0; color: "#6C646A" } + GradientStop { position: 1.0; color: Qt.darker("#6A6D6A") } + } + + Directory { + id:directory + filename: textInput.text + onDirectoryChanged:fileDialog.notifyRefresh() + } + + Rectangle { + id:actionContainer + + //make this rectangle invisible + color:"transparent" + anchors.left: parent.left + + //the height is a good proportion that creates more space at the top of + //the column of buttons + width: fileMenu.width * partition; height: fileMenu.height + + Column { + anchors.centerIn: parent + spacing: parent.height/32 + Button { + id: saveButton + label: "Save" + borderColor: buttonBorderColor + buttonColor: buttonFillColor + width: actionContainer.width/ 1.3 + height:actionContainer.height / 8 + labelSize:24 + onButtonClick: { + directory.fileContent = textArea.textContent + directory.filename = textInput.text + directory.saveFile() + } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: loadButton + width: actionContainer.width/ 1.3 + height:actionContainer.height/ 8 + buttonColor: buttonFillColor + borderColor: buttonBorderColor + label: "Load" + labelSize:24 + onButtonClick:{ + directory.filename = textInput.text + directory.loadFile() + textArea.textContent = directory.fileContent + } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + Button { + id: newButton + width: actionContainer.width/ 1.3 + height: actionContainer.height/ 8 + buttonColor: buttonFillColor + borderColor: buttonBorderColor + label: "New" + labelSize: 24 + onButtonClick:{ + textArea.textContent = "" + textInput.text = "" + } + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + + } + Rectangle { + id: space + width: actionContainer.width/ 1.3 + height: actionContainer.height / 16 + color: "transparent" + } + Button { + id: exitButton + width: actionContainer.width/ 1.3 + height: actionContainer.height/ 8 + label: "Exit" + labelSize: 24 + buttonColor: buttonFillColor + borderColor: buttonBorderColor + onButtonClick: Qt.quit() + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter(buttonFillColor,1.25) } + GradientStop { position: 0.67; color: Qt.darker(buttonFillColor,1.3) } + } + } + } + } + Rectangle { + id:dialogContainer + + width: 2*fileMenu.width * partition; height: fileMenu.height + anchors.right:parent.right + color: "transparent" + + Column { + anchors.centerIn: parent + spacing: parent.height /640 + FileDialog { + id:fileDialog + height: 2*dialogContainer.height * partition + width: dialogContainer.width + onSelectChanged: textInput.text = selectedFile + } + + Rectangle { + id:lowerPartition + height: dialogContainer.height * partition; width: dialogContainer.width + color: "transparent" + + Rectangle { + id: nameField + gradient: Gradient { + GradientStop { position: 0.0; color: "#806F6F6F" } + GradientStop { position: 1.0; color: "#136F6F6F" } + } + radius: 10 + anchors { centerIn:parent; leftMargin: 15; rightMargin: 15; topMargin: 15 } + height: parent.height-15 + width: parent.width -20 + border { color: "#4A4A4A"; width:1 } + + TextInput { + id: textInput + z:2 + anchors { bottom: parent.bottom; topMargin: 10; horizontalCenter: parent.horizontalCenter } + width: parent.width - 10 + height: parent.height -10 + font.pointSize: 40 + color: "lightsteelblue" + focus: true + } + Text { + id: textInstruction + anchors.centerIn: parent + text: "Select file name and press save or load" + font {pointSize: 11; weight: Font.Light; italic: true} + color: "lightblue" + z: 2 + opacity: (textInput.text == "") ? 1 : 0 + } + Text { + id:fieldLabel + anchors { top: parent.top; left: parent.left } + text: " file name: " + font { pointSize: 11; weight: Font.Light; italic: true } + color: "lightblue" + z:2 + } + MouseArea { + anchors.centerIn:parent + width: nameField.width; height: nameField.height + onClicked: { + textInput.text = "" + textInput.focus = true + textInput.forceFocus() + } + } + } + } + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/menuBar.qml b/examples/declarative/tutorials/gettingStarted/parts/part5/core/menuBar.qml new file mode 100644 index 00000000..49dc0e0d --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/menuBar.qml @@ -0,0 +1,147 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id: menuBar + width: 1000; height:300 + color:"transparent" + property color fileColor: "plum" + property color editColor: "powderblue" + + property real partition: 1/10 + + Column { + anchors.fill: parent + //container for the header and the buttons + z: 1 + Rectangle { + id: labelList + height:menuBar.height*partition + width: menuBar.width + color: "beige" + gradient: Gradient { + GradientStop { position: 0.0; color: "#8C8F8C" } + GradientStop { position: 0.17; color: "#6A6D6A" } + GradientStop { position: 0.98;color: "#3F3F3F" } + GradientStop { position: 1.0; color: "#0e1B20" } + } + Text { + height: parent.height + anchors { right: labelRow.left ; verticalCenter: parent.bottom } + text: "menu: " + color: "lightblue" + font { weight: Font.Light; italic: true } + smooth: true + } + //row displays its children in a vertical row + Row { + id: labelRow + anchors.centerIn: parent + spacing:40 + Button { + id: fileButton + height: 20; width: 50 + label: "File" + buttonColor : menuListView.currentIndex == 0? fileColor : Qt.darker(fileColor, 1.5) + scale: menuListView.currentIndex == 0? 1.25: 1 + labelSize: menuListView.currentIndex == 0? 16:12 + radius: 1 + smooth:true + //on a button click, change the list's currently selected item to FileMenu + onButtonClick: menuListView.currentIndex = 0 + gradient: Gradient { + GradientStop { position: 0.0; color: fileColor } + GradientStop { position: 1.0; color: "#136F6F6F" } + } + } + Button { + id: editButton + height: 20; width: 50 + buttonColor : menuListView.currentIndex == 1? Qt.darker(editColor, 1.5) : Qt.darker(editColor, 1.9) + scale: menuListView.currentIndex == 1? 1.25: 1 + label: "Edit" + radius: 1 + labelSize: menuListView.currentIndex == 1? 16:12 + smooth:true + //on a button click, change the list's currently selected item to EditMenu + onButtonClick: menuListView.currentIndex = 1 + gradient: Gradient { + GradientStop { position: 0.0; color: editColor } + GradientStop { position: 1.0; color: "#136F6F6F" } + } + } + } + } + + //list view will display a model according to a delegate + ListView { + id: menuListView + width:menuBar.width; height: 9*menuBar.height*partition + + //the model contains the data + model: menuListModel + + //control the movement of the menu switching + snapMode: ListView.SnapOneItem + orientation: ListView.Horizontal + boundsBehavior: Flickable.StopAtBounds + flickDeceleration: 5000 + highlightFollowsCurrentItem: true + highlightMoveDuration:240 + highlightRangeMode: ListView.StrictlyEnforceRange + } + } + //a list of visual items already have delegates handling their display + VisualItemModel { + id: menuListModel + + FileMenu { + id:fileMenu + width: menuListView.width; height: menuListView.height + color: fileColor + } + EditMenu { + color: editColor + width: menuListView.width; height: menuListView.height + } + } +} diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/qmldir b/examples/declarative/tutorials/gettingStarted/parts/part5/core/qmldir new file mode 100644 index 00000000..32dc8071 --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/qmldir @@ -0,0 +1,9 @@ +Button ./button.qml +FileDialog ./fileDialog.qml +TextArea ./textArea.qml +TextEditor ./textEditor.qml +EditMenu ./editMenu.qml +MenuBar ./menuBar.qml +FileMenu ./fileMenu.qml + +plugin FileDialog ../plugins diff --git a/examples/declarative/tutorials/gettingStarted/parts/part5/core/textArea.qml b/examples/declarative/tutorials/gettingStarted/parts/part5/core/textArea.qml new file mode 100644 index 00000000..fc122523 --- /dev/null +++ b/examples/declarative/tutorials/gettingStarted/parts/part5/core/textArea.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 1.0 + +Rectangle { + id:textArea + + function paste() { textEdit.paste() } + function copy() { textEdit.copy() } + function selectAll() { textEdit.selectAll() } + + width :400; height:400 + + property color fontColor: "white" + property alias textContent: textEdit.text + Flickable { + id: flickArea + width: parent.width; height: parent.height + anchors.fill:parent + + boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.HorizontalFlick + interactive: true + //Will move the text Edit area to make the area visible when + //scrolled with keyboard strokes + function ensureVisible(r) { + if (contentX >= r.x) + contentX = r.x; + else if (contentX+width <= r.x+r.width) + contentX = r.x+r.width-width; + if (contentY >= r.y) + contentY = r.y; + else if (contentY+height <= r.y+r.height) + contentY = r.y+r.height-height; + } + + TextEdit { + id: textEdit + anchors.fill:parent + width:parent.width; height:parent.height + color:fontColor + focus: true + wrapMode: TextEdit.Wrap + font.pointSize:10 + onCursorRectangleChanged: flickArea.ensureVisible(cursorRectangle) + selectByMouse: true + } + } +} -- cgit v1.2.3 From 8d0159a64e7b10e8c39ade516b27a06d875bff65 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 7 May 2013 13:19:46 +0200 Subject: Move debugger plugins into separate qml1tooling directory Separate the QML 1 and QML 2 debugger plugins. This helps avoid a nasty crash in libgobject when (uneccessarily) loading and unloading the wrong plugins. Task-number: QTCREATORBUG-9232 Change-Id: I0bce7b364fcce983ccaa531d9008609ff08bb77f Reviewed-by: Aurindam Jana --- src/declarative/debugger/qdeclarativedebugserver.cpp | 2 +- src/declarative/debugger/qdeclarativeinspectorservice.cpp | 2 +- src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro | 2 +- src/plugins/qmltooling/qmldbg_tcp_qtquick1/qmldbg_tcp_qtquick1.pro | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/declarative/debugger/qdeclarativedebugserver.cpp b/src/declarative/debugger/qdeclarativedebugserver.cpp index 652a805c..a65c50b7 100644 --- a/src/declarative/debugger/qdeclarativedebugserver.cpp +++ b/src/declarative/debugger/qdeclarativedebugserver.cpp @@ -126,7 +126,7 @@ QDeclarativeDebugServerConnection *QDeclarativeDebugServerPrivate::loadConnectio QStringList pluginCandidates; const QStringList paths = QCoreApplication::libraryPaths(); foreach (const QString &libPath, paths) { - const QDir dir(libPath + QLatin1String("/qmltooling")); + const QDir dir(libPath + QLatin1String("/qml1tooling")); if (dir.exists()) { QStringList plugins(dir.entryList(QDir::Files)); foreach (const QString &pluginPath, plugins) { diff --git a/src/declarative/debugger/qdeclarativeinspectorservice.cpp b/src/declarative/debugger/qdeclarativeinspectorservice.cpp index 44d4e877..c817c39e 100644 --- a/src/declarative/debugger/qdeclarativeinspectorservice.cpp +++ b/src/declarative/debugger/qdeclarativeinspectorservice.cpp @@ -124,7 +124,7 @@ QDeclarativeInspectorInterface *QDeclarativeInspectorService::loadInspectorPlugi QStringList pluginCandidates; const QStringList paths = QCoreApplication::libraryPaths(); foreach (const QString &libPath, paths) { - const QDir dir(libPath + QLatin1String("/qmltooling")); + const QDir dir(libPath + QLatin1String("/qml1tooling")); if (dir.exists()) foreach (const QString &pluginPath, dir.entryList(QDir::Files)) pluginCandidates << dir.absoluteFilePath(pluginPath); diff --git a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro index 9aca1d87..09b993b5 100644 --- a/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro +++ b/src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro @@ -1,7 +1,7 @@ TARGET = qmldbg_inspector QT += declarative declarative-private gui widgets core-private -PLUGIN_TYPE = qmltooling +PLUGIN_TYPE = qml1tooling PLUGIN_CLASS_NAME = QtQuick1Plugin load(qt_plugin) diff --git a/src/plugins/qmltooling/qmldbg_tcp_qtquick1/qmldbg_tcp_qtquick1.pro b/src/plugins/qmltooling/qmldbg_tcp_qtquick1/qmldbg_tcp_qtquick1.pro index ca21b389..20ced897 100644 --- a/src/plugins/qmltooling/qmldbg_tcp_qtquick1/qmldbg_tcp_qtquick1.pro +++ b/src/plugins/qmltooling/qmldbg_tcp_qtquick1/qmldbg_tcp_qtquick1.pro @@ -1,7 +1,7 @@ TARGET = qmldbg_tcp_qtdeclarative QT += declarative declarative-private network -PLUGIN_TYPE = qmltooling +PLUGIN_TYPE = qml1tooling PLUGIN_CLASS_NAME = QTcpServerConnection load(qt_plugin) -- cgit v1.2.3