aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf3
-rw-r--r--dist/changes-5.3.068
-rw-r--r--examples/quick/dialogs/dialogs.pro4
-rw-r--r--examples/quick/dialogs/systemdialogs/ColorDialogs.qml146
-rw-r--r--examples/quick/dialogs/systemdialogs/FileDialogs.qml180
-rw-r--r--examples/quick/dialogs/systemdialogs/FontDialogs.qml153
-rw-r--r--examples/quick/dialogs/systemdialogs/MessageDialogs.qml307
-rw-r--r--examples/quick/dialogs/systemdialogs/doc/images/systemdialogs-example.jpgbin47413 -> 0 bytes
-rw-r--r--examples/quick/dialogs/systemdialogs/doc/src/systemdialogs.qdoc48
-rw-r--r--examples/quick/dialogs/systemdialogs/systemdialogs.pro15
-rw-r--r--examples/quick/dialogs/systemdialogs/systemdialogs.qrc9
-rw-r--r--examples/quick/quick.pro1
-rw-r--r--examples/quick/views/listview/displaymargin.qml (renamed from examples/quick/dialogs/systemdialogs/systemdialogs.qml)66
-rw-r--r--examples/quick/views/views.qml1
-rw-r--r--examples/quick/views/views.qrc1
-rw-r--r--src/imports/dialogs-private/dialogs-private.pro17
-rw-r--r--src/imports/dialogs-private/qmldir4
-rw-r--r--src/imports/dialogs-private/qquickfontlistmodel.cpp290
-rw-r--r--src/imports/dialogs-private/qquickfontlistmodel_p.h125
-rw-r--r--src/imports/dialogs-private/qquickwritingsystemlistmodel.cpp176
-rw-r--r--src/imports/dialogs-private/qquickwritingsystemlistmodel_p.h100
-rw-r--r--src/imports/dialogs/DefaultColorDialog.qml362
-rw-r--r--src/imports/dialogs/DefaultFileDialog.qml394
-rw-r--r--src/imports/dialogs/DefaultFontDialog.qml483
-rw-r--r--src/imports/dialogs/DefaultMessageDialog.qml330
-rw-r--r--src/imports/dialogs/WidgetColorDialog.qml44
-rw-r--r--src/imports/dialogs/WidgetFileDialog.qml44
-rw-r--r--src/imports/dialogs/WidgetFontDialog.qml44
-rw-r--r--src/imports/dialogs/WidgetMessageDialog.qml44
-rw-r--r--src/imports/dialogs/dialogs.pro97
-rw-r--r--src/imports/dialogs/doc/images/critical.pngbin253 -> 0 bytes
-rw-r--r--src/imports/dialogs/doc/images/information.pngbin254 -> 0 bytes
-rw-r--r--src/imports/dialogs/doc/images/question.pngbin257 -> 0 bytes
-rw-r--r--src/imports/dialogs/doc/images/replacefile.pngbin4304 -> 0 bytes
-rw-r--r--src/imports/dialogs/doc/images/warning.pngbin224 -> 0 bytes
-rw-r--r--src/imports/dialogs/doc/qtquickdialogs.qdocconf41
-rw-r--r--src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc36
-rw-r--r--src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc58
-rw-r--r--src/imports/dialogs/images/checkers.pngbin149 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/checkmark.pngbin809 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/copy.pngbin1338 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/critical.pngbin253 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/crosshairs.pngbin876 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/folder.pngbin1841 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/information.pngbin254 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/question.pngbin257 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/slider_handle.pngbin1551 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/sunken_frame.pngbin623 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/up.pngbin662 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/warning.pngbin224 -> 0 bytes
-rw-r--r--src/imports/dialogs/images/window_border.pngbin588 -> 0 bytes
-rw-r--r--src/imports/dialogs/plugin.cpp214
-rw-r--r--src/imports/dialogs/plugins.qmltypes654
-rw-r--r--src/imports/dialogs/qml/Button.qml86
-rw-r--r--src/imports/dialogs/qml/CheckBox.qml96
-rwxr-xr-xsrc/imports/dialogs/qml/ColorSlider.qml138
-rw-r--r--src/imports/dialogs/qml/DefaultWindowDecoration.qml71
-rw-r--r--src/imports/dialogs/qml/EdgeFade.qml63
-rw-r--r--src/imports/dialogs/qml/TextField.qml89
-rw-r--r--src/imports/dialogs/qml/qmldir5
-rw-r--r--src/imports/dialogs/qmldir4
-rw-r--r--src/imports/dialogs/qquickabstractcolordialog.cpp134
-rw-r--r--src/imports/dialogs/qquickabstractcolordialog_p.h113
-rw-r--r--src/imports/dialogs/qquickabstractdialog.cpp337
-rw-r--r--src/imports/dialogs/qquickabstractdialog_p.h145
-rw-r--r--src/imports/dialogs/qquickabstractfiledialog.cpp194
-rw-r--r--src/imports/dialogs/qquickabstractfiledialog_p.h122
-rw-r--r--src/imports/dialogs/qquickabstractfontdialog.cpp150
-rw-r--r--src/imports/dialogs/qquickabstractfontdialog_p.h113
-rw-r--r--src/imports/dialogs/qquickabstractmessagedialog.cpp179
-rw-r--r--src/imports/dialogs/qquickabstractmessagedialog_p.h165
-rw-r--r--src/imports/dialogs/qquickcolordialog.cpp119
-rw-r--r--src/imports/dialogs/qquickcolordialog_p.h80
-rw-r--r--src/imports/dialogs/qquickdialogassets_p.h65
-rw-r--r--src/imports/dialogs/qquickfiledialog.cpp172
-rw-r--r--src/imports/dialogs/qquickfiledialog_p.h93
-rw-r--r--src/imports/dialogs/qquickfontdialog.cpp120
-rw-r--r--src/imports/dialogs/qquickfontdialog_p.h80
-rw-r--r--src/imports/dialogs/qquickmessagedialog.cpp181
-rw-r--r--src/imports/dialogs/qquickmessagedialog_p.h86
-rw-r--r--src/imports/dialogs/qquickplatformcolordialog.cpp254
-rw-r--r--src/imports/dialogs/qquickplatformcolordialog_p.h78
-rw-r--r--src/imports/dialogs/qquickplatformfiledialog.cpp314
-rw-r--r--src/imports/dialogs/qquickplatformfontdialog.cpp252
-rw-r--r--src/imports/dialogs/qquickplatformfontdialog_p.h78
-rw-r--r--src/imports/dialogs/qquickplatformmessagedialog.cpp398
-rw-r--r--src/imports/dialogs/qquickplatformmessagedialog_p.h78
-rw-r--r--src/imports/imports.pro4
-rw-r--r--src/imports/localstorage/plugin.cpp2
-rw-r--r--src/imports/settings/qqmlsettings.cpp3
-rw-r--r--src/imports/widgets/plugins.qmltypes302
-rw-r--r--src/imports/widgets/qmessageboxhelper_p.h107
-rw-r--r--src/imports/widgets/qmldir4
-rw-r--r--src/imports/widgets/qquickqcolordialog.cpp175
-rw-r--r--src/imports/widgets/qquickqcolordialog_p.h78
-rw-r--r--src/imports/widgets/qquickqfiledialog.cpp215
-rw-r--r--src/imports/widgets/qquickqfiledialog_p.h107
-rw-r--r--src/imports/widgets/qquickqfontdialog.cpp178
-rw-r--r--src/imports/widgets/qquickqfontdialog_p.h78
-rw-r--r--src/imports/widgets/qquickqmessagebox.cpp144
-rw-r--r--src/imports/widgets/qquickqmessagebox_p.h77
-rw-r--r--src/imports/widgets/widgets.pro32
-rw-r--r--src/imports/widgets/widgetsplugin.cpp89
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp8
-rw-r--r--src/plugins/accessible/shared/qqmlaccessible.cpp2
-rw-r--r--src/qml/compiler/compiler.pri6
-rw-r--r--src/qml/compiler/qqmlcodegenerator.cpp108
-rw-r--r--src/qml/compiler/qqmlcodegenerator_p.h16
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp1204
-rw-r--r--src/qml/compiler/qqmltypecompiler_p.h201
-rw-r--r--src/qml/compiler/qv4compileddata.cpp51
-rw-r--r--src/qml/compiler/qv4compileddata_p.h8
-rw-r--r--src/qml/compiler/qv4isel_masm.cpp13
-rw-r--r--src/qml/compiler/qv4regalloc.cpp3
-rw-r--r--src/qml/debugger/qqmlprofilerservice.cpp138
-rw-r--r--src/qml/debugger/qqmlprofilerservice_p.h105
-rw-r--r--src/qml/jsapi/qjsvalue.cpp2
-rw-r--r--src/qml/jsruntime/jsruntime.pri2
-rw-r--r--src/qml/jsruntime/qv4argumentsobject.cpp40
-rw-r--r--src/qml/jsruntime/qv4argumentsobject_p.h5
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp563
-rw-r--r--src/qml/jsruntime/qv4arraydata_p.h242
-rw-r--r--src/qml/jsruntime/qv4arrayobject.cpp195
-rw-r--r--src/qml/jsruntime/qv4arrayobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4context.cpp17
-rw-r--r--src/qml/jsruntime/qv4context_p.h4
-rw-r--r--src/qml/jsruntime/qv4dateobject.cpp1
-rw-r--r--src/qml/jsruntime/qv4dateobject_p.h5
-rw-r--r--src/qml/jsruntime/qv4engine.cpp24
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp5
-rw-r--r--src/qml/jsruntime/qv4errorobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp22
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4internalclass.cpp2
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp26
-rw-r--r--src/qml/jsruntime/qv4jsonobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4lookup.cpp9
-rw-r--r--src/qml/jsruntime/qv4lookup_p.h1
-rw-r--r--src/qml/jsruntime/qv4managed.cpp19
-rw-r--r--src/qml/jsruntime/qv4managed_p.h120
-rw-r--r--src/qml/jsruntime/qv4mathobject.cpp10
-rw-r--r--src/qml/jsruntime/qv4mathobject_p.h4
-rw-r--r--src/qml/jsruntime/qv4mm.cpp2
-rw-r--r--src/qml/jsruntime/qv4object.cpp635
-rw-r--r--src/qml/jsruntime/qv4object_p.h224
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp4
-rw-r--r--src/qml/jsruntime/qv4objectiterator_p.h2
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp62
-rw-r--r--src/qml/jsruntime/qv4property_p.h2
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp7
-rw-r--r--src/qml/jsruntime/qv4regexp.cpp2
-rw-r--r--src/qml/jsruntime/qv4regexp_p.h1
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp13
-rw-r--r--src/qml/jsruntime/qv4regexpobject_p.h1
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp77
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h2
-rw-r--r--src/qml/jsruntime/qv4sequenceobject.cpp9
-rw-r--r--src/qml/jsruntime/qv4serialize.cpp8
-rw-r--r--src/qml/jsruntime/qv4string.cpp18
-rw-r--r--src/qml/jsruntime/qv4string_p.h9
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp34
-rw-r--r--src/qml/jsruntime/qv4stringobject_p.h1
-rw-r--r--src/qml/jsruntime/qv4value_p.h4
-rw-r--r--src/qml/parser/qqmljsmemorypool_p.h2
-rw-r--r--src/qml/qml/qqmlbinding.cpp3
-rw-r--r--src/qml/qml/qqmlcompiler.cpp52
-rw-r--r--src/qml/qml/qqmlcompiler_p.h14
-rw-r--r--src/qml/qml/qqmlcomponent.cpp6
-rw-r--r--src/qml/qml/qqmlcustomparser.cpp76
-rw-r--r--src/qml/qml/qqmlcustomparser_p.h17
-rw-r--r--src/qml/qml/qqmlincubator.cpp17
-rw-r--r--src/qml/qml/qqmlincubator_p.h5
-rw-r--r--src/qml/qml/qqmllistwrapper.cpp2
-rw-r--r--src/qml/qml/qqmllocale.cpp87
-rw-r--r--src/qml/qml/qqmllocale_p.h58
-rw-r--r--src/qml/qml/qqmlmetatype.cpp2
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp1001
-rw-r--r--src/qml/qml/qqmlobjectcreator_p.h112
-rw-r--r--src/qml/qml/qqmlparserstatus.h1
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp2
-rw-r--r--src/qml/qml/qqmlscriptstring.h2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp176
-rw-r--r--src/qml/qml/qqmltypeloader_p.h5
-rw-r--r--src/qml/qml/v8/qv8engine.cpp41
-rw-r--r--src/qml/qml/v8/qv8engine_p.h4
-rw-r--r--src/qml/types/qqmlconnections.cpp38
-rw-r--r--src/qml/types/qqmlconnections_p.h1
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp62
-rw-r--r--src/qml/types/qqmllistmodel.cpp10
-rw-r--r--src/qml/types/qqmllistmodel_p.h4
-rw-r--r--src/qml/util/qqmladaptormodel.cpp7
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp6
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp2
-rw-r--r--src/quick/items/qquickgridview.cpp40
-rw-r--r--src/quick/items/qquickimage.cpp11
-rw-r--r--src/quick/items/qquickitem.cpp246
-rw-r--r--src/quick/items/qquickitem.h6
-rw-r--r--src/quick/items/qquickitem_p.h17
-rw-r--r--src/quick/items/qquickitemsmodule.cpp2
-rw-r--r--src/quick/items/qquickitemview.cpp40
-rw-r--r--src/quick/items/qquickitemview_p.h10
-rw-r--r--src/quick/items/qquickitemview_p_p.h2
-rw-r--r--src/quick/items/qquicklistview.cpp39
-rw-r--r--src/quick/items/qquickmousearea.cpp5
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp5
-rw-r--r--src/quick/items/qquickrectangle.cpp14
-rw-r--r--src/quick/items/qquicktext.cpp62
-rw-r--r--src/quick/items/qquicktext_p.h1
-rw-r--r--src/quick/items/qquicktext_p_p.h9
-rw-r--r--src/quick/items/qquicktextedit.cpp4
-rw-r--r--src/quick/items/qquicktranslate.cpp75
-rw-r--r--src/quick/items/qquicktranslate_p.h23
-rw-r--r--src/quick/items/qquickview.cpp27
-rw-r--r--src/quick/items/qquickview_p.h22
-rw-r--r--src/quick/items/qquickwindow.cpp119
-rw-r--r--src/quick/items/qquickwindow_p.h2
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp4
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp10
-rw-r--r--src/quick/util/qquickbehavior.cpp11
-rw-r--r--src/quick/util/qquickglobal.cpp2
-rw-r--r--src/quick/util/qquickpropertychanges.cpp61
-rw-r--r--src/quick/util/qquickpropertychanges_p.h2
-rw-r--r--tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp4
-rw-r--r--tests/auto/qml/qqmlecmascript/data/signalHandlers.qml11
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp5
-rw-r--r--tests/auto/qml/qqmlerror/tst_qqmlerror.cpp2
-rw-r--r--tests/auto/qml/qqmlglobal/tst_qqmlglobal.cpp2
-rw-r--r--tests/auto/qml/qqmlinstruction/tst_qqmlinstruction.cpp2
-rw-r--r--tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp6
-rw-r--r--tests/auto/qml/qqmllocale/tst_qqmllocale.cpp36
-rw-r--r--tests/auto/qml/qqmlmetaobject/tst_qqmlmetaobject.cpp6
-rw-r--r--tests/auto/qml/qqmlpropertymap/tst_qqmlpropertymap.cpp6
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp4
-rw-r--r--tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp44
-rw-r--r--tests/auto/quick/qquickbehaviors/data/qtbug21549-2.qml (renamed from examples/quick/dialogs/systemdialogs/main.cpp)36
-rw-r--r--tests/auto/quick/qquickbehaviors/data/qtbug21549.qml18
-rw-r--r--tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp54
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml9
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_canvas.qml15
-rw-r--r--tests/auto/quick/qquickgridview/data/displayMargin.qml (renamed from src/imports/dialogs/qquickplatformfiledialog_p.h)71
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp39
-rw-r--r--tests/auto/quick/qquickitem/data/visualParentOwnership.qml14
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp65
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp4
-rw-r--r--tests/auto/quick/qquicklistview/data/displayMargin.qml (renamed from src/imports/dialogs-private/dialogsprivateplugin.cpp)56
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp38
-rw-r--r--tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp57
-rw-r--r--tests/auto/quick/qquicktext/data/lineLayoutHAlign.qml20
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp47
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp4
-rw-r--r--tests/auto/quick/qquickview/tst_qquickview.cpp2
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp97
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp16
254 files changed, 5198 insertions, 13398 deletions
diff --git a/.qmake.conf b/.qmake.conf
index bb65e47d07..88d13d1eef 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,5 +2,4 @@ load(qt_build_config)
CONFIG += qt_example_installs
CONFIG += warning_clean
-MODULE_VERSION = 5.2.2
-
+MODULE_VERSION = 5.3.0
diff --git a/dist/changes-5.3.0 b/dist/changes-5.3.0
new file mode 100644
index 0000000000..5cda809d97
--- /dev/null
+++ b/dist/changes-5.3.0
@@ -0,0 +1,68 @@
+Qt 5.3 introduces many new features and improvements as well as bugfixes
+over the 5.2.x series. 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.2
+
+The Qt version 5.3 series is binary compatible with the 5.2.x series.
+Applications compiled for 5.2 will continue to run with 5.3.
+
+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 *
+****************************************************************************
+
+General Improvements
+--------------------
+
+Third party components
+----------------------
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+- Signals declared in QML that take "var" parameters, are now using QJSValue
+ as C++ type for these parameters, instead of QVariant.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtQml
+------
+
+QtQuick
+------
+
+****************************************************************************
+* Database Drivers *
+****************************************************************************
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Compiler Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
diff --git a/examples/quick/dialogs/dialogs.pro b/examples/quick/dialogs/dialogs.pro
deleted file mode 100644
index 538e75686c..0000000000
--- a/examples/quick/dialogs/dialogs.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS = \
- systemdialogs
diff --git a/examples/quick/dialogs/systemdialogs/ColorDialogs.qml b/examples/quick/dialogs/systemdialogs/ColorDialogs.qml
deleted file mode 100644
index 0cb42a01aa..0000000000
--- a/examples/quick/dialogs/systemdialogs/ColorDialogs.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 examples 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 2.0
-import QtQuick.Dialogs 1.0
-import "../../shared"
-
-Rectangle {
- width: 320
- height: 240
- color: palette.window
- SystemPalette { id: palette }
- clip: true
-
- //! [colordialog]
- ColorDialog {
- id: colorDialog
- visible: colorDialogVisible.checked
- modality: colorDialogModal.checked ? Qt.WindowModal : Qt.NonModal
- title: "Choose a color"
- color: "green"
- showAlphaChannel: colorDialogAlpha.checked
- onAccepted: { console.log("Accepted: " + color) }
- onRejected: { console.log("Rejected") }
- }
- //! [colordialog]
-
- Column {
- anchors.fill: parent
- anchors.margins: 12
- spacing: 8
- Text {
- font.bold: true
- text: "Color dialog properties:"
- }
- CheckBox {
- id: colorDialogModal
- text: "Modal"
- checked: true
- Binding on checked { value: colorDialog.modality != Qt.NonModal }
- }
- CheckBox {
- id: colorDialogAlpha
- text: "Show alpha channel"
- Binding on checked { value: colorDialog.showAlphaChannel }
- }
- CheckBox {
- id: colorDialogVisible
- text: "Visible"
- Binding on checked { value: colorDialog.visible }
- }
- Row {
- id: colorRow
- spacing: parent.spacing
- height: colorLabel.implicitHeight * 2.0
- Rectangle {
- color: colorDialog.color
- height: parent.height
- width: height * 2
- border.color: "black"
- MouseArea {
- anchors.fill: parent
- onClicked: colorDialog.open()
- }
- }
- Text {
- id: colorLabel
- color: palette.windowText
- text: "<b>current color:</b> " + colorDialog.color
- anchors.verticalCenter: parent.verticalCenter
- }
- }
- }
-
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: buttonRow.height * 1.2
- color: Qt.darker(palette.window, 1.1)
- border.color: Qt.darker(palette.window, 1.3)
- Row {
- id: buttonRow
- spacing: 6
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 12
- height: implicitHeight
- width: parent.width
- Button {
- text: "Open"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: colorDialog.open()
- }
- Button {
- text: "Close"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: colorDialog.close()
- }
- Button {
- text: "set to green"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: colorDialog.color = "green"
- }
- }
- }
-}
diff --git a/examples/quick/dialogs/systemdialogs/FileDialogs.qml b/examples/quick/dialogs/systemdialogs/FileDialogs.qml
deleted file mode 100644
index d6ee1a13ca..0000000000
--- a/examples/quick/dialogs/systemdialogs/FileDialogs.qml
+++ /dev/null
@@ -1,180 +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 examples 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 2.0
-import QtQuick.Dialogs 1.0
-import QtQuick.Window 2.0
-import "../../shared"
-
-Rectangle {
- width: 580
- height: 400
- color: palette.window
- SystemPalette { id: palette }
- clip: true
-
- //! [filedialog]
- FileDialog {
- id: fileDialog
- visible: fileDialogVisible.checked
- modality: fileDialogModal.checked ? Qt.WindowModal : Qt.NonModal
- title: fileDialogSelectFolder.checked ? "Choose a folder" :
- (fileDialogSelectMultiple.checked ? "Choose some files" : "Choose a file")
- selectExisting: fileDialogSelectExisting.checked
- selectMultiple: fileDialogSelectMultiple.checked
- selectFolder: fileDialogSelectFolder.checked
- nameFilters: [ "Image files (*.png *.jpg)", "All files (*)" ]
- selectedNameFilter: "All files (*)"
- onAccepted: {
- console.log("Accepted: " + fileUrls)
- if (fileDialogOpenFiles.checked)
- for (var i = 0; i < fileUrls.length; ++i)
- Qt.openUrlExternally(fileUrls[i])
- }
- onRejected: { console.log("Rejected") }
- }
- //! [filedialog]
-
- Column {
- anchors.fill: parent
- anchors.margins: 12
- spacing: 8
- Text {
- color: palette.windowText
- font.bold: true
- text: "File dialog properties:"
- }
- CheckBox {
- id: fileDialogModal
- text: "Modal"
- checked: true
- Binding on checked { value: fileDialog.modality != Qt.NonModal }
- }
- CheckBox {
- id: fileDialogSelectFolder
- text: "Select Folder"
- Binding on checked { value: fileDialog.selectFolder }
- }
- CheckBox {
- id: fileDialogSelectExisting
- text: "Select Existing Files"
- checked: true
- Binding on checked { value: fileDialog.selectExisting }
- }
- CheckBox {
- id: fileDialogSelectMultiple
- text: "Select Multiple Files"
- Binding on checked { value: fileDialog.selectMultiple }
- }
- CheckBox {
- id: fileDialogOpenFiles
- text: "Open Files After Accepting"
- }
- CheckBox {
- id: fileDialogVisible
- text: "Visible"
- Binding on checked { value: fileDialog.visible }
- }
- Text {
- color: palette.windowText
- text: "<b>current view folder:</b> " + fileDialog.folder
- }
- Text {
- color: palette.windowText
- text: "<b>name filters:</b> {" + fileDialog.nameFilters + "}"
- width: parent.width
- wrapMode: Text.Wrap
- }
- Text {
- color: palette.windowText
- text: "<b>current filter:</b>" + fileDialog.selectedNameFilter
- width: parent.width
- wrapMode: Text.Wrap
- }
- Text {
- color: palette.windowText
- text: "<b>chosen files:</b> " + fileDialog.fileUrls
- width: parent.width
- wrapMode: Text.Wrap
- }
- Text {
- color: palette.windowText
- text: "<b>chosen single path:</b> " + fileDialog.fileUrl
- width: parent.width
- wrapMode: Text.Wrap
- }
- }
-
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: buttonRow.height * 1.2
- color: Qt.darker(palette.window, 1.1)
- border.color: Qt.darker(palette.window, 1.3)
- Row {
- id: buttonRow
- spacing: 6
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 12
- height: implicitHeight
- width: parent.width
- Button {
- text: "Open"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fileDialog.open()
- }
- Button {
- text: "Close"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fileDialog.close()
- }
- Button {
- text: "go to /tmp"
- anchors.verticalCenter: parent.verticalCenter
- // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
- onClicked: fileDialog.folder = (Qt.platform.os === "windows" ? "/c:/temp" : "/tmp")
- }
- }
- }
-}
diff --git a/examples/quick/dialogs/systemdialogs/FontDialogs.qml b/examples/quick/dialogs/systemdialogs/FontDialogs.qml
deleted file mode 100644
index 7d4328994b..0000000000
--- a/examples/quick/dialogs/systemdialogs/FontDialogs.qml
+++ /dev/null
@@ -1,153 +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 examples 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 2.2
-import QtQuick.Dialogs 1.1
-import "../../shared"
-
-Rectangle {
- width: 320
- height: 360
- color: palette.window
- SystemPalette { id: palette }
- clip: true
-
- FontDialog {
- id: fontDialog
- visible: fontDialogVisible.checked
- modality: fontDialogModal.checked ? Qt.WindowModal : Qt.NonModal
- scalableFonts: fontDialogScalableFonts.checked
- nonScalableFonts: fontDialogNonScalableFonts.checked
- monospacedFonts: fontDialogMonospacedFonts.checked
- proportionalFonts: fontDialogProportionalFonts.checked
- title: "Choose a font"
- font: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal })
- onAccepted: { console.log("Accepted: " + font) }
- onRejected: { console.log("Rejected") }
- }
-
- Column {
- id: optionsColumn
- anchors.fill: parent
- anchors.margins: 12
- spacing: 8
- Text {
- font.bold: true
- text: "Font dialog properties:"
- }
- CheckBox {
- id: fontDialogModal
- text: "Modal"
- checked: true
- Binding on checked { value: fontDialog.modality != Qt.NonModal }
- }
- CheckBox {
- id: fontDialogScalableFonts
- text: "Scalable fonts"
- Binding on checked { value: fontDialog.scalableFonts }
- }
- CheckBox {
- id: fontDialogNonScalableFonts
- text: "Non scalable fonts"
- Binding on checked { value: fontDialog.nonScalableFonts }
- }
- CheckBox {
- id: fontDialogMonospacedFonts
- text: "Monospaced fonts"
- Binding on checked { value: fontDialog.monospacedFonts }
- }
- CheckBox {
- id: fontDialogProportionalFonts
- text: "Proportional fonts"
- Binding on checked { value: fontDialog.proportionalFonts }
- }
- CheckBox {
- id: fontDialogVisible
- text: "Visible"
- Binding on checked { value: fontDialog.visible }
- }
- Text {
- text: "Current font:"
- }
- Text {
- id: fontLabel
- color: palette.windowText
- text: "<b>" + fontDialog.font.family + " - " + fontDialog.font.pointSize + "</b>"
- MouseArea {
- anchors.fill: parent
- onClicked: fontDialog.open()
- }
- }
- }
-
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: buttonRow.height * 1.2
- color: Qt.darker(palette.window, 1.1)
- border.color: Qt.darker(palette.window, 1.3)
- Row {
- id: buttonRow
- spacing: 6
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 12
- width: parent.width
- Button {
- text: "Open"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fontDialog.open()
- }
- Button {
- text: "Close"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fontDialog.close()
- }
- Button {
- text: "set to default"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: fontDialog.font = Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal })
- }
- }
- }
-}
diff --git a/examples/quick/dialogs/systemdialogs/MessageDialogs.qml b/examples/quick/dialogs/systemdialogs/MessageDialogs.qml
deleted file mode 100644
index 9c70228046..0000000000
--- a/examples/quick/dialogs/systemdialogs/MessageDialogs.qml
+++ /dev/null
@@ -1,307 +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 examples 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 2.1
-import QtQuick.Dialogs 1.1
-import QtQuick.Window 2.0
-import "../../shared"
-
-Rectangle {
- width: 580
- height: 400
- color: palette.window
- SystemPalette { id: palette }
- clip: true
-
- //! [messagedialog]
- MessageDialog {
- id: messageDialog
- visible: messageDialogVisible.checked
- modality: messageDialogModal.checked ? Qt.WindowModal : Qt.NonModal
- title: windowTitleField.text
- text: customizeText.checked ? textField.text : ""
- informativeText: customizeInformativeText.checked ? informativeTextField.text : ""
- detailedText: customizeDetailedText.checked ? detailedTextField.text : ""
- onButtonClicked: console.log("clicked button " + clickedButton)
- onAccepted: lastChosen.text = "Accepted " +
- (clickedButton == StandardButton.Ok ? "(OK)" : (clickedButton == StandardButton.Retry ? "(Retry)" : "(Ignore)"))
- onRejected: lastChosen.text = "Rejected " +
- (clickedButton == StandardButton.Close ? "(Close)" : (clickedButton == StandardButton.Abort ? "(Abort)" : "(Cancel)"))
- onHelp: lastChosen.text = "Yelped for help!"
- onYes: lastChosen.text = (clickedButton == StandardButton.Yes ? "Yeessss!!" : "Yes, now and always")
- onNo: lastChosen.text = (clickedButton == StandardButton.No ? "Oh No." : "No, no, a thousand times no!")
- onApply: lastChosen.text = "Apply"
- onReset: lastChosen.text = "Reset"
- }
- //! [messagedialog]
-
- Column {
- anchors.fill: parent
- anchors.margins: 12
- spacing: 8
- Text {
- color: palette.windowText
- font.bold: true
- text: "Message dialog properties:"
- }
- CheckBox {
- id: messageDialogModal
- text: "Modal"
- checked: true
- Binding on checked { value: messageDialog.modality != Qt.NonModal }
- }
- CheckBox {
- id: customizeTitle
- text: "Window Title"
- checked: true
- width: parent.width
- TextField {
- id: windowTitleField
- anchors.right: parent.right
- width: informativeTextField.width
- text: "Alert"
- }
- }
- Row {
- spacing: 8
- property bool updating: false
- function updateIcon(icon, checked) {
- if (updating) return
- updating = true
- messageDialog.icon = (checked ? icon : StandardIcon.NoIcon)
- for (var i = 0; i < children.length; ++i)
- if (children[i].icon !== icon)
- children[i].checked = false
- updating = false
- }
-
- CheckBox {
- id: iconInformation
- text: "Information"
- property int icon: StandardIcon.Information
- onCheckedChanged: parent.updateIcon(icon, checked)
- }
-
- CheckBox {
- id: iconWarning
- text: "Warning"
- checked: true
- property int icon: StandardIcon.Warning
- onCheckedChanged: parent.updateIcon(icon, checked)
- Component.onCompleted: parent.updateIcon(icon, true)
- }
-
- CheckBox {
- id: iconCritical
- text: "Critical"
- property int icon: StandardIcon.Critical
- onCheckedChanged: parent.updateIcon(icon, checked)
- }
-
- CheckBox {
- id: iconQuestion
- text: "Question"
- property int icon: StandardIcon.Question
- onCheckedChanged: parent.updateIcon(icon, checked)
- }
- }
-
- CheckBox {
- id: customizeText
- text: "Primary Text"
- checked: true
- width: parent.width
- TextField {
- id: textField
- anchors.right: parent.right
- width: informativeTextField.width
- text: "Attention Please"
- }
- }
- CheckBox {
- id: customizeInformativeText
- text: "Informative Text"
- checked: true
- width: parent.width
- TextField {
- id: informativeTextField
- anchors.right: parent.right
- width: parent.width - parent.row.spacing - parent.row.width
- text: "Be alert!"
- }
- }
- Text {
- text: "Buttons:"
- }
- Flow {
- spacing: 8
- width: parent.width
- property bool updating: false
- function updateButtons(button, checked) {
- if (updating) return
- updating = true
- var buttons = 0
- for (var i = 0; i < children.length; ++i)
- if (children[i].checked)
- buttons |= children[i].button
- if (!buttons)
- buttons = StandardButton.Ok
- messageDialog.standardButtons = buttons
- updating = false
- }
-
- CheckBox {
- text: "Help"
- property int button: StandardButton.Help
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "Abort"
- property int button: StandardButton.Abort
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "Close"
- property int button: StandardButton.Close
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "Cancel"
- property int button: StandardButton.Cancel
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "NoToAll"
- property int button: StandardButton.NoToAll
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "No"
- property int button: StandardButton.No
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "YesToAll"
- property int button: StandardButton.YesToAll
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "Yes"
- property int button: StandardButton.Yes
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "Ignore"
- property int button: StandardButton.Ignore
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "Retry"
- property int button: StandardButton.Retry
- onCheckedChanged: parent.updateButtons(button, checked)
- }
-
- CheckBox {
- text: "OK"
- checked: true
- property int button: StandardButton.Ok
- onCheckedChanged: parent.updateButtons(button, checked)
- }
- }
- CheckBox {
- id: customizeDetailedText
- text: "Detailed Text"
- checked: true
- width: parent.width
- TextField {
- id: detailedTextField
- anchors.right: parent.right
- width: informativeTextField.width
- text: "The world needs more lerts."
- }
- }
- CheckBox {
- id: messageDialogVisible
- text: "Visible"
- Binding on checked { value: messageDialog.visible }
- }
- Text {
- id: lastChosen
- }
- }
-
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: buttonRow.height * 1.2
- color: Qt.darker(palette.window, 1.1)
- border.color: Qt.darker(palette.window, 1.3)
- Row {
- id: buttonRow
- spacing: 6
- anchors.verticalCenter: parent.verticalCenter
- anchors.left: parent.left
- anchors.leftMargin: 12
- width: parent.width
- Button {
- text: "Open"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: messageDialog.open()
- }
- Button {
- text: "Close"
- anchors.verticalCenter: parent.verticalCenter
- onClicked: messageDialog.close()
- }
- }
- }
-}
diff --git a/examples/quick/dialogs/systemdialogs/doc/images/systemdialogs-example.jpg b/examples/quick/dialogs/systemdialogs/doc/images/systemdialogs-example.jpg
deleted file mode 100644
index 4517a39308..0000000000
--- a/examples/quick/dialogs/systemdialogs/doc/images/systemdialogs-example.jpg
+++ /dev/null
Binary files differ
diff --git a/examples/quick/dialogs/systemdialogs/doc/src/systemdialogs.qdoc b/examples/quick/dialogs/systemdialogs/doc/src/systemdialogs.qdoc
deleted file mode 100644
index 9788be7343..0000000000
--- a/examples/quick/dialogs/systemdialogs/doc/src/systemdialogs.qdoc
+++ /dev/null
@@ -1,48 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-/*!
- \title Qt Quick System Dialog Examples
- \example systemdialogs
- \brief This example demonstrates the system dialog types in QML
- \image systemdialogs-example.jpg
- \ingroup qtquickdialog_examples
-
- This example demonstrates the system dialogs in the \l{Qt Quick Dialogs}
- module. The appearance and behavior is platform-dependent.
-
- A \l FileDialog is used to choose a single file, multiple files or a
- single directory, depending on how it is configured.
- \snippet systemdialogs/FileDialogs.qml filedialog
-
- A \l ColorDialog is used to choose a color, with or without alpha (transparency)
- depending on how it is configured.
- \snippet systemdialogs/ColorDialogs.qml colordialog
-
- The example can be built as a standalone executable, but each
- type of dialog is demonstrated in a separate QML file which can
- also be run separately with qmlscene.
-*/
diff --git a/examples/quick/dialogs/systemdialogs/systemdialogs.pro b/examples/quick/dialogs/systemdialogs/systemdialogs.pro
deleted file mode 100644
index 323ea2fac7..0000000000
--- a/examples/quick/dialogs/systemdialogs/systemdialogs.pro
+++ /dev/null
@@ -1,15 +0,0 @@
-TEMPLATE = app
-
-QT += quick qml
-SOURCES += main.cpp
-RESOURCES += systemdialogs.qrc ../../shared/shared.qrc
-
-OTHER_FILES += \
- systemdialogs.qml \
- FileDialogs.qml \
- ColorDialogs.qml \
- FontDialogs.qml \
- MessageDialogs.qml
-
-target.path = $$[QT_INSTALL_EXAMPLES]/quick/dialogs/systemdialogs
-INSTALLS += target
diff --git a/examples/quick/dialogs/systemdialogs/systemdialogs.qrc b/examples/quick/dialogs/systemdialogs/systemdialogs.qrc
deleted file mode 100644
index 2193088cb9..0000000000
--- a/examples/quick/dialogs/systemdialogs/systemdialogs.qrc
+++ /dev/null
@@ -1,9 +0,0 @@
-<RCC>
- <qresource prefix="/dialogs/systemdialogs">
- <file>systemdialogs.qml</file>
- <file>FileDialogs.qml</file>
- <file>ColorDialogs.qml</file>
- <file>FontDialogs.qml</file>
- <file>MessageDialogs.qml</file>
- </qresource>
-</RCC>
diff --git a/examples/quick/quick.pro b/examples/quick/quick.pro
index c6b7ee1c34..186988716c 100644
--- a/examples/quick/quick.pro
+++ b/examples/quick/quick.pro
@@ -21,7 +21,6 @@ SUBDIRS = quick-accessibility \
customitems \
imageprovider \
window \
- dialogs \
particles \
demos
diff --git a/examples/quick/dialogs/systemdialogs/systemdialogs.qml b/examples/quick/views/listview/displaymargin.qml
index 1600e88812..c3402f6baa 100644
--- a/examples/quick/dialogs/systemdialogs/systemdialogs.qml
+++ b/examples/quick/views/listview/displaymargin.qml
@@ -37,35 +37,57 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+import QtQuick 2.3
-import QtQuick 2.2
-import "../../shared"
+Item {
+ width: 480; height: 320
-TabSet {
- width: 580
- height: 440
+ ListView {
+ id: view
+ anchors.top: header.bottom
+ anchors.bottom: footer.top
+ width: parent.width
- FileDialogs {
- property string title: "File Dialog"
- anchors.fill: parent
- color: "#e3e3e3" // to match tab.png
- }
+ cacheBuffer: 0
+ displayMarginBeginning: 40
+ displayMarginEnd: 40
- ColorDialogs {
- property string title: "Color Dialog"
- anchors.fill: parent
- color: "#e3e3e3" // to match tab.png
+ model: 100
+ delegate: Rectangle {
+ objectName: "delegate"
+ width: parent.width
+ height: 25
+ color: index % 2 ? "steelblue" : "lightsteelblue"
+ Text {
+ anchors.centerIn: parent
+ color: "white"
+ text: "Item " + (index + 1)
+ }
+ }
}
- FontDialogs {
- property string title: "Font Dialog"
- anchors.fill: parent
- color: "#e3e3e3" // to match tab.png
+ Rectangle {
+ id: header
+ width: parent.width; height: 40
+ color: "#AAFF0000"
+
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 24
+ text: "Header"
+ }
}
- MessageDialogs {
- property string title: "Message Dialog"
- anchors.fill: parent
- color: "#e3e3e3" // to match tab.png
+ Rectangle {
+ id: footer
+ anchors.bottom: parent.bottom
+ width: parent.width; height: 40
+ color: "#AAFF0000"
+
+ Text {
+ anchors.centerIn: parent
+ font.pixelSize: 24
+ text: "Footer"
+ }
}
}
diff --git a/examples/quick/views/views.qml b/examples/quick/views/views.qml
index 1bc6f6a3d8..2fbf9c5470 100644
--- a/examples/quick/views/views.qml
+++ b/examples/quick/views/views.qml
@@ -58,6 +58,7 @@ Item {
addExample("Packages", "Transitions between a ListView and GridView", Qt.resolvedUrl("package/view.qml"))
addExample("PathView", "A simple PathView", Qt.resolvedUrl("pathview/pathview-example.qml"))
addExample("ObjectModel", "Using a ObjectModel", Qt.resolvedUrl("objectmodel/objectmodel.qml"))
+ addExample("Display Margins", "A ListView with display margins", Qt.resolvedUrl("listview/displaymargin.qml"))
}
}
}
diff --git a/examples/quick/views/views.qrc b/examples/quick/views/views.qrc
index 434fa788bf..52abb68659 100644
--- a/examples/quick/views/views.qrc
+++ b/examples/quick/views/views.qrc
@@ -65,5 +65,6 @@
<file>visualdatamodel/dragselection.qml</file>
<file>objectmodel/objectmodel.qml</file>
<file>views.qml</file>
+ <file>listview/displaymargin.qml</file>
</qresource>
</RCC>
diff --git a/src/imports/dialogs-private/dialogs-private.pro b/src/imports/dialogs-private/dialogs-private.pro
deleted file mode 100644
index 7f04617ef5..0000000000
--- a/src/imports/dialogs-private/dialogs-private.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-CXX_MODULE = qml
-TARGET = dialogsprivateplugin
-TARGETPATH = QtQuick/Dialogs/Private
-IMPORT_VERSION = 1.1
-
-SOURCES += \
- qquickfontlistmodel.cpp \
- qquickwritingsystemlistmodel.cpp \
- dialogsprivateplugin.cpp
-
-HEADERS += \
- qquickfontlistmodel_p.h \
- qquickwritingsystemlistmodel_p.h
-
-QT += gui-private core-private qml-private
-
-load(qml_plugin)
diff --git a/src/imports/dialogs-private/qmldir b/src/imports/dialogs-private/qmldir
deleted file mode 100644
index c371f8bb8c..0000000000
--- a/src/imports/dialogs-private/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtQuick.Dialogs.Private
-plugin dialogsprivateplugin
-typeinfo plugins.qmltypes
-classname QtQuick2DialogsPrivatePlugin
diff --git a/src/imports/dialogs-private/qquickfontlistmodel.cpp b/src/imports/dialogs-private/qquickfontlistmodel.cpp
deleted file mode 100644
index 96d1824ef6..0000000000
--- a/src/imports/dialogs-private/qquickfontlistmodel.cpp
+++ /dev/null
@@ -1,290 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickfontlistmodel_p.h"
-#include <QtGui/qfontdatabase.h>
-#include <QtQml/qqmlcontext.h>
-#include <private/qqmlengine_p.h>
-#include <private/qv8engine_p.h>
-#include <private/qv4value_p.h>
-#include <private/qv4engine_p.h>
-#include <private/qv4object_p.h>
-
-QT_BEGIN_NAMESPACE
-
-using namespace QV4;
-
-class QQuickFontListModelPrivate
-{
- Q_DECLARE_PUBLIC(QQuickFontListModel)
-
-public:
- QQuickFontListModelPrivate(QQuickFontListModel *q)
- : q_ptr(q), ws(QFontDatabase::Any)
- , options(QSharedPointer<QFontDialogOptions>(new QFontDialogOptions()))
- {}
-
- QQuickFontListModel *q_ptr;
- QFontDatabase db;
- QFontDatabase::WritingSystem ws;
- QSharedPointer<QFontDialogOptions> options;
- QStringList families;
- QHash<int, QByteArray> roleNames;
- ~QQuickFontListModelPrivate() {}
- void init();
-};
-
-
-void QQuickFontListModelPrivate::init()
-{
- Q_Q(QQuickFontListModel);
-
- families = db.families();
-
- emit q->rowCountChanged();
- emit q->writingSystemChanged();
-}
-
-QQuickFontListModel::QQuickFontListModel(QObject *parent)
- : QAbstractListModel(parent), d_ptr(new QQuickFontListModelPrivate(this))
-{
- Q_D(QQuickFontListModel);
- d->roleNames[FontFamilyRole] = "family";
- d->init();
-}
-
-QQuickFontListModel::~QQuickFontListModel()
-{
-}
-
-QVariant QQuickFontListModel::data(const QModelIndex &index, int role) const
-{
- Q_D(const QQuickFontListModel);
- QVariant rv;
-
- if (index.row() >= d->families.size())
- return rv;
-
- switch (role)
- {
- case FontFamilyRole:
- rv = d->families.at(index.row());
- break;
- default:
- break;
- }
- return rv;
-}
-
-QHash<int, QByteArray> QQuickFontListModel::roleNames() const
-{
- Q_D(const QQuickFontListModel);
- return d->roleNames;
-}
-
-int QQuickFontListModel::rowCount(const QModelIndex &parent) const
-{
- Q_D(const QQuickFontListModel);
- Q_UNUSED(parent);
- return d->families.size();
-}
-
-QModelIndex QQuickFontListModel::index(int row, int , const QModelIndex &) const
-{
- return createIndex(row, 0);
-}
-
-QString QQuickFontListModel::writingSystem() const
-{
- Q_D(const QQuickFontListModel);
- return QFontDatabase::writingSystemName(d->ws);
-}
-
-void QQuickFontListModel::setWritingSystem(const QString &wSystem)
-{
- Q_D(QQuickFontListModel);
-
- if (wSystem == writingSystem())
- return;
-
- QList<QFontDatabase::WritingSystem> wss;
- wss << QFontDatabase::Any;
- wss << d->db.writingSystems();
- QFontDatabase::WritingSystem ws;
- foreach (ws, wss) {
- if (wSystem == QFontDatabase::writingSystemName(ws)) {
- d->ws = ws;
- updateFamilies();
- return;
- }
- }
-}
-
-void QQuickFontListModel::updateFamilies()
-{
- Q_D(QQuickFontListModel);
-
- beginResetModel();
- const QFontDialogOptions::FontDialogOptions scalableMask = (QFontDialogOptions::FontDialogOptions)(QFontDialogOptions::ScalableFonts | QFontDialogOptions::NonScalableFonts);
- const QFontDialogOptions::FontDialogOptions spacingMask = (QFontDialogOptions::FontDialogOptions)(QFontDialogOptions::ProportionalFonts | QFontDialogOptions::MonospacedFonts);
- const QFontDialogOptions::FontDialogOptions options = d->options->options();
-
- d->families.clear();
- foreach (const QString &family, d->db.families(d->ws)) {
- if ((options & scalableMask) && (options & scalableMask) != scalableMask) {
- if (bool(options & QFontDialogOptions::ScalableFonts) != d->db.isSmoothlyScalable(family))
- continue;
- }
- if ((options & spacingMask) && (options & spacingMask) != spacingMask) {
- if (bool(options & QFontDialogOptions::MonospacedFonts) != d->db.isFixedPitch(family))
- continue;
- }
- d->families << family;
- }
- endResetModel();
-}
-
-bool QQuickFontListModel::scalableFonts() const
-{
- Q_D(const QQuickFontListModel);
- return d->options->testOption(QFontDialogOptions::ScalableFonts);
-}
-
-bool QQuickFontListModel::nonScalableFonts() const
-{
- Q_D(const QQuickFontListModel);
- return d->options->testOption(QFontDialogOptions::NonScalableFonts);
-}
-
-bool QQuickFontListModel::monospacedFonts() const
-{
- Q_D(const QQuickFontListModel);
- return d->options->testOption(QFontDialogOptions::MonospacedFonts);
-}
-
-bool QQuickFontListModel::proportionalFonts() const
-{
- Q_D(const QQuickFontListModel);
- return d->options->testOption(QFontDialogOptions::ProportionalFonts);
-}
-
-QQmlV4Handle QQuickFontListModel::get(int idx) const
-{
- Q_D(const QQuickFontListModel);
-
- if (idx < 0 || idx >= count())
- return QQmlV4Handle(Encode::undefined());
-
- QQmlEngine *engine = qmlContext(this)->engine();
- QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine);
- ExecutionEngine *v4engine = QV8Engine::getV4(v8engine);
- Scope scope(v4engine);
- ScopedObject o(scope, v4engine->newObject());
- ScopedString s(scope);
- for (int ii = 0; ii < d->roleNames.keys().count(); ++ii) {
- Property *p = o->insertMember((s = v4engine->newIdentifier(d->roleNames[Qt::UserRole + ii + 1])), PropertyAttributes());
- p->value = v8engine->fromVariant(data(index(idx, 0), Qt::UserRole + ii + 1));
- }
-
- return QQmlV4Handle(o);
-}
-
-QQmlV4Handle QQuickFontListModel::pointSizes()
-{
- QQmlEngine *engine = qmlContext(this)->engine();
- QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine);
- ExecutionEngine *v4engine = QV8Engine::getV4(v8engine);
- Scope scope(v4engine);
-
- QList<int> pss = QFontDatabase::standardSizes();
- int size = pss.size();
-
- Scoped<QV4::ArrayObject> a(scope, v4engine->newArrayObject());
- a->arrayReserve(size);
- a->arrayDataLen = size;
- for (int i = 0; i < size; ++i)
- a->arrayData[i].value = Primitive::fromInt32(pss.at(i));
- a->setArrayLengthUnchecked(size);
-
- return QQmlV4Handle(ScopedValue(scope, a.asReturnedValue()));
-}
-
-void QQuickFontListModel::classBegin()
-{
-}
-
-void QQuickFontListModel::componentComplete()
-{
-}
-
-void QQuickFontListModel::setScalableFonts(bool arg)
-{
- Q_D(QQuickFontListModel);
- d->options->setOption(QFontDialogOptions::ScalableFonts, arg);
- updateFamilies();
- emit scalableFontsChanged();
-}
-
-void QQuickFontListModel::setNonScalableFonts(bool arg)
-{
- Q_D(QQuickFontListModel);
- d->options->setOption(QFontDialogOptions::NonScalableFonts, arg);
- updateFamilies();
- emit nonScalableFontsChanged();
-}
-
-void QQuickFontListModel::setMonospacedFonts(bool arg)
-{
- Q_D(QQuickFontListModel);
- d->options->setOption(QFontDialogOptions::MonospacedFonts, arg);
- updateFamilies();
- emit monospacedFontsChanged();
-}
-
-void QQuickFontListModel::setProportionalFonts(bool arg)
-{
- Q_D(QQuickFontListModel);
- d->options->setOption(QFontDialogOptions::ProportionalFonts, arg);
- updateFamilies();
- emit proportionalFontsChanged();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs-private/qquickfontlistmodel_p.h b/src/imports/dialogs-private/qquickfontlistmodel_p.h
deleted file mode 100644
index 3e2e7f7132..0000000000
--- a/src/imports/dialogs-private/qquickfontlistmodel_p.h
+++ /dev/null
@@ -1,125 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKFONTLISTMODEL_P_H
-#define QQUICKFONTLISTMODEL_P_H
-
-#include <QtCore/qstringlist.h>
-#include <QtCore/qabstractitemmodel.h>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include <QtQml/qqmlparserstatus.h>
-#include <private/qv8engine_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QModelIndex;
-
-class QQuickFontListModelPrivate;
-
-class QQuickFontListModel : public QAbstractListModel, public QQmlParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QQmlParserStatus)
- Q_PROPERTY(QString writingSystem READ writingSystem WRITE setWritingSystem NOTIFY writingSystemChanged)
-
- Q_PROPERTY(bool scalableFonts READ scalableFonts WRITE setScalableFonts NOTIFY scalableFontsChanged)
- Q_PROPERTY(bool nonScalableFonts READ nonScalableFonts WRITE setNonScalableFonts NOTIFY nonScalableFontsChanged)
- Q_PROPERTY(bool monospacedFonts READ monospacedFonts WRITE setMonospacedFonts NOTIFY monospacedFontsChanged)
- Q_PROPERTY(bool proportionalFonts READ proportionalFonts WRITE setProportionalFonts NOTIFY proportionalFontsChanged)
-
- Q_PROPERTY(int count READ count NOTIFY rowCountChanged)
-
-public:
- QQuickFontListModel(QObject *parent = 0);
- ~QQuickFontListModel();
-
- enum Roles {
- FontFamilyRole = Qt::UserRole + 1
- };
-
- virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
- virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- virtual QHash<int, QByteArray> roleNames() const;
-
- int count() const { return rowCount(QModelIndex()); }
-
- QString writingSystem() const;
- void setWritingSystem(const QString& writingSystem);
-
- bool scalableFonts() const;
- bool nonScalableFonts() const;
- bool monospacedFonts() const;
- bool proportionalFonts() const;
-
- Q_INVOKABLE QQmlV4Handle get(int index) const;
- Q_INVOKABLE QQmlV4Handle pointSizes();
-
- virtual void classBegin();
- virtual void componentComplete();
-
-public Q_SLOTS:
- void setScalableFonts(bool arg);
- void setNonScalableFonts(bool arg);
- void setMonospacedFonts(bool arg);
- void setProportionalFonts(bool arg);
-
-Q_SIGNALS:
- void scalableFontsChanged();
- void nonScalableFontsChanged();
- void monospacedFontsChanged();
- void proportionalFontsChanged();
- void writingSystemChanged();
- void rowCountChanged() const;
-
-protected:
- void updateFamilies();
-
-private:
- Q_DISABLE_COPY(QQuickFontListModel)
- Q_DECLARE_PRIVATE(QQuickFontListModel)
- QScopedPointer<QQuickFontListModelPrivate> d_ptr;
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKFONTLISTMODEL_P_H
diff --git a/src/imports/dialogs-private/qquickwritingsystemlistmodel.cpp b/src/imports/dialogs-private/qquickwritingsystemlistmodel.cpp
deleted file mode 100644
index f2b4ff8b8f..0000000000
--- a/src/imports/dialogs-private/qquickwritingsystemlistmodel.cpp
+++ /dev/null
@@ -1,176 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwritingsystemlistmodel_p.h"
-#include <QtGui/qfontdatabase.h>
-#include <QtQml/qqmlcontext.h>
-#include <private/qqmlengine_p.h>
-#include <private/qv8engine_p.h>
-#include <private/qv4value_p.h>
-#include <private/qv4engine_p.h>
-#include <private/qv4object_p.h>
-
-QT_BEGIN_NAMESPACE
-
-using namespace QV4;
-
-class QQuickWritingSystemListModelPrivate
-{
- Q_DECLARE_PUBLIC(QQuickWritingSystemListModel)
-
-public:
- QQuickWritingSystemListModelPrivate(QQuickWritingSystemListModel *q)
- : q_ptr(q)
- {}
-
- QQuickWritingSystemListModel *q_ptr;
- QList<QFontDatabase::WritingSystem> wss;
- QHash<int, QByteArray> roleNames;
- ~QQuickWritingSystemListModelPrivate() {}
- void init();
-};
-
-
-void QQuickWritingSystemListModelPrivate::init()
-{
- Q_Q(QQuickWritingSystemListModel);
- wss << QFontDatabase::Any;
- QFontDatabase db;
- wss << db.writingSystems();
-
- emit q->rowCountChanged();
- emit q->writingSystemsChanged();
-}
-
-QQuickWritingSystemListModel::QQuickWritingSystemListModel(QObject *parent)
- : QAbstractListModel(parent), d_ptr(new QQuickWritingSystemListModelPrivate(this))
-{
- Q_D(QQuickWritingSystemListModel);
- d->roleNames[WritingSystemNameRole] = "name";
- d->roleNames[WritingSystemSampleRole] = "sample";
- d->init();
-}
-
-QQuickWritingSystemListModel::~QQuickWritingSystemListModel()
-{
-}
-
-QVariant QQuickWritingSystemListModel::data(const QModelIndex &index, int role) const
-{
- Q_D(const QQuickWritingSystemListModel);
- QVariant rv;
-
- if (index.row() >= d->wss.size())
- return rv;
-
- switch (role)
- {
- case WritingSystemNameRole:
- rv = QFontDatabase::writingSystemName(d->wss.at(index.row()));
- break;
- case WritingSystemSampleRole:
- rv = QFontDatabase::writingSystemSample(d->wss.at(index.row()));
- break;
- default:
- break;
- }
- return rv;
-}
-
-QHash<int, QByteArray> QQuickWritingSystemListModel::roleNames() const
-{
- Q_D(const QQuickWritingSystemListModel);
- return d->roleNames;
-}
-
-int QQuickWritingSystemListModel::rowCount(const QModelIndex &parent) const
-{
- Q_D(const QQuickWritingSystemListModel);
- Q_UNUSED(parent);
- return d->wss.size();
-}
-
-QModelIndex QQuickWritingSystemListModel::index(int row, int , const QModelIndex &) const
-{
- return createIndex(row, 0);
-}
-
-QStringList QQuickWritingSystemListModel::writingSystems() const
-{
- Q_D(const QQuickWritingSystemListModel);
- QStringList result;
- QFontDatabase::WritingSystem ws;
- foreach (ws, d->wss)
- result.append(QFontDatabase::writingSystemName(ws));
-
- return result;
-}
-
-QQmlV4Handle QQuickWritingSystemListModel::get(int idx) const
-{
- Q_D(const QQuickWritingSystemListModel);
-
- if (idx < 0 || idx >= count())
- return QQmlV4Handle(Encode::undefined());
-
- QQmlEngine *engine = qmlContext(this)->engine();
- QV8Engine *v8engine = QQmlEnginePrivate::getV8Engine(engine);
- ExecutionEngine *v4engine = QV8Engine::getV4(v8engine);
- Scope scope(v4engine);
- ScopedObject o(scope, v4engine->newObject());
- ScopedString s(scope);
- for (int ii = 0; ii < d->roleNames.keys().count(); ++ii) {
- Property *p = o->insertMember((s = v4engine->newIdentifier(d->roleNames[Qt::UserRole + ii + 1])), PropertyAttributes());
- p->value = v8engine->fromVariant(data(index(idx, 0), Qt::UserRole + ii + 1));
- }
-
- return QQmlV4Handle(o);
-}
-
-void QQuickWritingSystemListModel::classBegin()
-{
-}
-
-void QQuickWritingSystemListModel::componentComplete()
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs-private/qquickwritingsystemlistmodel_p.h b/src/imports/dialogs-private/qquickwritingsystemlistmodel_p.h
deleted file mode 100644
index 31058bbf78..0000000000
--- a/src/imports/dialogs-private/qquickwritingsystemlistmodel_p.h
+++ /dev/null
@@ -1,100 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWRITINGSYSTEMLISTMODEL_P_H
-#define QQUICKWRITINGSYSTEMLISTMODEL_P_H
-
-#include <QtCore/qstringlist.h>
-#include <QtCore/qabstractitemmodel.h>
-#include <QtQml/qqmlparserstatus.h>
-#include <private/qv8engine_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QModelIndex;
-
-class QQuickWritingSystemListModelPrivate;
-
-class QQuickWritingSystemListModel : public QAbstractListModel, public QQmlParserStatus
-{
- Q_OBJECT
- Q_INTERFACES(QQmlParserStatus)
- Q_PROPERTY(QStringList writingSystems READ writingSystems NOTIFY writingSystemsChanged)
-
- Q_PROPERTY(int count READ count NOTIFY rowCountChanged)
-
-public:
- QQuickWritingSystemListModel(QObject *parent = 0);
- ~QQuickWritingSystemListModel();
-
- enum Roles {
- WritingSystemNameRole = Qt::UserRole + 1,
- WritingSystemSampleRole = Qt::UserRole + 2
- };
-
- virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
- virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
- virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
- virtual QHash<int, QByteArray> roleNames() const;
-
- int count() const { return rowCount(QModelIndex()); }
-
- QStringList writingSystems() const;
-
- Q_INVOKABLE QQmlV4Handle get(int index) const;
-
- virtual void classBegin();
- virtual void componentComplete();
-
-Q_SIGNALS:
- void writingSystemsChanged();
- void rowCountChanged() const;
-
-private:
- Q_DISABLE_COPY(QQuickWritingSystemListModel)
- Q_DECLARE_PRIVATE(QQuickWritingSystemListModel)
- QScopedPointer<QQuickWritingSystemListModelPrivate> d_ptr;
-
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWRITINGSYSTEMLISTMODEL_P_H
diff --git a/src/imports/dialogs/DefaultColorDialog.qml b/src/imports/dialogs/DefaultColorDialog.qml
deleted file mode 100644
index 4913e332d7..0000000000
--- a/src/imports/dialogs/DefaultColorDialog.qml
+++ /dev/null
@@ -1,362 +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 QtQuick.Dialogs 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 2.1
-import QtQuick.Window 2.1
-import QtQuick.Dialogs 1.0
-import "qml"
-
-AbstractColorDialog {
- id: root
- property bool __valueSet: true // guard to prevent binding loops
- function __setControlsFromColor() {
- __valueSet = false
- hueSlider.value = root.currentHue
- saturationSlider.value = root.currentSaturation
- lightnessSlider.value = root.currentLightness
- alphaSlider.value = root.currentAlpha
- crosshairs.x = root.currentLightness * paletteMap.width
- crosshairs.y = (1.0 - root.currentSaturation) * paletteMap.height
- __valueSet = true
- }
- onCurrentColorChanged: __setControlsFromColor()
- onSelectionAccepted: root.color = root.currentColor
-
- Rectangle {
- id: content
- property int maxSize: 0.9 * Math.min(Screen.desktopAvailableWidth, Screen.desktopAvailableHeight)
- implicitHeight: Math.min(maxSize, Screen.pixelDensity * (usePaletteMap ? 100 : 50))
- implicitWidth: usePaletteMap ? implicitHeight - bottomMinHeight : implicitHeight * 1.5
- color: palette.window
- focus: root.visible
- property real bottomMinHeight: sliders.height + buttonRow.height + outerSpacing * 3
- property real spacing: 8
- property real outerSpacing: 12
- property bool usePaletteMap: true
-
- Keys.onPressed: {
- event.accepted = true
- switch (event.key) {
- case Qt.Key_Return:
- case Qt.Key_Select:
- accept()
- break
- case Qt.Key_Escape:
- case Qt.Key_Back:
- reject()
- break
- case Qt.Key_C:
- if (event.modifiers & Qt.ControlModifier)
- colorField.copyAll()
- break
- case Qt.Key_V:
- if (event.modifiers & Qt.ControlModifier) {
- colorField.paste()
- root.currentColor = colorField.text
- }
- break
- default:
- // do nothing
- event.accepted = false
- break
- }
- }
-
- // set the preferred width based on height, to avoid "letterboxing" the paletteMap
- onHeightChanged: implicitHeight = Math.max((usePaletteMap ? 480 : bottomMinHeight), height)
-
- SystemPalette { id: palette }
-
- Item {
- id: paletteFrame
- visible: content.usePaletteMap
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- margins: content.outerSpacing
- }
- height: Math.min(content.height - content.bottomMinHeight, content.width - content.outerSpacing * 2)
-
- Image {
- id: paletteMap
- x: (parent.width - width) / 2
- width: height
- onWidthChanged: root.__setControlsFromColor()
- height: parent.height
- source: "images/checkers.png"
- fillMode: Image.Tile
-
- // note we smoothscale the shader from a smaller version to improve performance
- ShaderEffect {
- id: map
- width: 64
- height: 64
- opacity: alphaSlider.value
- scale: paletteMap.width / width;
- layer.enabled: true
- layer.smooth: true
- anchors.centerIn: parent
- property real hue: hueSlider.value
-
- fragmentShader: "
- varying mediump vec2 qt_TexCoord0;
- uniform highp float qt_Opacity;
- uniform highp float hue;
-
- highp float hueToIntensity(highp float v1, highp float v2, highp float h) {
- h = fract(h);
- if (h < 1.0 / 6.0)
- return v1 + (v2 - v1) * 6.0 * h;
- else if (h < 1.0 / 2.0)
- return v2;
- else if (h < 2.0 / 3.0)
- return v1 + (v2 - v1) * 6.0 * (2.0 / 3.0 - h);
-
- return v1;
- }
-
- highp vec3 HSLtoRGB(highp vec3 color) {
- highp float h = color.x;
- highp float l = color.z;
- highp float s = color.y;
-
- if (s < 1.0 / 256.0)
- return vec3(l, l, l);
-
- highp float v1;
- highp float v2;
- if (l < 0.5)
- v2 = l * (1.0 + s);
- else
- v2 = (l + s) - (s * l);
-
- v1 = 2.0 * l - v2;
-
- highp float d = 1.0 / 3.0;
- highp float r = hueToIntensity(v1, v2, h + d);
- highp float g = hueToIntensity(v1, v2, h);
- highp float b = hueToIntensity(v1, v2, h - d);
- return vec3(r, g, b);
- }
-
- void main() {
- lowp vec4 c = vec4(1.0);
- c.rgb = HSLtoRGB(vec3(hue, 1.0 - qt_TexCoord0.t, qt_TexCoord0.s));
- gl_FragColor = c * qt_Opacity;
- }
- "
- }
-
- MouseArea {
- id: mapMouseArea
- anchors.fill: parent
- onPositionChanged: {
- if (pressed && containsMouse) {
- var xx = Math.max(0, Math.min(mouse.x, parent.width))
- var yy = Math.max(0, Math.min(mouse.y, parent.height))
- saturationSlider.value = 1.0 - yy / parent.height
- lightnessSlider.value = xx / parent.width
- // TODO if we constrain the movement here, can avoid the containsMouse test
- crosshairs.x = mouse.x - crosshairs.radius
- crosshairs.y = mouse.y - crosshairs.radius
- }
- }
- onPressed: positionChanged(mouse)
- }
-
- Image {
- id: crosshairs
- property int radius: width / 2 // truncated to int
- source: "images/crosshairs.png"
- }
-
- BorderImage {
- anchors.fill: parent
- anchors.margins: -1
- anchors.leftMargin: -2
- source: "images/sunken_frame.png"
- border.left: 8
- border.right: 8
- border.top: 8
- border.bottom: 8
- }
- }
- }
-
- Column {
- id: sliders
- anchors {
- top: paletteFrame.bottom
- left: parent.left
- right: parent.right
- margins: content.outerSpacing
- }
- spacing: content.spacing
-
- ColorSlider {
- id: hueSlider
- value: 0.5
- onValueChanged: if (__valueSet) root.currentColor = Qt.hsla(hueSlider.value, saturationSlider.value, lightnessSlider.value, alphaSlider.value)
- text: qsTr("Hue")
- trackDelegate: Rectangle {
- rotation: -90
- transformOrigin: Item.TopLeft
- gradient: Gradient {
- GradientStop {position: 0.000; color: Qt.rgba(1, 0, 0, 1)}
- GradientStop {position: 0.167; color: Qt.rgba(1, 1, 0, 1)}
- GradientStop {position: 0.333; color: Qt.rgba(0, 1, 0, 1)}
- GradientStop {position: 0.500; color: Qt.rgba(0, 1, 1, 1)}
- GradientStop {position: 0.667; color: Qt.rgba(0, 0, 1, 1)}
- GradientStop {position: 0.833; color: Qt.rgba(1, 0, 1, 1)}
- GradientStop {position: 1.000; color: Qt.rgba(1, 0, 0, 1)}
- }
- }
- }
-
- ColorSlider {
- id: saturationSlider
- visible: !content.usePaletteMap
- value: 0.5
- onValueChanged: if (__valueSet) root.currentColor = Qt.hsla(hueSlider.value, saturationSlider.value, lightnessSlider.value, alphaSlider.value)
- text: qsTr("Saturation")
- trackDelegate: Rectangle {
- rotation: -90
- transformOrigin: Item.TopLeft
- gradient: Gradient {
- GradientStop { position: 0; color: Qt.hsla(hueSlider.value, 0.0, lightnessSlider.value, 1.0) }
- GradientStop { position: 1; color: Qt.hsla(hueSlider.value, 1.0, lightnessSlider.value, 1.0) }
- }
- }
- }
-
- ColorSlider {
- id: lightnessSlider
- visible: !content.usePaletteMap
- value: 0.5
- onValueChanged: if (__valueSet) root.currentColor = Qt.hsla(hueSlider.value, saturationSlider.value, lightnessSlider.value, alphaSlider.value)
- text: qsTr("Luminosity")
- trackDelegate: Rectangle {
- rotation: -90
- transformOrigin: Item.TopLeft
- gradient: Gradient {
- GradientStop { position: 0; color: "black" }
- GradientStop { position: 0.5; color: Qt.hsla(hueSlider.value, saturationSlider.value, 0.5, 1.0) }
- GradientStop { position: 1; color: "white" }
- }
- }
- }
-
- ColorSlider {
- id: alphaSlider
- minimum: 0.0
- maximum: 1.0
- value: 1.0
- onValueChanged: if (__valueSet) root.currentColor = Qt.hsla(hueSlider.value, saturationSlider.value, lightnessSlider.value, alphaSlider.value)
- text: qsTr("Alpha")
- visible: root.showAlphaChannel
- trackDelegate: Item {
- rotation: -90
- transformOrigin: Item.TopLeft
- Image {
- anchors {fill: parent}
- source: "images/checkers.png"
- fillMode: Image.TileVertically
- }
- Rectangle {
- anchors.fill: parent
- gradient: Gradient {
- GradientStop { position: 0; color: "transparent" }
- GradientStop { position: 1; color: Qt.hsla(hueSlider.value,
- saturationSlider.value,
- lightnessSlider.value, 1.0) }
- } }
- }
- }
- }
-
- Item {
- id: buttonRow
- height: Math.max(buttonsOnly.height, copyIcon.height)
- width: parent.width
- anchors {
- left: parent.left
- right: parent.right
- bottom: content.bottom
- margins: content.outerSpacing
- }
- Row {
- spacing: content.spacing
- height: parent.height
- TextField {
- id: colorField
- text: root.currentColor.toString()
- anchors.verticalCenter: parent.verticalCenter
- onAccepted: root.currentColor = text
- Component.onCompleted: width = implicitWidth + 10
- }
- Image {
- id: copyIcon
- anchors.verticalCenter: parent.verticalCenter
- source: "images/copy.png"
- MouseArea {
- anchors.fill: parent
- onClicked: colorField.copyAll()
- }
- }
- }
- Row {
- id: buttonsOnly
- spacing: content.spacing
- anchors.right: parent.right
- Button {
- id: cancelButton
- text: "Cancel"
- onClicked: root.reject()
- }
- Button {
- id: okButton
- text: "OK"
- onClicked: root.accept()
- }
- }
- }
- }
-}
diff --git a/src/imports/dialogs/DefaultFileDialog.qml b/src/imports/dialogs/DefaultFileDialog.qml
deleted file mode 100644
index 627a719f60..0000000000
--- a/src/imports/dialogs/DefaultFileDialog.qml
+++ /dev/null
@@ -1,394 +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 QtQuick.Dialogs 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 2.1
-import QtQuick.Dialogs 1.0
-import QtQuick.Window 2.1
-import Qt.labs.folderlistmodel 2.0
-import "qml"
-
-AbstractFileDialog {
- id: root
- onVisibleChanged: {
- if (visible) {
- __selectedIndices = []
- __lastClickedIdx = -1
- currentPathField.visible = false
- }
- }
- onFolderChanged: {
- var str = new String(folder)
- if (str.indexOf("qrc:") === 0)
- folder = "file:" + str.slice(4)
- if (view.model.folder != folder)
- view.model.folder = folder
- }
-
- property real __textX: titleBar.height
- property SystemPalette __palette
- property var __selectedIndices: []
- property int __lastClickedIdx: -1
-
- function __dirDown(path) {
- view.model.folder = "file://" + path
- __lastClickedIdx = -1
- __selectedIndices = []
- }
- function __dirUp() {
- if (view.model.parentFolder == "")
- view.model.folder = "file:///"
- else
- view.model.folder = view.model.parentFolder
- __lastClickedIdx = -1
- __selectedIndices = []
- }
- function __up(extend) {
- if (view.currentIndex > 0)
- --view.currentIndex
- else
- view.currentIndex = 0
- if (extend) {
- if (__selectedIndices.indexOf(view.currentIndex) < 0) {
- var selCopy = __selectedIndices
- selCopy.push(view.currentIndex)
- __selectedIndices = selCopy
- }
- } else
- __selectedIndices = [view.currentIndex]
- }
- function __down(extend) {
- if (view.currentIndex < view.model.count - 1)
- ++view.currentIndex
- else
- view.currentIndex = view.model.count - 1
- if (extend) {
- if (__selectedIndices.indexOf(view.currentIndex) < 0) {
- var selCopy = __selectedIndices
- selCopy.push(view.currentIndex)
- __selectedIndices = selCopy
- }
- } else
- __selectedIndices = [view.currentIndex]
- }
- function __acceptSelection() {
- clearSelection()
- if (selectFolder && __selectedIndices.length == 0)
- addSelection(folder)
- else if (__selectedIndices.length > 0) {
- __selectedIndices.map(function(idx) {
- if (view.model.isFolder(idx)) {
- if (selectFolder)
- addSelection(view.model.get(idx, "fileURL"))
- } else {
- if (!selectFolder)
- addSelection(view.model.get(idx, "fileURL"))
- }
- })
- } else {
- addSelection(pathToUrl(currentPathField.text))
- }
- accept()
- }
-
- Rectangle {
- id: content
- property int maxSize: Math.min(Screen.desktopAvailableWidth, Screen.desktopAvailableHeight)
- // TODO: QTBUG-29817 geometry from AbstractFileDialog
- implicitWidth: Math.min(maxSize, Screen.pixelDensity * 100)
- implicitHeight: Math.min(maxSize, Screen.pixelDensity * 80)
- color: __palette.window
- focus: root.visible && !currentPathField.visible
- property real spacing: 6
- property real outerSpacing: 12
- SystemPalette { id: __palette }
-
- Component {
- id: folderDelegate
- Rectangle {
- id: wrapper
- function launch() {
- if (view.model.isFolder(index)) {
- __dirDown(filePath)
- } else {
- root.__acceptSelection()
- }
- }
- width: content.width
- height: nameText.implicitHeight * 1.5
- color: "transparent"
- Rectangle {
- id: itemHighlight
- visible: root.__selectedIndices.indexOf(index) >= 0
- anchors.fill: parent
- color: __palette.highlight
- }
- Image {
- id: icon
- source: "images/folder.png"
- height: wrapper.height - y * 2; width: height
- x: (root.__textX - width) / 2
- y: 2
- visible: view.model.isFolder(index)
- }
- Text {
- id: nameText
- anchors.fill: parent; verticalAlignment: Text.AlignVCenter
- text: fileName
- anchors.leftMargin: root.__textX
- color: itemHighlight.visible ? __palette.highlightedText : __palette.windowText
- elide: Text.ElideRight
- }
- MouseArea {
- id: mouseRegion
- anchors.fill: parent
- onDoubleClicked: {
- __selectedIndices = [index]
- root.__lastClickedIdx = index
- launch()
- }
- onClicked: {
- view.currentIndex = index
- if (mouse.modifiers & Qt.ControlModifier && root.selectMultiple) {
- // modifying the contents of __selectedIndices doesn't notify,
- // so we have to re-assign the variable
- var selCopy = __selectedIndices
- var existingIdx = selCopy.indexOf(index)
- if (existingIdx >= 0)
- selCopy.splice(existingIdx, 1)
- else
- selCopy.push(index)
- __selectedIndices = selCopy
- } else if (mouse.modifiers & Qt.ShiftModifier && root.selectMultiple) {
- if (root.__lastClickedIdx >= 0) {
- var sel = []
- if (index > __lastClickedIdx) {
- for (var i = root.__lastClickedIdx; i <= index; i++)
- sel.push(i)
- } else {
- for (var i = root.__lastClickedIdx; i >= index; i--)
- sel.push(i)
- }
- __selectedIndices = sel
- }
- } else {
- __selectedIndices = [index]
- root.__lastClickedIdx = index
- }
- }
- }
- }
- }
-
- Keys.onPressed: {
- event.accepted = true
- switch (event.key) {
- case Qt.Key_Up:
- root.__up(event.modifiers & Qt.ShiftModifier && root.selectMultiple)
- break
- case Qt.Key_Down:
- root.__down(event.modifiers & Qt.ShiftModifier && root.selectMultiple)
- break
- case Qt.Key_Left:
- root.__dirUp()
- break
- case Qt.Key_Return:
- case Qt.Key_Select:
- case Qt.Key_Right:
- if (view.currentItem)
- view.currentItem.launch()
- else
- root.__acceptSelection()
- break
- case Qt.Key_Back:
- case Qt.Key_Escape:
- reject()
- break
- case Qt.Key_C:
- if (event.modifiers & Qt.ControlModifier)
- currentPathField.copyAll()
- break
- case Qt.Key_V:
- if (event.modifiers & Qt.ControlModifier) {
- currentPathField.visible = true
- currentPathField.paste()
- }
- break
- default:
- // do nothing
- event.accepted = false
- break
- }
- }
-
- ListView {
- id: view
- anchors.top: titleBar.bottom
- anchors.bottom: bottomBar.top
- clip: true
- x: 0
- width: parent.width
- model: FolderListModel {
- onFolderChanged: {
- root.folder = folder
- currentPathField.text = root.urlToPath(view.model.folder)
- }
- }
- delegate: folderDelegate
- highlight: Rectangle {
- color: "transparent"
- border.color: Qt.darker(__palette.window, 1.3)
- }
- highlightMoveDuration: 0
- highlightMoveVelocity: -1
- }
-
- MouseArea {
- anchors.fill: view
- enabled: currentPathField.visible
- onClicked: currentPathField.visible = false
- }
-
-
- Item {
- id: titleBar
- width: parent.width
- height: currentPathField.height * 1.5
- Rectangle {
- anchors.fill: parent
- color: Qt.darker(__palette.window, 1.1)
- border.color: Qt.darker(__palette.window, 1.3)
- }
- Rectangle {
- id: upButton
- width: root.__textX
- height: titleBar.height
- color: "transparent"
-
- Image {
- id: upButtonImage
- anchors.centerIn: parent; source: "images/up.png"
- }
- MouseArea { id: upRegion; anchors.centerIn: parent
- width: 56
- height: parent.height
- onClicked: if (view.model.parentFolder !== "") __dirUp()
- }
- states: [
- State {
- name: "pressed"
- when: upRegion.pressed
- PropertyChanges { target: upButton; color: __palette.highlight }
- }
- ]
- }
- Text {
- id: currentPathText
- anchors.left: parent.left; anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: __textX; anchors.rightMargin: content.spacing
- text: root.urlToPath(view.model.folder)
- color: __palette.text
- elide: Text.ElideLeft; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter
- MouseArea {
- anchors.fill: parent
- onClicked: currentPathField.visible = true
- }
- }
- TextField {
- id: currentPathField
- anchors.left: parent.left; anchors.right: parent.right; anchors.verticalCenter: parent.verticalCenter
- anchors.leftMargin: __textX; anchors.rightMargin: content.spacing
- visible: false
- focus: visible
- onAccepted: {
- root.clearSelection()
- if (root.addSelection(root.pathToUrl(text)))
- root.accept()
- else
- view.model.folder = root.pathFolder(text)
- }
- onDownPressed: currentPathField.visible = false
- onBackPressed: reject()
- onEscapePressed: reject()
- }
- }
- Rectangle {
- id: bottomBar
- width: parent.width
- height: buttonRow.height + buttonRow.spacing * 2
- anchors.bottom: parent.bottom
- color: Qt.darker(__palette.window, 1.1)
- border.color: Qt.darker(__palette.window, 1.3)
-
- Row {
- id: buttonRow
- anchors.right: parent.right
- anchors.rightMargin: spacing
- anchors.verticalCenter: parent.verticalCenter
- spacing: content.spacing
- TextField {
- id: filterField
- text: root.selectedNameFilter
- visible: !selectFolder
- width: bottomBar.width - cancelButton.width - okButton.width - parent.spacing * 5
- anchors.verticalCenter: parent.verticalCenter
- onAccepted: {
- root.selectNameFilter(text)
- view.model.nameFilters = text
- }
- }
- Button {
- id: cancelButton
- text: "Cancel"
- onClicked: root.reject()
- }
- Button {
- id: okButton
- text: "OK"
- onClicked: {
- if (view.model.isFolder(view.currentIndex) && !selectFolder)
- __dirDown(view.model.get(view.currentIndex, "filePath"))
- else
- root.__acceptSelection()
- }
- }
- }
- }
- }
-}
diff --git a/src/imports/dialogs/DefaultFontDialog.qml b/src/imports/dialogs/DefaultFontDialog.qml
deleted file mode 100644
index 29feed342f..0000000000
--- a/src/imports/dialogs/DefaultFontDialog.qml
+++ /dev/null
@@ -1,483 +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 QtQuick.Dialogs module of 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 2.1
-import QtQuick.Window 2.1
-import QtQuick.Dialogs 1.1
-import QtQuick.Dialogs.Private 1.1
-import "qml"
-
-AbstractFontDialog {
- id: root
-
- property alias font: content.externalFont
-
- Rectangle {
- id: content
- implicitWidth: Math.min(Screen.desktopAvailableWidth, implicitHeight * 1.2)
- implicitHeight: Math.min(Screen.desktopAvailableHeight, settingsBottom.implicitHeight * 3)
- color: palette.window
- focus: root.visible
- property real spacing: 6
- property real outerSpacing: 12
- property real listMargins: 4
- property real delegateHeightMultiplier: 1.5
- property real extraWidth: width > 400 ? width - 400 : 0
- property real extraHeight: height > initialHeight ? height - initialHeight : 0
- property real initialHeight: -1
- onHeightChanged: if (visible && initialHeight < 0) initialHeight = height
-
- property color borderColor: Qt.darker(palette.button, 1.5)
-
- property font font: Qt.font({ family: "Helvetica", pointSize: 24, weight: Font.Normal })
- property font externalFont
- property string writingSystem
- property string writingSystemSample
- property var pointSizes
-
- onFontChanged: externalFont = font
-
- onExternalFontChanged: {
- if (content.font != content.externalFont) {
- font = externalFont
- wsListView.reset()
- fontListView.reset()
- weightListView.reset()
- }
- }
-
- Keys.onPressed: {
- event.accepted = true
- switch (event.key) {
- case Qt.Key_Return:
- case Qt.Key_Select:
- root.font = content.font
- root.accept()
- break
- case Qt.Key_Escape:
- case Qt.Key_Back:
- reject()
- break
- default:
- // do nothing
- event.accepted = false
- break
- }
- }
-
- SystemPalette { id: palette }
-
- Column {
- id: contentColumn
- anchors.fill: parent
- anchors.margins: content.outerSpacing
- spacing: content.outerSpacing
-
- Grid {
- id: settingsTop
- columns: 3
- spacing: content.spacing
- width: parent.width
- height: parent.height - buttonRow.height - settingsBottom.height - parent.spacing * 2
- property real columnHeight: height - writingSystemLabel.height - spacing
-
- Text { id: writingSystemLabel; text: qsTr("Writing System"); font.bold: true }
- Text { id: fontNameLabel; text: qsTr("Font"); font.bold: true }
- Text { id: sizeLabel; text: qsTr("Size"); font.bold: true }
- Rectangle {
- id: wsColumn
- radius: 3
- color: palette.window
- border.color: content.borderColor
- implicitWidth: Math.max(writingSystemLabel.implicitWidth, 100) + content.extraWidth / 5
- height: parent.columnHeight
- clip: true
- ListView {
- id: wsListView
- anchors.fill: parent
- anchors.margins: content.listMargins
- anchors.topMargin: 2
- highlightMoveDuration: 0
- onHeightChanged: positionViewAtIndex(currentIndex, ListView.Contain)
- function reset() {
- if (wsModel.count > 0) {
- content.writingSystem = wsModel.get(0).name;
- fontModel.writingSystem = content.writingSystem;
- content.writingSystemSample = wsModel.get(0).sample;
- }
- }
-
- model: WritingSystemListModel {
- id: wsModel
- Component.onCompleted: wsListView.reset()
- }
- highlight: Rectangle {
- color: palette.highlight
- x: 2 - wsListView.anchors.margins
- width: wsListView.parent.width - 4
- }
- delegate: Item {
- width: parent.width
- height: wsText.height * content.delegateHeightMultiplier
- Text {
- id: wsText
- text: name
- width: parent.width
- elide: Text.ElideRight
- color: index === wsListView.currentIndex ? palette.highlightedText : palette.windowText
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- wsListView.currentIndex = index;
- content.writingSystem = wsModel.get(wsListView.currentIndex).name;
- fontModel.writingSystem = content.writingSystem;
- content.writingSystemSample = wsModel.get(wsListView.currentIndex).sample;
- }
- }
- }
- }
- }
- Rectangle {
- radius: 3
- color: palette.window
- border.color: content.borderColor
- implicitWidth: Math.max(fontNameLabel.implicitWidth, parent.width - wsColumn.implicitWidth - pointSizesColumn.implicitWidth - parent.spacing * 2)
- height: parent.columnHeight
- clip: true
- ListView {
- id: fontListView
- anchors.fill: parent
- anchors.margins: content.listMargins
- anchors.topMargin: 2
- highlightMoveDuration: 0
- onHeightChanged: positionViewAtIndex(currentIndex, ListView.Contain)
- function reset() {
- fontModel.findIndex()
- content.pointSizes = fontModel.pointSizes()
- fontModel.findPointSizesIndex()
- }
-
- model: FontListModel {
- id: fontModel
- scalableFonts: root.scalableFonts
- nonScalableFonts: root.nonScalableFonts
- monospacedFonts: root.monospacedFonts
- proportionalFonts: root.proportionalFonts
- Component.onCompleted: fontListView.reset()
- onModelReset: { findIndex(); }
- function findIndex() {
- if (fontModel.count <= 0)
- return
-
- if (content.font.family == "") {
- content.font.family = fontModel.get(0).family
- fontListView.currentIndex = 0
- } else {
- var find = false
- for (var i = 0; i < fontModel.count; ++i) {
- if (content.font.family == fontModel.get(i).family) {
- find = true
- fontListView.currentIndex = i
- break
- }
- }
- if (find == false) {
- content.font.family = fontModel.get(0).family
- fontListView.currentIndex = 0
- }
- }
- }
- function findPointSizesIndex() {
- if (content.pointSizes.length <= 0)
- return
-
- var find = false
- for (var i = 0; i < content.pointSizes.length; ++i) {
- if (content.font.pointSize == content.pointSizes[i]) {
- find = true
- pointSizesListView.currentIndex = i
- break
- }
- }
- if (find == false) {
- content.font.pointSize = content.pointSizes[0]
- pointSizesListView.currentIndex = 0
- }
- }
- }
- highlight: Rectangle {
- color: palette.highlight
- x: 2 - fontListView.anchors.margins
- width: fontListView.parent.width - 4
- }
- delegate: Item {
- width: parent.width
- height: fontText.height * content.delegateHeightMultiplier
- Text {
- id: fontText
- text: family
- width: parent.width
- elide: Text.ElideRight
- color: index === fontListView.currentIndex ? palette.highlightedText : palette.windowText
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- fontListView.currentIndex = index
- content.font.family = fontModel.get(fontListView.currentIndex).family
- }
- }
- }
- }
- }
- Rectangle {
- id: pointSizesColumn
- radius: 3
- color: palette.window
- border.color: content.borderColor
- implicitWidth:sizeLabel.implicitWidth * 2
- height: parent.columnHeight
- clip: true
- ListView {
- id: pointSizesListView
- anchors.fill: parent
- anchors.margins: content.listMargins
- anchors.topMargin: 2
- highlightMoveDuration: 0
- onHeightChanged: positionViewAtIndex(currentIndex, ListView.Contain)
- model: content.pointSizes
- highlight: Rectangle {
- color: palette.highlight
- x: 2 - pointSizesListView.anchors.margins
- width: pointSizesListView.parent.width - 4
- }
- delegate: Item {
- width: parent.width
- height: pointSizesText.height * content.delegateHeightMultiplier
- Text {
- id: pointSizesText
- text: content.pointSizes[index]
- width: parent.width
- elide: Text.ElideRight
- color: index === pointSizesListView.currentIndex ? palette.highlightedText : palette.windowText
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- pointSizesListView.currentIndex = index
- content.font.pointSize = content.pointSizes[pointSizesListView.currentIndex]
- }
- }
- }
- }
- }
- }
-
- Grid {
- id: settingsBottom
- columns: 3
- spacing: content.spacing
- width: parent.width
- height: initialHeight + content.extraHeight / 4
- property real initialHeight
- property real secondRowHeight: height - weightLabel.height - spacing
- Component.onCompleted: initialHeight = implicitHeight
-
- Text { id: weightLabel; text: qsTr("Weight"); font.bold: true }
- Text { id: optionsLabel; text: qsTr("Style"); font.bold: true }
- Text { id: sampleLabel; text: qsTr("Sample"); font.bold: true }
- Rectangle {
- id: weightColumn
- radius: 3
- color: palette.window
- border.color: content.borderColor
- implicitWidth: optionsColumn.implicitWidth
- implicitHeight: optionsColumn.implicitHeight
- height: parent.secondRowHeight
- clip: true
- ListView {
- id: weightListView
- anchors.fill: parent
- anchors.margins: content.listMargins
- anchors.topMargin: 2
- highlightMoveDuration: 0
- onHeightChanged: positionViewAtIndex(currentIndex, ListView.Contain)
- function reset() {
- weightModel.findIndex()
- }
-
- model: ListModel {
- id: weightModel
- ListElement {
- name: "Light"
- weight: Font.Light
- }
- ListElement {
- name: "Normal"
- weight: Font.Normal
- }
- ListElement {
- name: "DemiBold"
- weight: Font.DemiBold
- }
- ListElement {
- name: "Bold"
- weight: Font.Bold
- }
- ListElement {
- name: "Black"
- weight: Font.Black
- }
- Component.onCompleted: weightListView.reset()
- function findIndex() {
- var find = false
- for (var i = 0; i < weightModel.count; ++i) {
- if (content.font.weight == weightModel.get(i).weight) {
- find = true
- weightListView.currentIndex = i
- break
- }
- }
- if (find == false) {
- content.font.weight = weightModel.get(1).family
- fontListView.currentIndex = 1
- }
- }
- }
- highlight: Rectangle {
- color: palette.highlight
- x: 2 - weightListView.anchors.margins
- width: weightListView.parent.width - 4
- }
- delegate: Item {
- width: parent.width
- height: weightText.height * content.delegateHeightMultiplier
- Text {
- id: weightText
- text: name
- width: parent.width
- elide: Text.ElideRight
- color: index === weightListView.currentIndex ? palette.highlightedText : palette.windowText
- anchors.verticalCenter: parent.verticalCenter
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- weightListView.currentIndex = index
- content.font.weight = weightModel.get(weightListView.currentIndex).weight
- }
- }
- }
- }
- }
- Column {
- id: optionsColumn
- spacing: 4
- CheckBox {
- id: italicCheckBox
- text: qsTr("Italic")
- checked: content.font.italic
- onClicked: { content.font.italic = italicCheckBox.checked }
- }
- CheckBox {
- id: underlineCheckBox
- text: qsTr("Underline")
- checked: content.font.underline
- onClicked: { content.font.underline = underlineCheckBox.checked }
- }
- CheckBox {
- id: overlineCheckBox
- text: qsTr("Overline")
- checked: content.font.overline
- onClicked: { content.font.overline = overlineCheckBox.checked }
- }
- CheckBox {
- id: strikeoutCheckBox
- text: qsTr("Strikeout")
- checked: content.font.strikeout
- onClicked: { content.font.strikeout = strikeoutCheckBox.checked }
- }
- }
- Rectangle {
- clip: true
- implicitWidth: sample.implicitWidth + parent.spacing
- implicitHeight: optionsColumn.implicitHeight
- width: parent.width - weightColumn.width - optionsColumn.width - parent.spacing * 2
- height: parent.secondRowHeight
- color: palette.window
- border.color: content.borderColor
- Text {
- id: sample
- anchors.centerIn: parent
- font: content.font
- text: content.writingSystemSample
- }
- }
- }
-
- Item {
- id: buttonRow
- height: buttonsOnly.height
- width: parent.width
- Row {
- id: buttonsOnly
- spacing: content.spacing
- anchors.right: parent.right
- Button {
- text: qsTr("Cancel")
- onClicked: root.reject()
- }
- Button {
- text: qsTr("OK")
- onClicked: {
- root.font = content.font
- root.accept()
- }
- }
- }
- }
- }
- }
-}
-
diff --git a/src/imports/dialogs/DefaultMessageDialog.qml b/src/imports/dialogs/DefaultMessageDialog.qml
deleted file mode 100644
index ba29469b5e..0000000000
--- a/src/imports/dialogs/DefaultMessageDialog.qml
+++ /dev/null
@@ -1,330 +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 QtQuick.Dialogs 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 2.1
-import QtQuick.Window 2.1
-import QtQuick.Dialogs 1.1
-import "qml"
-
-AbstractMessageDialog {
- id: root
-
- Rectangle {
- id: content
- property real spacing: 6
- property real outerSpacing: 12
- property real buttonsRowImplicitWidth: Screen.pixelDensity * 50
- implicitHeight: contentColumn.implicitHeight + outerSpacing * 2
- onImplicitHeightChanged: root.height = implicitHeight
- implicitWidth: Math.min(Screen.desktopAvailableWidth * 0.9, Math.max(
- mainText.implicitWidth, buttonsRowImplicitWidth) + outerSpacing * 2);
- onImplicitWidthChanged: root.width = implicitWidth
- color: palette.window
- focus: root.visible
- Keys.onPressed: {
- event.accepted = true
- if (event.modifiers === Qt.ControlModifier)
- switch (event.key) {
- case Qt.Key_A:
- detailedText.selectAll()
- break
- case Qt.Key_C:
- detailedText.copy()
- break
- } else switch (event.key) {
- case Qt.Key_Escape:
- case Qt.Key_Back:
- reject()
- break
- case Qt.Key_Enter:
- case Qt.Key_Return:
- accept()
- break
- }
- }
-
- Column {
- id: contentColumn
- spacing: content.spacing
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- margins: content.outerSpacing
- }
-
- SystemPalette { id: palette }
-
- Item {
- width: parent.width
- height: Math.max(icon.height, mainText.height + informativeText.height + content.spacing)
- Image {
- id: icon
- source: root.standardIconSource
- }
-
- Text {
- id: mainText
- anchors {
- left: icon.right
- leftMargin: content.spacing
- right: parent.right
- }
- text: root.text
- font.weight: Font.Bold
- wrapMode: Text.WordWrap
- }
-
- Text {
- id: informativeText
- anchors {
- left: icon.right
- right: parent.right
- top: mainText.bottom
- leftMargin: content.spacing
- topMargin: content.spacing
- }
- text: root.informativeText
- wrapMode: Text.WordWrap
- }
- }
-
-
- Flow {
- id: buttons
- spacing: content.spacing
- layoutDirection: Qt.RightToLeft
- width: parent.width + content.outerSpacing
- x: -content.outerSpacing
- Button {
- id: okButton
- text: "OK"
- onClicked: root.click(StandardButton.Ok)
- visible: root.standardButtons & StandardButton.Ok
- }
- Button {
- id: openButton
- text: "Open"
- onClicked: root.click(StandardButton.Open)
- visible: root.standardButtons & StandardButton.Open
- }
- Button {
- id: saveButton
- text: "Save"
- onClicked: root.click(StandardButton.Save)
- visible: root.standardButtons & StandardButton.Save
- }
- Button {
- id: saveAllButton
- text: "Save All"
- onClicked: root.click(StandardButton.SaveAll)
- visible: root.standardButtons & StandardButton.SaveAll
- }
- Button {
- id: retryButton
- text: "Retry"
- onClicked: root.click(StandardButton.Retry)
- visible: root.standardButtons & StandardButton.Retry
- }
- Button {
- id: ignoreButton
- text: "Ignore"
- onClicked: root.click(StandardButton.Ignore)
- visible: root.standardButtons & StandardButton.Ignore
- }
- Button {
- id: applyButton
- text: "Apply"
- onClicked: root.click(StandardButton.Apply)
- visible: root.standardButtons & StandardButton.Apply
- }
- Button {
- id: yesButton
- text: "Yes"
- onClicked: root.click(StandardButton.Yes)
- visible: root.standardButtons & StandardButton.Yes
- }
- Button {
- id: yesAllButton
- text: "Yes to All"
- onClicked: root.click(StandardButton.YesToAll)
- visible: root.standardButtons & StandardButton.YesToAll
- }
- Button {
- id: noButton
- text: "No"
- onClicked: root.click(StandardButton.No)
- visible: root.standardButtons & StandardButton.No
- }
- Button {
- id: noAllButton
- text: "No to All"
- onClicked: root.click(StandardButton.NoToAll)
- visible: root.standardButtons & StandardButton.NoToAll
- }
- Button {
- id: discardButton
- text: "Discard"
- onClicked: root.click(StandardButton.Discard)
- visible: root.standardButtons & StandardButton.Discard
- }
- Button {
- id: resetButton
- text: "Reset"
- onClicked: root.click(StandardButton.Reset)
- visible: root.standardButtons & StandardButton.Reset
- }
- Button {
- id: restoreDefaultsButton
- text: "Restore Defaults"
- onClicked: root.click(StandardButton.RestoreDefaults)
- visible: root.standardButtons & StandardButton.RestoreDefaults
- }
- Button {
- id: cancelButton
- text: "Cancel"
- onClicked: root.click(StandardButton.Cancel)
- visible: root.standardButtons & StandardButton.Cancel
- }
- Button {
- id: abortButton
- text: "Abort"
- onClicked: root.click(StandardButton.Abort)
- visible: root.standardButtons & StandardButton.Abort
- }
- Button {
- id: closeButton
- text: "Close"
- onClicked: root.click(StandardButton.Close)
- visible: root.standardButtons & StandardButton.Close
- }
- Button {
- id: moreButton
- text: "Show Details..."
- onClicked: content.state = (content.state === "" ? "expanded" : "")
- visible: root.detailedText.length > 0
- }
- Button {
- id: helpButton
- text: "Help"
- onClicked: root.click(StandardButton.Help)
- visible: root.standardButtons & StandardButton.Help
- }
- onVisibleChildrenChanged: calculateImplicitWidth()
- }
- }
-
- Item {
- id: details
- width: parent.width
- implicitHeight: detailedText.implicitHeight + content.spacing
- height: 0
- clip: true
-
- anchors {
- left: parent.left
- right: parent.right
- top: contentColumn.bottom
- topMargin: content.spacing
- leftMargin: content.outerSpacing
- rightMargin: content.outerSpacing
- }
-
- Flickable {
- id: flickable
- contentHeight: detailedText.height
- anchors.fill: parent
- anchors.topMargin: content.spacing
- anchors.bottomMargin: content.outerSpacing
- TextEdit {
- id: detailedText
- text: root.detailedText
- width: details.width
- wrapMode: Text.WordWrap
- readOnly: true
- selectByMouse: true
- }
- }
-
- Component {
- id: edgeFade
- EdgeFade {
- fadeColor: palette.window
- topThreshold: flickable.atYBeginning ? 0 : content.spacing * 3
- bottomThreshold: flickable.atYEnd ? 0 : content.spacing * 3
- }
- }
-
- Loader {
- sourceComponent: flickable.height < flickable.contentHeight ? edgeFade : undefined
- anchors.fill: parent
- }
-
- }
-
- states: [
- State {
- name: "expanded"
- PropertyChanges {
- target: details
- height: content.height - contentColumn.height - content.spacing - content.outerSpacing
- }
- PropertyChanges {
- target: content
- implicitHeight: contentColumn.implicitHeight + content.spacing * 2 +
- detailedText.implicitHeight + content.outerSpacing * 2
- }
- PropertyChanges {
- target: moreButton
- text: "Hide Details"
- }
- }
- ]
- }
- function calculateImplicitWidth() {
- if (buttons.visibleChildren.length < 2)
- return;
- var calcWidth = 0;
- for (var i = 0; i < buttons.visibleChildren.length; ++i)
- calcWidth += Math.max(100, buttons.visibleChildren[i].implicitWidth) + content.spacing
- content.buttonsRowImplicitWidth = content.outerSpacing + calcWidth
- }
- Component.onCompleted: calculateImplicitWidth()
-}
diff --git a/src/imports/dialogs/WidgetColorDialog.qml b/src/imports/dialogs/WidgetColorDialog.qml
deleted file mode 100644
index ed7c7ab77a..0000000000
--- a/src/imports/dialogs/WidgetColorDialog.qml
+++ /dev/null
@@ -1,44 +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 QtQuick.Dialogs 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 2.1
-import QtQuick.PrivateWidgets 1.0
-
-QtColorDialog { }
diff --git a/src/imports/dialogs/WidgetFileDialog.qml b/src/imports/dialogs/WidgetFileDialog.qml
deleted file mode 100644
index c8f59d20a7..0000000000
--- a/src/imports/dialogs/WidgetFileDialog.qml
+++ /dev/null
@@ -1,44 +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 QtQuick.Dialogs 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 2.1
-import QtQuick.PrivateWidgets 1.0
-
-QtFileDialog { }
diff --git a/src/imports/dialogs/WidgetFontDialog.qml b/src/imports/dialogs/WidgetFontDialog.qml
deleted file mode 100644
index 69f98b28a2..0000000000
--- a/src/imports/dialogs/WidgetFontDialog.qml
+++ /dev/null
@@ -1,44 +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 QtQuick.Dialogs 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 2.2
-import QtQuick.PrivateWidgets 1.1
-
-QtFontDialog { }
diff --git a/src/imports/dialogs/WidgetMessageDialog.qml b/src/imports/dialogs/WidgetMessageDialog.qml
deleted file mode 100644
index 8bc3eccfd7..0000000000
--- a/src/imports/dialogs/WidgetMessageDialog.qml
+++ /dev/null
@@ -1,44 +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 QtQuick.Dialogs 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 2.1
-import QtQuick.PrivateWidgets 1.1
-
-QtMessageDialog { }
diff --git a/src/imports/dialogs/dialogs.pro b/src/imports/dialogs/dialogs.pro
deleted file mode 100644
index 1abad55883..0000000000
--- a/src/imports/dialogs/dialogs.pro
+++ /dev/null
@@ -1,97 +0,0 @@
-CXX_MODULE = qml
-TARGET = dialogplugin
-TARGETPATH = QtQuick/Dialogs
-IMPORT_VERSION = 1.1
-
-QMAKE_DOCS = $$PWD/doc/qtquickdialogs.qdocconf
-
-SOURCES += \
- qquickabstractmessagedialog.cpp \
- qquickplatformmessagedialog.cpp \
- qquickmessagedialog.cpp \
- qquickabstractfiledialog.cpp \
- qquickplatformfiledialog.cpp \
- qquickfiledialog.cpp \
- qquickabstractcolordialog.cpp \
- qquickplatformcolordialog.cpp \
- qquickcolordialog.cpp \
- qquickabstractfontdialog.cpp \
- qquickplatformfontdialog.cpp \
- qquickfontdialog.cpp \
- qquickabstractdialog.cpp \
- plugin.cpp
-
-HEADERS += \
- qquickabstractmessagedialog_p.h \
- qquickplatformmessagedialog_p.h \
- qquickmessagedialog_p.h \
- qquickdialogassets_p.h \
- qquickabstractfiledialog_p.h \
- qquickplatformfiledialog_p.h \
- qquickfiledialog_p.h \
- qquickabstractcolordialog_p.h \
- qquickplatformcolordialog_p.h \
- qquickcolordialog_p.h \
- qquickabstractfontdialog_p.h \
- qquickplatformfontdialog_p.h \
- qquickfontdialog_p.h \
- qquickabstractdialog_p.h
-
-DIALOGS_QML_FILES += \
- DefaultMessageDialog.qml \
- WidgetMessageDialog.qml \
- DefaultFileDialog.qml \
- WidgetFileDialog.qml \
- DefaultColorDialog.qml \
- WidgetColorDialog.qml \
- DefaultFontDialog.qml \
- WidgetFontDialog.qml \
- qml/Button.qml \
- qml/CheckBox.qml \
- qml/ColorSlider.qml \
- qml/EdgeFade.qml \
- qml/DefaultWindowDecoration.qml \
- qml/TextField.qml \
- qml/qmldir \
- images/critical.png \
- images/information.png \
- images/question.png \
- images/warning.png \
- images/checkers.png \
- images/checkmark.png \
- images/copy.png \
- images/crosshairs.png \
- images/slider_handle.png \
- images/sunken_frame.png \
- images/window_border.png \
- images/folder.png \
- images/up.png
-
-QT += quick-private gui gui-private core core-private qml
-
-# Create the resource file
-GENERATED_RESOURCE_FILE = $$OUT_PWD/dialogs.qrc
-
-RESOURCE_CONTENT = \
- "<RCC>" \
- "<qresource prefix=\"/QtQuick/Dialogs\">"
-
-for(resourcefile, DIALOGS_QML_FILES) {
- resourcefileabsolutepath = $$absolute_path($$resourcefile)
- relativepath_in = $$relative_path($$resourcefileabsolutepath, $$_PRO_FILE_PWD_)
- relativepath_out = $$relative_path($$resourcefileabsolutepath, $$OUT_PWD)
- RESOURCE_CONTENT += "<file alias=\"$$relativepath_in\">$$relativepath_out</file>"
-}
-
-RESOURCE_CONTENT += \
- "</qresource>" \
- "</RCC>"
-
-write_file($$GENERATED_RESOURCE_FILE, RESOURCE_CONTENT)|error("Aborting.")
-
-RESOURCES += $$GENERATED_RESOURCE_FILE
-
-# In case of a debug build, deploy the QML files too
-CONFIG(debug, debug|release): QML_FILES += $$DIALOGS_QML_FILES
-
-load(qml_plugin)
diff --git a/src/imports/dialogs/doc/images/critical.png b/src/imports/dialogs/doc/images/critical.png
deleted file mode 100644
index dc9c5aebf4..0000000000
--- a/src/imports/dialogs/doc/images/critical.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/doc/images/information.png b/src/imports/dialogs/doc/images/information.png
deleted file mode 100644
index 0a2eb87d10..0000000000
--- a/src/imports/dialogs/doc/images/information.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/doc/images/question.png b/src/imports/dialogs/doc/images/question.png
deleted file mode 100644
index 2dd92fd791..0000000000
--- a/src/imports/dialogs/doc/images/question.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/doc/images/replacefile.png b/src/imports/dialogs/doc/images/replacefile.png
deleted file mode 100644
index d1479fa944..0000000000
--- a/src/imports/dialogs/doc/images/replacefile.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/doc/images/warning.png b/src/imports/dialogs/doc/images/warning.png
deleted file mode 100644
index cba78f6bea..0000000000
--- a/src/imports/dialogs/doc/images/warning.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/doc/qtquickdialogs.qdocconf b/src/imports/dialogs/doc/qtquickdialogs.qdocconf
deleted file mode 100644
index 1bad67790f..0000000000
--- a/src/imports/dialogs/doc/qtquickdialogs.qdocconf
+++ /dev/null
@@ -1,41 +0,0 @@
-include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
-
-project = QtQuickDialogs
-description = Qt Quick Dialogs Reference Documentation
-url = http://qt-project.org/doc/qt-$QT_VER
-version = $QT_VERSION
-
-qhp.projects = QtQuickDialogs
-
-qhp.QtQuickDialogs.file = qtquickdialogs.qhp
-qhp.QtQuickDialogs.namespace = org.qt-project.qtquickdialogs.$QT_VERSION_TAG
-qhp.QtQuickDialogs.virtualFolder = qtquickdialogs
-qhp.QtQuickDialogs.indexTitle = Qt Quick Dialogs
-qhp.QtQuickDialogs.indexRoot =
-
-qhp.QtQuickDialogs.filterAttributes = qtquickdialogs $QT_VERSION qtrefdoc
-qhp.QtQuickDialogs.customFilters.Qt.name = QtQuickDialogs $QT_VERSION
-qhp.QtQuickDialogs.customFilters.Qt.filterAttributes = qtquickdialogs $QT_VERSION
-
-qhp.QtQuickDialogs.subprojects = qtquickdialogsqmltypes
-qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.title = QML Types
-qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.indexTitle = Qt Quick Dialogs QML Types
-qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.selectors = fake:qmlclass
-qhp.QtQuickDialogs.subprojects.qtquickdialogsqmltypes.sortPages = true
-
-depends = qtqml qtquick qtgui qtwidgets qtdoc
-
-exampledirs += ../../../../examples/quick/dialogs
-
-examplesinstallpath = quick/dialogs
-
-headerdirs += ..
-
-sourcedirs += ..
-
-imagedirs += images
-
-excludedirs += ../qml
-
-navigation.landingpage = "Qt Quick Dialogs"
-navigation.qmltypespage = "Qt Quick Dialogs QML Types"
diff --git a/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc b/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc
deleted file mode 100644
index ee277f48dc..0000000000
--- a/src/imports/dialogs/doc/src/qtquickdialogs-examples.qdoc
+++ /dev/null
@@ -1,36 +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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \group qtquickdialog_examples
- \ingroup qtquickexamples
- \title Qt Quick Examples - Dialogs
- \brief A Collection of examples for \l{Qt Quick Dialogs}, written in QML.
-
- These examples show how to use the \l{Qt Quick Dialogs}.
-*/
-
diff --git a/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc b/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc
deleted file mode 100644
index 5a1223b04d..0000000000
--- a/src/imports/dialogs/doc/src/qtquickdialogs-index.qdoc
+++ /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 documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \group dialogs
- \title Dialogs
-*/
-
-/*!
- \page qtquickdialogs-index.html
- \title Qt Quick Dialogs
-
- \brief Qt Quick Dialogs submodule
-
- The module is new in Qt 5.1.
-
- \section1 Dialogs
-
- \annotatedlist dialogs
-
- \section1 Related information
-
- \section2 Examples
- \list
- \li \l{Qt Quick Examples - Dialogs}{Dialogs Examples}
- \endlist
-
- \section2 Reference
- \list
- \li \l{Qt Quick Dialogs QML Types}{QML Types}
- \endlist
-
-*/
-
diff --git a/src/imports/dialogs/images/checkers.png b/src/imports/dialogs/images/checkers.png
deleted file mode 100644
index 458d33de9d..0000000000
--- a/src/imports/dialogs/images/checkers.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/checkmark.png b/src/imports/dialogs/images/checkmark.png
deleted file mode 100644
index 821aafccdd..0000000000
--- a/src/imports/dialogs/images/checkmark.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/copy.png b/src/imports/dialogs/images/copy.png
deleted file mode 100644
index 2aeb28288f..0000000000
--- a/src/imports/dialogs/images/copy.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/critical.png b/src/imports/dialogs/images/critical.png
deleted file mode 100644
index dc9c5aebf4..0000000000
--- a/src/imports/dialogs/images/critical.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/crosshairs.png b/src/imports/dialogs/images/crosshairs.png
deleted file mode 100644
index 9a61946eca..0000000000
--- a/src/imports/dialogs/images/crosshairs.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/folder.png b/src/imports/dialogs/images/folder.png
deleted file mode 100644
index e53e2ad464..0000000000
--- a/src/imports/dialogs/images/folder.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/information.png b/src/imports/dialogs/images/information.png
deleted file mode 100644
index 0a2eb87d10..0000000000
--- a/src/imports/dialogs/images/information.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/question.png b/src/imports/dialogs/images/question.png
deleted file mode 100644
index 2dd92fd791..0000000000
--- a/src/imports/dialogs/images/question.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/slider_handle.png b/src/imports/dialogs/images/slider_handle.png
deleted file mode 100644
index e3b9654392..0000000000
--- a/src/imports/dialogs/images/slider_handle.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/sunken_frame.png b/src/imports/dialogs/images/sunken_frame.png
deleted file mode 100644
index 178c3092d2..0000000000
--- a/src/imports/dialogs/images/sunken_frame.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/up.png b/src/imports/dialogs/images/up.png
deleted file mode 100644
index b05f8025d0..0000000000
--- a/src/imports/dialogs/images/up.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/warning.png b/src/imports/dialogs/images/warning.png
deleted file mode 100644
index cba78f6bea..0000000000
--- a/src/imports/dialogs/images/warning.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/images/window_border.png b/src/imports/dialogs/images/window_border.png
deleted file mode 100644
index 431af8545d..0000000000
--- a/src/imports/dialogs/images/window_border.png
+++ /dev/null
Binary files differ
diff --git a/src/imports/dialogs/plugin.cpp b/src/imports/dialogs/plugin.cpp
deleted file mode 100644
index 70e12093b6..0000000000
--- a/src/imports/dialogs/plugin.cpp
+++ /dev/null
@@ -1,214 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/qqml.h>
-#include <QtQml/qqmlextensionplugin.h>
-#include "qquickmessagedialog_p.h"
-#include "qquickabstractmessagedialog_p.h"
-#include "qquickdialogassets_p.h"
-#include "qquickplatformmessagedialog_p.h"
-#include "qquickfiledialog_p.h"
-#include "qquickabstractfiledialog_p.h"
-#include "qquickplatformfiledialog_p.h"
-#include "qquickcolordialog_p.h"
-#include "qquickabstractcolordialog_p.h"
-#include "qquickplatformcolordialog_p.h"
-#include "qquickfontdialog_p.h"
-#include "qquickabstractfontdialog_p.h"
-#include "qquickplatformfontdialog_p.h"
-#include <private/qguiapplication_p.h>
-#include <qpa/qplatformintegration.h>
-
-//#define PURE_QML_ONLY
-//#define DEBUG_REGISTRATION
-
-static void initResources()
-{
- Q_INIT_RESOURCE(dialogs);
-}
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlmodule QtQuick.Dialogs 1.1
- \title Qt Quick Dialogs QML Types
- \ingroup qmlmodules
- \brief Provides QML types for standard file, color picker and message dialogs
-
- This QML module contains types for creating and interacting with system dialogs.
-
- To use the types in this module, import the module with the following line:
-
- \code
- import QtQuick.Dialogs 1.1
- \endcode
-*/
-
-class QtQuick2DialogsPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
-
-public:
- QtQuick2DialogsPlugin() : QQmlExtensionPlugin(), m_useResources(true) { }
-
- virtual void initializeEngine(QQmlEngine *engine, const char * uri) {
-#ifdef DEBUG_REGISTRATION
- qDebug() << Q_FUNC_INFO << uri << m_decorationComponentUrl;
-#else
- Q_UNUSED(uri)
-#endif
- QQuickAbstractDialog::m_decorationComponent =
- new QQmlComponent(engine, m_decorationComponentUrl, QQmlComponent::Asynchronous);
- }
-
- virtual void registerTypes(const char *uri) {
- initResources();
-
-#ifdef DEBUG_REGISTRATION
- qDebug() << Q_FUNC_INFO << uri;
-#endif
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.Dialogs"));
- bool hasTopLevelWindows = QGuiApplicationPrivate::platformIntegration()->
- hasCapability(QPlatformIntegration::MultipleWindows);
- QDir qmlDir(baseUrl().toLocalFile());
- QDir widgetsDir(baseUrl().toLocalFile());
- // TODO: find the directory by searching rather than assuming a relative path
- widgetsDir.cd("../PrivateWidgets");
-
- // If at least one file was actually installed, then use installed qml files instead of resources.
- // This makes debugging and incremental development easier, whereas the "normal" installation
- // uses resources to save space and cut down on the number of files to deploy.
- if (qmlDir.exists(QString("DefaultFileDialog.qml")))
- m_useResources = false;
- m_decorationComponentUrl = m_useResources ?
- QUrl("qrc:/QtQuick/Dialogs/qml/DefaultWindowDecoration.qml") :
- QUrl::fromLocalFile(qmlDir.filePath(QString("qml/DefaultWindowDecoration.qml")));
-
- // Prefer the QPA dialog helpers if the platform supports them.
- // Else if there is a QWidget-based implementation, check whether it's
- // possible to instantiate it from Qt Quick.
- // Otherwise fall back to a pure-QML implementation.
-
- // MessageDialog
- qmlRegisterUncreatableType<QQuickStandardButton>(uri, 1, 1, "StandardButton",
- QLatin1String("Do not create objects of type StandardButton"));
- qmlRegisterUncreatableType<QQuickStandardIcon>(uri, 1, 1, "StandardIcon",
- QLatin1String("Do not create objects of type StandardIcon"));
-#ifndef PURE_QML_ONLY
- if (QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(QPlatformTheme::MessageDialog))
- qmlRegisterType<QQuickPlatformMessageDialog>(uri, 1, 0, "MessageDialog");
- else
-#endif
- registerWidgetOrQmlImplementation<QQuickMessageDialog>(widgetsDir, qmlDir, "MessageDialog", uri, hasTopLevelWindows, 1, 1);
-
- // FileDialog
-#ifndef PURE_QML_ONLY
- if (QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(QPlatformTheme::FileDialog))
- qmlRegisterType<QQuickPlatformFileDialog>(uri, 1, 0, "FileDialog");
- else
-#endif
- registerWidgetOrQmlImplementation<QQuickFileDialog>(widgetsDir, qmlDir, "FileDialog", uri, hasTopLevelWindows, 1, 0);
-
- // ColorDialog
-#ifndef PURE_QML_ONLY
- if (QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(QPlatformTheme::ColorDialog))
- qmlRegisterType<QQuickPlatformColorDialog>(uri, 1, 0, "ColorDialog");
- else
-#endif
- registerWidgetOrQmlImplementation<QQuickColorDialog>(widgetsDir, qmlDir, "ColorDialog", uri, hasTopLevelWindows, 1, 0);
-
- // FontDialog
-#ifndef PURE_QML_ONLY
- if (QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(QPlatformTheme::FontDialog))
- qmlRegisterType<QQuickPlatformFontDialog>(uri, 1, 1, "FontDialog");
- else
-#endif
- registerWidgetOrQmlImplementation<QQuickFontDialog>(widgetsDir, qmlDir, "FontDialog", uri, hasTopLevelWindows, 1, 1);
- }
-
-protected:
- template <class WrapperType>
- void registerWidgetOrQmlImplementation(QDir widgetsDir, QDir qmlDir,
- const char *qmlName, const char *uri, bool hasTopLevelWindows, int versionMajor, int versionMinor) {
- // qDebug() << "QtQuick2DialogsPlugin::registerWidgetOrQmlImplementation" << uri << qmlName << ": QML in" << qmlDir.absolutePath()
- // << "using resources?" << m_useResources << "; widgets in" << widgetsDir.absolutePath();
- bool needQmlImplementation = true;
-
-#ifdef PURE_QML_ONLY
- Q_UNUSED(widgetsDir)
- Q_UNUSED(hasTopLevelWindows)
-#else
- // If there is a qmldir and we have a QApplication instance (as opposed to a
- // widget-free QGuiApplication), assume that the widget-based dialog will work.
- if (hasTopLevelWindows && widgetsDir.exists("qmldir") &&
- QCoreApplication::instance()->inherits("QApplication")) {
- QUrl dialogQmlPath = m_useResources ?
- QUrl(QString("qrc:/QtQuick/Dialogs/Widget%1.qml").arg(qmlName)) :
- QUrl::fromLocalFile(qmlDir.filePath(QString("Widget%1.qml").arg(qmlName)));
- if (qmlRegisterType(dialogQmlPath, uri, versionMajor, versionMinor, qmlName) >= 0) {
- needQmlImplementation = false;
-#ifdef DEBUG_REGISTRATION
- qDebug() << " registering" << qmlName << " as " << dialogQmlPath << "success?" << !needQmlImplementation;
-#endif
- }
- }
-#endif
- if (needQmlImplementation) {
- QByteArray abstractTypeName = QByteArray("Abstract") + qmlName;
- qmlRegisterType<WrapperType>(uri, versionMajor, versionMinor, abstractTypeName); // implementation wrapper
- QUrl dialogQmlPath = m_useResources ?
- QUrl(QString("qrc:/QtQuick/Dialogs/Default%1.qml").arg(qmlName)) :
- QUrl::fromLocalFile(qmlDir.filePath(QString("Default%1.qml").arg(qmlName)));
-#ifdef DEBUG_REGISTRATION
- qDebug() << " registering" << qmlName << " as " << dialogQmlPath << "success?" <<
-#endif
- qmlRegisterType(dialogQmlPath, uri, versionMajor, versionMinor, qmlName);
- }
- }
-
- QUrl m_decorationComponentUrl;
- bool m_useResources;
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
diff --git a/src/imports/dialogs/plugins.qmltypes b/src/imports/dialogs/plugins.qmltypes
deleted file mode 100644
index d5db4b93bd..0000000000
--- a/src/imports/dialogs/plugins.qmltypes
+++ /dev/null
@@ -1,654 +0,0 @@
-import QtQuick.tooling 1.1
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -omit-prefix=__ QtQuick.Dialogs 1.1'
-
-Module {
- Component {
- name: "QQuickAbstractColorDialog"
- prototype: "QQuickAbstractDialog"
- Property { name: "showAlphaChannel"; type: "bool" }
- Property { name: "color"; type: "QColor" }
- Property { name: "currentColor"; type: "QColor" }
- Property { name: "currentHue"; type: "double"; isReadonly: true }
- Property { name: "currentSaturation"; type: "double"; isReadonly: true }
- Property { name: "currentLightness"; type: "double"; isReadonly: true }
- Property { name: "currentAlpha"; type: "double"; isReadonly: true }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setModality"
- Parameter { name: "m"; type: "Qt::WindowModality" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setColor"
- Parameter { name: "arg"; type: "QColor" }
- }
- Method {
- name: "setCurrentColor"
- Parameter { name: "currentColor"; type: "QColor" }
- }
- Method {
- name: "setShowAlphaChannel"
- Parameter { name: "arg"; type: "bool" }
- }
- }
- Component {
- name: "QQuickAbstractDialog"
- prototype: "QObject"
- Property { name: "visible"; type: "bool" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "title"; type: "string" }
- Property { name: "isWindow"; type: "bool"; isReadonly: true }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Signal { name: "visibilityChanged" }
- Signal { name: "geometryChanged" }
- Signal { name: "accepted" }
- Signal { name: "rejected" }
- Method { name: "open" }
- Method { name: "close" }
- Method {
- name: "setX"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setY"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setWidth"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "arg"; type: "int" }
- }
- }
- Component {
- name: "QQuickAbstractFileDialog"
- prototype: "QQuickAbstractDialog"
- Property { name: "selectExisting"; type: "bool" }
- Property { name: "selectMultiple"; type: "bool" }
- Property { name: "selectFolder"; type: "bool" }
- Property { name: "folder"; type: "QUrl" }
- Property { name: "nameFilters"; type: "QStringList" }
- Property { name: "selectedNameFilter"; type: "string" }
- Property { name: "fileUrl"; type: "QUrl"; isReadonly: true }
- Property { name: "fileUrls"; type: "QList<QUrl>"; isReadonly: true }
- Signal { name: "filterSelected" }
- Signal { name: "fileModeChanged" }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setSelectExisting"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setSelectMultiple"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setSelectFolder"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setFolder"
- Parameter { name: "f"; type: "QUrl" }
- }
- Method {
- name: "setNameFilters"
- Parameter { name: "f"; type: "QStringList" }
- }
- Method {
- name: "selectNameFilter"
- Parameter { name: "f"; type: "string" }
- }
- }
- Component {
- name: "QQuickAbstractFontDialog"
- prototype: "QQuickAbstractDialog"
- Property { name: "scalableFonts"; type: "bool" }
- Property { name: "nonScalableFonts"; type: "bool" }
- Property { name: "monospacedFonts"; type: "bool" }
- Property { name: "proportionalFonts"; type: "bool" }
- Property { name: "font"; type: "QFont" }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setModality"
- Parameter { name: "m"; type: "Qt::WindowModality" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setFont"
- Parameter { name: "arg"; type: "QFont" }
- }
- Method {
- name: "setScalableFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setNonScalableFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setMonospacedFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setProportionalFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- }
- Component {
- name: "QQuickAbstractMessageDialog"
- prototype: "QQuickAbstractDialog"
- Enum {
- name: "Icon"
- values: {
- "NoIcon": 0,
- "Information": 1,
- "Warning": 2,
- "Critical": 3,
- "Question": 4
- }
- }
- Enum {
- name: "StandardButton"
- values: {
- "NoButton": 0,
- "Ok": 1024,
- "Save": 2048,
- "SaveAll": 4096,
- "Open": 8192,
- "Yes": 16384,
- "YesToAll": 32768,
- "No": 65536,
- "NoToAll": 131072,
- "Abort": 262144,
- "Retry": 524288,
- "Ignore": 1048576,
- "Close": 2097152,
- "Cancel": 4194304,
- "Discard": 8388608,
- "Help": 16777216,
- "Apply": 33554432,
- "Reset": 67108864,
- "RestoreDefaults": 134217728
- }
- }
- Enum {
- name: "StandardButtons"
- values: {
- "NoButton": 0,
- "Ok": 1024,
- "Save": 2048,
- "SaveAll": 4096,
- "Open": 8192,
- "Yes": 16384,
- "YesToAll": 32768,
- "No": 65536,
- "NoToAll": 131072,
- "Abort": 262144,
- "Retry": 524288,
- "Ignore": 1048576,
- "Close": 2097152,
- "Cancel": 4194304,
- "Discard": 8388608,
- "Help": 16777216,
- "Apply": 33554432,
- "Reset": 67108864,
- "RestoreDefaults": 134217728
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "informativeText"; type: "string" }
- Property { name: "detailedText"; type: "string" }
- Property { name: "icon"; type: "Icon" }
- Property { name: "standardIconSource"; type: "QUrl"; isReadonly: true }
- Property { name: "standardButtons"; type: "StandardButtons" }
- Property { name: "clickedButton"; type: "StandardButton"; isReadonly: true }
- Signal { name: "buttonClicked" }
- Signal { name: "discard" }
- Signal { name: "help" }
- Signal { name: "yes" }
- Signal { name: "no" }
- Signal { name: "apply" }
- Signal { name: "reset" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setInformativeText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setDetailedText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setIcon"
- Parameter { name: "icon"; type: "Icon" }
- }
- Method {
- name: "setStandardButtons"
- Parameter { name: "buttons"; type: "StandardButtons" }
- }
- Method {
- name: "click"
- Parameter { name: "button"; type: "QMessageDialogOptions::StandardButton" }
- Parameter { type: "QMessageDialogOptions::ButtonRole" }
- }
- Method {
- name: "click"
- Parameter { name: "button"; type: "QQuickAbstractMessageDialog::StandardButton" }
- }
- }
- Component {
- name: "QQuickColorDialog"
- defaultProperty: "implementation"
- prototype: "QQuickAbstractColorDialog"
- exports: ["QtQuick.Dialogs/AbstractColorDialog 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- }
- Component {
- name: "QQuickFileDialog"
- defaultProperty: "implementation"
- prototype: "QQuickAbstractFileDialog"
- exports: ["QtQuick.Dialogs/AbstractFileDialog 1.0"]
- exportMetaObjectRevisions: [0]
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- Method { name: "clearSelection" }
- Method {
- name: "addSelection"
- type: "bool"
- Parameter { name: "path"; type: "QUrl" }
- }
- }
- Component {
- name: "QQuickFontDialog"
- defaultProperty: "implementation"
- prototype: "QQuickAbstractFontDialog"
- exports: ["QtQuick.Dialogs/AbstractFontDialog 1.1"]
- exportMetaObjectRevisions: [0]
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- }
- Component {
- name: "QQuickMessageDialog"
- defaultProperty: "implementation"
- prototype: "QQuickAbstractMessageDialog"
- exports: ["QtQuick.Dialogs/AbstractMessageDialog 1.1"]
- exportMetaObjectRevisions: [0]
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- }
- Component {
- name: "QQuickStandardButton"
- exports: ["QtQuick.Dialogs/StandardButton 1.1"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QQuickStandardIcon"
- exports: ["QtQuick.Dialogs/StandardIcon 1.1"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- prototype: "QObject"
- name: "QtQuick.Dialogs/ColorDialog"
- exports: ["QtQuick.Dialogs/ColorDialog 1.0"]
- exportMetaObjectRevisions: [0]
- defaultProperty: "implementation"
- Property { name: "showAlphaChannel"; type: "bool" }
- Property { name: "color"; type: "QColor" }
- Property { name: "currentColor"; type: "QColor" }
- Property { name: "currentHue"; type: "double"; isReadonly: true }
- Property { name: "currentSaturation"; type: "double"; isReadonly: true }
- Property { name: "currentLightness"; type: "double"; isReadonly: true }
- Property { name: "currentAlpha"; type: "double"; isReadonly: true }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setModality"
- Parameter { name: "m"; type: "Qt::WindowModality" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setColor"
- Parameter { name: "arg"; type: "QColor" }
- }
- Method {
- name: "setCurrentColor"
- Parameter { name: "currentColor"; type: "QColor" }
- }
- Method {
- name: "setShowAlphaChannel"
- Parameter { name: "arg"; type: "bool" }
- }
- Property { name: "visible"; type: "bool" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "title"; type: "string" }
- Property { name: "isWindow"; type: "bool"; isReadonly: true }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Signal { name: "visibilityChanged" }
- Signal { name: "geometryChanged" }
- Signal { name: "accepted" }
- Signal { name: "rejected" }
- Method { name: "open" }
- Method { name: "close" }
- Method {
- name: "setX"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setY"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setWidth"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "arg"; type: "int" }
- }
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- }
- Component {
- prototype: "QObject"
- name: "QtQuick.Dialogs/FileDialog"
- exports: ["QtQuick.Dialogs/FileDialog 1.0"]
- exportMetaObjectRevisions: [0]
- defaultProperty: "implementation"
- Property { name: "visible"; type: "bool" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "title"; type: "string" }
- Property { name: "isWindow"; type: "bool"; isReadonly: true }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Signal { name: "visibilityChanged" }
- Signal { name: "geometryChanged" }
- Signal { name: "accepted" }
- Signal { name: "rejected" }
- Method { name: "open" }
- Method { name: "close" }
- Method {
- name: "setX"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setY"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setWidth"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "arg"; type: "int" }
- }
- Property { name: "selectExisting"; type: "bool" }
- Property { name: "selectMultiple"; type: "bool" }
- Property { name: "selectFolder"; type: "bool" }
- Property { name: "folder"; type: "QUrl" }
- Property { name: "nameFilters"; type: "QStringList" }
- Property { name: "selectedNameFilter"; type: "string" }
- Property { name: "fileUrl"; type: "QUrl"; isReadonly: true }
- Property { name: "fileUrls"; type: "QList<QUrl>"; isReadonly: true }
- Signal { name: "filterSelected" }
- Signal { name: "fileModeChanged" }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setSelectExisting"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setSelectMultiple"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setSelectFolder"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setFolder"
- Parameter { name: "f"; type: "QUrl" }
- }
- Method {
- name: "setNameFilters"
- Parameter { name: "f"; type: "QStringList" }
- }
- Method {
- name: "selectNameFilter"
- Parameter { name: "f"; type: "string" }
- }
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- Method { name: "clearSelection" }
- Method {
- name: "addSelection"
- type: "bool"
- Parameter { name: "path"; type: "QUrl" }
- }
- }
- Component {
- prototype: "QObject"
- name: "QtQuick.Dialogs/FontDialog"
- exports: ["QtQuick.Dialogs/FontDialog 1.1"]
- exportMetaObjectRevisions: [1]
- defaultProperty: "implementation"
- Property { name: "font"; type: "QFont" }
- Property { name: "visible"; type: "bool" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "title"; type: "string" }
- Property { name: "isWindow"; type: "bool"; isReadonly: true }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Signal { name: "visibilityChanged" }
- Signal { name: "geometryChanged" }
- Signal { name: "accepted" }
- Signal { name: "rejected" }
- Method { name: "open" }
- Method { name: "close" }
- Method {
- name: "setX"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setY"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setWidth"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "arg"; type: "int" }
- }
- Property { name: "scalableFonts"; type: "bool" }
- Property { name: "nonScalableFonts"; type: "bool" }
- Property { name: "monospacedFonts"; type: "bool" }
- Property { name: "proportionalFonts"; type: "bool" }
- Property { name: "font"; type: "QFont" }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setModality"
- Parameter { name: "m"; type: "Qt::WindowModality" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setFont"
- Parameter { name: "arg"; type: "QFont" }
- }
- Method {
- name: "setScalableFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setNonScalableFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setMonospacedFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setProportionalFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- }
- Component {
- prototype: "QObject"
- name: "QtQuick.Dialogs/MessageDialog"
- exports: ["QtQuick.Dialogs/MessageDialog 1.1"]
- exportMetaObjectRevisions: [1]
- defaultProperty: "implementation"
- Method { name: "calculateImplicitWidth"; type: "QVariant" }
- Property { name: "visible"; type: "bool" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "title"; type: "string" }
- Property { name: "isWindow"; type: "bool"; isReadonly: true }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Signal { name: "visibilityChanged" }
- Signal { name: "geometryChanged" }
- Signal { name: "accepted" }
- Signal { name: "rejected" }
- Method { name: "open" }
- Method { name: "close" }
- Method {
- name: "setX"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setY"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setWidth"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "arg"; type: "int" }
- }
- Property { name: "text"; type: "string" }
- Property { name: "informativeText"; type: "string" }
- Property { name: "detailedText"; type: "string" }
- Property { name: "icon"; type: "Icon" }
- Property { name: "standardIconSource"; type: "QUrl"; isReadonly: true }
- Property { name: "standardButtons"; type: "StandardButtons" }
- Property { name: "clickedButton"; type: "StandardButton"; isReadonly: true }
- Signal { name: "buttonClicked" }
- Signal { name: "discard" }
- Signal { name: "help" }
- Signal { name: "yes" }
- Signal { name: "no" }
- Signal { name: "apply" }
- Signal { name: "reset" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setInformativeText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setDetailedText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setIcon"
- Parameter { name: "icon"; type: "Icon" }
- }
- Method {
- name: "setStandardButtons"
- Parameter { name: "buttons"; type: "StandardButtons" }
- }
- Method {
- name: "click"
- Parameter { name: "button"; type: "QMessageDialogOptions::StandardButton" }
- Parameter { type: "QMessageDialogOptions::ButtonRole" }
- }
- Method {
- name: "click"
- Parameter { name: "button"; type: "QQuickAbstractMessageDialog::StandardButton" }
- }
- Property { name: "implementation"; type: "QObject"; isPointer: true }
- }
-}
diff --git a/src/imports/dialogs/qml/Button.qml b/src/imports/dialogs/qml/Button.qml
deleted file mode 100644
index f48264d5ff..0000000000
--- a/src/imports/dialogs/qml/Button.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 QtQuick.Dialogs 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 2.1
-import QtQuick.Window 2.1
-
-Item {
- id: container
-
- property alias text: buttonLabel.text
- property alias label: buttonLabel
- signal clicked
- property alias containsMouse: mouseArea.containsMouse
- property alias pressed: mouseArea.pressed
- implicitHeight: Math.max(Screen.pixelDensity * 7, buttonLabel.implicitHeight * 1.2)
- implicitWidth: visible ? Math.max(Screen.pixelDensity * 11, buttonLabel.implicitWidth * 1.3) : 0
- height: implicitHeight
- width: implicitWidth
-
- SystemPalette { id: palette }
-
- Rectangle {
- id: frame
- anchors.fill: parent
- color: palette.button
- gradient: Gradient {
- GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button }
- GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) }
- }
- antialiasing: true
- radius: height / 6
- border.color: Qt.darker(palette.button, 1.5)
- border.width: 1
- }
-
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: container.clicked()
- hoverEnabled: true
- }
-
- Text {
- id: buttonLabel
- text: container.text
- color: palette.buttonText
- anchors.centerIn: parent
- }
-}
diff --git a/src/imports/dialogs/qml/CheckBox.qml b/src/imports/dialogs/qml/CheckBox.qml
deleted file mode 100644
index 32b0e6ff70..0000000000
--- a/src/imports/dialogs/qml/CheckBox.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 QtQuick.Dialogs 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 2.1
-
-Item {
- id: root
- implicitHeight: frame.height
- implicitWidth: row.implicitWidth
- width: implicitWidth
- height: implicitHeight
- property alias text: label.text
- property bool checked
- property alias pressed: mouseArea.pressed
- signal clicked
-
- SystemPalette { id: palette }
-
- Row {
- id: row
- anchors.verticalCenter: parent.verticalCenter
- spacing: 6
- Rectangle {
- id: frame
- gradient: Gradient {
- GradientStop { position: 0.0; color: mouseArea.pressed ? Qt.darker(palette.button, 1.3) : palette.button }
- GradientStop { position: 1.0; color: Qt.darker(palette.button, 1.3) }
- }
- height: label.implicitHeight * 1.5
- width: height
- anchors.margins: 1
- radius: 3
- antialiasing: true
- border.color: Qt.darker(palette.button, 1.5)
- Image {
- id: theX
- source: "../images/checkmark.png"
- anchors.fill: frame
- anchors.margins: frame.width / 5
- fillMode: Image.PreserveAspectFit
- smooth: true
- visible: checked
- }
- }
- Text {
- id: label
- color: palette.text
- anchors.verticalCenter: frame.verticalCenter
- }
- }
- MouseArea {
- id: mouseArea
- anchors.fill: parent
- onClicked: {
- parent.checked = !parent.checked
- parent.clicked()
- }
- }
-}
diff --git a/src/imports/dialogs/qml/ColorSlider.qml b/src/imports/dialogs/qml/ColorSlider.qml
deleted file mode 100755
index 8fc9717380..0000000000
--- a/src/imports/dialogs/qml/ColorSlider.qml
+++ /dev/null
@@ -1,138 +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 Qt Graphical Effects module.
-**
-** $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 2.1
-
-Item {
- id: colorSlider
-
- property real value: 1
- property real maximum: 1
- property real minimum: 0
- property string text: ""
- property bool pressed: mouseArea.pressed
- property bool integer: false
- property Component trackDelegate
- property string handleSource: "../images/slider_handle.png"
-
- width: parent.width
- height: handle.height + textText.implicitHeight
-
- function updatePos() {
- if (maximum > minimum) {
- var pos = (track.width - 10) * (value - minimum) / (maximum - minimum) + 5;
- return Math.min(Math.max(pos, 5), track.width - 5) - 10;
- } else {
- return 5;
- }
- }
-
- SystemPalette { id: palette }
-
- Column {
- id: column
- width: parent.width
- spacing: 12
- Text {
- id: textText
- anchors.horizontalCenter: parent.horizontalCenter
- text: colorSlider.text
- anchors.left: parent.left
- color: palette.windowText
- }
-
- Item {
- id: track
- height: 8
- anchors.left: parent.left
- anchors.right: parent.right
-
- Loader {
- sourceComponent: trackDelegate
- width: parent.height
- height: parent.width
- y: width
- }
-
- BorderImage {
- source: "../images/sunken_frame.png"
- border.left: 8
- border.right: 8
- border.top:8
- border.bottom: 8
- anchors.fill: track
- anchors.margins: -1
- anchors.topMargin: -2
- anchors.leftMargin: -2
- }
-
- Image {
- id: handle
- anchors.verticalCenter: parent.verticalCenter
- smooth: true
- source: "../images/slider_handle.png"
- x: updatePos() - 8
- z: 1
- }
-
- MouseArea {
- id: mouseArea
- anchors {left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter}
- height: handle.height
- width: handle.width
- preventStealing: true
-
- onPressed: {
- var handleX = Math.max(0, Math.min(mouseX, mouseArea.width))
- var realValue = (maximum - minimum) * handleX / mouseArea.width + minimum;
- value = colorSlider.integer ? Math.round(realValue) : realValue;
- }
-
- onPositionChanged: {
- if (pressed) {
- var handleX = Math.max(0, Math.min(mouseX, mouseArea.width))
- var realValue = (maximum - minimum) * handleX / mouseArea.width + minimum;
- value = colorSlider.integer ? Math.round(realValue) : realValue;
- }
- }
- }
- }
- }
-}
diff --git a/src/imports/dialogs/qml/DefaultWindowDecoration.qml b/src/imports/dialogs/qml/DefaultWindowDecoration.qml
deleted file mode 100644
index ec930101d2..0000000000
--- a/src/imports/dialogs/qml/DefaultWindowDecoration.qml
+++ /dev/null
@@ -1,71 +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 QtQuick.Dialogs 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 2.1
-
-Rectangle {
- color: "#80000000"
- anchors.fill: parent
- z: 1000000
- property alias content: borderImage.content
- property bool dismissOnOuterClick: true
- signal dismissed
- MouseArea {
- anchors.fill: parent
- enabled: dismissOnOuterClick
- onClicked: dismissed()
- BorderImage {
- id: borderImage
- property Item content
-
- MouseArea { anchors.fill: parent }
-
- width: content ? content.width + 15 : 0
- height: content ? content.height + 15 : 0
- onWidthChanged: content.x = 5
- onHeightChanged: content.y = 5
- border { left: 10; top: 10; right: 10; bottom: 10 }
- clip: true
- source: "../images/window_border.png"
- anchors.centerIn: parent
- onContentChanged: if (content) content.parent = borderImage
- }
- }
-}
diff --git a/src/imports/dialogs/qml/EdgeFade.qml b/src/imports/dialogs/qml/EdgeFade.qml
deleted file mode 100644
index 376aa151e6..0000000000
--- a/src/imports/dialogs/qml/EdgeFade.qml
+++ /dev/null
@@ -1,63 +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 QtQuick.Dialogs 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 2.1
-
-ShaderEffect {
- property color fadeColor
- property real topThreshold: 10
- property real bottomThreshold: 10
- property real _topRatio: topThreshold / height
- property real _bottomRatio: bottomThreshold / height
- z: 1
- fragmentShader: "
- varying lowp vec2 qt_TexCoord0;
- uniform lowp vec4 fadeColor;
- uniform highp float _topRatio;
- uniform highp float _bottomRatio;
-
- void main() {
- highp float bottomEnd = 1. - _bottomRatio;
- gl_FragColor = fadeColor *
- (qt_TexCoord0.y < _topRatio ? 1. - qt_TexCoord0.y / _topRatio :
- (qt_TexCoord0.y > bottomEnd ? (qt_TexCoord0.y - bottomEnd) / _bottomRatio : 0.));
- }
- "
-}
diff --git a/src/imports/dialogs/qml/TextField.qml b/src/imports/dialogs/qml/TextField.qml
deleted file mode 100644
index e67155086c..0000000000
--- a/src/imports/dialogs/qml/TextField.qml
+++ /dev/null
@@ -1,89 +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 QtQuick.Dialogs 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 2.1
-
-Item {
- id: root
-
- property alias textInput: textInput
- property alias text: textInput.text
- signal accepted
- signal downPressed
- signal backPressed
- signal escapePressed
- implicitWidth: textInput.implicitWidth + rect.radius * 2
- implicitHeight: textInput.implicitHeight
-
- function copyAll() {
- textInput.selectAll()
- textInput.copy()
- }
-
- function paste() {
- textInput.selectAll()
- textInput.paste()
- }
-
- SystemPalette { id: palette }
- height: textInput.implicitHeight + 8
- clip: true
-
- Rectangle {
- id: rect
- anchors.fill: parent
- radius: height / 4
- color: palette.button
- border.color: Qt.darker(palette.button, 1.5)
- }
-
- TextInput {
- id: textInput
- color: palette.text
- anchors.fill: parent
- anchors.leftMargin: rect.radius
- anchors.rightMargin: rect.radius
- verticalAlignment: Text.AlignVCenter
- onAccepted: root.accepted()
- Keys.onDownPressed: root.downPressed()
- Keys.onBackPressed: root.backPressed()
- Keys.onEscapePressed: root.escapePressed()
- }
-}
diff --git a/src/imports/dialogs/qml/qmldir b/src/imports/dialogs/qml/qmldir
deleted file mode 100644
index 9d273b1c4b..0000000000
--- a/src/imports/dialogs/qml/qmldir
+++ /dev/null
@@ -1,5 +0,0 @@
-Button 1.0 Button.qml
-CheckBox 1.1 CheckBox.qml
-ColorSlider 1.0 ColorSlider.qml
-EdgeFade 1.0 EdgeFade.qml
-TextField 1.0 TextField.qml
diff --git a/src/imports/dialogs/qmldir b/src/imports/dialogs/qmldir
deleted file mode 100644
index b4ae1a059c..0000000000
--- a/src/imports/dialogs/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtQuick.Dialogs
-plugin dialogplugin
-classname QtQuick2DialogsPlugin
-typeinfo plugins.qmltypes
diff --git a/src/imports/dialogs/qquickabstractcolordialog.cpp b/src/imports/dialogs/qquickabstractcolordialog.cpp
deleted file mode 100644
index 1931bde905..0000000000
--- a/src/imports/dialogs/qquickabstractcolordialog.cpp
+++ /dev/null
@@ -1,134 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickabstractcolordialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-QQuickAbstractColorDialog::QQuickAbstractColorDialog(QObject *parent)
- : QQuickAbstractDialog(parent)
- , m_dlgHelper(0)
- , m_options(QSharedPointer<QColorDialogOptions>(new QColorDialogOptions()))
-{
- // On the Mac, modality doesn't work unless you call exec(). But this is a reasonable default anyway.
- m_modality = Qt::NonModal;
- connect(this, SIGNAL(accepted()), this, SIGNAL(selectionAccepted()));
-}
-
-QQuickAbstractColorDialog::~QQuickAbstractColorDialog()
-{
-}
-
-void QQuickAbstractColorDialog::setVisible(bool v)
-{
- if (helper() && v) {
- m_dlgHelper->setOptions(m_options);
- // Due to the fact that QColorDialogOptions doesn't have currentColor...
- m_dlgHelper->setCurrentColor(m_color);
- }
- QQuickAbstractDialog::setVisible(v);
- // QTBUG-35206
-#if defined(Q_OS_WIN)
- if (m_dialogWindow)
- m_dialogWindow->setWidth(m_dialogWindow->width() + 1);
-#endif
-}
-
-void QQuickAbstractColorDialog::setModality(Qt::WindowModality m)
-{
-#ifdef Q_OS_MAC
- // On the Mac, modality doesn't work unless you call exec()
- m_modality = Qt::NonModal;
- emit modalityChanged();
- return;
-#endif
- QQuickAbstractDialog::setModality(m);
-}
-
-QString QQuickAbstractColorDialog::title() const
-{
- return m_options->windowTitle();
-}
-
-bool QQuickAbstractColorDialog::showAlphaChannel() const
-{
- return m_options->testOption(QColorDialogOptions::ShowAlphaChannel);
-}
-
-void QQuickAbstractColorDialog::setTitle(const QString &t)
-{
- if (m_options->windowTitle() == t) return;
- m_options->setWindowTitle(t);
- emit titleChanged();
-}
-
-void QQuickAbstractColorDialog::setColor(QColor arg)
-{
- if (m_dlgHelper)
- m_dlgHelper->setCurrentColor(arg);
- // m_options->setCustomColor or setStandardColor don't make sense here
- if (m_color != arg) {
- m_color = arg;
- emit colorChanged();
- }
- setCurrentColor(arg);
-}
-
-void QQuickAbstractColorDialog::setCurrentColor(QColor currentColor)
-{
- if (m_currentColor != currentColor) {
- m_currentColor = currentColor;
- emit currentColorChanged();
- }
-}
-
-void QQuickAbstractColorDialog::setShowAlphaChannel(bool arg)
-{
- m_options->setOption(QColorDialogOptions::ShowAlphaChannel, arg);
- emit showAlphaChannelChanged();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickabstractcolordialog_p.h b/src/imports/dialogs/qquickabstractcolordialog_p.h
deleted file mode 100644
index ad2c7ce1ed..0000000000
--- a/src/imports/dialogs/qquickabstractcolordialog_p.h
+++ /dev/null
@@ -1,113 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKABSTRACTCOLORDIALOG_P_H
-#define QQUICKABSTRACTCOLORDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQml>
-#include <QQuickView>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include <qpa/qplatformtheme.h>
-#include "qquickabstractdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickAbstractColorDialog : public QQuickAbstractDialog
-{
- Q_OBJECT
- Q_PROPERTY(bool showAlphaChannel READ showAlphaChannel WRITE setShowAlphaChannel NOTIFY showAlphaChannelChanged)
- Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
- Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged)
- Q_PROPERTY(qreal currentHue READ currentHue NOTIFY currentColorChanged)
- Q_PROPERTY(qreal currentSaturation READ currentSaturation NOTIFY currentColorChanged)
- Q_PROPERTY(qreal currentLightness READ currentLightness NOTIFY currentColorChanged)
- Q_PROPERTY(qreal currentAlpha READ currentAlpha NOTIFY currentColorChanged)
-
-public:
- QQuickAbstractColorDialog(QObject *parent = 0);
- virtual ~QQuickAbstractColorDialog();
-
- virtual QString title() const;
- bool showAlphaChannel() const;
- QColor color() const { return m_color; }
- QColor currentColor() const { return m_currentColor; }
- qreal currentHue() const { return m_currentColor.hslHueF(); }
- qreal currentSaturation() const { return m_currentColor.hslSaturationF(); }
- qreal currentLightness() const { return m_currentColor.lightnessF(); }
- qreal currentAlpha() const { return m_currentColor.alphaF(); }
-
-public Q_SLOTS:
- void setVisible(bool v);
- void setModality(Qt::WindowModality m);
- void setTitle(const QString &t);
- void setColor(QColor arg);
- void setCurrentColor(QColor currentColor);
- void setShowAlphaChannel(bool arg);
-
-Q_SIGNALS:
- void showAlphaChannelChanged();
- void colorChanged();
- void currentColorChanged();
- void selectionAccepted();
-
-protected:
- QPlatformColorDialogHelper *m_dlgHelper;
- QSharedPointer<QColorDialogOptions> m_options;
- QColor m_color;
- QColor m_currentColor;
-
- Q_DISABLE_COPY(QQuickAbstractColorDialog)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKABSTRACTCOLORDIALOG_P_H
diff --git a/src/imports/dialogs/qquickabstractdialog.cpp b/src/imports/dialogs/qquickabstractdialog.cpp
deleted file mode 100644
index 9bb2388741..0000000000
--- a/src/imports/dialogs/qquickabstractdialog.cpp
+++ /dev/null
@@ -1,337 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickabstractdialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQmlComponent>
-#include <QQuickWindow>
-#include <qpa/qplatformintegration.h>
-
-QT_BEGIN_NAMESPACE
-
-QQmlComponent *QQuickAbstractDialog::m_decorationComponent(0);
-
-QQuickAbstractDialog::QQuickAbstractDialog(QObject *parent)
- : QObject(parent)
- , m_parentWindow(0)
- , m_visible(false)
- , m_modality(Qt::WindowModal)
- , m_qmlImplementation(0)
- , m_dialogWindow(0)
- , m_contentItem(0)
- , m_windowDecoration(0)
- , m_hasNativeWindows(QGuiApplicationPrivate::platformIntegration()->
- hasCapability(QPlatformIntegration::MultipleWindows) &&
- QGuiApplicationPrivate::platformIntegration()->
- hasCapability(QPlatformIntegration::WindowManagement))
- , m_hasAspiredPosition(false)
-{
-}
-
-QQuickAbstractDialog::~QQuickAbstractDialog()
-{
-}
-
-void QQuickAbstractDialog::setVisible(bool v)
-{
- if (m_visible == v) return;
- m_visible = v;
- if (helper()) {
- if (v) {
- Qt::WindowFlags flags = Qt::Dialog;
- if (!title().isEmpty())
- flags |= Qt::WindowTitleHint;
- m_visible = helper()->show(flags, m_modality, parentWindow());
- } else {
- helper()->hide();
- }
- } else {
- // For a pure QML implementation, there is no helper.
- // But m_implementation is probably either an Item or a Window at this point.
- if (!m_dialogWindow) {
- m_dialogWindow = qobject_cast<QWindow *>(m_qmlImplementation);
- if (!m_dialogWindow) {
- m_contentItem = qobject_cast<QQuickItem *>(m_qmlImplementation);
- if (m_contentItem) {
- if (m_hasNativeWindows)
- m_dialogWindow = m_contentItem->window();
- // An Item-based dialog implementation doesn't come with a window, so
- // we have to instantiate one iff the platform allows it.
- if (!m_dialogWindow && m_hasNativeWindows) {
- QQuickWindow *win = new QQuickWindow;
- ((QObject *)win)->setParent(this); // memory management only
- m_dialogWindow = win;
- m_contentItem->setParentItem(win->contentItem());
- m_dialogWindow->setMinimumSize(QSize(m_contentItem->implicitWidth(), m_contentItem->implicitHeight()));
- connect(win, SIGNAL(widthChanged(int)), this, SLOT(windowGeometryChanged()));
- connect(win, SIGNAL(heightChanged(int)), this, SLOT(windowGeometryChanged()));
- }
-
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
-
- // If the platform does not support multiple windows, but the dialog is
- // implemented as an Item, then try to decorate it as a fake window and make it visible.
- if (parentItem && !m_dialogWindow && !m_windowDecoration) {
- if (m_decorationComponent) {
- if (m_decorationComponent->isLoading())
- connect(m_decorationComponent, SIGNAL(statusChanged(QQmlComponent::Status)),
- this, SLOT(decorationLoaded()));
- else
- decorationLoaded();
- }
- // Window decoration wasn't possible, so just reparent it into the scene
- else {
- m_contentItem->setParentItem(parentItem);
- m_contentItem->setZ(10000);
- }
- }
- }
- }
- if (m_dialogWindow) {
- // "grow up" to the size and position expected to achieve
- if (!m_sizeAspiration.isNull()) {
- if (m_hasAspiredPosition)
- m_dialogWindow->setGeometry(m_sizeAspiration);
- else {
- if (m_sizeAspiration.width() > 0)
- m_dialogWindow->setWidth(m_sizeAspiration.width());
- if (m_sizeAspiration.height() > 0)
- m_dialogWindow->setHeight(m_sizeAspiration.height());
- }
- }
- connect(m_dialogWindow, SIGNAL(visibleChanged(bool)), this, SLOT(visibleChanged(bool)));
- connect(m_dialogWindow, SIGNAL(xChanged(int)), this, SLOT(setX(int)));
- connect(m_dialogWindow, SIGNAL(yChanged(int)), this, SLOT(setY(int)));
- connect(m_dialogWindow, SIGNAL(widthChanged(int)), this, SLOT(setWidth(int)));
- connect(m_dialogWindow, SIGNAL(heightChanged(int)), this, SLOT(setHeight(int)));
- }
- }
- if (m_windowDecoration) {
- m_windowDecoration->setVisible(v);
- } else if (m_dialogWindow) {
- if (v) {
- m_dialogWindow->setTransientParent(parentWindow());
- m_dialogWindow->setTitle(title());
- m_dialogWindow->setModality(m_modality);
- }
- m_dialogWindow->setVisible(v);
- }
- }
-
- emit visibilityChanged();
-}
-
-void QQuickAbstractDialog::decorationLoaded()
-{
- bool ok = false;
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- while (parentItem->parentItem() && !parentItem->parentItem()->inherits("QQuickRootItem"))
- parentItem = parentItem->parentItem();
- if (m_decorationComponent->isError()) {
- qWarning() << m_decorationComponent->errors();
- } else {
- QObject *decoration = m_decorationComponent->create();
- m_windowDecoration = qobject_cast<QQuickItem *>(decoration);
- if (m_windowDecoration) {
- m_windowDecoration->setParentItem(parentItem);
- // Give the window decoration its content to manage
- QVariant contentVariant;
- contentVariant.setValue<QQuickItem*>(m_contentItem);
- m_windowDecoration->setProperty("content", contentVariant);
- connect(m_windowDecoration, SIGNAL(dismissed()), this, SLOT(reject()));
- ok = true;
- } else {
- qWarning() << m_decorationComponent->url() <<
- "cannot be used as a window decoration because it's not an Item";
- delete m_windowDecoration;
- delete m_decorationComponent;
- m_decorationComponent = 0;
- }
- }
- // Window decoration wasn't possible, so just reparent it into the scene
- if (!ok) {
- m_contentItem->setParentItem(parentItem);
- m_contentItem->setZ(10000);
- }
-}
-
-void QQuickAbstractDialog::setModality(Qt::WindowModality m)
-{
- if (m_modality == m) return;
- m_modality = m;
- emit modalityChanged();
-}
-
-void QQuickAbstractDialog::accept()
-{
- setVisible(false);
- emit accepted();
-}
-
-void QQuickAbstractDialog::reject()
-{
- setVisible(false);
- emit rejected();
-}
-
-void QQuickAbstractDialog::visibleChanged(bool v)
-{
- m_visible = v;
- emit visibilityChanged();
-}
-
-void QQuickAbstractDialog::windowGeometryChanged()
-{
- QQuickItem *content = qobject_cast<QQuickItem*>(m_qmlImplementation);
- if (m_dialogWindow && content) {
- content->setWidth(m_dialogWindow->width());
- content->setHeight(m_dialogWindow->height());
- }
-}
-
-QQuickWindow *QQuickAbstractDialog::parentWindow()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
- return m_parentWindow;
-}
-
-void QQuickAbstractDialog::setQmlImplementation(QObject *obj)
-{
- m_qmlImplementation = obj;
- if (m_dialogWindow) {
- disconnect(this, SLOT(visibleChanged(bool)));
- // Can't necessarily delete because m_dialogWindow might have been provided by the QML.
- m_dialogWindow = 0;
- }
-}
-
-int QQuickAbstractDialog::x() const
-{
- if (m_dialogWindow)
- return m_dialogWindow->x();
- return m_sizeAspiration.x();
-}
-
-int QQuickAbstractDialog::y() const
-{
- if (m_dialogWindow)
- return m_dialogWindow->y();
- return m_sizeAspiration.y();
-}
-
-int QQuickAbstractDialog::width() const
-{
- if (m_dialogWindow)
- return m_dialogWindow->width();
- return m_sizeAspiration.width();
-}
-
-int QQuickAbstractDialog::height() const
-{
- if (m_dialogWindow)
- return m_dialogWindow->height();
- return m_sizeAspiration.height();
-}
-
-void QQuickAbstractDialog::setX(int arg)
-{
- m_hasAspiredPosition = true;
- m_sizeAspiration.setX(arg);
- if (helper()) {
- // TODO
- } else if (m_dialogWindow) {
- if (sender() != m_dialogWindow)
- m_dialogWindow->setX(arg);
- } else if (m_contentItem) {
- m_contentItem->setX(arg);
- }
- emit geometryChanged();
-}
-
-void QQuickAbstractDialog::setY(int arg)
-{
- m_hasAspiredPosition = true;
- m_sizeAspiration.setY(arg);
- if (helper()) {
- // TODO
- } else if (m_dialogWindow) {
- if (sender() != m_dialogWindow)
- m_dialogWindow->setY(arg);
- } else if (m_contentItem) {
- m_contentItem->setY(arg);
- }
- emit geometryChanged();
-}
-
-void QQuickAbstractDialog::setWidth(int arg)
-{
- m_sizeAspiration.setWidth(arg);
- if (helper()) {
- // TODO
- } else if (m_dialogWindow) {
- if (sender() != m_dialogWindow)
- m_dialogWindow->setWidth(arg);
- } else if (m_contentItem) {
- m_contentItem->setWidth(arg);
- }
- emit geometryChanged();
-}
-
-void QQuickAbstractDialog::setHeight(int arg)
-{
- m_sizeAspiration.setHeight(arg);
- if (helper()) {
- // TODO
- } else if (m_dialogWindow) {
- if (sender() != m_dialogWindow)
- m_dialogWindow->setHeight(arg);
- } else if (m_contentItem) {
- m_contentItem->setHeight(arg);
- }
- emit geometryChanged();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickabstractdialog_p.h b/src/imports/dialogs/qquickabstractdialog_p.h
deleted file mode 100644
index 8ffa166c5b..0000000000
--- a/src/imports/dialogs/qquickabstractdialog_p.h
+++ /dev/null
@@ -1,145 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKABSTRACTDIALOG_P_H
-#define QQUICKABSTRACTDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQml>
-#include <QQuickView>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include <qpa/qplatformtheme.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickAbstractDialog : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged)
- Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged)
- Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
- Q_PROPERTY(bool isWindow READ isWindow CONSTANT)
- Q_PROPERTY(int x READ x WRITE setX NOTIFY geometryChanged)
- Q_PROPERTY(int y READ y WRITE setY NOTIFY geometryChanged)
- Q_PROPERTY(int width READ width WRITE setWidth NOTIFY geometryChanged)
- Q_PROPERTY(int height READ height WRITE setHeight NOTIFY geometryChanged)
-
-public:
- QQuickAbstractDialog(QObject *parent = 0);
- virtual ~QQuickAbstractDialog();
-
- bool isVisible() const { return m_visible; }
- Qt::WindowModality modality() const { return m_modality; }
- virtual QString title() const = 0;
- QObject* qmlImplementation() { return m_qmlImplementation; }
-
- int x() const;
- int y() const;
- int width() const;
- int height() const;
-
- virtual void setVisible(bool v);
- virtual void setModality(Qt::WindowModality m);
- virtual void setTitle(const QString &t) = 0;
- void setQmlImplementation(QObject* obj);
- bool isWindow() const { return m_hasNativeWindows; }
-
-public Q_SLOTS:
- void open() { setVisible(true); }
- void close() { setVisible(false); }
- void setX(int arg);
- void setY(int arg);
- void setWidth(int arg);
- void setHeight(int arg);
-
-Q_SIGNALS:
- void visibilityChanged();
- void geometryChanged();
- void modalityChanged();
- void titleChanged();
- void accepted();
- void rejected();
-
-protected Q_SLOTS:
- void decorationLoaded();
- virtual void accept();
- virtual void reject();
- void visibleChanged(bool v);
- void windowGeometryChanged();
-
-protected:
- virtual QPlatformDialogHelper *helper() = 0;
- QQuickWindow *parentWindow();
-
-protected:
- QQuickWindow *m_parentWindow;
- bool m_visible;
- Qt::WindowModality m_modality;
-
-protected: // variables for pure-QML implementations only
- QObject *m_qmlImplementation;
- QWindow *m_dialogWindow;
- QQuickItem *m_contentItem;
- QQuickItem *m_windowDecoration;
- bool m_hasNativeWindows;
- QRect m_sizeAspiration;
- bool m_hasAspiredPosition;
-
- static QQmlComponent *m_decorationComponent;
-
- friend class QtQuick2DialogsPlugin;
-
- Q_DISABLE_COPY(QQuickAbstractDialog)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKABSTRACTDIALOG_P_H
diff --git a/src/imports/dialogs/qquickabstractfiledialog.cpp b/src/imports/dialogs/qquickabstractfiledialog.cpp
deleted file mode 100644
index 0cac801311..0000000000
--- a/src/imports/dialogs/qquickabstractfiledialog.cpp
+++ /dev/null
@@ -1,194 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickabstractfiledialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-QQuickAbstractFileDialog::QQuickAbstractFileDialog(QObject *parent)
- : QQuickAbstractDialog(parent)
- , m_dlgHelper(0)
- , m_options(QSharedPointer<QFileDialogOptions>(new QFileDialogOptions()))
- , m_selectExisting(true)
- , m_selectMultiple(false)
- , m_selectFolder(false)
-{
- updateModes();
- connect(this, SIGNAL(accepted()), this, SIGNAL(selectionAccepted()));
-}
-
-QQuickAbstractFileDialog::~QQuickAbstractFileDialog()
-{
-}
-
-void QQuickAbstractFileDialog::setVisible(bool v)
-{
- if (helper() && v) {
- m_dlgHelper->setOptions(m_options);
- m_dlgHelper->setFilter();
- emit filterSelected();
- }
- QQuickAbstractDialog::setVisible(v);
-}
-
-QString QQuickAbstractFileDialog::title() const
-{
- return m_options->windowTitle();
-}
-
-void QQuickAbstractFileDialog::setTitle(const QString &t)
-{
- if (m_options->windowTitle() == t) return;
- m_options->setWindowTitle(t);
- emit titleChanged();
-}
-
-void QQuickAbstractFileDialog::setSelectExisting(bool selectExisting)
-{
- if (selectExisting == m_selectExisting) return;
- m_selectExisting = selectExisting;
- updateModes();
-}
-
-void QQuickAbstractFileDialog::setSelectMultiple(bool selectMultiple)
-{
- if (selectMultiple == m_selectMultiple) return;
- m_selectMultiple = selectMultiple;
- updateModes();
-}
-
-void QQuickAbstractFileDialog::setSelectFolder(bool selectFolder)
-{
- if (selectFolder == m_selectFolder) return;
- m_selectFolder = selectFolder;
- updateModes();
-}
-
-QUrl QQuickAbstractFileDialog::folder()
-{
- if (m_dlgHelper && !m_dlgHelper->directory().isEmpty())
- return m_dlgHelper->directory();
- return m_options->initialDirectory();
-}
-
-void QQuickAbstractFileDialog::setFolder(const QUrl &f)
-{
- if (m_dlgHelper)
- m_dlgHelper->setDirectory(f);
- m_options->setInitialDirectory(f);
- emit folderChanged();
-}
-
-void QQuickAbstractFileDialog::setNameFilters(const QStringList &f)
-{
- m_options->setNameFilters(f);
- if (f.isEmpty())
- selectNameFilter(QString());
- else if (!f.contains(selectedNameFilter()))
- selectNameFilter(f.first());
- emit nameFiltersChanged();
-}
-
-QString QQuickAbstractFileDialog::selectedNameFilter()
-{
- QString ret;
- if (m_dlgHelper)
- ret = m_dlgHelper->selectedNameFilter();
- if (ret.isEmpty())
- return m_options->initiallySelectedNameFilter();
- return ret;
-}
-
-void QQuickAbstractFileDialog::selectNameFilter(const QString &f)
-{
- // This should work whether the dialog is currently being shown already, or ahead of time.
- m_options->setInitiallySelectedNameFilter(f);
- if (m_dlgHelper)
- m_dlgHelper->selectNameFilter(f);
- emit filterSelected();
-}
-
-QUrl QQuickAbstractFileDialog::fileUrl()
-{
- QList<QUrl> urls = fileUrls();
- return (urls.count() == 1) ? urls[0] : QUrl();
-}
-
-QList<QUrl> QQuickAbstractFileDialog::fileUrls()
-{
- if (m_dlgHelper)
- return m_dlgHelper->selectedFiles();
- return QList<QUrl>();
-}
-
-void QQuickAbstractFileDialog::updateModes()
-{
- // The 4 possible modes are AnyFile, ExistingFile, Directory, ExistingFiles
- // Assume AnyFile until we find a reason to the contrary
- QFileDialogOptions::FileMode mode = QFileDialogOptions::AnyFile;
-
- if (m_selectFolder) {
- mode = QFileDialogOptions::Directory;
- m_options->setOption(QFileDialogOptions::ShowDirsOnly);
- m_selectMultiple = false;
- m_selectExisting = true;
- setNameFilters(QStringList());
- } else if (m_selectExisting) {
- mode = m_selectMultiple ?
- QFileDialogOptions::ExistingFiles : QFileDialogOptions::ExistingFile;
- m_options->setOption(QFileDialogOptions::ShowDirsOnly, false);
- } else if (m_selectMultiple) {
- m_selectExisting = true;
- }
- if (!m_selectExisting)
- m_selectMultiple = false;
- m_options->setFileMode(mode);
- m_options->setAcceptMode(m_selectExisting ?
- QFileDialogOptions::AcceptOpen : QFileDialogOptions::AcceptSave);
- emit fileModeChanged();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickabstractfiledialog_p.h b/src/imports/dialogs/qquickabstractfiledialog_p.h
deleted file mode 100644
index 5ce48e8055..0000000000
--- a/src/imports/dialogs/qquickabstractfiledialog_p.h
+++ /dev/null
@@ -1,122 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKABSTRACTFILEDIALOG_P_H
-#define QQUICKABSTRACTFILEDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQml>
-#include <QQuickView>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include <qpa/qplatformtheme.h>
-#include "qquickabstractdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickAbstractFileDialog : public QQuickAbstractDialog
-{
- Q_OBJECT
- Q_PROPERTY(bool selectExisting READ selectExisting WRITE setSelectExisting NOTIFY fileModeChanged)
- Q_PROPERTY(bool selectMultiple READ selectMultiple WRITE setSelectMultiple NOTIFY fileModeChanged)
- Q_PROPERTY(bool selectFolder READ selectFolder WRITE setSelectFolder NOTIFY fileModeChanged)
- Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged)
- Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters NOTIFY nameFiltersChanged)
- Q_PROPERTY(QString selectedNameFilter READ selectedNameFilter WRITE selectNameFilter NOTIFY filterSelected)
- Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY selectionAccepted)
- Q_PROPERTY(QList<QUrl> fileUrls READ fileUrls NOTIFY selectionAccepted)
-
-public:
- QQuickAbstractFileDialog(QObject *parent = 0);
- virtual ~QQuickAbstractFileDialog();
-
- virtual QString title() const;
- bool selectExisting() const { return m_selectExisting; }
- bool selectMultiple() const { return m_selectMultiple; }
- bool selectFolder() const { return m_selectFolder; }
- QUrl folder();
- QStringList nameFilters() const { return m_options->nameFilters(); }
- QString selectedNameFilter();
- QUrl fileUrl();
- virtual QList<QUrl> fileUrls();
-
-public Q_SLOTS:
- void setVisible(bool v);
- void setTitle(const QString &t);
- void setSelectExisting(bool s);
- void setSelectMultiple(bool s);
- void setSelectFolder(bool s);
- void setFolder(const QUrl &f);
- void setNameFilters(const QStringList &f);
- void selectNameFilter(const QString &f);
-
-Q_SIGNALS:
- void folderChanged();
- void nameFiltersChanged();
- void filterSelected();
- void fileModeChanged();
- void selectionAccepted();
-
-protected:
- void updateModes();
-
-protected:
- QPlatformFileDialogHelper *m_dlgHelper;
- QSharedPointer<QFileDialogOptions> m_options;
- bool m_selectExisting;
- bool m_selectMultiple;
- bool m_selectFolder;
-
- Q_DISABLE_COPY(QQuickAbstractFileDialog)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKABSTRACTFILEDIALOG_P_H
diff --git a/src/imports/dialogs/qquickabstractfontdialog.cpp b/src/imports/dialogs/qquickabstractfontdialog.cpp
deleted file mode 100644
index 29dd15e8cc..0000000000
--- a/src/imports/dialogs/qquickabstractfontdialog.cpp
+++ /dev/null
@@ -1,150 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickabstractfontdialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-QQuickAbstractFontDialog::QQuickAbstractFontDialog(QObject *parent)
- : QQuickAbstractDialog(parent)
- , m_dlgHelper(0)
- , m_options(QSharedPointer<QFontDialogOptions>(new QFontDialogOptions()))
-{
- // On the Mac, modality doesn't work unless you call exec(). But this is a reasonable default anyway.
- m_modality = Qt::NonModal;
- connect(this, SIGNAL(accepted()), this, SIGNAL(selectionAccepted()));
-}
-
-QQuickAbstractFontDialog::~QQuickAbstractFontDialog()
-{
-}
-
-void QQuickAbstractFontDialog::setVisible(bool v)
-{
- if (helper() && v) {
- m_dlgHelper->setOptions(m_options);
- // Due to the fact that QFontDialogOptions doesn't have currentFont...
- m_dlgHelper->setCurrentFont(m_font);
- }
- QQuickAbstractDialog::setVisible(v);
-}
-
-void QQuickAbstractFontDialog::setModality(Qt::WindowModality m)
-{
-#ifdef Q_OS_MAC
- // On the Mac, modality doesn't work unless you call exec()
- m_modality = Qt::NonModal;
- emit modalityChanged();
- return;
-#endif
- QQuickAbstractDialog::setModality(m);
-}
-
-QString QQuickAbstractFontDialog::title() const
-{
- return m_options->windowTitle();
-}
-
-bool QQuickAbstractFontDialog::scalableFonts() const
-{
- return m_options->testOption(QFontDialogOptions::ScalableFonts);
-}
-
-bool QQuickAbstractFontDialog::nonScalableFonts() const
-{
- return m_options->testOption(QFontDialogOptions::NonScalableFonts);
-}
-
-bool QQuickAbstractFontDialog::monospacedFonts() const
-{
- return m_options->testOption(QFontDialogOptions::MonospacedFonts);
-}
-
-bool QQuickAbstractFontDialog::proportionalFonts() const
-{
- return m_options->testOption(QFontDialogOptions::ProportionalFonts);
-}
-
-void QQuickAbstractFontDialog::setTitle(const QString &t)
-{
- if (m_options->windowTitle() == t) return;
- m_options->setWindowTitle(t);
- emit titleChanged();
-}
-
-void QQuickAbstractFontDialog::setFont(const QFont &arg)
-{
- if (m_font != arg) {
- m_font = arg;
- emit fontChanged();
- }
-}
-
-void QQuickAbstractFontDialog::setScalableFonts(bool arg)
-{
- m_options->setOption(QFontDialogOptions::ScalableFonts, arg);
- emit scalableFontsChanged();
-}
-
-void QQuickAbstractFontDialog::setNonScalableFonts(bool arg)
-{
- m_options->setOption(QFontDialogOptions::NonScalableFonts, arg);
- emit nonScalableFontsChanged();
-}
-
-void QQuickAbstractFontDialog::setMonospacedFonts(bool arg)
-{
- m_options->setOption(QFontDialogOptions::MonospacedFonts, arg);
- emit monospacedFontsChanged();
-}
-
-void QQuickAbstractFontDialog::setProportionalFonts(bool arg)
-{
- m_options->setOption(QFontDialogOptions::ProportionalFonts, arg);
- emit proportionalFontsChanged();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickabstractfontdialog_p.h b/src/imports/dialogs/qquickabstractfontdialog_p.h
deleted file mode 100644
index 858a0d3eac..0000000000
--- a/src/imports/dialogs/qquickabstractfontdialog_p.h
+++ /dev/null
@@ -1,113 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKABSTRACTFONTDIALOG_P_H
-#define QQUICKABSTRACTFONTDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQml>
-#include <QQuickView>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include <QtGui/qfont.h>
-#include <qpa/qplatformtheme.h>
-#include "qquickabstractdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickAbstractFontDialog : public QQuickAbstractDialog
-{
- Q_OBJECT
- Q_PROPERTY(bool scalableFonts READ scalableFonts WRITE setScalableFonts NOTIFY scalableFontsChanged)
- Q_PROPERTY(bool nonScalableFonts READ nonScalableFonts WRITE setNonScalableFonts NOTIFY nonScalableFontsChanged)
- Q_PROPERTY(bool monospacedFonts READ monospacedFonts WRITE setMonospacedFonts NOTIFY monospacedFontsChanged)
- Q_PROPERTY(bool proportionalFonts READ proportionalFonts WRITE setProportionalFonts NOTIFY proportionalFontsChanged)
- Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
-
-public:
- QQuickAbstractFontDialog(QObject *parent = 0);
- virtual ~QQuickAbstractFontDialog();
-
- virtual QString title() const;
- bool scalableFonts() const;
- bool nonScalableFonts() const;
- bool monospacedFonts() const;
- bool proportionalFonts() const;
- QFont font() const { return m_font; }
-
-public Q_SLOTS:
- void setVisible(bool v);
- void setModality(Qt::WindowModality m);
- void setTitle(const QString &t);
- void setFont(const QFont &arg);
- void setScalableFonts(bool arg);
- void setNonScalableFonts(bool arg);
- void setMonospacedFonts(bool arg);
- void setProportionalFonts(bool arg);
-
-Q_SIGNALS:
- void scalableFontsChanged();
- void nonScalableFontsChanged();
- void monospacedFontsChanged();
- void proportionalFontsChanged();
- void fontChanged();
- void selectionAccepted();
-
-protected:
- QPlatformFontDialogHelper *m_dlgHelper;
- QSharedPointer<QFontDialogOptions> m_options;
- QFont m_font;
-
- Q_DISABLE_COPY(QQuickAbstractFontDialog)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKABSTRACTFONTDIALOG_P_H
diff --git a/src/imports/dialogs/qquickabstractmessagedialog.cpp b/src/imports/dialogs/qquickabstractmessagedialog.cpp
deleted file mode 100644
index a44464962a..0000000000
--- a/src/imports/dialogs/qquickabstractmessagedialog.cpp
+++ /dev/null
@@ -1,179 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickabstractmessagedialog_p.h"
-#include <QtGui/qpa/qplatformdialoghelper.h>
-
-QT_BEGIN_NAMESPACE
-
-QQuickAbstractMessageDialog::QQuickAbstractMessageDialog(QObject *parent)
- : QQuickAbstractDialog(parent)
- , m_dlgHelper(0)
- , m_options(QSharedPointer<QMessageDialogOptions>(new QMessageDialogOptions()))
- , m_clickedButton(NoButton)
-{
-}
-
-QQuickAbstractMessageDialog::~QQuickAbstractMessageDialog()
-{
-}
-
-void QQuickAbstractMessageDialog::setVisible(bool v)
-{
- if (helper() && v)
- m_dlgHelper->setOptions(m_options);
- if (v)
- m_clickedButton = NoButton;
- QQuickAbstractDialog::setVisible(v);
-}
-
-void QQuickAbstractMessageDialog::setTitle(const QString &arg)
-{
- if (arg != m_options->windowTitle()) {
- m_options->setWindowTitle(arg);
- emit titleChanged();
- }
-}
-
-void QQuickAbstractMessageDialog::setText(const QString &arg)
-{
- if (arg != m_options->text()) {
- m_options->setText(arg);
- emit textChanged();
- }
-}
-
-void QQuickAbstractMessageDialog::setInformativeText(const QString &arg)
-{
- if (arg != m_options->informativeText()) {
- m_options->setInformativeText(arg);
- emit informativeTextChanged();
- }
-}
-
-void QQuickAbstractMessageDialog::setDetailedText(const QString &arg)
-{
- if (arg != m_options->detailedText()) {
- m_options->setDetailedText(arg);
- emit detailedTextChanged();
- }
-}
-
-void QQuickAbstractMessageDialog::setIcon(QQuickAbstractMessageDialog::Icon icon)
-{
- if (static_cast<int>(icon) != static_cast<int>(m_options->icon())) {
- m_options->setIcon(static_cast<QMessageDialogOptions::Icon>(icon));
- emit iconChanged();
- }
-}
-
-QUrl QQuickAbstractMessageDialog::standardIconSource()
-{
- switch (m_options->icon()) {
- case QMessageDialogOptions::Information:
- return QUrl("images/information.png");
- break;
- case QMessageDialogOptions::Warning:
- return QUrl("images/warning.png");
- break;
- case QMessageDialogOptions::Critical:
- return QUrl("images/critical.png");
- break;
- case QMessageDialogOptions::Question:
- return QUrl("images/question.png");
- break;
- default:
- return QUrl();
- break;
- }
-}
-
-void QQuickAbstractMessageDialog::setStandardButtons(StandardButtons buttons)
-{
- if (buttons != m_options->standardButtons()) {
- m_options->setStandardButtons(static_cast<QMessageDialogOptions::StandardButtons>(static_cast<int>(buttons)));
- emit standardButtonsChanged();
- }
-}
-
-void QQuickAbstractMessageDialog::click(QMessageDialogOptions::StandardButton button, QMessageDialogOptions::ButtonRole role)
-{
- setVisible(false);
- m_clickedButton = static_cast<StandardButton>(button);
- emit buttonClicked();
- switch (role) {
- case QMessageDialogOptions::AcceptRole:
- emit accept();
- break;
- case QMessageDialogOptions::RejectRole:
- emit reject();
- break;
- case QMessageDialogOptions::DestructiveRole:
- emit discard();
- break;
- case QMessageDialogOptions::HelpRole:
- emit help();
- break;
- case QMessageDialogOptions::YesRole:
- emit yes();
- break;
- case QMessageDialogOptions::NoRole:
- emit no();
- break;
- case QMessageDialogOptions::ApplyRole:
- emit apply();
- break;
- case QMessageDialogOptions::ResetRole:
- emit reset();
- break;
- default:
- qWarning("unhandled MessageDialog button %d with role %d", button, role);
- }
-}
-
-void QQuickAbstractMessageDialog::click(QQuickAbstractMessageDialog::StandardButton button)
-{
- click(static_cast<QMessageDialogOptions::StandardButton>(button),
- static_cast<QMessageDialogOptions::ButtonRole>(
- QMessageDialogOptions::buttonRole(static_cast<QMessageDialogOptions::StandardButton>(button))));
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickabstractmessagedialog_p.h b/src/imports/dialogs/qquickabstractmessagedialog_p.h
deleted file mode 100644
index f2427bb2e0..0000000000
--- a/src/imports/dialogs/qquickabstractmessagedialog_p.h
+++ /dev/null
@@ -1,165 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKABSTRACTMESSAGEDIALOG_P_H
-#define QQUICKABSTRACTMESSAGEDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtQml>
-#include <QQuickView>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include <qpa/qplatformtheme.h>
-#include "qquickabstractdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickAbstractMessageDialog : public QQuickAbstractDialog
-{
- Q_OBJECT
-
- Q_ENUMS(Icon)
- Q_ENUMS(StandardButton)
- Q_FLAGS(StandardButtons)
-
- Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
- Q_PROPERTY(QString informativeText READ informativeText WRITE setInformativeText NOTIFY informativeTextChanged)
- Q_PROPERTY(QString detailedText READ detailedText WRITE setDetailedText NOTIFY detailedTextChanged)
- Q_PROPERTY(Icon icon READ icon WRITE setIcon NOTIFY iconChanged)
- Q_PROPERTY(QUrl standardIconSource READ standardIconSource NOTIFY iconChanged)
- Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged)
- Q_PROPERTY(StandardButton clickedButton READ clickedButton NOTIFY buttonClicked)
-
-public:
- QQuickAbstractMessageDialog(QObject *parent = 0);
- virtual ~QQuickAbstractMessageDialog();
-
- virtual QString title() const { return m_options->windowTitle(); }
- QString text() const { return m_options->text(); }
- QString informativeText() const { return m_options->informativeText(); }
- QString detailedText() const { return m_options->detailedText(); }
-
- enum Icon {
- NoIcon = QMessageDialogOptions::NoIcon,
- Information = QMessageDialogOptions::Information,
- Warning = QMessageDialogOptions::Warning,
- Critical = QMessageDialogOptions::Critical,
- Question = QMessageDialogOptions::Question
- };
-
- Icon icon() const { return static_cast<Icon>(m_options->icon()); }
-
- QUrl standardIconSource();
-
- enum StandardButton {
- NoButton = QMessageDialogOptions::NoButton,
- Ok = QMessageDialogOptions::Ok,
- Save = QMessageDialogOptions::Save,
- SaveAll = QMessageDialogOptions::SaveAll,
- Open = QMessageDialogOptions::Open,
- Yes = QMessageDialogOptions::Yes,
- YesToAll = QMessageDialogOptions::YesToAll,
- No = QMessageDialogOptions::No,
- NoToAll = QMessageDialogOptions::NoToAll,
- Abort = QMessageDialogOptions::Abort,
- Retry = QMessageDialogOptions::Retry,
- Ignore = QMessageDialogOptions::Ignore,
- Close = QMessageDialogOptions::Close,
- Cancel = QMessageDialogOptions::Cancel,
- Discard = QMessageDialogOptions::Discard,
- Help = QMessageDialogOptions::Help,
- Apply = QMessageDialogOptions::Apply,
- Reset = QMessageDialogOptions::Reset,
- RestoreDefaults = QMessageDialogOptions::RestoreDefaults
- };
- Q_DECLARE_FLAGS(StandardButtons, StandardButton)
-
- StandardButtons standardButtons() const { return static_cast<StandardButtons>(static_cast<int>(m_options->standardButtons())); }
-
- StandardButton clickedButton() const { return m_clickedButton; }
-
-public Q_SLOTS:
- virtual void setVisible(bool v);
- virtual void setTitle(const QString &arg);
- void setText(const QString &arg);
- void setInformativeText(const QString &arg);
- void setDetailedText(const QString &arg);
- void setIcon(Icon icon);
- void setStandardButtons(StandardButtons buttons);
- void click(QMessageDialogOptions::StandardButton button, QMessageDialogOptions::ButtonRole);
- void click(QQuickAbstractMessageDialog::StandardButton button);
-
-Q_SIGNALS:
- void textChanged();
- void informativeTextChanged();
- void detailedTextChanged();
- void iconChanged();
- void standardButtonsChanged();
- void buttonClicked();
- void discard();
- void help();
- void yes();
- void no();
- void apply();
- void reset();
-
-protected:
- QPlatformMessageDialogHelper *m_dlgHelper;
- QSharedPointer<QMessageDialogOptions> m_options;
- StandardButton m_clickedButton;
-
- Q_DISABLE_COPY(QQuickAbstractMessageDialog)
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAbstractMessageDialog::StandardButtons)
-
-QT_END_NAMESPACE
-
-#endif // QQUICKABSTRACTMESSAGEDIALOG_P_H
diff --git a/src/imports/dialogs/qquickcolordialog.cpp b/src/imports/dialogs/qquickcolordialog.cpp
deleted file mode 100644
index d0e0e11b07..0000000000
--- a/src/imports/dialogs/qquickcolordialog.cpp
+++ /dev/null
@@ -1,119 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickcolordialog_p.h"
-#include <QQuickItem>
-#include <private/qguiapplication_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype AbstractColorDialog
- \instantiates QQuickColorDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
- \brief API wrapper for QML file dialog implementations
- \since 5.1
- \internal
-
- AbstractColorDialog provides only the API for implementing a color dialog.
- The implementation (e.g. a Window or preferably an Item, in case it is
- shown on a device that doesn't support multiple windows) can be provided as
- \l implementation, which is the default property (the only allowed child
- element).
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractColorDialog::accepted
-
- This signal is emitted by \l accept().
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractColorDialog::rejected
-
- This signal is emitted by \l reject().
-*/
-
-/*!
- \class QQuickColorDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- The QQuickColorDialog class is a concrete subclass of
- \l QQuickAbstractColorDialog, but it is abstract from the QML perspective
- because it needs to enclose a graphical implementation. It exists in order
- to provide accessors and helper functions which the QML implementation will
- need.
-
- \since 5.1
-*/
-
-/*!
- Constructs a file dialog wrapper with parent window \a parent.
-*/
-QQuickColorDialog::QQuickColorDialog(QObject *parent)
- : QQuickAbstractColorDialog(parent)
-{
-}
-
-
-/*!
- Destroys the file dialog wrapper.
-*/
-QQuickColorDialog::~QQuickColorDialog()
-{
-}
-
-/*!
- \qmlproperty bool AbstractColorDialog::visible
-
- This property holds whether the dialog is visible. By default this is false.
-*/
-
-/*!
- \qmlproperty QObject AbstractColorDialog::implementation
-
- The QML object which implements the actual file dialog. Should be either a
- \l Window or an \l Item.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickcolordialog_p.h b/src/imports/dialogs/qquickcolordialog_p.h
deleted file mode 100644
index ff6953fc0f..0000000000
--- a/src/imports/dialogs/qquickcolordialog_p.h
+++ /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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKCOLORDIALOG_P_H
-#define QQUICKCOLORDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractcolordialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickColorDialog : public QQuickAbstractColorDialog
-{
- Q_OBJECT
- Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false)
- Q_CLASSINFO("DefaultProperty", "implementation") // AbstractColorDialog in QML can have only one child
-
-public:
- explicit QQuickColorDialog(QObject *parent = 0);
- ~QQuickColorDialog();
-
-protected:
- virtual QPlatformColorDialogHelper *helper() { return 0; }
-
- Q_DISABLE_COPY(QQuickColorDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickColorDialog *)
-
-#endif // QQUICKCOLORDIALOG_P_H
diff --git a/src/imports/dialogs/qquickdialogassets_p.h b/src/imports/dialogs/qquickdialogassets_p.h
deleted file mode 100644
index 406b68a66d..0000000000
--- a/src/imports/dialogs/qquickdialogassets_p.h
+++ /dev/null
@@ -1,65 +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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKDIALOGASSETS_P_H
-#define QQUICKDIALOGASSETS_P_H
-
-#include <private/qtquickglobal_p.h>
-#include <QtGui/qpa/qplatformdialoghelper.h>
-#include "qquickabstractmessagedialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickStandardButton
-{
- Q_GADGET
- Q_ENUMS(QQuickAbstractMessageDialog::StandardButton)
-};
-
-class QQuickStandardIcon
-{
- Q_GADGET
- Q_ENUMS(QQuickAbstractMessageDialog::Icon)
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKDIALOGASSETS_P_H
diff --git a/src/imports/dialogs/qquickfiledialog.cpp b/src/imports/dialogs/qquickfiledialog.cpp
deleted file mode 100644
index 2ee4afc5d2..0000000000
--- a/src/imports/dialogs/qquickfiledialog.cpp
+++ /dev/null
@@ -1,172 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickfiledialog_p.h"
-#include <QQuickItem>
-#include <private/qguiapplication_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype AbstractFileDialog
- \instantiates QQuickFileDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
- \brief API wrapper for QML file dialog implementations
- \since 5.1
- \internal
-
- AbstractFileDialog provides only the API for implementing a file dialog.
- The implementation (e.g. a Window or preferably an Item, in case it is
- shown on a device that doesn't support multiple windows) can be provided as
- \l implementation, which is the default property (the only allowed child
- element).
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractFileDialog::accepted
-
- This signal is emitted by \l accept().
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractFileDialog::rejected
-
- This signal is emitted by \l reject().
-*/
-
-/*!
- \class QQuickFileDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- The QQuickFileDialog class is a concrete subclass of
- \l QQuickAbstractFileDialog, but it is abstract from the QML perspective
- because it needs to enclose a graphical implementation. It exists in order
- to provide accessors and helper functions which the QML implementation will
- need.
-
- \since 5.1
-*/
-
-/*!
- Constructs a file dialog wrapper with parent window \a parent.
-*/
-QQuickFileDialog::QQuickFileDialog(QObject *parent)
- : QQuickAbstractFileDialog(parent)
-{
-}
-
-
-/*!
- Destroys the file dialog wrapper.
-*/
-QQuickFileDialog::~QQuickFileDialog()
-{
-}
-
-QList<QUrl> QQuickFileDialog::fileUrls()
-{
- return m_selections;
-}
-
-/*!
- \qmlproperty bool AbstractFileDialog::visible
-
- This property holds whether the dialog is visible. By default this is false.
-*/
-
-/*!
- \qmlproperty bool AbstractFileDialog::fileUrls
-
- A list of files to be populated as the user chooses.
-*/
-
-/*!
- \brief Clears \l fileUrls
-*/
-void QQuickFileDialog::clearSelection()
-{
- m_selections.clear();
-}
-
-/*!
- \brief Adds one file to \l fileUrls
-
- \l path should be given as an absolute file:// path URL.
- Returns true on success, false if the given path is
- not valid given the current property settings.
-*/
-bool QQuickFileDialog::addSelection(const QUrl &path)
-{
- QFileInfo info(path.toLocalFile());
- if (info.exists() && ((info.isDir() && m_selectFolder) || !info.isDir())) {
- if (m_selectFolder)
- m_selections.append(pathFolder(path.toLocalFile()));
- else
- m_selections.append(path);
- return true;
- }
- return false;
-}
-
-/*!
- \brief get a file's directory as a URL
-
- If \a path points to a directory, just convert it to a URL.
- If \a path points to a file, convert the file's directory to a URL.
-*/
-QUrl QQuickFileDialog::pathFolder(const QString &path)
-{
- QFileInfo info(path);
- if (info.exists() && info.isDir())
- return QUrl::fromLocalFile(path);
- return QUrl::fromLocalFile(QFileInfo(path).absolutePath());
-}
-
-/*!
- \qmlproperty QObject AbstractFileDialog::implementation
-
- The QML object which implements the actual file dialog. Should be either a
- \l Window or an \l Item.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickfiledialog_p.h b/src/imports/dialogs/qquickfiledialog_p.h
deleted file mode 100644
index a4c7939fda..0000000000
--- a/src/imports/dialogs/qquickfiledialog_p.h
+++ /dev/null
@@ -1,93 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKFILEDIALOG_P_H
-#define QQUICKFILEDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractfiledialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickFileDialog : public QQuickAbstractFileDialog
-{
- Q_OBJECT
- Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false)
- Q_CLASSINFO("DefaultProperty", "implementation") // AbstractFileDialog in QML can have only one child
-
-public:
- explicit QQuickFileDialog(QObject *parent = 0);
- ~QQuickFileDialog();
- virtual QList<QUrl> fileUrls();
-
-Q_SIGNALS:
-
-public Q_SLOTS:
- void clearSelection();
- bool addSelection(const QUrl &path);
-
-protected:
- virtual QPlatformFileDialogHelper *helper() { return 0; }
- Q_INVOKABLE QString urlToPath(const QUrl &url) { return url.toLocalFile(); }
- Q_INVOKABLE QUrl pathToUrl(const QString &path) { return QUrl::fromLocalFile(path); }
- Q_INVOKABLE QUrl pathFolder(const QString &path);
-
-private:
- QList<QUrl> m_selections;
-
- Q_DISABLE_COPY(QQuickFileDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickFileDialog *)
-
-#endif // QQUICKFILEDIALOG_P_H
diff --git a/src/imports/dialogs/qquickfontdialog.cpp b/src/imports/dialogs/qquickfontdialog.cpp
deleted file mode 100644
index 2f3c6d83bb..0000000000
--- a/src/imports/dialogs/qquickfontdialog.cpp
+++ /dev/null
@@ -1,120 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickfontdialog_p.h"
-#include <QQuickItem>
-#include <private/qguiapplication_p.h>
-#include <qpa/qplatformintegration.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype AbstractFontDialog
- \instantiates QQuickFontDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
- \brief API wrapper for QML font dialog implementations
- \since 5.2
- \internal
-
- AbstractFontDialog provides only the API for implementing a font dialog.
- The implementation (e.g. a Window or preferably an Item, in case it is
- shown on a device that doesn't support multiple windows) can be provided as
- \l implementation, which is the default property (the only allowed child
- element).
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractFontDialog::accepted
-
- The \a accepted signal is emitted by \l accept().
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractFontDialog::rejected
-
- The \a accepted signal is emitted by \l reject().
-*/
-
-/*!
- \class QQuickFontDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- The QQuickFontDialog class is a concrete subclass of \l
- QQuickAbstractFontDialog, but it is abstract from the QML perspective
- because it needs to enclose a graphical implementation. It exists in order
- to provide accessors and helper functions which the QML implementation will
- need.
-
- \since 5.2
-*/
-
-/*!
- Constructs a font dialog wrapper with parent window \a parent.
-*/
-QQuickFontDialog::QQuickFontDialog(QObject *parent)
- : QQuickAbstractFontDialog(parent)
-{
-}
-
-
-/*!
- Destroys the font dialog wrapper.
-*/
-QQuickFontDialog::~QQuickFontDialog()
-{
-}
-
-/*!
- \qmlproperty bool AbstractFontDialog::visible
-
- This property holds whether the dialog is visible. By default this is false.
-*/
-
-/*!
- \qmlproperty QObject AbstractFontDialog::implementation
-
- The QML object which implements the actual font dialog. Should be either a
- \l Window or an \l Item.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickfontdialog_p.h b/src/imports/dialogs/qquickfontdialog_p.h
deleted file mode 100644
index a8e2d82e6f..0000000000
--- a/src/imports/dialogs/qquickfontdialog_p.h
+++ /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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKFONTDIALOG_P_H
-#define QQUICKFONTDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractfontdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickFontDialog : public QQuickAbstractFontDialog
-{
- Q_OBJECT
- Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false)
- Q_CLASSINFO("DefaultProperty", "implementation")
-
-public:
- explicit QQuickFontDialog(QObject *parent = 0);
- ~QQuickFontDialog();
-
-protected:
- virtual QPlatformFontDialogHelper *helper() { return 0; }
-
- Q_DISABLE_COPY(QQuickFontDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickFontDialog *)
-
-#endif // QQUICKFONTDIALOG_P_H
diff --git a/src/imports/dialogs/qquickmessagedialog.cpp b/src/imports/dialogs/qquickmessagedialog.cpp
deleted file mode 100644
index 43b6ca09b4..0000000000
--- a/src/imports/dialogs/qquickmessagedialog.cpp
+++ /dev/null
@@ -1,181 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickmessagedialog_p.h"
-#include <QQuickItem>
-#include <private/qguiapplication_p.h>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype AbstractMessageDialog
- \instantiates QQuickMessageDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
- \brief API wrapper for QML message dialog implementations
- \since 5.2
- \internal
-
- AbstractMessageDialog provides only the API for implementing a message dialog.
- The implementation (e.g. a Window or preferably an Item, in case it is
- shown on a device that doesn't support multiple windows) can be provided as
- \l implementation, which is the default property (the only allowed child
- element).
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractMessageDialog::accepted
-
- This signal is emitted by \l accept().
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::AbstractMessageDialog::rejected
-
- This signal is emitted by \l reject().
-*/
-
-/*!
- \class QQuickMessageDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- The QQuickMessageDialog class is a concrete subclass of
- \l QQuickAbstractMessageDialog, but it is abstract from the QML perspective
- because it needs to enclose a graphical implementation. It exists in order
- to provide accessors and helper functions which the QML implementation will
- need.
-
- \since 5.2
-*/
-
-/*!
- Constructs a message dialog wrapper with parent window \a parent.
-*/
-QQuickMessageDialog::QQuickMessageDialog(QObject *parent)
- : QQuickAbstractMessageDialog(parent)
-{
- connect(this, SIGNAL(buttonClicked()), this, SLOT(clicked()));
-}
-
-
-/*!
- Destroys the message dialog wrapper.
-*/
-QQuickMessageDialog::~QQuickMessageDialog()
-{
-}
-
-/*!
- \qmlproperty bool AbstractMessageDialog::visible
-
- This property holds whether the dialog is visible. By default this is false.
-*/
-
-/*!
- \qmlproperty QObject AbstractMessageDialog::implementation
-
- The QML object which implements the actual message dialog. Should be either a
- \l Window or an \l Item.
-*/
-
-
-void QQuickMessageDialog::clicked() {
- switch (m_clickedButton) {
- // This mapping from buttons to roles is the same as
- // documented for enum QMessageBox::StandardButton
- case Ok:
- case Open:
- case Save:
- case SaveAll:
- case Retry:
- case Ignore:
- accept();
- break;
- case Cancel:
- case Close:
- case Abort:
- reject();
- break;
- case Discard:
- emit discard();
- close();
- break;
- case Help:
- emit help();
- break;
- case Yes:
- case YesToAll:
- emit yes();
- close();
- break;
- case No:
- case NoToAll:
- emit no();
- close();
- break;
- case Apply:
- emit apply();
- break;
- case Reset:
- case RestoreDefaults:
- emit reset();
- break;
- default:
- qWarning("StandardButton %d has no role", m_clickedButton);
- }
-}
-
-void QQuickMessageDialog::accept() {
- // enter key is treated like OK
- if (m_clickedButton == NoButton)
- m_clickedButton = Ok;
- QQuickAbstractMessageDialog::accept();
-}
-
-void QQuickMessageDialog::reject() {
- // escape key is treated like cancel
- if (m_clickedButton == NoButton)
- m_clickedButton = Cancel;
- QQuickAbstractMessageDialog::reject();
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickmessagedialog_p.h b/src/imports/dialogs/qquickmessagedialog_p.h
deleted file mode 100644
index b21d8cba42..0000000000
--- a/src/imports/dialogs/qquickmessagedialog_p.h
+++ /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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKMESSAGEDIALOG_P_H
-#define QQUICKMESSAGEDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractmessagedialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickMessageDialog : public QQuickAbstractMessageDialog
-{
- Q_OBJECT
- Q_PROPERTY(QObject* implementation READ qmlImplementation WRITE setQmlImplementation DESIGNABLE false)
- Q_CLASSINFO("DefaultProperty", "implementation") // AbstractMessageDialog in QML can have only one child
-
-public:
- explicit QQuickMessageDialog(QObject *parent = 0);
- ~QQuickMessageDialog();
-
-protected:
- virtual QPlatformDialogHelper *helper() { return 0; }
-
-protected Q_SLOTS:
- virtual void accept();
- virtual void reject();
- void clicked();
-
-private:
- Q_DISABLE_COPY(QQuickMessageDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickMessageDialog *)
-
-#endif // QQUICKMESSAGEDIALOG_P_H
diff --git a/src/imports/dialogs/qquickplatformcolordialog.cpp b/src/imports/dialogs/qquickplatformcolordialog.cpp
deleted file mode 100644
index 11ddbfe6c7..0000000000
--- a/src/imports/dialogs/qquickplatformcolordialog.cpp
+++ /dev/null
@@ -1,254 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickplatformcolordialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickView>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype ColorDialog
- \instantiates QQuickPlatformColorDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup dialogs
- \brief Dialog component for choosing a color.
- \since 5.1
-
- ColorDialog allows the user to select a color. The dialog is initially
- invisible. You need to set the properties as desired first, then set
- \l visible to true or call \l open().
-
- Here is a minimal example to open a color dialog and exit after the user
- chooses a color:
-
- \qml
- import QtQuick 2.1
- import QtQuick.Dialogs 1.0
-
- ColorDialog {
- id: colorDialog
- title: "Please choose a color"
- onAccepted: {
- console.log("You chose: " + colorDialog.color)
- Qt.quit()
- }
- onRejected: {
- console.log("Canceled")
- Qt.quit()
- }
- Component.onCompleted: visible = true
- }
- \endqml
-
- A ColorDialog window is automatically transient for its parent window. So
- whether you declare the dialog inside an \l Item or inside a \l Window, the
- dialog will appear centered over the window containing the item, or over
- the Window that you declared.
-
- The implementation of ColorDialog will be a platform color dialog if
- possible. If that isn't possible, then it will try to instantiate a
- \l QColorDialog. If that also isn't possible, then it will fall back to a QML
- implementation, DefaultColorDialog.qml. In that case you can customize the
- appearance by editing this file. DefaultColorDialog.qml contains a Rectangle
- to hold the dialog's contents, because certain embedded systems do not
- support multiple top-level windows. When the dialog becomes visible, it
- will automatically be wrapped in a Window if possible, or simply reparented
- on top of the main window if there can only be one window.
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::ColorDialog::accepted
-
- This handler is called when the user has finished using the
- dialog. You can then inspect the \l color property to get the selection.
-
- Example:
-
- \qml
- ColorDialog {
- onAccepted: { console.log("Selected color: " + color) }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::ColorDialog::rejected
-
- This handler is called when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickPlatformColorDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- \brief The QQuickPlatformColorDialog class provides a color dialog
-
- The dialog is implemented via the QPlatformColorDialogHelper when possible;
- otherwise it falls back to a QColorDialog or a QML implementation.
-
- \since 5.1
-*/
-
-/*!
- Constructs a color dialog with parent window \a parent.
-*/
-QQuickPlatformColorDialog::QQuickPlatformColorDialog(QObject *parent) :
- QQuickAbstractColorDialog(parent)
-{
-}
-
-/*!
- Destroys the color dialog.
-*/
-QQuickPlatformColorDialog::~QQuickPlatformColorDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformColorDialogHelper *QQuickPlatformColorDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if ( !m_dlgHelper && QGuiApplicationPrivate::platformTheme()->
- usePlatformNativeDialog(QPlatformTheme::ColorDialog) ) {
- m_dlgHelper = static_cast<QPlatformColorDialogHelper *>(QGuiApplicationPrivate::platformTheme()
- ->createPlatformDialogHelper(QPlatformTheme::ColorDialog));
- if (!m_dlgHelper)
- return m_dlgHelper;
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- connect(m_dlgHelper, SIGNAL(currentColorChanged(QColor)), this, SLOT(setCurrentColor(QColor)));
- connect(m_dlgHelper, SIGNAL(colorSelected(QColor)), this, SLOT(setColor(QColor)));
- }
-
- return m_dlgHelper;
-}
-
-/*!
- \qmlproperty bool ColorDialog::visible
-
- This property holds whether the dialog is visible. By default this is
- false.
-
- \sa modality
-*/
-
-/*!
- \qmlproperty Qt::WindowModality ColorDialog::modality
-
- Whether the dialog should be shown modal with respect to the window
- containing the dialog's parent Item, modal with respect to the whole
- application, or non-modal.
-
- By default it is \l NonModal.
-
- Modality does not mean that there are any blocking calls to wait for the
- dialog to be accepted or rejected; it's only that the user will be
- prevented from interacting with the parent window and/or the application
- windows at the same time.
-
- On MacOS the color dialog is only allowed to be non-modal.
-*/
-
-/*!
- \qmlmethod void ColorDialog::open()
-
- Shows the dialog to the user. It is equivalent to setting \l visible to
- true.
-*/
-
-/*!
- \qmlmethod void ColorDialog::close()
-
- Closes the dialog.
-*/
-
-/*!
- \qmlproperty string ColorDialog::title
-
- The title of the dialog window.
-*/
-
-/*!
- \qmlproperty bool ColorDialog::showAlphaChannel
-
- Whether the dialog will provide a means of changing the opacity.
-
- By default, this property is true. This property must be set to the desired
- value before opening the dialog. Usually the alpha channel is represented
- by an additional slider control.
-*/
-
-/*!
- \qmlproperty color ColorDialog::color
-
- The color which the user selected.
-
- \note This color is not always the same as the color held by the
- currentColor property since the user can choose different colors before
- finally selecting the one to use.
-
- \sa currentColor
-*/
-
-/*!
- \qmlproperty color ColorDialog::currentColor
-
- The color which the user has currently selected.
-
- For the color that is set when the dialog is accepted, use the \l color
- property.
-
- \sa color
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickplatformcolordialog_p.h b/src/imports/dialogs/qquickplatformcolordialog_p.h
deleted file mode 100644
index 55d301da8b..0000000000
--- a/src/imports/dialogs/qquickplatformcolordialog_p.h
+++ /dev/null
@@ -1,78 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPLATFORMCOLORDIALOG_P_H
-#define QQUICKPLATFORMCOLORDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractcolordialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPlatformColorDialog : public QQuickAbstractColorDialog
-{
- Q_OBJECT
-
-public:
- QQuickPlatformColorDialog(QObject *parent = 0);
- virtual ~QQuickPlatformColorDialog();
-
-protected:
- QPlatformColorDialogHelper *helper();
-
- Q_DISABLE_COPY(QQuickPlatformColorDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPlatformColorDialog *)
-
-#endif // QQUICKPLATFORMCOLORDIALOG_P_H
diff --git a/src/imports/dialogs/qquickplatformfiledialog.cpp b/src/imports/dialogs/qquickplatformfiledialog.cpp
deleted file mode 100644
index 066aabe336..0000000000
--- a/src/imports/dialogs/qquickplatformfiledialog.cpp
+++ /dev/null
@@ -1,314 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickplatformfiledialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickView>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype FileDialog
- \instantiates QQuickPlatformFileDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup dialogs
- \brief Dialog component for choosing files from a local filesystem.
- \since 5.1
-
- FileDialog provides a basic file chooser: it allows the user to select
- existing files and/or directories, or create new filenames. The dialog is
- initially invisible. You need to set the properties as desired first, then
- set \l visible to true or call \l open().
-
- Here is a minimal example to open a file dialog and exit after the user
- chooses a file:
-
- \qml
- import QtQuick 2.1
- import QtQuick.Dialogs 1.0
-
- FileDialog {
- id: fileDialog
- title: "Please choose a file"
- onAccepted: {
- console.log("You chose: " + fileDialog.fileUrls)
- Qt.quit()
- }
- onRejected: {
- console.log("Canceled")
- Qt.quit()
- }
- Component.onCompleted: visible = true
- }
- \endqml
-
- A FileDialog window is automatically transient for its parent window. So
- whether you declare the dialog inside an \l Item or inside a \l Window, the
- dialog will appear centered over the window containing the item, or over
- the Window that you declared.
-
- The implementation of FileDialog will be a platform file dialog if
- possible. If that isn't possible, then it will try to instantiate a
- \l QFileDialog. If that also isn't possible, then it will fall back to a QML
- implementation, DefaultFileDialog.qml. In that case you can customize the
- appearance by editing this file. DefaultFileDialog.qml contains a Rectangle
- to hold the dialog's contents, because certain embedded systems do not
- support multiple top-level windows. When the dialog becomes visible, it
- will automatically be wrapped in a Window if possible, or simply reparented
- on top of the main window if there can only be one window.
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FileDialog::accepted
-
- This handler is called when the user has finished using the
- dialog. You can then inspect the \l fileUrl or \l fileUrls properties to
- get the selection.
-
- Example:
-
- \qml
- FileDialog {
- onAccepted: { console.log("Selected file: " + fileUrl) }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FileDialog::rejected
-
- This handler is called when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickPlatformFileDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- \brief The QQuickPlatformFileDialog class provides a file dialog
-
- The dialog is implemented via the QPlatformFileDialogHelper when possible;
- otherwise it falls back to a QFileDialog or a QML implementation.
-
- \since 5.1
-*/
-
-/*!
- Constructs a file dialog with parent window \a parent.
-*/
-QQuickPlatformFileDialog::QQuickPlatformFileDialog(QObject *parent) :
- QQuickAbstractFileDialog(parent)
-{
-}
-
-/*!
- Destroys the file dialog.
-*/
-QQuickPlatformFileDialog::~QQuickPlatformFileDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if ( !m_dlgHelper && QGuiApplicationPrivate::platformTheme()->
- usePlatformNativeDialog(QPlatformTheme::FileDialog) ) {
- m_dlgHelper = static_cast<QPlatformFileDialogHelper *>(QGuiApplicationPrivate::platformTheme()
- ->createPlatformDialogHelper(QPlatformTheme::FileDialog));
- if (!m_dlgHelper)
- return m_dlgHelper;
- connect(m_dlgHelper, SIGNAL(directoryEntered(QUrl)), this, SIGNAL(folderChanged()));
- connect(m_dlgHelper, SIGNAL(filterSelected(QString)), this, SIGNAL(filterSelected()));
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- }
-
- return m_dlgHelper;
-}
-
-/*!
- \qmlproperty bool FileDialog::visible
-
- This property holds whether the dialog is visible. By default this is
- false.
-
- \sa modality
-*/
-
-/*!
- \qmlproperty Qt::WindowModality FileDialog::modality
-
- Whether the dialog should be shown modal with respect to the window
- containing the dialog's parent Item, modal with respect to the whole
- application, or non-modal.
-
- By default it is \c Qt.WindowModal.
-
- Modality does not mean that there are any blocking calls to wait for the
- dialog to be accepted or rejected; it's only that the user will be
- prevented from interacting with the parent window and/or the application
- windows at the same time. You probably need to write an onAccepted handler
- to actually load or save the chosen file.
-*/
-
-/*!
- \qmlmethod void FileDialog::open()
-
- Shows the dialog to the user. It is equivalent to setting \l visible to
- true.
-*/
-
-/*!
- \qmlmethod void FileDialog::close()
-
- Closes the dialog.
-*/
-
-/*!
- \qmlproperty string FileDialog::title
-
- The title of the dialog window.
-*/
-
-/*!
- \qmlproperty bool FileDialog::selectExisting
-
- Whether only existing files or directories can be selected.
-
- By default, this property is true. This property must be set to the desired
- value before opening the dialog. Setting this property to false implies
- that the dialog is for naming a file to which to save something, or naming
- a folder to be created; therefore \l selectMultiple must be false.
-*/
-
-/*!
- \qmlproperty bool FileDialog::selectMultiple
-
- Whether more than one filename can be selected.
-
- By default, this property is false. This property must be set to the
- desired value before opening the dialog. Setting this property to true
- implies that \l selectExisting must be true.
-*/
-
-/*!
- \qmlproperty bool FileDialog::selectFolder
-
- Whether the selected item should be a folder.
-
- By default, this property is false. This property must be set to the
- desired value before opening the dialog. Setting this property to true
- implies that \l selectMultiple must be false and \l selectExisting must be
- true.
-*/
-
-/*!
- \qmlproperty url FileDialog::folder
-
- The path to the currently selected folder. Setting this property before
- invoking open() will cause the file browser to be initially positioned on
- the specified folder.
-
- The value of this property is also updated after the dialog is closed.
-
- By default, this property is false.
-*/
-
-/*!
- \qmlproperty list<string> FileDialog::nameFilters
-
- A list of strings to be used as file name filters. Each string can be a
- space-separated list of filters; filters may include the ? and * wildcards.
- The list of filters can also be enclosed in parentheses and a textual
- description of the filter can be provided.
-
- For example:
-
- \qml
- FileDialog {
- nameFilters: [ "Image files (*.jpg *.png)", "All files (*)" ]
- }
- \endqml
-
- \note Directories are not excluded by filters.
- \sa selectedNameFilter
-*/
-
-/*!
- \qmlproperty string FileDialog::selectedNameFilter
-
- Which of the \l nameFilters is currently selected.
-
- This property can be set before the dialog is visible, to set the default
- name filter, and can also be set while the dialog is visible to set the
- current name filter. It is also updated when the user selects a different
- filter.
-*/
-
-/*!
- \qmlproperty url FileDialog::fileUrl
-
- The path of the file which was selected by the user.
-
- \note This property is set only if exactly one file was selected. In all
- other cases, it will be empty.
-
- \sa fileUrls
-*/
-
-/*!
- \qmlproperty list<url> FileDialog::fileUrls
-
- The list of file paths which were selected by the user.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickplatformfontdialog.cpp b/src/imports/dialogs/qquickplatformfontdialog.cpp
deleted file mode 100644
index 46ad5eb8df..0000000000
--- a/src/imports/dialogs/qquickplatformfontdialog.cpp
+++ /dev/null
@@ -1,252 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickplatformfontdialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickView>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype FontDialog
- \instantiates QQuickPlatformFontDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup qtquick-visual
- \ingroup dialogs
- \brief Dialog component for choosing a font.
- \since 5.2
-
- FontDialog allows the user to select a font. The dialog is initially
- invisible. You need to set the properties as desired first, then set
- \l visible to true or call \l open().
-
- Here is a minimal example to open a font dialog and exit after the user
- chooses a font:
-
- \qml
- import QtQuick 2.2
- import QtQuick.Dialogs 1.1
-
- FontDialog {
- id: fontDialog
- title: "Please choose a font"
- font: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal })
- onAccepted: {
- console.log("You chose: " + fontDialog.font)
- Qt.quit()
- }
- onRejected: {
- console.log("Canceled")
- Qt.quit()
- }
- Component.onCompleted: visible = true
- }
- \endqml
-
- A FontDialog window is automatically transient for its parent window. So
- whether you declare the dialog inside an \l Item or inside a \l Window, the
- dialog will appear centered over the window containing the item, or over
- the Window that you declared.
-
- The implementation of FontDialog will be a platform font dialog if
- possible. If that isn't possible, then it will try to instantiate a
- \l QFontDialog. If that also isn't possible, then it will fall back to a QML
- implementation, DefaultFontDialog.qml. In that case you can customize the
- appearance by editing this file. DefaultFontDialog.qml contains a Rectangle
- to hold the dialog's contents, because certain embedded systems do not
- support multiple top-level windows. When the dialog becomes visible, it
- will automatically be wrapped in a Window if possible, or simply reparented
- on top of the main window if there can only be one window.
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FontDialog::accepted
-
- The \a accepted signal is emitted when the user has finished using the
- dialog. You can then inspect the \a font property to get the selection.
-
- Example:
-
- \qml
- FontDialog {
- onAccepted: { console.log("Selected font: " + font) }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FontDialog::rejected
-
- The \a rejected signal is emitted when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickPlatformFontDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- \brief The QQuickPlatformFontDialog class provides a font dialog
-
- The dialog is implemented via the QQuickPlatformFontDialogHelper when possible;
- otherwise it falls back to a QFontDialog or a QML implementation.
-
- \since 5.2
-*/
-
-/*!
- Constructs a file dialog with parent window \a parent.
-*/
-QQuickPlatformFontDialog::QQuickPlatformFontDialog(QObject *parent) :
- QQuickAbstractFontDialog(parent)
-{
-}
-
-/*!
- Destroys the file dialog.
-*/
-QQuickPlatformFontDialog::~QQuickPlatformFontDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformFontDialogHelper *QQuickPlatformFontDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if ( !m_dlgHelper && QGuiApplicationPrivate::platformTheme()->
- usePlatformNativeDialog(QPlatformTheme::FontDialog) ) {
- m_dlgHelper = static_cast<QPlatformFontDialogHelper *>(QGuiApplicationPrivate::platformTheme()
- ->createPlatformDialogHelper(QPlatformTheme::FontDialog));
- if (!m_dlgHelper)
- return m_dlgHelper;
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- connect(m_dlgHelper, SIGNAL(currentFontChanged(const QFont&)), this, SLOT(setFont(const QFont&)));
- connect(m_dlgHelper, SIGNAL(fontSelected(const QFont&)), this, SLOT(setFont(const QFont&)));
- }
-
- return m_dlgHelper;
-}
-
-/*!
- \qmlproperty bool FontDialog::visible
-
- This property holds whether the dialog is visible. By default this is
- false.
-
- \sa modality
-*/
-
-/*!
- \qmlproperty Qt::WindowModality FontDialog::modality
-
- Whether the dialog should be shown modal with respect to the window
- containing the dialog's parent Item, modal with respect to the whole
- application, or non-modal.
-
- By default it is \l WindowModal.
-
- Modality does not mean that there are any blocking calls to wait for the
- dialog to be accepted or rejected; it's only that the user will be
- prevented from interacting with the parent window and/or the application
- windows at the same time. You probably need to write an onAccepted handler
- to actually load or save the chosen file.
-*/
-
-/*!
- \qmlmethod void FontDialog::open()
-
- Shows the dialog to the user. It is equivalent to setting \l visible to
- true.
-*/
-
-/*!
- \qmlmethod void FontDialog::close()
-
- Closes the dialog.
-*/
-
-/*!
- \qmlproperty string FontDialog::title
-
- The title of the dialog window.
-*/
-
-/*!
- \qmlproperty bool FontDialog::scalableFonts
-
- Whether the dialog will show scalable fonts or not.
-*/
-
-/*!
- \qmlproperty bool FontDialog::nonScalableFonts
-
- Whether the dialog will show non scalable fonts or not.
-*/
-
-/*!
- \qmlproperty bool FontDialog::monospacedFonts
-
- Whether the dialog will show monospaced fonts or not.
-*/
-
-/*!
- \qmlproperty bool FontDialog::proportionalFonts
-
- Whether the dialog will show proportional fonts or not.
-*/
-
-/*!
- \qmlproperty font FontDialog::font
-
- The font which the user selected.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickplatformfontdialog_p.h b/src/imports/dialogs/qquickplatformfontdialog_p.h
deleted file mode 100644
index 743b24ad87..0000000000
--- a/src/imports/dialogs/qquickplatformfontdialog_p.h
+++ /dev/null
@@ -1,78 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPLATFORMFONTDIALOG_P_H
-#define QQUICKPLATFORMFONTDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractfontdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPlatformFontDialog : public QQuickAbstractFontDialog
-{
- Q_OBJECT
-
-public:
- QQuickPlatformFontDialog(QObject *parent = 0);
- virtual ~QQuickPlatformFontDialog();
-
-protected:
- QPlatformFontDialogHelper *helper();
-
- Q_DISABLE_COPY(QQuickPlatformFontDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPlatformFontDialog *)
-
-#endif // QQUICKPLATFORMFONTDIALOG_P_H
diff --git a/src/imports/dialogs/qquickplatformmessagedialog.cpp b/src/imports/dialogs/qquickplatformmessagedialog.cpp
deleted file mode 100644
index 65114100d2..0000000000
--- a/src/imports/dialogs/qquickplatformmessagedialog.cpp
+++ /dev/null
@@ -1,398 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickplatformmessagedialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <QWindow>
-#include <QQuickView>
-#include <QQuickWindow>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype MessageDialog
- \instantiates QQuickPlatformMessageDialog
- \inqmlmodule QtQuick.Dialogs 1
- \ingroup dialogs
- \brief Dialog component for displaying popup messages.
- \since 5.2
-
- The most basic use case for a MessageDialog is a popup alert. It also
- allows the user to respond in various ways depending on which buttons are
- enabled. The dialog is initially invisible. You need to set the properties
- as desired first, then set \l visible to \c true or call \l open().
-
- Here is a minimal example to show an alert and exit after the user
- responds:
-
- \qml
- import QtQuick 2.2
- import QtQuick.Dialogs 1.1
-
- MessageDialog {
- id: messageDialog
- title: "May I have your attention please"
- text: "It's so cool that you are using Qt Quick."
- onAccepted: {
- console.log("And of course you could only agree.")
- Qt.quit()
- }
- Component.onCompleted: visible = true
- }
- \endqml
-
- There are several possible handlers depending on which \l standardButtons
- the dialog has and the \l {QMessageBox::ButtonRole} {ButtonRole} of each.
- For example, the \l {rejected} {onRejected} handler will be called if the
- user presses a \gui Cancel, \gui Close or \gui Abort button.
-
- A MessageDialog window is automatically transient for its parent window. So
- whether you declare the dialog inside an \l Item or inside a \l Window, the
- dialog will appear centered over the window containing the item, or over
- the Window that you declared.
-
- The implementation of MessageDialog will be a platform message dialog if
- possible. If that isn't possible, then it will try to instantiate a
- \l QMessageBox. If that also isn't possible, then it will fall back to a QML
- implementation, \c DefaultMessageDialog.qml. In that case you can customize
- the appearance by editing this file. \c DefaultMessageDialog.qml contains a
- \l Rectangle to hold the dialog's contents, because certain embedded systems
- do not support multiple top-level windows. When the dialog becomes visible,
- it will automatically be wrapped in a \l Window if possible, or simply
- reparented on top of the main window if there can only be one window.
-*/
-
-/*!
- \qmlsignal MessageDialog::accepted()
-
- This handler is called when the user has pressed any button which has the
- \l {QMessageBox::AcceptRole} {AcceptRole}: \gui OK, \gui Open, \gui Save,
- \gui {Save All}, \gui Retry or \gui Ignore.
-*/
-
-/*!
- \qmlsignal MessageDialog::rejected()
-
- This handler is called when the user has dismissed the dialog, by closing
- the dialog window, by pressing a \gui Cancel, \gui Close or \gui Abort
- button on the dialog, or by pressing the back button or the escape key.
-*/
-
-/*!
- \qmlsignal MessageDialog::discard()
-
- This handler is called when the user has pressed the \gui Discard button.
-*/
-
-/*!
- \qmlsignal MessageDialog::help()
-
- This handler is called when the user has pressed the \gui Help button.
- Depending on platform, the dialog may not be automatically dismissed
- because the help that your application provides may need to be relevant to
- the text shown in this dialog in order to assist the user in making a
- decision. However on other platforms it's not possible to show a dialog and
- a help window at the same time. If you want to be sure that the dialog will
- close, you can set \l visible to \c false in your handler.
-*/
-
-/*!
- \qmlsignal MessageDialog::yes()
-
- This handler is called when the user has pressed any button which has
- the \l {QMessageBox::YesRole} {YesRole}: \gui Yes or \gui {Yes to All}.
-*/
-
-/*!
- \qmlsignal MessageDialog::no()
-
- This handler is called when the user has pressed any button which has
- the \l {QMessageBox::NoRole} {NoRole}: \gui No or \gui {No to All}.
-*/
-
-/*!
- \qmlsignal MessageDialog::apply()
-
- This handler is called when the user has pressed the \gui Apply button.
-*/
-
-/*!
- \qmlsignal MessageDialog::reset()
-
- This handler is called when the user has pressed any button which has
- the \l {QMessageBox::ResetRole} {ResetRole}: \gui Reset or \gui {Restore Defaults}.
-*/
-
-/*!
- \class QQuickPlatformMessageDialog
- \inmodule QtQuick.Dialogs
- \internal
-
- \brief The QQuickPlatformMessageDialog class provides a message dialog
-
- The dialog is implemented via the QPlatformMessageDialogHelper when possible;
- otherwise it falls back to a QMessageBox or a QML implementation.
-
- \since 5.2
-*/
-
-/*!
- Constructs a file dialog with parent window \a parent.
-*/
-QQuickPlatformMessageDialog::QQuickPlatformMessageDialog(QObject *parent) :
- QQuickAbstractMessageDialog(parent)
-{
-}
-
-/*!
- Destroys the file dialog.
-*/
-QQuickPlatformMessageDialog::~QQuickPlatformMessageDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformMessageDialogHelper *QQuickPlatformMessageDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if ( !m_dlgHelper && QGuiApplicationPrivate::platformTheme()->
- usePlatformNativeDialog(QPlatformTheme::MessageDialog) ) {
- m_dlgHelper = static_cast<QPlatformMessageDialogHelper *>(QGuiApplicationPrivate::platformTheme()
- ->createPlatformDialogHelper(QPlatformTheme::MessageDialog));
- if (!m_dlgHelper)
- return m_dlgHelper;
- // accept() shouldn't be emitted. reject() happens only if the dialog is
- // dismissed by closing the window rather than by one of its button widgets.
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- connect(m_dlgHelper, SIGNAL(clicked(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole)),
- this, SLOT(click(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole)));
- }
-
- return m_dlgHelper;
-}
-
-/*!
- \qmlproperty bool MessageDialog::visible
-
- This property holds whether the dialog is visible. By default this is
- \c false.
-
- \sa modality
-*/
-
-/*!
- \qmlproperty Qt::WindowModality MessageDialog::modality
-
- Whether the dialog should be shown modal with respect to the window
- containing the dialog's parent Item, modal with respect to the whole
- application, or non-modal.
-
- By default it is \c Qt.WindowModal.
-
- Modality does not mean that there are any blocking calls to wait for the
- dialog to be accepted or rejected; it's only that the user will be
- prevented from interacting with the parent window and/or the application
- windows until the dialog is dismissed.
-*/
-
-/*!
- \qmlmethod void MessageDialog::open()
-
- Shows the dialog to the user. It is equivalent to setting \l visible to
- \c true.
-*/
-
-/*!
- \qmlmethod void MessageDialog::close()
-
- Closes the dialog.
-*/
-
-/*!
- \qmlproperty string MessageDialog::title
-
- The title of the dialog window.
-*/
-
-/*!
- \qmlproperty string MessageDialog::text
-
- The primary text to be displayed.
-*/
-
-/*!
- \qmlproperty string MessageDialog::informativeText
-
- The informative text that provides a fuller description for the message.
-
- Informative text can be used to supplement the \c text to give more
- information to the user. Depending on the platform, it may appear in a
- smaller font below the text, or simply appended to the text.
-
- \sa {MessageDialog::text}{text}
-*/
-
-/*!
- \qmlproperty string MessageDialog::detailedText
-
- The text to be displayed in the details area, which is hidden by default.
- The user will then be able to press the \gui {Show Details...} button to
- make it visible.
-
- \sa {MessageDialog::text}{text}
-*/
-
-/*!
- \enum QQuickStandardIcon::Icon
-
- This enum specifies a standard icon to be used on a dialog.
-*/
-
-/*!
- \qmlproperty QQuickStandardIcon::Icon MessageDialog::icon
-
- The icon of the message box can be specified with one of these values:
-
- \table
- \row
- \li no icon
- \li \l StandardIcon.NoIcon
- \li For an unadorned text alert.
- \row
- \li \inlineimage ../images/question.png "Question icon"
- \li \l StandardIcon.Question
- \li For asking a question during normal operations.
- \row
- \li \image information.png
- \li \l StandardIcon.Information
- \li For reporting information about normal operations.
- \row
- \li \image warning.png
- \li \l StandardIcon.Warning
- \li For reporting non-critical errors.
- \row
- \li \image critical.png
- \li \l StandardIcon.Critical
- \li For reporting critical errors.
- \endtable
-
- The default is \c StandardIcon.NoIcon.
-
- The enum values are the same as in \l QMessageBox::Icon.
-*/
-
-// TODO after QTBUG-35019 is fixed: fix links to this module's enums
-// rather than linking to those in QMessageBox
-/*!
- \enum QQuickStandardButton::StandardButton
-
- This enum specifies a button with a standard label to be used on a dialog.
-*/
-
-/*!
- \qmlproperty StandardButtons MessageDialog::standardButtons
-
- The MessageDialog has a row of buttons along the bottom, each of which has
- a \l {QMessageBox::ButtonRole} {ButtonRole} that determines which signal
- will be emitted when the button is pressed. You can also find out which
- specific button was pressed after the fact via the \l clickedButton
- property. You can control which buttons are available by setting
- standardButtons to a bitwise-or combination of the following flags:
-
- \table
- \row \li StandardButton.Ok \li An \gui OK button defined with the \l {QMessageBox::AcceptRole} {AcceptRole}.
- \row \li StandardButton.Open \li An \gui Open button defined with the \l {QMessageBox::AcceptRole} {AcceptRole}.
- \row \li StandardButton.Save \li A \gui Save button defined with the \l {QMessageBox::AcceptRole} {AcceptRole}.
- \row \li StandardButton.Cancel \li A \gui Cancel button defined with the \l {QMessageBox::RejectRole} {RejectRole}.
- \row \li StandardButton.Close \li A \gui Close button defined with the \l {QMessageBox::RejectRole} {RejectRole}.
- \row \li StandardButton.Discard \li A \gui Discard or \gui {Don't Save} button, depending on the platform,
- defined with the \l {QMessageBox::DestructiveRole} {DestructiveRole}.
- \row \li StandardButton.Apply \li An \gui Apply button defined with the \l {QMessageBox::ApplyRole} {ApplyRole}.
- \row \li StandardButton.Reset \li A \gui Reset button defined with the \l {QMessageBox::ResetRole} {ResetRole}.
- \row \li StandardButton.RestoreDefaults \li A \gui {Restore Defaults} button defined with the \l {QMessageBox::ResetRole} {ResetRole}.
- \row \li StandardButton.Help \li A \gui Help button defined with the \l {QMessageBox::HelpRole} {HelpRole}.
- \row \li StandardButton.SaveAll \li A \gui {Save All} button defined with the \l {QMessageBox::AcceptRole} {AcceptRole}.
- \row \li StandardButton.Yes \li A \gui Yes button defined with the \l {QMessageBox::YesRole} {YesRole}.
- \row \li StandardButton.YesToAll \li A \gui {Yes to All} button defined with the \l {QMessageBox::YesRole} {YesRole}.
- \row \li StandardButton.No \li A \gui No button defined with the \l {QMessageBox::NoRole} {NoRole}.
- \row \li StandardButton.NoToAll \li A \gui {No to All} button defined with the \l {QMessageBox::NoRole} {NoRole}.
- \row \li StandardButton.Abort \li An \gui Abort button defined with the \l {QMessageBox::RejectRole} {RejectRole}.
- \row \li StandardButton.Retry \li A \gui Retry button defined with the \l {QMessageBox::AcceptRole} {AcceptRole}.
- \row \li StandardButton.Ignore \li An \gui Ignore button defined with the \l {QMessageBox::AcceptRole} {AcceptRole}.
- \endtable
-
- For example the following dialog will ask a question with 5 possible answers:
-
- \qml
- import QtQuick 2.2
- import QtQuick.Dialogs 1.1
-
- MessageDialog {
- title: "Overwrite?"
- icon: StandardIcon.Question
- text: "file.txt already exists. Replace?"
- detailedText: "To replace a file means that its existing contents will be lost. " +
- "The file that you are copying now will be copied over it instead."
- standardButtons: StandardButton.Yes | StandardButton.YesToAll |
- StandardButton.No | StandardButton.NoToAll | StandardButton.Abort
- Component.onCompleted: visible = true
- onYes: console.log("copied")
- onNo: console.log("didn't copy")
- onRejected: console.log("aborted")
- }
- \endqml
-
- \image replacefile.png
-
- The default is \c StandardButton.Ok.
-
- The enum values are the same as in \l QMessageBox::StandardButtons.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/imports/dialogs/qquickplatformmessagedialog_p.h b/src/imports/dialogs/qquickplatformmessagedialog_p.h
deleted file mode 100644
index 61f055bb38..0000000000
--- a/src/imports/dialogs/qquickplatformmessagedialog_p.h
+++ /dev/null
@@ -1,78 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKPLATFORMMESSAGEDIALOG_P_H
-#define QQUICKPLATFORMMESSAGEDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qquickabstractmessagedialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickPlatformMessageDialog : public QQuickAbstractMessageDialog
-{
- Q_OBJECT
-
-public:
- QQuickPlatformMessageDialog(QObject *parent = 0);
- virtual ~QQuickPlatformMessageDialog();
-
-protected:
- QPlatformMessageDialogHelper *helper();
-
- Q_DISABLE_COPY(QQuickPlatformMessageDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickPlatformMessageDialog *)
-
-#endif // QQUICKPLATFORMMESSAGEDIALOG_P_H
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 3f15755211..f1d262a6c3 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -11,11 +11,7 @@ qtHaveModule(quick) {
qtquick2 \
particles \
window \
- dialogs-private \
- dialogs \
testlib
}
qtHaveModule(xmlpatterns) : SUBDIRS += xmllistmodel
-
-qtHaveModule(quick):qtHaveModule(widgets): SUBDIRS += widgets
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 48693dbbf3..7e0de1cd4b 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -281,7 +281,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
ScopedValue values(scope, ctx->callData->args[1]);
if (values->asArrayObject()) {
ScopedArrayObject array(scope, values);
- quint32 size = array->arrayLength();
+ quint32 size = array->getLength();
QV4::ScopedValue v(scope);
for (quint32 ii = 0; ii < size; ++ii)
query.bindValue(ii, engine->toVariant((v = array->getIndexed(ii)), -1));
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index 011a39f20c..128eb9ed38 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -273,6 +273,9 @@ QSettings *QQmlSettingsPrivate::instance() const
void QQmlSettingsPrivate::init()
{
if (!initialized) {
+#ifdef SETTINGS_DEBUG
+ qDebug() << "QQmlSettings: stored at" << instance()->fileName();
+#endif
load();
initialized = true;
}
diff --git a/src/imports/widgets/plugins.qmltypes b/src/imports/widgets/plugins.qmltypes
deleted file mode 100644
index a67443c5b7..0000000000
--- a/src/imports/widgets/plugins.qmltypes
+++ /dev/null
@@ -1,302 +0,0 @@
-import QtQuick.tooling 1.1
-
-// This file describes the plugin-supplied types contained in the library.
-// It is used for QML tooling purposes only.
-//
-// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.PrivateWidgets 1.1'
-
-Module {
- Component {
- name: "QQuickAbstractColorDialog"
- prototype: "QQuickAbstractDialog"
- Property { name: "showAlphaChannel"; type: "bool" }
- Property { name: "color"; type: "QColor" }
- Property { name: "currentColor"; type: "QColor" }
- Property { name: "currentHue"; type: "double"; isReadonly: true }
- Property { name: "currentSaturation"; type: "double"; isReadonly: true }
- Property { name: "currentLightness"; type: "double"; isReadonly: true }
- Property { name: "currentAlpha"; type: "double"; isReadonly: true }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setModality"
- Parameter { name: "m"; type: "Qt::WindowModality" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setColor"
- Parameter { name: "arg"; type: "QColor" }
- }
- Method {
- name: "setCurrentColor"
- Parameter { name: "currentColor"; type: "QColor" }
- }
- Method {
- name: "setShowAlphaChannel"
- Parameter { name: "arg"; type: "bool" }
- }
- }
- Component {
- name: "QQuickAbstractDialog"
- prototype: "QObject"
- Property { name: "visible"; type: "bool" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "title"; type: "string" }
- Property { name: "isWindow"; type: "bool"; isReadonly: true }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Signal { name: "visibilityChanged" }
- Signal { name: "geometryChanged" }
- Signal { name: "accepted" }
- Signal { name: "rejected" }
- Method { name: "open" }
- Method { name: "close" }
- Method {
- name: "setX"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setY"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setWidth"
- Parameter { name: "arg"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "arg"; type: "int" }
- }
- }
- Component {
- name: "QQuickAbstractFileDialog"
- prototype: "QQuickAbstractDialog"
- Property { name: "selectExisting"; type: "bool" }
- Property { name: "selectMultiple"; type: "bool" }
- Property { name: "selectFolder"; type: "bool" }
- Property { name: "folder"; type: "QUrl" }
- Property { name: "nameFilters"; type: "QStringList" }
- Property { name: "selectedNameFilter"; type: "string" }
- Property { name: "fileUrl"; type: "QUrl"; isReadonly: true }
- Property { name: "fileUrls"; type: "QList<QUrl>"; isReadonly: true }
- Signal { name: "filterSelected" }
- Signal { name: "fileModeChanged" }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setSelectExisting"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setSelectMultiple"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setSelectFolder"
- Parameter { name: "s"; type: "bool" }
- }
- Method {
- name: "setFolder"
- Parameter { name: "f"; type: "QUrl" }
- }
- Method {
- name: "setNameFilters"
- Parameter { name: "f"; type: "QStringList" }
- }
- Method {
- name: "selectNameFilter"
- Parameter { name: "f"; type: "string" }
- }
- }
- Component {
- name: "QQuickAbstractFontDialog"
- prototype: "QQuickAbstractDialog"
- Property { name: "scalableFonts"; type: "bool" }
- Property { name: "nonScalableFonts"; type: "bool" }
- Property { name: "monospacedFonts"; type: "bool" }
- Property { name: "proportionalFonts"; type: "bool" }
- Property { name: "font"; type: "QFont" }
- Signal { name: "selectionAccepted" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setModality"
- Parameter { name: "m"; type: "Qt::WindowModality" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "t"; type: "string" }
- }
- Method {
- name: "setFont"
- Parameter { name: "arg"; type: "QFont" }
- }
- Method {
- name: "setScalableFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setNonScalableFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setMonospacedFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- Method {
- name: "setProportionalFonts"
- Parameter { name: "arg"; type: "bool" }
- }
- }
- Component {
- name: "QQuickAbstractMessageDialog"
- prototype: "QQuickAbstractDialog"
- exports: ["QtQuick.PrivateWidgets/QtMessageDialog 1.1"]
- exportMetaObjectRevisions: [0]
- Enum {
- name: "Icon"
- values: {
- "NoIcon": 0,
- "Information": 1,
- "Warning": 2,
- "Critical": 3,
- "Question": 4
- }
- }
- Enum {
- name: "StandardButton"
- values: {
- "NoButton": 0,
- "Ok": 1024,
- "Save": 2048,
- "SaveAll": 4096,
- "Open": 8192,
- "Yes": 16384,
- "YesToAll": 32768,
- "No": 65536,
- "NoToAll": 131072,
- "Abort": 262144,
- "Retry": 524288,
- "Ignore": 1048576,
- "Close": 2097152,
- "Cancel": 4194304,
- "Discard": 8388608,
- "Help": 16777216,
- "Apply": 33554432,
- "Reset": 67108864,
- "RestoreDefaults": 134217728
- }
- }
- Enum {
- name: "StandardButtons"
- values: {
- "NoButton": 0,
- "Ok": 1024,
- "Save": 2048,
- "SaveAll": 4096,
- "Open": 8192,
- "Yes": 16384,
- "YesToAll": 32768,
- "No": 65536,
- "NoToAll": 131072,
- "Abort": 262144,
- "Retry": 524288,
- "Ignore": 1048576,
- "Close": 2097152,
- "Cancel": 4194304,
- "Discard": 8388608,
- "Help": 16777216,
- "Apply": 33554432,
- "Reset": 67108864,
- "RestoreDefaults": 134217728
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "informativeText"; type: "string" }
- Property { name: "detailedText"; type: "string" }
- Property { name: "icon"; type: "Icon" }
- Property { name: "standardIconSource"; type: "QUrl"; isReadonly: true }
- Property { name: "standardButtons"; type: "StandardButtons" }
- Property { name: "clickedButton"; type: "StandardButton"; isReadonly: true }
- Signal { name: "buttonClicked" }
- Signal { name: "discard" }
- Signal { name: "help" }
- Signal { name: "yes" }
- Signal { name: "no" }
- Signal { name: "apply" }
- Signal { name: "reset" }
- Method {
- name: "setVisible"
- Parameter { name: "v"; type: "bool" }
- }
- Method {
- name: "setTitle"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setInformativeText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setDetailedText"
- Parameter { name: "arg"; type: "string" }
- }
- Method {
- name: "setIcon"
- Parameter { name: "icon"; type: "Icon" }
- }
- Method {
- name: "setStandardButtons"
- Parameter { name: "buttons"; type: "StandardButtons" }
- }
- Method {
- name: "click"
- Parameter { name: "button"; type: "QMessageDialogOptions::StandardButton" }
- Parameter { type: "QMessageDialogOptions::ButtonRole" }
- }
- Method {
- name: "click"
- Parameter { name: "button"; type: "QQuickAbstractMessageDialog::StandardButton" }
- }
- }
- Component {
- name: "QQuickQColorDialog"
- prototype: "QQuickAbstractColorDialog"
- exports: ["QtQuick.PrivateWidgets/QtColorDialog 1.0"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QQuickQFileDialog"
- prototype: "QQuickAbstractFileDialog"
- exports: ["QtQuick.PrivateWidgets/QtFileDialog 1.0"]
- exportMetaObjectRevisions: [0]
- }
- Component {
- name: "QQuickQFontDialog"
- prototype: "QQuickAbstractFontDialog"
- exports: ["QtQuick.PrivateWidgets/QtFontDialog 1.1"]
- exportMetaObjectRevisions: [0]
- }
-}
diff --git a/src/imports/widgets/qmessageboxhelper_p.h b/src/imports/widgets/qmessageboxhelper_p.h
deleted file mode 100644
index 4f1070f97d..0000000000
--- a/src/imports/widgets/qmessageboxhelper_p.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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMESSAGEBOXHELPER_P_H
-#define QMESSAGEBOXHELPER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QMessageBox>
-#include "../dialogs/qquickabstractmessagedialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QMessageBoxHelper : public QPlatformMessageDialogHelper
-{
- Q_OBJECT
-public:
- QMessageBoxHelper() {
- connect(&m_dialog, SIGNAL(accepted()), this, SIGNAL(accept()));
- connect(&m_dialog, SIGNAL(rejected()), this, SIGNAL(reject()));
- connect(&m_dialog, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
- }
-
- virtual void exec() { m_dialog.exec(); }
-
- virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) {
- m_dialog.winId();
- QWindow *window = m_dialog.windowHandle();
- Q_ASSERT(window);
- window->setTransientParent(parent);
- window->setFlags(f);
- m_dialog.setWindowModality(m);
- m_dialog.setWindowTitle(QPlatformMessageDialogHelper::options()->windowTitle());
- m_dialog.setIcon(static_cast<QMessageBox::Icon>(QPlatformMessageDialogHelper::options()->icon()));
- if (!QPlatformMessageDialogHelper::options()->text().isNull())
- m_dialog.setText(QPlatformMessageDialogHelper::options()->text());
- if (!QPlatformMessageDialogHelper::options()->informativeText().isNull())
- m_dialog.setInformativeText(QPlatformMessageDialogHelper::options()->informativeText());
- if (!QPlatformMessageDialogHelper::options()->detailedText().isNull())
- m_dialog.setDetailedText(QPlatformMessageDialogHelper::options()->detailedText());
- m_dialog.setStandardButtons(static_cast<QMessageBox::StandardButtons>(static_cast<int>(
- QPlatformMessageDialogHelper::options()->standardButtons())));
- m_dialog.show();
- return m_dialog.isVisible();
- }
-
- virtual void hide() { m_dialog.hide(); }
-
- QMessageBox m_dialog;
-
-public Q_SLOTS:
- void buttonClicked(QAbstractButton* button) {
- emit clicked(static_cast<QMessageDialogOptions::StandardButton>(m_dialog.standardButton(button)),
- static_cast<QMessageDialogOptions::ButtonRole>(m_dialog.buttonRole(button)));
- }
-};
-
-QT_END_NAMESPACE
-
-#endif // QMESSAGEBOXHELPER_P_H
diff --git a/src/imports/widgets/qmldir b/src/imports/widgets/qmldir
deleted file mode 100644
index da63c98e61..0000000000
--- a/src/imports/widgets/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtQuick.PrivateWidgets
-plugin widgetsplugin
-classname QtQuick2PrivateWidgetsPlugin
-typeinfo plugins.qmltypes
diff --git a/src/imports/widgets/qquickqcolordialog.cpp b/src/imports/widgets/qquickqcolordialog.cpp
deleted file mode 100644
index ee27d147e7..0000000000
--- a/src/imports/widgets/qquickqcolordialog.cpp
+++ /dev/null
@@ -1,175 +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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickqcolordialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <private/qqmlcontext_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-#include <QColorDialog>
-
-QT_BEGIN_NAMESPACE
-
-class QColorDialogHelper : public QPlatformColorDialogHelper
-{
-public:
- QColorDialogHelper() :
- QPlatformColorDialogHelper()
- {
- connect(&m_dialog, SIGNAL(currentColorChanged(const QColor&)), this, SIGNAL(currentColorChanged(const QColor&)));
- connect(&m_dialog, SIGNAL(colorSelected(const QColor&)), this, SIGNAL(colorSelected(const QColor&)));
- connect(&m_dialog, SIGNAL(accepted()), this, SIGNAL(accept()));
- connect(&m_dialog, SIGNAL(rejected()), this, SIGNAL(reject()));
- }
-
- virtual void setCurrentColor(const QColor &c) { m_dialog.setCurrentColor(c); }
- virtual QColor currentColor() const { return m_dialog.currentColor(); }
-
- virtual void exec() { m_dialog.exec(); }
-
- virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) {
- m_dialog.winId();
- QWindow *window = m_dialog.windowHandle();
- Q_ASSERT(window);
- window->setTransientParent(parent);
- window->setFlags(f);
- m_dialog.setWindowModality(m);
- m_dialog.setWindowTitle(QPlatformColorDialogHelper::options()->windowTitle());
- m_dialog.setOptions((QColorDialog::ColorDialogOptions)((int)(QPlatformColorDialogHelper::options()->options())));
- m_dialog.show();
- return m_dialog.isVisible();
- }
-
- virtual void hide() { m_dialog.hide(); }
-
-private:
- QColorDialog m_dialog;
-};
-
-/*!
- \qmltype QtColorDialog
- \instantiates QQuickQColorDialog
- \inqmlmodule QtQuick.PrivateWidgets 1
- \ingroup qtquick-visual
- \brief Dialog component for choosing a color.
- \since 5.1
- \internal
-
- QtColorDialog provides a means to instantiate and manage a QColorDialog.
- It is not recommended to be used directly; it is an implementation
- detail of \l ColorDialog in the \l QtQuick.Dialogs module.
-
- To use this type, you will need to import the module with the following line:
- \code
- import QtQuick.PrivateWidgets 1.0
- \endcode
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::ColorDialog::accepted
-
- The \a accepted signal is emitted when the user has finished using the
- dialog. You can then inspect the \a color property to get the selection.
-
- Example:
-
- \qml
- ColorDialog {
- onAccepted: { console.log("Selected color: " + color) }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::ColorDialog::rejected
-
- The \a rejected signal is emitted when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickQColorDialog
- \inmodule QtQuick.PrivateWidgets
- \internal
-
- \brief The QQuickQColorDialog class is a wrapper for a QColorDialog.
-
- \since 5.1
-*/
-
-/*!
- Constructs a file dialog with parent window \a parent.
-*/
-QQuickQColorDialog::QQuickQColorDialog(QObject *parent)
- : QQuickAbstractColorDialog(parent)
-{
-}
-
-/*!
- Destroys the file dialog.
-*/
-QQuickQColorDialog::~QQuickQColorDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformColorDialogHelper *QQuickQColorDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if (!m_dlgHelper) {
- m_dlgHelper = new QColorDialogHelper();
- connect(m_dlgHelper, SIGNAL(currentColorChanged(const QColor&)), this, SLOT(setCurrentColor(QColor)));
- connect(m_dlgHelper, SIGNAL(colorSelected(const QColor&)), this, SLOT(setColor(QColor)));
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- }
-
- return m_dlgHelper;
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/widgets/qquickqcolordialog_p.h b/src/imports/widgets/qquickqcolordialog_p.h
deleted file mode 100644
index 3fb0476299..0000000000
--- a/src/imports/widgets/qquickqcolordialog_p.h
+++ /dev/null
@@ -1,78 +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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKQCOLORDIALOG_P_H
-#define QQUICKQCOLORDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "../dialogs/qquickabstractcolordialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickQColorDialog : public QQuickAbstractColorDialog
-{
- Q_OBJECT
-
-public:
- QQuickQColorDialog(QObject *parent = 0);
- virtual ~QQuickQColorDialog();
-
-protected:
- QPlatformColorDialogHelper *helper();
-
- Q_DISABLE_COPY(QQuickQColorDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickQColorDialog *)
-
-#endif // QQUICKQCOLORDIALOG_P_H
diff --git a/src/imports/widgets/qquickqfiledialog.cpp b/src/imports/widgets/qquickqfiledialog.cpp
deleted file mode 100644
index 403577fabe..0000000000
--- a/src/imports/widgets/qquickqfiledialog.cpp
+++ /dev/null
@@ -1,215 +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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickqfiledialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <private/qqmlcontext_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-#include <QFileDialog>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype QtFileDialog
- \instantiates QQuickQFileDialog
- \inqmlmodule QtQuick.PrivateWidgets 1
- \ingroup qtquick-visual
- \brief Dialog component for choosing files from a local filesystem.
- \since 5.1
- \internal
-
- QtFileDialog provides a means to instantiate and manage a QFileDialog.
- It is not recommended to be used directly; it is an implementation
- detail of \l FileDialog in the \l QtQuick.Dialogs module.
-
- To use this type, you will need to import the module with the following line:
- \code
- import QtQuick.PrivateWidgets 1.0
- \endcode
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FileDialog::accepted
-
- The \a accepted signal is emitted when the user has finished using the
- dialog. You can then inspect the \a fileUrl or \a fileUrls properties to
- get the selection.
-
- Example:
-
- \qml
- FileDialog {
- onAccepted: { console.log("Selected file: " + fileUrl) }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FileDialog::rejected
-
- The \a rejected signal is emitted when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickQFileDialog
- \inmodule QtQuick.PrivateWidgets
- \internal
-
- \brief The QQuickQFileDialog class is a wrapper for a QFileDialog.
-
- \since 5.1
-*/
-
-/*!
- Constructs a file dialog with parent window \a parent.
-*/
-QQuickQFileDialog::QQuickQFileDialog(QObject *parent)
- : QQuickAbstractFileDialog(parent)
-{
-}
-
-/*!
- Destroys the file dialog.
-*/
-QQuickQFileDialog::~QQuickQFileDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformFileDialogHelper *QQuickQFileDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if (!m_dlgHelper) {
- m_dlgHelper = new QFileDialogHelper();
- connect(m_dlgHelper, SIGNAL(directoryEntered(const QUrl &)), this, SIGNAL(folderChanged()));
- connect(m_dlgHelper, SIGNAL(filterSelected(const QString &)), this, SIGNAL(filterSelected()));
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- }
-
- return m_dlgHelper;
-}
-
-QFileDialogHelper::QFileDialogHelper() :
- QPlatformFileDialogHelper()
-{
- connect(&m_dialog, SIGNAL(currentChanged(const QString&)), this, SLOT(currentChanged(const QString&)));
- connect(&m_dialog, SIGNAL(directoryEntered(const QString&)), this, SLOT(directoryEntered(const QString&)));
- connect(&m_dialog, SIGNAL(fileSelected(const QString&)), this, SLOT(fileSelected(const QString&)));
- connect(&m_dialog, SIGNAL(filesSelected(const QStringList&)), this, SLOT(filesSelected(const QStringList&)));
- connect(&m_dialog, SIGNAL(filterSelected(const QString&)), this, SIGNAL(filterSelected(const QString&)));
- connect(&m_dialog, SIGNAL(accepted()), this, SIGNAL(accept()));
- connect(&m_dialog, SIGNAL(rejected()), this, SIGNAL(reject()));
-}
-
-QList<QUrl> QFileDialogHelper::selectedFiles() const
-{
- return m_dialog.selectedUrls();
-}
-
-void QFileDialogHelper::setFilter() {
- m_dialog.setWindowTitle(QPlatformFileDialogHelper::options()->windowTitle());
- if (QPlatformFileDialogHelper::options()->isLabelExplicitlySet(QFileDialogOptions::LookIn))
- m_dialog.setLabelText(m_dialog.LookIn, QPlatformFileDialogHelper::options()->labelText(QFileDialogOptions::LookIn));
- if (QPlatformFileDialogHelper::options()->isLabelExplicitlySet(QFileDialogOptions::FileName))
- m_dialog.setLabelText(m_dialog.FileName, QPlatformFileDialogHelper::options()->labelText(QFileDialogOptions::FileName));
- if (QPlatformFileDialogHelper::options()->isLabelExplicitlySet(QFileDialogOptions::FileType))
- m_dialog.setLabelText(m_dialog.FileType, QPlatformFileDialogHelper::options()->labelText(QFileDialogOptions::FileType));
- if (QPlatformFileDialogHelper::options()->isLabelExplicitlySet(QFileDialogOptions::Accept))
- m_dialog.setLabelText(m_dialog.Accept, QPlatformFileDialogHelper::options()->labelText(QFileDialogOptions::Accept));
- if (QPlatformFileDialogHelper::options()->isLabelExplicitlySet(QFileDialogOptions::Reject))
- m_dialog.setLabelText(m_dialog.Reject, QPlatformFileDialogHelper::options()->labelText(QFileDialogOptions::Reject));
- m_dialog.setFilter(QPlatformFileDialogHelper::options()->filter());
- m_dialog.setNameFilters(QPlatformFileDialogHelper::options()->nameFilters());
- m_dialog.selectNameFilter(QPlatformFileDialogHelper::options()->initiallySelectedNameFilter());
- m_dialog.setFileMode(QFileDialog::FileMode(QPlatformFileDialogHelper::options()->fileMode()));
- m_dialog.setOptions((QFileDialog::Options)((int)(QPlatformFileDialogHelper::options()->options())));
- m_dialog.setAcceptMode(QFileDialog::AcceptMode(QPlatformFileDialogHelper::options()->acceptMode()));
-
- const QUrl initialDirectory = QPlatformFileDialogHelper::options()->initialDirectory();
- if (initialDirectory.isValid() && initialDirectory.isLocalFile())
- m_dialog.setDirectory(initialDirectory.toLocalFile());
-}
-
-bool QFileDialogHelper::show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) {
- m_dialog.winId();
- QWindow *window = m_dialog.windowHandle();
- Q_ASSERT(window);
- window->setTransientParent(parent);
- window->setFlags(f);
- m_dialog.setWindowModality(m);
- m_dialog.show();
- return m_dialog.isVisible();
-}
-
-void QFileDialogHelper::currentChanged(const QString& path)
-{
- emit QPlatformFileDialogHelper::currentChanged(QUrl::fromLocalFile(path));
-}
-
-void QFileDialogHelper::directoryEntered(const QString& path)
-{
- emit QPlatformFileDialogHelper::directoryEntered(QUrl::fromLocalFile(path));
-}
-
-void QFileDialogHelper::fileSelected(const QString& path)
-{
- emit QPlatformFileDialogHelper::fileSelected(QUrl::fromLocalFile(path));
-}
-
-void QFileDialogHelper::filesSelected(const QStringList& paths)
-{
- QList<QUrl> pathUrls;
- foreach (const QString &path, paths)
- pathUrls << QUrl::fromLocalFile(path);
- emit QPlatformFileDialogHelper::filesSelected(pathUrls);
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/widgets/qquickqfiledialog_p.h b/src/imports/widgets/qquickqfiledialog_p.h
deleted file mode 100644
index 2bd364eba0..0000000000
--- a/src/imports/widgets/qquickqfiledialog_p.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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKQFILEDIALOG_P_H
-#define QQUICKQFILEDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QFileDialog>
-#include "../dialogs/qquickabstractfiledialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickQFileDialog : public QQuickAbstractFileDialog
-{
- Q_OBJECT
-
-public:
- QQuickQFileDialog(QObject *parent = 0);
- virtual ~QQuickQFileDialog();
-
-protected:
- QPlatformFileDialogHelper *helper();
-
- Q_DISABLE_COPY(QQuickQFileDialog)
-};
-
-class QFileDialogHelper : public QPlatformFileDialogHelper
-{
- Q_OBJECT
-public:
- QFileDialogHelper();
-
- bool defaultNameFilterDisables() const Q_DECL_OVERRIDE { return true; }
- void setDirectory(const QUrl &dir) Q_DECL_OVERRIDE { m_dialog.setDirectoryUrl(dir); }
- QUrl directory() const Q_DECL_OVERRIDE { return m_dialog.directoryUrl(); }
- void selectFile(const QUrl &f) Q_DECL_OVERRIDE { m_dialog.selectUrl(f); }
- QList<QUrl> selectedFiles() const Q_DECL_OVERRIDE;
- void setFilter() Q_DECL_OVERRIDE;
- void selectNameFilter(const QString &f) Q_DECL_OVERRIDE { m_dialog.selectNameFilter(f); }
- QString selectedNameFilter() const Q_DECL_OVERRIDE { return m_dialog.selectedNameFilter(); }
- void exec() Q_DECL_OVERRIDE { m_dialog.exec(); }
- bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) Q_DECL_OVERRIDE;
- void hide() Q_DECL_OVERRIDE { m_dialog.hide(); }
-
-private Q_SLOTS:
- void currentChanged(const QString& path);
- void directoryEntered(const QString& path);
- void fileSelected(const QString& path);
- void filesSelected(const QStringList& paths);
-
-private:
- QFileDialog m_dialog;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickQFileDialog *)
-
-#endif // QQUICKQFILEDIALOG_P_H
diff --git a/src/imports/widgets/qquickqfontdialog.cpp b/src/imports/widgets/qquickqfontdialog.cpp
deleted file mode 100644
index 6d637e1ddb..0000000000
--- a/src/imports/widgets/qquickqfontdialog.cpp
+++ /dev/null
@@ -1,178 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickqfontdialog_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <private/qqmlcontext_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-#include <QFontDialog>
-
-QT_BEGIN_NAMESPACE
-
-class QFontDialogHelper : public QPlatformFontDialogHelper
-{
-public:
- QFontDialogHelper() :
- QPlatformFontDialogHelper()
- {
- connect(&m_dialog, SIGNAL(currentFontChanged(const QFont &)), this, SIGNAL(currentFontChanged(const QFont &)));
- connect(&m_dialog, SIGNAL(fontSelected(const QFont &)), this, SIGNAL(fontSelected(const QFont &)));
- connect(&m_dialog, SIGNAL(accepted()), this, SIGNAL(accept()));
- connect(&m_dialog, SIGNAL(rejected()), this, SIGNAL(reject()));
- }
-
- virtual void setCurrentFont(const QFont &font) { m_dialog.setCurrentFont(font); }
- virtual QFont currentFont() const { return m_dialog.currentFont(); }
-
- virtual void exec() { m_dialog.exec(); }
-
- virtual bool show(Qt::WindowFlags f, Qt::WindowModality m, QWindow *parent) {
- m_dialog.winId();
- QWindow *window = m_dialog.windowHandle();
- Q_ASSERT(window);
- window->setTransientParent(parent);
- window->setFlags(f);
- m_dialog.windowHandle()->setTransientParent(parent);
- m_dialog.windowHandle()->setFlags(f);
- m_dialog.setWindowModality(m);
- m_dialog.setWindowTitle(QPlatformFontDialogHelper::options()->windowTitle());
- m_dialog.setOptions((QFontDialog::FontDialogOptions)((int)(QPlatformFontDialogHelper::options()->options())));
- m_dialog.show();
- return m_dialog.isVisible();
- }
-
- virtual void hide() { m_dialog.hide(); }
-
-private:
- QFontDialog m_dialog;
-};
-
-/*!
- \qmltype QtFontDialog
- \instantiates QQuickQFontDialog
- \inqmlmodule QtQuick.PrivateWidgets 1
- \ingroup qtquick-visual
- \brief Dialog component for choosing files from a local filesystem.
- \since 5.2
- \internal
-
- QtFontDialog provides a means to instantiate and manage a QFontDialog.
- It is not recommended to be used directly; it is an implementation
- detail of \l FontDialog in the \l QtQuick.Dialogs module.
-
- To use this type, you will need to import the module with the following line:
- \code
- import QtQuick.PrivateWidgets 1.1
- \endcode
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FontDialog::accepted
-
- The \a accepted signal is emitted when the user has finished using the
- dialog. You can then inspect the \a filePath or \a filePaths properties to
- get the selection.
-
- Example:
-
- \qml
- FontDialog {
- onAccepted: { console.log("Selected file: " + filePath) }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::FontDialog::rejected
-
- The \a rejected signal is emitted when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickQFontDialog
- \inmodule QtQuick.PrivateWidgets
- \internal
-
- \brief The QQuickQFontDialog class is a wrapper for a QFontDialog.
-
- \since 5.2
-*/
-
-/*!
- Constructs a file dialog with parent window \a parent.
-*/
-QQuickQFontDialog::QQuickQFontDialog(QObject *parent)
- : QQuickAbstractFontDialog(parent)
-{
-}
-
-/*!
- Destroys the file dialog.
-*/
-QQuickQFontDialog::~QQuickQFontDialog()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformFontDialogHelper *QQuickQFontDialog::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if (!m_dlgHelper) {
- m_dlgHelper = new QFontDialogHelper();
- connect(m_dlgHelper, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(setFont(const QFont &)));
- connect(m_dlgHelper, SIGNAL(fontSelected(const QFont &)), this, SLOT(setFont(const QFont &)));
- connect(m_dlgHelper, SIGNAL(accept()), this, SLOT(accept()));
- connect(m_dlgHelper, SIGNAL(reject()), this, SLOT(reject()));
- }
-
- return m_dlgHelper;
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/widgets/qquickqfontdialog_p.h b/src/imports/widgets/qquickqfontdialog_p.h
deleted file mode 100644
index 6efd15995b..0000000000
--- a/src/imports/widgets/qquickqfontdialog_p.h
+++ /dev/null
@@ -1,78 +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 QtQuick.Dialogs module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKQFONTDIALOG_P_H
-#define QQUICKQFONTDIALOG_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "../dialogs/qquickabstractfontdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickQFontDialog : public QQuickAbstractFontDialog
-{
- Q_OBJECT
-
-public:
- QQuickQFontDialog(QObject *parent = 0);
- virtual ~QQuickQFontDialog();
-
-protected:
- QPlatformFontDialogHelper *helper();
-
- Q_DISABLE_COPY(QQuickQFontDialog)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickQFontDialog *)
-
-#endif // QQUICKQFONTDIALOG_P_H
diff --git a/src/imports/widgets/qquickqmessagebox.cpp b/src/imports/widgets/qquickqmessagebox.cpp
deleted file mode 100644
index 1b92efc5ef..0000000000
--- a/src/imports/widgets/qquickqmessagebox.cpp
+++ /dev/null
@@ -1,144 +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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickqmessagebox_p.h"
-#include "qmessageboxhelper_p.h"
-#include "qquickitem.h"
-
-#include <private/qguiapplication_p.h>
-#include <private/qqmlcontext_p.h>
-#include <QWindow>
-#include <QQuickWindow>
-#include <QMessageBox>
-#include <QAbstractButton>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmltype QtMessageDialog
- \instantiates QQuickQMessageBox
- \inqmlmodule QtQuick.PrivateWidgets 1
- \ingroup qtquick-visual
- \brief Dialog component for choosing a color.
- \since 5.2
- \internal
-
- QtMessageDialog provides a means to instantiate and manage a QMessageBox.
- It is not recommended to be used directly; it is an implementation
- detail of \l MessageDialog in the \l QtQuick.Dialogs module.
-
- To use this type, you will need to import the module with the following line:
- \code
- import QtQuick.PrivateWidgets 1.1
- \endcode
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::MessageDialog::accepted
-
- The \a accepted signal is emitted when the user has pressed the OK button
- on the dialog.
-
- Example:
-
- \qml
- MessageDialog {
- onAccepted: { console.log("accepted") }
- }
- \endqml
-*/
-
-/*!
- \qmlsignal QtQuick::Dialogs::MessageDialog::rejected
-
- The \a rejected signal is emitted when the user has dismissed the dialog,
- either by closing the dialog window or by pressing the Cancel button.
-*/
-
-/*!
- \class QQuickQMessageBox
- \inmodule QtQuick.PrivateWidgets
- \internal
-
- \brief The QQuickQMessageBox class is a wrapper for a QMessageBox.
-
- \since 5.2
-*/
-
-/*!
- Constructs a message dialog with parent window \a parent.
-*/
-QQuickQMessageBox::QQuickQMessageBox(QObject *parent)
- : QQuickAbstractMessageDialog(parent)
-{
-}
-
-/*!
- Destroys the message dialog.
-*/
-QQuickQMessageBox::~QQuickQMessageBox()
-{
- if (m_dlgHelper)
- m_dlgHelper->hide();
- delete m_dlgHelper;
-}
-
-QPlatformDialogHelper *QQuickQMessageBox::helper()
-{
- QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());
- if (parentItem)
- m_parentWindow = parentItem->window();
-
- if (!QQuickAbstractMessageDialog::m_dlgHelper) {
- QMessageBoxHelper* helper = new QMessageBoxHelper();
- QQuickAbstractMessageDialog::m_dlgHelper = helper;
- // accept() shouldn't be emitted. reject() happens only if the dialog is
- // dismissed by closing the window rather than by one of its button widgets.
- connect(helper, SIGNAL(accept()), this, SLOT(accept()));
- connect(helper, SIGNAL(reject()), this, SLOT(reject()));
- connect(helper, SIGNAL(clicked(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole)),
- this, SLOT(click(QMessageDialogOptions::StandardButton, QMessageDialogOptions::ButtonRole)));
- }
-
- return QQuickAbstractMessageDialog::m_dlgHelper;
-}
-
-QT_END_NAMESPACE
diff --git a/src/imports/widgets/qquickqmessagebox_p.h b/src/imports/widgets/qquickqmessagebox_p.h
deleted file mode 100644
index be91f1d02b..0000000000
--- a/src/imports/widgets/qquickqmessagebox_p.h
+++ /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 QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKQMESSAGEBOX_P_H
-#define QQUICKQMESSAGEBOX_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "../dialogs/qquickabstractmessagedialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickQMessageBox : public QQuickAbstractMessageDialog
-{
-public:
- QQuickQMessageBox(QObject *parent = 0);
- virtual ~QQuickQMessageBox();
-
-protected:
- virtual QPlatformDialogHelper *helper();
-
-protected:
- Q_DISABLE_COPY(QQuickQMessageBox)
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QQuickQMessageBox *)
-
-#endif // QQUICKQMESSAGEBOX_P_H
diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro
deleted file mode 100644
index 5320838082..0000000000
--- a/src/imports/widgets/widgets.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-CXX_MODULE = qml
-TARGET = widgetsplugin
-TARGETPATH = QtQuick/PrivateWidgets
-IMPORT_VERSION = 1.1
-
-SOURCES += \
- qquickqmessagebox.cpp \
- ../dialogs/qquickabstractmessagedialog.cpp \
- qquickqfiledialog.cpp \
- ../dialogs/qquickabstractfiledialog.cpp \
- qquickqcolordialog.cpp \
- ../dialogs/qquickabstractcolordialog.cpp \
- qquickqfontdialog.cpp \
- ../dialogs/qquickabstractfontdialog.cpp \
- ../dialogs/qquickabstractdialog.cpp \
- widgetsplugin.cpp
-
-HEADERS += \
- qquickqmessagebox_p.h \
- qmessageboxhelper_p.h \
- ../dialogs/qquickabstractmessagedialog_p.h \
- qquickqfiledialog_p.h \
- ../dialogs/qquickabstractfiledialog_p.h \
- qquickqcolordialog_p.h \
- ../dialogs/qquickabstractcolordialog_p.h \
- qquickqfontdialog_p.h \
- ../dialogs/qquickabstractfontdialog_p.h \
- ../dialogs/qquickabstractdialog_p.h
-
-QT += quick-private gui-private core-private qml-private widgets
-
-load(qml_plugin)
diff --git a/src/imports/widgets/widgetsplugin.cpp b/src/imports/widgets/widgetsplugin.cpp
deleted file mode 100644
index 05c3a5e86c..0000000000
--- a/src/imports/widgets/widgetsplugin.cpp
+++ /dev/null
@@ -1,89 +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 plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/qqmlextensionplugin.h>
-#include <QtQml/qqml.h>
-#include "qquickqmessagebox_p.h"
-#include "qquickqfiledialog_p.h"
-#include "qquickqcolordialog_p.h"
-#include "qquickqfontdialog_p.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \qmlmodule QtQuick.PrivateWidgets 1
- \title QWidget QML Types
- \ingroup qmlmodules
- \brief Provides QML types for certain QWidgets
- \internal
-
- This QML module contains types which should not be depended upon in Qt Quick
- applications, but are available if the Widgets module is linked. It is
- recommended to load components from this module conditionally, if at all,
- and to provide fallback implementations in case they fail to load.
-
- \code
- import QtQuick.PrivateWidgets 1.1
- \endcode
-
- \since 5.1
-*/
-
-class QtQuick2PrivateWidgetsPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
-
-public:
- virtual void registerTypes(const char *uri)
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick.PrivateWidgets"));
-
- qmlRegisterType<QQuickQMessageBox>(uri, 1, 1, "QtMessageDialog");
- qmlRegisterType<QQuickQFileDialog>(uri, 1, 0, "QtFileDialog");
- qmlRegisterType<QQuickQColorDialog>(uri, 1, 0, "QtColorDialog");
- qmlRegisterType<QQuickQFontDialog>(uri, 1, 1, "QtFontDialog");
- }
-};
-
-QT_END_NAMESPACE
-
-#include "widgetsplugin.moc"
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index 97dc3aba1f..ebfdad5cbf 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -925,10 +925,12 @@ QQmlV4Handle QQuickXmlListModel::get(int index) const
ExecutionEngine *v4engine = QV8Engine::getV4(v8engine);
Scope scope(v4engine);
Scoped<Object> o(scope, v4engine->newObject());
+ ScopedString name(scope);
+ ScopedValue value(scope);
for (int ii = 0; ii < d->roleObjects.count(); ++ii) {
- ScopedString name(scope, v4engine->newIdentifier(d->roleObjects[ii]->name()));
- Property *p = o->insertMember(name, PropertyAttributes());
- p->value = v8engine->fromVariant(d->data.value(ii).value(index));
+ name = v4engine->newIdentifier(d->roleObjects[ii]->name());
+ value = v8engine->fromVariant(d->data.value(ii).value(index));
+ o->insertMember(name, value);
}
return QQmlV4Handle(o);
diff --git a/src/plugins/accessible/shared/qqmlaccessible.cpp b/src/plugins/accessible/shared/qqmlaccessible.cpp
index d08f9bdb2c..ecf4e56acf 100644
--- a/src/plugins/accessible/shared/qqmlaccessible.cpp
+++ b/src/plugins/accessible/shared/qqmlaccessible.cpp
@@ -185,7 +185,7 @@ void QQmlAccessible::doAction(const QString &actionName)
// use the "stepSize" property on the item
if (QAccessibleValueInterface *valueIface = valueInterface()) {
QVariant valueV = valueIface->currentValue();
- qreal newValue = valueV.toInt();
+ qreal newValue = valueV.toReal();
QVariant stepSizeV = object()->property("stepSize");
qreal stepSize = stepSizeV.isValid() ? stepSizeV.toReal() : qreal(1.0);
diff --git a/src/qml/compiler/compiler.pri b/src/qml/compiler/compiler.pri
index df4f5e8dc3..b2569f9111 100644
--- a/src/qml/compiler/compiler.pri
+++ b/src/qml/compiler/compiler.pri
@@ -15,7 +15,8 @@ HEADERS += \
$$PWD/qv4ssa_p.h \
$$PWD/qv4regalloc_p.h \
$$PWD/qqmlcodegenerator_p.h \
- $$PWD/qv4isel_masm_p.h
+ $$PWD/qv4isel_masm_p.h \
+ $$PWD/qqmltypecompiler_p.h
SOURCES += \
$$PWD/qv4compileddata.cpp \
@@ -28,6 +29,7 @@ SOURCES += \
$$PWD/qv4ssa.cpp \
$$PWD/qv4regalloc.cpp \
$$PWD/qqmlcodegenerator.cpp \
- $$PWD/qv4isel_masm.cpp
+ $$PWD/qv4isel_masm.cpp \
+ $$PWD/qqmltypecompiler.cpp
include(../../3rdparty/masm/masm.pri)
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp
index 13b23fde68..22ae1228c7 100644
--- a/src/qml/compiler/qqmlcodegenerator.cpp
+++ b/src/qml/compiler/qqmlcodegenerator.cpp
@@ -64,6 +64,21 @@ using namespace QtQml;
return false; \
}
+void QmlObject::init(MemoryPool *pool, int typeNameIndex, int id, const AST::SourceLocation &loc)
+{
+ inheritedTypeNameIndex = typeNameIndex;
+
+ location.line = loc.startLine;
+ location.column = loc.startColumn;
+
+ idIndex = id;
+ indexOfDefaultProperty = -1;
+ properties = pool->New<PoolList<QmlProperty> >();
+ qmlSignals = pool->New<PoolList<Signal> >();
+ bindings = pool->New<PoolList<Binding> >();
+ functions = pool->New<PoolList<Function> >();
+}
+
void QmlObject::dump(DebugStream &out)
{
out << inheritedTypeNameIndex << " {" << endl;
@@ -82,8 +97,9 @@ QStringList Signal::parameterStringList(const QStringList &stringPool) const
return result;
}
-QQmlCodeGenerator::QQmlCodeGenerator()
- : _object(0)
+QQmlCodeGenerator::QQmlCodeGenerator(const QSet<QString> &illegalNames)
+ : illegalNames(illegalNames)
+ , _object(0)
, jsGenerator(0)
{
}
@@ -214,7 +230,7 @@ bool QQmlCodeGenerator::visit(AST::UiObjectDefinition *node)
bool QQmlCodeGenerator::visit(AST::UiObjectBinding *node)
{
int idx = defineQMLObject(node->qualifiedTypeNameId, node->initializer);
- appendBinding(node->qualifiedId, idx);
+ appendBinding(node->qualifiedId, idx, node->hasOnToken);
return false;
}
@@ -292,10 +308,8 @@ bool QQmlCodeGenerator::sanityCheckFunctionNames()
if (name.at(0).isUpper())
COMPILE_EXCEPTION(function->identifierToken, tr("Method names cannot begin with an upper case letter"));
-#if 0 // ###
- if (enginePrivate->v8engine()->illegalNames().contains(currSlot.name.toString()))
- COMPILE_EXCEPTION(&currSlot, tr("Illegal method name"));
-#endif
+ if (illegalNames.contains(name))
+ COMPILE_EXCEPTION(function->identifierToken, tr("Illegal method name"));
}
return true;
}
@@ -307,20 +321,10 @@ int QQmlCodeGenerator::defineQMLObject(AST::UiQualifiedId *qualifiedTypeNameId,
const int objectIndex = _objects.size() - 1;
qSwap(_object, obj);
- _object->inheritedTypeNameIndex = registerString(asString(qualifiedTypeNameId));
-
AST::SourceLocation loc;
if (qualifiedTypeNameId)
loc = qualifiedTypeNameId->firstSourceLocation();
- _object->location.line = loc.startLine;
- _object->location.column = loc.startColumn;
-
- _object->idIndex = emptyStringIndex;
- _object->indexOfDefaultProperty = -1;
- _object->properties = New<PoolList<QmlProperty> >();
- _object->qmlSignals = New<PoolList<Signal> >();
- _object->bindings = New<PoolList<Binding> >();
- _object->functions = New<PoolList<Function> >();
+ _object->init(pool, registerString(asString(qualifiedTypeNameId)), emptyStringIndex, loc);
QSet<QString> propertyNames;
qSwap(_propertyNames, propertyNames);
@@ -589,10 +593,8 @@ bool QQmlCodeGenerator::visit(AST::UiPublicMember *node)
if (signalName.at(0).isUpper())
COMPILE_EXCEPTION(node->identifierToken, tr("Signal names cannot begin with an upper case letter"));
-#if 0 // ### cannot access identifier table from separate thread
- if (enginePrivate->v8engine()->illegalNames().contains(currSig.name.toString()))
- COMPILE_EXCEPTION(&currSig, tr("Illegal signal name"));
-#endif
+ if (illegalNames.contains(signalName))
+ COMPILE_EXCEPTION(node->identifierToken, tr("Illegal signal name"));
_object->qmlSignals->append(signal);
} else {
@@ -739,6 +741,10 @@ bool QQmlCodeGenerator::visit(AST::UiSourceElement *node)
if (AST::FunctionDeclaration *funDecl = AST::cast<AST::FunctionDeclaration *>(node->sourceElement)) {
_functions << funDecl;
Function *f = New<Function>();
+ f->functionDeclaration = funDecl;
+ AST::SourceLocation loc = funDecl->firstSourceLocation();
+ f->location.line = loc.startLine;
+ f->location.column = loc.startColumn;
f->index = _functions.size() - 1;
_object->functions->append(f);
} else {
@@ -844,13 +850,13 @@ void QQmlCodeGenerator::appendBinding(AST::UiQualifiedId *name, AST::Statement *
qSwap(_object, object);
}
-void QQmlCodeGenerator::appendBinding(AST::UiQualifiedId *name, int objectIndex)
+void QQmlCodeGenerator::appendBinding(AST::UiQualifiedId *name, int objectIndex, bool isOnAssignment)
{
QmlObject *object = 0;
if (!resolveQualifiedId(&name, &object))
return;
qSwap(_object, object);
- appendBinding(name->identifierToken, registerString(name->name.toString()), objectIndex);
+ appendBinding(name->identifierToken, registerString(name->name.toString()), objectIndex, /*isListItem*/false, isOnAssignment);
qSwap(_object, object);
}
@@ -873,9 +879,9 @@ void QQmlCodeGenerator::appendBinding(const AST::SourceLocation &nameLocation, i
_object->bindings->append(binding);
}
-void QQmlCodeGenerator::appendBinding(const AST::SourceLocation &nameLocation, int propertyNameIndex, int objectIndex, bool isListItem)
+void QQmlCodeGenerator::appendBinding(const AST::SourceLocation &nameLocation, int propertyNameIndex, int objectIndex, bool isListItem, bool isOnAssignment)
{
- if (!sanityCheckPropertyName(nameLocation, propertyNameIndex, isListItem))
+ if (!sanityCheckPropertyName(nameLocation, propertyNameIndex, isListItem | isOnAssignment))
return;
if (stringAt(propertyNameIndex) == QStringLiteral("id")) {
@@ -888,7 +894,16 @@ void QQmlCodeGenerator::appendBinding(const AST::SourceLocation &nameLocation, i
binding->location.line = nameLocation.startLine;
binding->location.column = nameLocation.startColumn;
binding->flags = 0;
- binding->type = QV4::CompiledData::Binding::Type_Object;
+
+ // No type name on the initializer means it must be a group property
+ if (stringAt(_objects.at(objectIndex)->inheritedTypeNameIndex).isEmpty())
+ binding->type = QV4::CompiledData::Binding::Type_GroupProperty;
+ else
+ binding->type = QV4::CompiledData::Binding::Type_Object;
+
+ if (isOnAssignment)
+ binding->flags |= QV4::CompiledData::Binding::IsOnAssignment;
+
binding->value.objectIndex = objectIndex;
_object->bindings->append(binding);
}
@@ -926,12 +941,11 @@ bool QQmlCodeGenerator::setId(AST::Statement *value)
COMPILE_EXCEPTION(loc, tr( "IDs must contain only letters, numbers, and underscores"));
}
-#if 0 // ###
- if (enginePrivate->v8engine()->illegalNames().contains(str))
- COMPILE_EXCEPTION(v, tr( "ID illegally masks global JavaScript property"));
-#endif
+ QString idQString(str.toString());
+ if (illegalNames.contains(idQString))
+ COMPILE_EXCEPTION(loc, tr( "ID illegally masks global JavaScript property"));
- _object->idIndex = registerString(str.toString());
+ _object->idIndex = registerString(idQString);
_object->locationOfIdProperty.line = loc.startLine;
_object->locationOfIdProperty.column = loc.startColumn;
@@ -970,14 +984,14 @@ bool QQmlCodeGenerator::resolveQualifiedId(AST::UiQualifiedId **nameToResolve, Q
return true;
}
-bool QQmlCodeGenerator::sanityCheckPropertyName(const AST::SourceLocation &nameLocation, int nameIndex, bool isListItem)
+bool QQmlCodeGenerator::sanityCheckPropertyName(const AST::SourceLocation &nameLocation, int nameIndex, bool isListItemOnOrAssignment)
{
const QString &name = jsGenerator->strings.at(nameIndex);
if (name.isEmpty())
return true;
// List items are implement by multiple bindings to the same name, so allow duplicates.
- if (!isListItem) {
+ if (!isListItemOnOrAssignment) {
if (_propertyNames.contains(name))
COMPILE_EXCEPTION(nameLocation, tr("Duplicate property name"));
@@ -987,13 +1001,8 @@ bool QQmlCodeGenerator::sanityCheckPropertyName(const AST::SourceLocation &nameL
if (name.at(0).isUpper())
COMPILE_EXCEPTION(nameLocation, tr("Property names cannot begin with an upper case letter"));
-#if 0 // ### how to check against illegalNames when in separate thread?
- if (enginePrivate->v8engine()->illegalNames().contains(prop.name.toString())) {
- COMPILE_EXCEPTION_LOCATION(prop.nameLocation.line,
- prop.nameLocation.column,
- tr("Illegal property name"));
- }
-#endif
+ if (illegalNames.contains(name))
+ COMPILE_EXCEPTION(nameLocation, tr("Illegal property name"));
return true;
}
@@ -1625,11 +1634,16 @@ SignalHandlerConverter::SignalHandlerConverter(QQmlEnginePrivate *enginePrivate,
bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclarations()
{
- foreach (QmlObject *obj, parsedQML->objects) {
+ for (int objectIndex = 0; objectIndex < parsedQML->objects.count(); ++objectIndex) {
+ QmlObject * const obj = parsedQML->objects.at(objectIndex);
QString elementName = stringAt(obj->inheritedTypeNameIndex);
if (elementName.isEmpty())
continue;
- QQmlPropertyCache *cache = unit->resolvedTypes[obj->inheritedTypeNameIndex].createPropertyCache(QQmlEnginePrivate::get(enginePrivate));
+ QQmlCompiledData::TypeReference &tr = unit->resolvedTypes[obj->inheritedTypeNameIndex];
+ if (tr.type && tr.type->customParser())
+ continue;
+ QQmlPropertyCache *cache = unit->propertyCaches.value(objectIndex);
+ Q_ASSERT(cache);
if (!convertSignalHandlerExpressionsToFunctionDeclarations(obj, elementName, cache))
return false;
}
@@ -1659,10 +1673,6 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
if (!QQmlCodeGenerator::isSignalPropertyName(propertyName))
continue;
- if (binding->type != QV4::CompiledData::Binding::Type_Script) {
- COMPILE_EXCEPTION(binding->location, tr("Incorrectly specified signal assignment"));
- }
-
PropertyResolver resolver(propertyCache);
Q_ASSERT(propertyName.startsWith(QStringLiteral("on")));
@@ -1731,6 +1741,10 @@ bool SignalHandlerConverter::convertSignalHandlerExpressionsToFunctionDeclaratio
parameters = entry.value();
}
+ if (binding->type != QV4::CompiledData::Binding::Type_Script) {
+ COMPILE_EXCEPTION(binding->location, tr("Incorrectly specified signal assignment"));
+ }
+
QQmlJS::Engine &jsEngine = parsedQML->jsParserEngine;
QQmlJS::MemoryPool *pool = jsEngine.pool();
diff --git a/src/qml/compiler/qqmlcodegenerator_p.h b/src/qml/compiler/qqmlcodegenerator_p.h
index 0a0e4f2d5b..f1050f4476 100644
--- a/src/qml/compiler/qqmlcodegenerator_p.h
+++ b/src/qml/compiler/qqmlcodegenerator_p.h
@@ -135,6 +135,8 @@ struct Binding : public QV4::CompiledData::Binding
struct Function
{
+ AST::FunctionDeclaration *functionDeclaration;
+ QV4::CompiledData::Location location;
int index; // index in parsedQML::functions
Function *next;
};
@@ -153,6 +155,8 @@ struct QmlObject
PoolList<Binding> *bindings;
PoolList<Function> *functions;
+ void init(QQmlJS::MemoryPool *pool, int typeNameIndex, int id, const AST::SourceLocation &location = AST::SourceLocation());
+
void dump(DebugStream &out);
};
@@ -207,7 +211,7 @@ struct Q_QML_EXPORT QQmlCodeGenerator : public AST::Visitor
{
Q_DECLARE_TR_FUNCTIONS(QQmlCodeGenerator)
public:
- QQmlCodeGenerator();
+ QQmlCodeGenerator(const QSet<QString> &illegalNames);
bool generateFromQml(const QString &code, const QUrl &url, const QString &urlString, ParsedQML *output);
static bool isSignalPropertyName(const QString &name);
@@ -253,9 +257,9 @@ public:
void setBindingValue(QV4::CompiledData::Binding *binding, AST::Statement *statement);
void appendBinding(AST::UiQualifiedId *name, AST::Statement *value);
- void appendBinding(AST::UiQualifiedId *name, int objectIndex);
+ void appendBinding(AST::UiQualifiedId *name, int objectIndex, bool isOnAssignment = false);
void appendBinding(const AST::SourceLocation &nameLocation, int propertyNameIndex, AST::Statement *value);
- void appendBinding(const AST::SourceLocation &nameLocation, int propertyNameIndex, int objectIndex, bool isListItem = false);
+ void appendBinding(const AST::SourceLocation &nameLocation, int propertyNameIndex, int objectIndex, bool isListItem = false, bool isOnAssignment = false);
bool setId(AST::Statement *value);
@@ -263,7 +267,7 @@ public:
// with the object any right-hand-side of a binding should apply to.
bool resolveQualifiedId(AST::UiQualifiedId **nameToResolve, QmlObject **object);
- bool sanityCheckPropertyName(const AST::SourceLocation &nameLocation, int nameIndex, bool isListItem = false);
+ bool sanityCheckPropertyName(const AST::SourceLocation &nameLocation, int nameIndex, bool isListItemOnOrAssignment = false);
void recordError(const AST::SourceLocation &location, const QString &description);
@@ -272,7 +276,7 @@ public:
static QQmlScript::LocationSpan location(AST::SourceLocation start, AST::SourceLocation end);
int registerString(const QString &str) const { return jsGenerator->registerString(str); }
- template <typename _Tp> _Tp *New() { return new (pool->allocate(sizeof(_Tp))) _Tp(); }
+ template <typename _Tp> _Tp *New() { return pool->New<_Tp>(); }
QString stringAt(int index) const { return jsGenerator->strings.at(index); }
@@ -280,6 +284,8 @@ public:
QList<QQmlError> errors;
+ QSet<QString> illegalNames;
+
QList<QV4::CompiledData::Import*> _imports;
QList<Pragma*> _pragmas;
QList<QmlObject*> _objects;
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
new file mode 100644
index 0000000000..d6dde63d4b
--- /dev/null
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -0,0 +1,1204 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qqmltypecompiler_p.h"
+
+#include <private/qqmlcompiler_p.h>
+#include <private/qqmlobjectcreator_p.h>
+#include <private/qqmlcustomparser_p.h>
+#include <private/qqmlvmemetaobject_p.h>
+#include <private/qqmlcomponent_p.h>
+
+#define COMPILE_EXCEPTION(token, desc) \
+ { \
+ recordError((token)->location, desc); \
+ return false; \
+ }
+
+QT_BEGIN_NAMESPACE
+
+QQmlTypeCompiler::QQmlTypeCompiler(QQmlEnginePrivate *engine, QQmlCompiledData *compiledData, QQmlTypeData *typeData, QtQml::ParsedQML *parsedQML)
+ : engine(engine)
+ , compiledData(compiledData)
+ , typeData(typeData)
+ , parsedQML(parsedQML)
+{
+}
+
+bool QQmlTypeCompiler::compile()
+{
+ compiledData->importCache = new QQmlTypeNameCache;
+
+ foreach (const QString &ns, typeData->namespaces())
+ compiledData->importCache->add(ns);
+
+ // Add any Composite Singletons that were used to the import cache
+ foreach (const QQmlTypeData::TypeReference &singleton, typeData->compositeSingletons())
+ compiledData->importCache->add(singleton.type->qmlTypeName(), singleton.type->sourceUrl(), singleton.prefix);
+
+ typeData->imports().populateCache(compiledData->importCache);
+ compiledData->importCache->addref();
+
+ const QHash<int, QQmlTypeData::TypeReference> &resolvedTypes = typeData->resolvedTypeRefs();
+ for (QHash<int, QQmlTypeData::TypeReference>::ConstIterator resolvedType = resolvedTypes.constBegin(), end = resolvedTypes.constEnd();
+ resolvedType != end; ++resolvedType) {
+ QQmlCompiledData::TypeReference ref;
+ if (resolvedType->typeData) {
+ ref.component = resolvedType->typeData->compiledData();
+ ref.component->addref();
+ } else {
+ ref.type = resolvedType->type;
+ Q_ASSERT(ref.type);
+ }
+ ref.majorVersion = resolvedType->majorVersion;
+ ref.minorVersion = resolvedType->minorVersion;
+ compiledData->resolvedTypes.insert(resolvedType.key(), ref);
+ }
+
+ // Build property caches and VME meta object data
+
+ const int objectCount = parsedQML->objects.count();
+ compiledData->datas.reserve(objectCount);
+ compiledData->propertyCaches.reserve(objectCount);
+
+ {
+ QQmlPropertyCacheCreator propertyCacheBuilder(this);
+ if (!propertyCacheBuilder.buildMetaObjects())
+ return false;
+ }
+
+ {
+ SignalHandlerConverter converter(engine, parsedQML, compiledData);
+ if (!converter.convertSignalHandlerExpressionsToFunctionDeclarations()) {
+ errors << converter.errors;
+ return false;
+ }
+ }
+
+ // Collect imported scripts
+ const QList<QQmlTypeData::ScriptReference> &scripts = typeData->resolvedScripts();
+ compiledData->scripts.reserve(scripts.count());
+ for (int scriptIndex = 0; scriptIndex < scripts.count(); ++scriptIndex) {
+ const QQmlTypeData::ScriptReference &script = scripts.at(scriptIndex);
+
+ QString qualifier = script.qualifier;
+ QString enclosingNamespace;
+
+ const int lastDotIndex = qualifier.lastIndexOf(QLatin1Char('.'));
+ if (lastDotIndex != -1) {
+ enclosingNamespace = qualifier.left(lastDotIndex);
+ qualifier = qualifier.mid(lastDotIndex+1);
+ }
+
+ compiledData->importCache->add(qualifier, scriptIndex, enclosingNamespace);
+ QQmlScriptData *scriptData = script.script->scriptData();
+ scriptData->addref();
+ compiledData->scripts << scriptData;
+ }
+
+ // Resolve component boundaries and aliases
+
+ {
+ // Scan for components, determine their scopes and resolve aliases within the scope.
+ QQmlComponentAndAliasResolver resolver(this);
+ if (!resolver.resolve())
+ return false;
+ }
+
+ // Compile JS binding expressions and signal handlers
+
+ JSCodeGen jsCodeGen(typeData->finalUrlString(), parsedQML->code, &parsedQML->jsModule, &parsedQML->jsParserEngine, parsedQML->program, compiledData->importCache);
+ const QVector<int> runtimeFunctionIndices = jsCodeGen.generateJSCodeForFunctionsAndBindings(parsedQML->functions);
+
+ QV4::ExecutionEngine *v4 = engine->v4engine();
+
+ QScopedPointer<QQmlJS::EvalInstructionSelection> isel(v4->iselFactory->create(engine, v4->executableAllocator, &parsedQML->jsModule, &parsedQML->jsGenerator));
+ isel->setUseFastLookups(false);
+ QV4::CompiledData::CompilationUnit *jsUnit = isel->compile(/*generated unit data*/false);
+
+ // Generate QML compiled type data structures
+
+ QmlUnitGenerator qmlGenerator;
+ QV4::CompiledData::QmlUnit *qmlUnit = qmlGenerator.generate(*parsedQML, runtimeFunctionIndices);
+
+ if (jsUnit) {
+ Q_ASSERT(!jsUnit->data);
+ jsUnit->ownsData = false;
+ jsUnit->data = &qmlUnit->header;
+ }
+
+ compiledData->compilationUnit = jsUnit;
+ if (compiledData->compilationUnit)
+ compiledData->compilationUnit->ref();
+ compiledData->qmlUnit = qmlUnit; // ownership transferred to m_compiledData
+
+ // Add to type registry of composites
+ if (compiledData->isCompositeType())
+ engine->registerInternalCompositeType(compiledData);
+ else {
+ const QV4::CompiledData::Object *obj = qmlUnit->objectAt(qmlUnit->indexOfRootObject);
+ QQmlCompiledData::TypeReference typeRef = compiledData->resolvedTypes.value(obj->inheritedTypeNameIndex);
+ if (typeRef.component) {
+ compiledData->metaTypeId = typeRef.component->metaTypeId;
+ compiledData->listMetaTypeId = typeRef.component->listMetaTypeId;
+ } else {
+ compiledData->metaTypeId = typeRef.type->typeId();
+ compiledData->listMetaTypeId = typeRef.type->qListTypeId();
+ }
+ }
+
+ // Sanity check property bindings
+ QQmlPropertyValidator validator(this);
+ if (!validator.validate())
+ return false;
+
+ return errors.isEmpty();
+}
+
+void QQmlTypeCompiler::recordError(const QQmlError &error)
+{
+ QQmlError e = error;
+ e.setUrl(compiledData->url);
+ errors << e;
+}
+
+QString QQmlTypeCompiler::stringAt(int idx) const
+{
+ return parsedQML->stringAt(idx);
+}
+
+int QQmlTypeCompiler::registerString(const QString &str)
+{
+ return parsedQML->jsGenerator.registerString(str);
+}
+
+const QV4::CompiledData::QmlUnit *QQmlTypeCompiler::qmlUnit() const
+{
+ return compiledData->qmlUnit;
+}
+
+const QQmlImports *QQmlTypeCompiler::imports() const
+{
+ return &typeData->imports();
+}
+
+QHash<int, QQmlCompiledData::TypeReference> *QQmlTypeCompiler::resolvedTypes()
+{
+ return &compiledData->resolvedTypes;
+}
+
+QList<QmlObject *> *QQmlTypeCompiler::qmlObjects()
+{
+ return &parsedQML->objects;
+}
+
+int QQmlTypeCompiler::rootObjectIndex() const
+{
+ return parsedQML->indexOfRootObject;
+}
+
+void QQmlTypeCompiler::setPropertyCaches(const QVector<QQmlPropertyCache *> &caches)
+{
+ Q_ASSERT(compiledData->propertyCaches.isEmpty());
+ compiledData->propertyCaches = caches;
+ Q_ASSERT(caches.count() >= parsedQML->indexOfRootObject);
+ compiledData->rootPropertyCache = caches.at(parsedQML->indexOfRootObject);
+}
+
+const QVector<QQmlPropertyCache *> &QQmlTypeCompiler::propertyCaches() const
+{
+ return compiledData->propertyCaches;
+}
+
+void QQmlTypeCompiler::setVMEMetaObjects(const QVector<QByteArray> &metaObjects)
+{
+ Q_ASSERT(compiledData->datas.isEmpty());
+ compiledData->datas = metaObjects;
+}
+
+QVector<QByteArray> *QQmlTypeCompiler::vmeMetaObjects() const
+{
+ return &compiledData->datas;
+}
+
+QHash<int, int> *QQmlTypeCompiler::objectIndexToIdForRoot()
+{
+ return &compiledData->objectIndexToIdForRoot;
+}
+
+QHash<int, QHash<int, int> > *QQmlTypeCompiler::objectIndexToIdPerComponent()
+{
+ return &compiledData->objectIndexToIdPerComponent;
+}
+
+QHash<int, QByteArray> *QQmlTypeCompiler::customParserData()
+{
+ return &compiledData->customParserData;
+}
+
+MemoryPool *QQmlTypeCompiler::memoryPool()
+{
+ return parsedQML->jsParserEngine.pool();
+}
+
+QQmlCompilePass::QQmlCompilePass(QQmlTypeCompiler *typeCompiler)
+ : compiler(typeCompiler)
+{
+}
+
+void QQmlCompilePass::recordError(const QV4::CompiledData::Location &location, const QString &description)
+{
+ QQmlError error;
+ error.setLine(location.line);
+ error.setColumn(location.column);
+ error.setDescription(description);
+ compiler->recordError(error);
+}
+
+static QAtomicInt classIndexCounter(0);
+
+QQmlPropertyCacheCreator::QQmlPropertyCacheCreator(QQmlTypeCompiler *typeCompiler)
+ : QQmlCompilePass(typeCompiler)
+ , enginePrivate(typeCompiler->enginePrivate())
+ , qmlObjects(*typeCompiler->qmlObjects())
+ , imports(typeCompiler->imports())
+ , resolvedTypes(typeCompiler->resolvedTypes())
+{
+}
+
+QQmlPropertyCacheCreator::~QQmlPropertyCacheCreator()
+{
+ for (int i = 0; i < propertyCaches.count(); ++i)
+ if (QQmlPropertyCache *cache = propertyCaches.at(i))
+ cache->release();
+ propertyCaches.clear();
+}
+
+bool QQmlPropertyCacheCreator::buildMetaObjects()
+{
+ propertyCaches.resize(qmlObjects.count());
+ vmeMetaObjects.resize(qmlObjects.count());
+
+ if (!buildMetaObjectRecursively(compiler->rootObjectIndex(), /*referencing object*/-1, /*instantiating binding*/0))
+ return false;
+
+ compiler->setVMEMetaObjects(vmeMetaObjects);
+ compiler->setPropertyCaches(propertyCaches);
+ propertyCaches.clear();
+
+ return true;
+}
+
+bool QQmlPropertyCacheCreator::buildMetaObjectRecursively(int objectIndex, int referencingObjectIndex, const QV4::CompiledData::Binding *instantiatingBinding)
+{
+ const QmlObject *obj = qmlObjects.at(objectIndex);
+
+ QQmlPropertyCache *baseTypeCache = 0;
+
+ bool needVMEMetaObject = obj->properties->count != 0 || obj->qmlSignals->count != 0 || obj->functions->count != 0;
+ if (!needVMEMetaObject) {
+ for (const QtQml::Binding *binding = obj->bindings->first; binding; binding = binding->next) {
+ if (binding->type == QV4::CompiledData::Binding::Type_Object && (binding->flags & QV4::CompiledData::Binding::IsOnAssignment)) {
+
+ // On assignments are implemented using value interceptors, which require a VME meta object.
+ needVMEMetaObject = true;
+
+ // If the on assignment is inside a group property, we need to distinguish between QObject based
+ // group properties and value type group properties. For the former the base type is derived from
+ // the property that references us, for the latter we only need a meta-object on the referencing object
+ // because interceptors can't go to the shared value type instances.
+ if (instantiatingBinding && instantiatingBinding->type == QV4::CompiledData::Binding::Type_GroupProperty) {
+ QQmlPropertyCache *parentCache = propertyCaches.at(referencingObjectIndex);
+ Q_ASSERT(parentCache);
+ Q_ASSERT(!stringAt(instantiatingBinding->propertyNameIndex).isEmpty());
+
+ bool notInRevision = false;
+ QQmlPropertyData *pd = PropertyResolver(parentCache).property(stringAt(instantiatingBinding->propertyNameIndex), &notInRevision);
+ Q_ASSERT(pd);
+ if (QQmlValueTypeFactory::isValueType(pd->propType)) {
+ needVMEMetaObject = false;
+ if (!ensureMetaObject(referencingObjectIndex))
+ return false;
+ } else if (pd->isQObject()) {
+ baseTypeCache = enginePrivate->rawPropertyCacheForType(pd->propType);
+ Q_ASSERT(baseTypeCache);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ QString typeName = stringAt(obj->inheritedTypeNameIndex);
+ if (!typeName.isEmpty()) {
+ QQmlCompiledData::TypeReference typeRef = resolvedTypes->value(obj->inheritedTypeNameIndex);
+ baseTypeCache = typeRef.createPropertyCache(QQmlEnginePrivate::get(enginePrivate));
+ Q_ASSERT(baseTypeCache);
+ }
+
+ if (needVMEMetaObject) {
+ if (!createMetaObject(objectIndex, obj, baseTypeCache))
+ return false;
+ } else if (baseTypeCache) {
+ propertyCaches[objectIndex] = baseTypeCache;
+ baseTypeCache->addref();
+ }
+
+ for (const QtQml::Binding *binding = obj->bindings->first; binding; binding = binding->next)
+ if (binding->type >= QV4::CompiledData::Binding::Type_Object)
+ if (!buildMetaObjectRecursively(binding->value.objectIndex, objectIndex, binding))
+ return false;
+
+ return true;
+}
+
+bool QQmlPropertyCacheCreator::ensureMetaObject(int objectIndex)
+{
+ if (!vmeMetaObjects.at(objectIndex).isEmpty())
+ return true;
+ const QtQml::QmlObject *obj = qmlObjects.at(objectIndex);
+ QQmlCompiledData::TypeReference typeRef = resolvedTypes->value(obj->inheritedTypeNameIndex);
+ QQmlPropertyCache *baseTypeCache = typeRef.createPropertyCache(QQmlEnginePrivate::get(enginePrivate));
+ return createMetaObject(objectIndex, obj, baseTypeCache);
+}
+
+bool QQmlPropertyCacheCreator::createMetaObject(int objectIndex, const QtQml::QmlObject *obj, QQmlPropertyCache *baseTypeCache)
+{
+ QQmlPropertyCache *cache = baseTypeCache->copyAndReserve(QQmlEnginePrivate::get(enginePrivate),
+ obj->properties->count,
+ obj->functions->count + obj->properties->count + obj->qmlSignals->count,
+ obj->qmlSignals->count + obj->properties->count);
+ propertyCaches[objectIndex] = cache;
+ cache->addref();
+
+ struct TypeData {
+ QV4::CompiledData::Property::Type dtype;
+ int metaType;
+ } builtinTypes[] = {
+ { QV4::CompiledData::Property::Var, qMetaTypeId<QJSValue>() },
+ { QV4::CompiledData::Property::Variant, QMetaType::QVariant },
+ { QV4::CompiledData::Property::Int, QMetaType::Int },
+ { QV4::CompiledData::Property::Bool, QMetaType::Bool },
+ { QV4::CompiledData::Property::Real, QMetaType::Double },
+ { QV4::CompiledData::Property::String, QMetaType::QString },
+ { QV4::CompiledData::Property::Url, QMetaType::QUrl },
+ { QV4::CompiledData::Property::Color, QMetaType::QColor },
+ { QV4::CompiledData::Property::Font, QMetaType::QFont },
+ { QV4::CompiledData::Property::Time, QMetaType::QTime },
+ { QV4::CompiledData::Property::Date, QMetaType::QDate },
+ { QV4::CompiledData::Property::DateTime, QMetaType::QDateTime },
+ { QV4::CompiledData::Property::Rect, QMetaType::QRectF },
+ { QV4::CompiledData::Property::Point, QMetaType::QPointF },
+ { QV4::CompiledData::Property::Size, QMetaType::QSizeF },
+ { QV4::CompiledData::Property::Vector2D, QMetaType::QVector2D },
+ { QV4::CompiledData::Property::Vector3D, QMetaType::QVector3D },
+ { QV4::CompiledData::Property::Vector4D, QMetaType::QVector4D },
+ { QV4::CompiledData::Property::Matrix4x4, QMetaType::QMatrix4x4 },
+ { QV4::CompiledData::Property::Quaternion, QMetaType::QQuaternion }
+ };
+ static const uint builtinTypeCount = sizeof(builtinTypes) / sizeof(TypeData);
+
+ QByteArray newClassName;
+
+ if (false /* ### compileState->root == obj && !compileState->nested*/) {
+#if 0 // ###
+ QString path = output->url.path();
+ int lastSlash = path.lastIndexOf(QLatin1Char('/'));
+ if (lastSlash > -1) {
+ QString nameBase = path.mid(lastSlash + 1, path.length()-lastSlash-5);
+ if (!nameBase.isEmpty() && nameBase.at(0).isUpper())
+ newClassName = nameBase.toUtf8() + "_QMLTYPE_" +
+ QByteArray::number(classIndexCounter.fetchAndAddRelaxed(1));
+ }
+#endif
+ }
+ if (newClassName.isEmpty()) {
+ newClassName = QQmlMetaObject(baseTypeCache).className();
+ newClassName.append("_QML_");
+ newClassName.append(QByteArray::number(classIndexCounter.fetchAndAddRelaxed(1)));
+ }
+
+ cache->_dynamicClassName = newClassName;
+
+ int aliasCount = 0;
+ int varPropCount = 0;
+
+ for (QtQml::QmlProperty *p = obj->properties->first; p; p = p->next) {
+ if (p->type == QV4::CompiledData::Property::Alias)
+ aliasCount++;
+ else if (p->type == QV4::CompiledData::Property::Var)
+ varPropCount++;
+
+#if 0 // ### Do this elsewhere
+ // No point doing this for both the alias and non alias cases
+ QQmlPropertyData *d = property(obj, p->name);
+ if (d && d->isFinal())
+ COMPILE_EXCEPTION(p, tr("Cannot override FINAL property"));
+#endif
+ }
+
+ typedef QQmlVMEMetaData VMD;
+
+ QByteArray &dynamicData = vmeMetaObjects[objectIndex] = QByteArray(sizeof(QQmlVMEMetaData)
+ + obj->properties->count * sizeof(VMD::PropertyData)
+ + obj->functions->count * sizeof(VMD::MethodData)
+ + aliasCount * sizeof(VMD::AliasData), 0);
+
+ int effectivePropertyIndex = cache->propertyIndexCacheStart;
+ int effectiveMethodIndex = cache->methodIndexCacheStart;
+
+ // For property change signal override detection.
+ // We prepopulate a set of signal names which already exist in the object,
+ // and throw an error if there is a signal/method defined as an override.
+ QSet<QString> seenSignals;
+ seenSignals << QStringLiteral("destroyed") << QStringLiteral("parentChanged") << QStringLiteral("objectNameChanged");
+ QQmlPropertyCache *parentCache = cache;
+ while ((parentCache = parentCache->parent())) {
+ if (int pSigCount = parentCache->signalCount()) {
+ int pSigOffset = parentCache->signalOffset();
+ for (int i = pSigOffset; i < pSigCount; ++i) {
+ QQmlPropertyData *currPSig = parentCache->signal(i);
+ // XXX TODO: find a better way to get signal name from the property data :-/
+ for (QQmlPropertyCache::StringCache::ConstIterator iter = parentCache->stringCache.begin();
+ iter != parentCache->stringCache.end(); ++iter) {
+ if (currPSig == (*iter).second) {
+ seenSignals.insert(iter.key());
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // First set up notify signals for properties - first normal, then var, then alias
+ enum { NSS_Normal = 0, NSS_Var = 1, NSS_Alias = 2 };
+ for (int ii = NSS_Normal; ii <= NSS_Alias; ++ii) { // 0 == normal, 1 == var, 2 == alias
+
+ if (ii == NSS_Var && varPropCount == 0) continue;
+ else if (ii == NSS_Alias && aliasCount == 0) continue;
+
+ for (QtQml::QmlProperty *p = obj->properties->first; p; p = p->next) {
+ if ((ii == NSS_Normal && (p->type == QV4::CompiledData::Property::Alias ||
+ p->type == QV4::CompiledData::Property::Var)) ||
+ ((ii == NSS_Var) && (p->type != QV4::CompiledData::Property::Var)) ||
+ ((ii == NSS_Alias) && (p->type != QV4::CompiledData::Property::Alias)))
+ continue;
+
+ quint32 flags = QQmlPropertyData::IsSignal | QQmlPropertyData::IsFunction |
+ QQmlPropertyData::IsVMESignal;
+
+ QString changedSigName = stringAt(p->nameIndex) + QLatin1String("Changed");
+ seenSignals.insert(changedSigName);
+
+ cache->appendSignal(changedSigName, flags, effectiveMethodIndex++);
+ }
+ }
+
+ // Dynamic signals
+ for (QtQml::Signal *s = obj->qmlSignals->first; s; s = s->next) {
+ const int paramCount = s->parameters->count;
+
+ QList<QByteArray> names;
+ QVarLengthArray<int, 10> paramTypes(paramCount?(paramCount + 1):0);
+
+ if (paramCount) {
+ paramTypes[0] = paramCount;
+
+ QtQml::SignalParameter *param = s->parameters->first;
+ for (int i = 0; i < paramCount; ++i, param = param->next) {
+ names.append(stringAt(param->nameIndex).toUtf8());
+ if (param->type < builtinTypeCount) {
+ // built-in type
+ paramTypes[i + 1] = builtinTypes[param->type].metaType;
+ } else {
+ // lazily resolved type
+ Q_ASSERT(param->type == QV4::CompiledData::Property::Custom);
+ const QString customTypeName = stringAt(param->customTypeNameIndex);
+ QQmlType *qmltype = 0;
+ if (!imports->resolveType(customTypeName, &qmltype, 0, 0, 0))
+ COMPILE_EXCEPTION(s, tr("Invalid signal parameter type: %1").arg(customTypeName));
+
+ if (qmltype->isComposite()) {
+ QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl());
+ Q_ASSERT(tdata);
+ Q_ASSERT(tdata->isComplete());
+
+ QQmlCompiledData *data = tdata->compiledData();
+
+ paramTypes[i + 1] = data->metaTypeId;
+
+ tdata->release();
+ } else {
+ paramTypes[i + 1] = qmltype->typeId();
+ }
+ }
+ }
+ }
+
+ ((QQmlVMEMetaData *)dynamicData.data())->signalCount++;
+
+ quint32 flags = QQmlPropertyData::IsSignal | QQmlPropertyData::IsFunction |
+ QQmlPropertyData::IsVMESignal;
+ if (paramCount)
+ flags |= QQmlPropertyData::HasArguments;
+
+ QString signalName = stringAt(s->nameIndex);
+ if (seenSignals.contains(signalName))
+ COMPILE_EXCEPTION(s, tr("Duplicate signal name: invalid override of property change signal or superclass signal"));
+ seenSignals.insert(signalName);
+
+ cache->appendSignal(signalName, flags, effectiveMethodIndex++,
+ paramCount?paramTypes.constData():0, names);
+ }
+
+
+ // Dynamic slots
+ for (QtQml::Function *s = obj->functions->first; s; s = s->next) {
+ AST::FunctionDeclaration *astFunction = s->functionDeclaration;
+
+ quint32 flags = QQmlPropertyData::IsFunction | QQmlPropertyData::IsVMEFunction;
+
+ if (astFunction->formals)
+ flags |= QQmlPropertyData::HasArguments;
+
+ QString slotName = astFunction->name.toString();
+ if (seenSignals.contains(slotName))
+ COMPILE_EXCEPTION(s, tr("Duplicate method name: invalid override of property change signal or superclass signal"));
+ // Note: we don't append slotName to the seenSignals list, since we don't
+ // protect against overriding change signals or methods with properties.
+
+ QList<QByteArray> parameterNames;
+ AST::FormalParameterList *param = astFunction->formals;
+ while (param) {
+ parameterNames << param->name.toUtf8();
+ param = param->next;
+ }
+
+ cache->appendMethod(slotName, flags, effectiveMethodIndex++, parameterNames);
+ }
+
+
+ // Dynamic properties (except var and aliases)
+ int effectiveSignalIndex = cache->signalHandlerIndexCacheStart;
+ int propertyIdx = 0;
+ for (QtQml::QmlProperty *p = obj->properties->first; p; p = p->next, ++propertyIdx) {
+
+ if (p->type == QV4::CompiledData::Property::Alias ||
+ p->type == QV4::CompiledData::Property::Var)
+ continue;
+
+ int propertyType = 0;
+ int vmePropertyType = 0;
+ quint32 propertyFlags = 0;
+
+ if (p->type < builtinTypeCount) {
+ propertyType = builtinTypes[p->type].metaType;
+ vmePropertyType = propertyType;
+
+ if (p->type == QV4::CompiledData::Property::Variant)
+ propertyFlags |= QQmlPropertyData::IsQVariant;
+ } else {
+ Q_ASSERT(p->type == QV4::CompiledData::Property::CustomList ||
+ p->type == QV4::CompiledData::Property::Custom);
+
+ QQmlType *qmltype = 0;
+ if (!imports->resolveType(stringAt(p->customTypeNameIndex), &qmltype, 0, 0, 0)) {
+ COMPILE_EXCEPTION(p, tr("Invalid property type"));
+ }
+
+ Q_ASSERT(qmltype);
+ if (qmltype->isComposite()) {
+ QQmlTypeData *tdata = enginePrivate->typeLoader.getType(qmltype->sourceUrl());
+ Q_ASSERT(tdata);
+ Q_ASSERT(tdata->isComplete());
+
+ QQmlCompiledData *data = tdata->compiledData();
+
+ if (p->type == QV4::CompiledData::Property::Custom) {
+ propertyType = data->metaTypeId;
+ vmePropertyType = QMetaType::QObjectStar;
+ } else {
+ propertyType = data->listMetaTypeId;
+ vmePropertyType = qMetaTypeId<QQmlListProperty<QObject> >();
+ }
+
+ tdata->release();
+ } else {
+ if (p->type == QV4::CompiledData::Property::Custom) {
+ propertyType = qmltype->typeId();
+ vmePropertyType = QMetaType::QObjectStar;
+ } else {
+ propertyType = qmltype->qListTypeId();
+ vmePropertyType = qMetaTypeId<QQmlListProperty<QObject> >();
+ }
+ }
+
+ if (p->type == QV4::CompiledData::Property::Custom)
+ propertyFlags |= QQmlPropertyData::IsQObjectDerived;
+ else
+ propertyFlags |= QQmlPropertyData::IsQList;
+ }
+
+ if ((!p->flags & QV4::CompiledData::Property::IsReadOnly) && p->type != QV4::CompiledData::Property::CustomList)
+ propertyFlags |= QQmlPropertyData::IsWritable;
+
+
+ QString propertyName = stringAt(p->nameIndex);
+ if (propertyIdx == obj->indexOfDefaultProperty) cache->_defaultPropertyName = propertyName;
+ cache->appendProperty(propertyName, propertyFlags, effectivePropertyIndex++,
+ propertyType, effectiveSignalIndex);
+
+ effectiveSignalIndex++;
+
+ VMD *vmd = (QQmlVMEMetaData *)dynamicData.data();
+ (vmd->propertyData() + vmd->propertyCount)->propertyType = vmePropertyType;
+ vmd->propertyCount++;
+ }
+
+ // Now do var properties
+ propertyIdx = 0;
+ for (QtQml::QmlProperty *p = obj->properties->first; p; p = p->next, ++propertyIdx) {
+
+ if (p->type != QV4::CompiledData::Property::Var)
+ continue;
+
+ quint32 propertyFlags = QQmlPropertyData::IsVarProperty;
+ if (!p->flags & QV4::CompiledData::Property::IsReadOnly)
+ propertyFlags |= QQmlPropertyData::IsWritable;
+
+ VMD *vmd = (QQmlVMEMetaData *)dynamicData.data();
+ (vmd->propertyData() + vmd->propertyCount)->propertyType = QMetaType::QVariant;
+ vmd->propertyCount++;
+ ((QQmlVMEMetaData *)dynamicData.data())->varPropertyCount++;
+
+ QString propertyName = stringAt(p->nameIndex);
+ if (propertyIdx == obj->indexOfDefaultProperty) cache->_defaultPropertyName = propertyName;
+ cache->appendProperty(propertyName, propertyFlags, effectivePropertyIndex++,
+ QMetaType::QVariant, effectiveSignalIndex);
+
+ effectiveSignalIndex++;
+ }
+
+ // Alias property count. Actual data is setup in buildDynamicMetaAliases
+ ((QQmlVMEMetaData *)dynamicData.data())->aliasCount = aliasCount;
+
+ // Dynamic slot data - comes after the property data
+ for (QtQml::Function *s = obj->functions->first; s; s = s->next) {
+ AST::FunctionDeclaration *astFunction = s->functionDeclaration;
+ int formalsCount = 0;
+ AST::FormalParameterList *param = astFunction->formals;
+ while (param) {
+ formalsCount++;
+ param = param->next;
+ }
+
+ VMD::MethodData methodData = { /* runtimeFunctionIndex*/ 0, // ###
+ formalsCount,
+ /* s->location.start.line */0 }; // ###
+
+ VMD *vmd = (QQmlVMEMetaData *)dynamicData.data();
+ VMD::MethodData &md = *(vmd->methodData() + vmd->methodCount);
+ vmd->methodCount++;
+ md = methodData;
+ }
+
+ return true;
+}
+
+QQmlComponentAndAliasResolver::QQmlComponentAndAliasResolver(QQmlTypeCompiler *typeCompiler)
+ : QQmlCompilePass(typeCompiler)
+ , enginePrivate(typeCompiler->enginePrivate())
+ , pool(typeCompiler->memoryPool())
+ , qmlObjects(typeCompiler->qmlObjects())
+ , indexOfRootObject(typeCompiler->rootObjectIndex())
+ , _componentIndex(-1)
+ , _objectIndexToIdInScope(0)
+ , resolvedTypes(typeCompiler->resolvedTypes())
+ , propertyCaches(typeCompiler->propertyCaches())
+ , vmeMetaObjectData(typeCompiler->vmeMetaObjects())
+ , objectIndexToIdForRoot(typeCompiler->objectIndexToIdForRoot())
+ , objectIndexToIdPerComponent(typeCompiler->objectIndexToIdPerComponent())
+{
+}
+
+void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QtQml::QmlObject *obj, int objectIndex)
+{
+ QQmlPropertyCache *propertyCache = propertyCaches.value(objectIndex);
+ Q_ASSERT(propertyCache);
+
+ PropertyResolver propertyResolver(propertyCache);
+
+ bool defaultPropertyQueried = false;
+ QQmlPropertyData *defaultProperty = 0;
+
+ for (QtQml::Binding *binding = obj->bindings->first; binding; binding = binding->next) {
+ if (binding->type != QV4::CompiledData::Binding::Type_Object)
+ continue;
+ if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression)
+ continue;
+
+ const QtQml::QmlObject *targetObject = qmlObjects->at(binding->value.objectIndex);
+ QQmlType *targetType = resolvedTypes->value(targetObject->inheritedTypeNameIndex).type;
+ if (targetType && targetType->metaObject() == &QQmlComponent::staticMetaObject)
+ continue;
+
+ QQmlPropertyData *pd = 0;
+ QString propertyName = stringAt(binding->propertyNameIndex);
+ if (!propertyName.isEmpty()) {
+ bool notInRevision = false;
+ pd = propertyResolver.property(propertyName, &notInRevision);
+ } else {
+ if (!defaultPropertyQueried) {
+ defaultProperty = propertyCache->defaultProperty();
+ defaultPropertyQueried = true;
+ }
+ pd = defaultProperty;
+ }
+ if (!pd || !pd->isQObject())
+ continue;
+
+ QQmlPropertyCache *pc = enginePrivate->rawPropertyCacheForType(pd->propType);
+ const QMetaObject *mo = pc->firstCppMetaObject();
+ while (mo) {
+ if (mo == &QQmlComponent::staticMetaObject)
+ break;
+ mo = mo->superClass();
+ }
+
+ if (!mo)
+ continue;
+
+ static QQmlType *componentType = QQmlMetaType::qmlType(&QQmlComponent::staticMetaObject);
+ Q_ASSERT(componentType);
+
+ QtQml::QmlObject *syntheticComponent = pool->New<QtQml::QmlObject>();
+ syntheticComponent->init(pool, compiler->registerString(QString::fromUtf8(componentType->typeName())), compiler->registerString(QString()));
+
+ if (!resolvedTypes->contains(syntheticComponent->inheritedTypeNameIndex)) {
+ QQmlCompiledData::TypeReference typeRef;
+ typeRef.type = componentType;
+ typeRef.majorVersion = componentType->majorVersion();
+ typeRef.minorVersion = componentType->minorVersion();
+ resolvedTypes->insert(syntheticComponent->inheritedTypeNameIndex, typeRef);
+ }
+
+ qmlObjects->append(syntheticComponent);
+ const int componentIndex = qmlObjects->count() - 1;
+
+ QtQml::Binding *syntheticBinding = pool->New<QtQml::Binding>();
+ *syntheticBinding = *binding;
+ syntheticBinding->type = QV4::CompiledData::Binding::Type_Object;
+ syntheticComponent->bindings->append(syntheticBinding);
+
+ binding->value.objectIndex = componentIndex;
+
+ componentRoots.append(componentIndex);
+ componentBoundaries.append(syntheticBinding->value.objectIndex);
+ }
+}
+
+bool QQmlComponentAndAliasResolver::resolve()
+{
+ // Detect real Component {} objects as well as implicitly defined components, such as
+ // someItemDelegate: Item {}
+ // In the implicit case Item is surrounded by a synthetic Component {} because the property
+ // on the left hand side is of QQmlComponent type.
+ for (int i = 0; i < qmlObjects->count(); ++i) {
+ const QtQml::QmlObject *obj = qmlObjects->at(i);
+ if (stringAt(obj->inheritedTypeNameIndex).isEmpty())
+ continue;
+
+ QQmlCompiledData::TypeReference tref = resolvedTypes->value(obj->inheritedTypeNameIndex);
+ if (!tref.type)
+ continue;
+ if (tref.type->metaObject() != &QQmlComponent::staticMetaObject) {
+ findAndRegisterImplicitComponents(obj, i);
+ continue;
+ }
+
+ componentRoots.append(i);
+
+ if (obj->functions->count > 0)
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new functions."));
+ if (obj->properties->count > 0)
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new properties."));
+ if (obj->qmlSignals->count > 0)
+ COMPILE_EXCEPTION(obj, tr("Component objects cannot declare new signals."));
+
+ if (obj->bindings->count == 0)
+ COMPILE_EXCEPTION(obj, tr("Cannot create empty component specification"));
+
+ const QtQml::Binding *rootBinding = obj->bindings->first;
+ if (rootBinding->next || rootBinding->type != QV4::CompiledData::Binding::Type_Object)
+ COMPILE_EXCEPTION(rootBinding, tr("Component elements may not contain properties other than id"));
+
+ componentBoundaries.append(rootBinding->value.objectIndex);
+ }
+
+ std::sort(componentBoundaries.begin(), componentBoundaries.end());
+
+ for (int i = 0; i < componentRoots.count(); ++i) {
+ const QtQml::QmlObject *component = qmlObjects->at(componentRoots.at(i));
+ const QtQml::Binding *rootBinding = component->bindings->first;
+
+ _componentIndex = i;
+ _idToObjectIndex.clear();
+
+ _objectIndexToIdInScope = &(*objectIndexToIdPerComponent)[componentRoots.at(i)];
+
+ _objectsWithAliases.clear();
+
+ if (!collectIdsAndAliases(rootBinding->value.objectIndex))
+ return false;
+
+ if (!resolveAliases())
+ return false;
+ }
+
+ // Collect ids and aliases for root
+ _componentIndex = -1;
+ _idToObjectIndex.clear();
+ _objectIndexToIdInScope = objectIndexToIdForRoot;
+ _objectsWithAliases.clear();
+
+ collectIdsAndAliases(indexOfRootObject);
+
+ resolveAliases();
+
+ return true;
+}
+
+bool QQmlComponentAndAliasResolver::collectIdsAndAliases(int objectIndex)
+{
+ const QtQml::QmlObject *obj = qmlObjects->at(objectIndex);
+
+ QString id = stringAt(obj->idIndex);
+ if (!id.isEmpty()) {
+ if (_idToObjectIndex.contains(obj->idIndex)) {
+ recordError(obj->locationOfIdProperty, tr("id is not unique"));
+ return false;
+ }
+ _idToObjectIndex.insert(obj->idIndex, objectIndex);
+ _objectIndexToIdInScope->insert(objectIndex, _objectIndexToIdInScope->count());
+ }
+
+ for (QtQml::QmlProperty *property = obj->properties->first; property; property = property->next) {
+ if (property->type == QV4::CompiledData::Property::Alias) {
+ _objectsWithAliases.append(objectIndex);
+ break;
+ }
+ }
+
+ for (QtQml::Binding *binding = obj->bindings->first; binding; binding = binding->next) {
+ if (binding->type != QV4::CompiledData::Binding::Type_Object
+ && binding->type != QV4::CompiledData::Binding::Type_AttachedProperty
+ && binding->type != QV4::CompiledData::Binding::Type_GroupProperty)
+ continue;
+
+ // Stop at Component boundary
+ if (std::binary_search(componentBoundaries.constBegin(), componentBoundaries.constEnd(), binding->value.objectIndex))
+ continue;
+
+ if (!collectIdsAndAliases(binding->value.objectIndex))
+ return false;
+ }
+
+ return true;
+}
+
+bool QQmlComponentAndAliasResolver::resolveAliases()
+{
+ foreach (int objectIndex, _objectsWithAliases) {
+ const QtQml::QmlObject *obj = qmlObjects->at(objectIndex);
+
+ QQmlPropertyCache *propertyCache = propertyCaches.value(objectIndex);
+ Q_ASSERT(propertyCache);
+
+ int effectiveSignalIndex = propertyCache->signalHandlerIndexCacheStart + propertyCache->propertyIndexCache.count();
+ int effectivePropertyIndex = propertyCache->propertyIndexCacheStart + propertyCache->propertyIndexCache.count();
+ int effectiveAliasIndex = 0;
+
+ const QtQml::QmlProperty *p = obj->properties->first;
+ for (int propertyIndex = 0; propertyIndex < obj->properties->count; ++propertyIndex, p = p->next) {
+ if (p->type != QV4::CompiledData::Property::Alias)
+ continue;
+
+ const int idIndex = p->aliasIdValueIndex;
+ const int targetObjectIndex = _idToObjectIndex.value(idIndex, -1);
+ if (targetObjectIndex == -1) {
+ recordError(p->aliasLocation, tr("Invalid alias reference. Unable to find id \"%1\"").arg(stringAt(idIndex)));
+ return false;
+ }
+ const int targetId = _objectIndexToIdInScope->value(targetObjectIndex, -1);
+ Q_ASSERT(targetId != -1);
+
+ const QString aliasPropertyValue = stringAt(p->aliasPropertyValueIndex);
+
+ QStringRef property;
+ QStringRef subProperty;
+
+ const int propertySeparator = aliasPropertyValue.indexOf(QLatin1Char('.'));
+ if (propertySeparator != -1) {
+ property = aliasPropertyValue.leftRef(propertySeparator);
+ subProperty = aliasPropertyValue.midRef(propertySeparator + 1);
+ } else
+ property = QStringRef(&aliasPropertyValue, 0, aliasPropertyValue.length());
+
+ int propIdx = -1;
+ int propType = 0;
+ int notifySignal = -1;
+ int flags = 0;
+ int type = 0;
+ bool writable = false;
+ bool resettable = false;
+
+ quint32 propertyFlags = QQmlPropertyData::IsAlias;
+
+ if (property.isEmpty()) {
+ const QtQml::QmlObject *targetObject = qmlObjects->at(targetObjectIndex);
+ QQmlCompiledData::TypeReference typeRef = resolvedTypes->value(targetObject->inheritedTypeNameIndex);
+
+ if (typeRef.type)
+ type = typeRef.type->typeId();
+ else
+ type = typeRef.component->metaTypeId;
+
+ flags |= QML_ALIAS_FLAG_PTR;
+ propertyFlags |= QQmlPropertyData::IsQObjectDerived;
+ } else {
+ QQmlPropertyCache *targetCache = propertyCaches.value(targetObjectIndex);
+ Q_ASSERT(targetCache);
+ QtQml::PropertyResolver resolver(targetCache);
+
+ QQmlPropertyData *targetProperty = resolver.property(property.toString());
+ if (!targetProperty || targetProperty->coreIndex > 0x0000FFFF) {
+ recordError(p->aliasLocation, tr("Invalid alias location"));
+ return false;
+ }
+
+ propIdx = targetProperty->coreIndex;
+ type = targetProperty->propType;
+
+ writable = targetProperty->isWritable();
+ resettable = targetProperty->isResettable();
+ notifySignal = targetProperty->notifyIndex;
+
+ if (!subProperty.isEmpty()) {
+ QQmlValueType *valueType = QQmlValueTypeFactory::valueType(type);
+ if (!valueType) {
+ recordError(p->aliasLocation, tr("Invalid alias location"));
+ return false;
+ }
+
+ propType = type;
+
+ int valueTypeIndex =
+ valueType->metaObject()->indexOfProperty(subProperty.toString().toUtf8().constData());
+ if (valueTypeIndex == -1) {
+ recordError(p->aliasLocation, tr("Invalid alias location"));
+ return false;
+ }
+ Q_ASSERT(valueTypeIndex <= 0x0000FFFF);
+
+ propIdx |= (valueTypeIndex << 16);
+ if (valueType->metaObject()->property(valueTypeIndex).isEnumType())
+ type = QVariant::Int;
+ else
+ type = valueType->metaObject()->property(valueTypeIndex).userType();
+
+ } else {
+ if (targetProperty->isEnum()) {
+ type = QVariant::Int;
+ } else {
+ // Copy type flags
+ propertyFlags |= targetProperty->getFlags() & QQmlPropertyData::PropTypeFlagMask;
+
+ if (targetProperty->isVarProperty())
+ propertyFlags |= QQmlPropertyData::IsQVariant;
+
+ if (targetProperty->isQObject())
+ flags |= QML_ALIAS_FLAG_PTR;
+ }
+ }
+ }
+
+ QQmlVMEMetaData::AliasData aliasData = { targetId, propIdx, propType, flags, notifySignal };
+
+ typedef QQmlVMEMetaData VMD;
+ QByteArray &dynamicData = (*vmeMetaObjectData)[objectIndex];
+ Q_ASSERT(!dynamicData.isEmpty());
+ VMD *vmd = (QQmlVMEMetaData *)dynamicData.data();
+ *(vmd->aliasData() + effectiveAliasIndex++) = aliasData;
+
+ Q_ASSERT(dynamicData.isDetached());
+
+ if (!(p->flags & QV4::CompiledData::Property::IsReadOnly) && writable)
+ propertyFlags |= QQmlPropertyData::IsWritable;
+ else
+ propertyFlags &= ~QQmlPropertyData::IsWritable;
+
+ if (resettable)
+ propertyFlags |= QQmlPropertyData::IsResettable;
+ else
+ propertyFlags &= ~QQmlPropertyData::IsResettable;
+
+ QString propertyName = stringAt(p->nameIndex);
+ if (propertyIndex == obj->indexOfDefaultProperty) propertyCache->_defaultPropertyName = propertyName;
+ propertyCache->appendProperty(propertyName, propertyFlags, effectivePropertyIndex++,
+ type, effectiveSignalIndex++);
+
+ }
+ }
+ return true;
+}
+
+
+QQmlPropertyValidator::QQmlPropertyValidator(QQmlTypeCompiler *typeCompiler)
+ : QQmlCompilePass(typeCompiler)
+ , qmlUnit(typeCompiler->qmlUnit())
+ , resolvedTypes(*typeCompiler->resolvedTypes())
+ , propertyCaches(typeCompiler->propertyCaches())
+ , objectIndexToIdPerComponent(*typeCompiler->objectIndexToIdPerComponent())
+ , customParserData(typeCompiler->customParserData())
+{
+}
+
+bool QQmlPropertyValidator::validate()
+{
+ for (quint32 i = 0; i < qmlUnit->nObjects; ++i) {
+ const QV4::CompiledData::Object *obj = qmlUnit->objectAt(i);
+ if (stringAt(obj->inheritedTypeNameIndex).isEmpty())
+ continue;
+
+ if (isComponent(i))
+ continue;
+
+ QQmlPropertyCache *propertyCache = propertyCaches.value(i);
+ Q_ASSERT(propertyCache);
+
+ if (!validateObject(obj, i, propertyCache))
+ return false;
+ }
+ return true;
+}
+
+const QQmlImports &QQmlPropertyValidator::imports() const
+{
+ return *compiler->imports();
+}
+
+bool QQmlPropertyValidator::validateObject(const QV4::CompiledData::Object *obj, int objectIndex, QQmlPropertyCache *propertyCache)
+{
+ QQmlCustomParser *customParser = 0;
+ QQmlCompiledData::TypeReference objectType = resolvedTypes.value(obj->inheritedTypeNameIndex);
+ if (objectType.type)
+ customParser = objectType.type->customParser();
+ QList<const QV4::CompiledData::Binding*> customBindings;
+
+ PropertyResolver propertyResolver(propertyCache);
+
+ QQmlPropertyData *defaultProperty = propertyCache->defaultProperty();
+
+ const QV4::CompiledData::Binding *binding = obj->bindingTable();
+ for (quint32 i = 0; i < obj->nBindings; ++i, ++binding) {
+ if (binding->type == QV4::CompiledData::Binding::Type_AttachedProperty
+ || binding->type == QV4::CompiledData::Binding::Type_GroupProperty) {
+ if (customParser)
+ customBindings << binding;
+ continue;
+ }
+
+ const QString name = stringAt(binding->propertyNameIndex);
+
+ bool bindingToDefaultProperty = false;
+
+ bool notInRevision = false;
+ QQmlPropertyData *pd = 0;
+ if (!name.isEmpty()) {
+ if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression)
+ pd = propertyResolver.signal(name, &notInRevision);
+ else
+ pd = propertyResolver.property(name, &notInRevision);
+
+ if (notInRevision) {
+ QString typeName = stringAt(obj->inheritedTypeNameIndex);
+ if (objectType.type) {
+ COMPILE_EXCEPTION(binding, tr("\"%1.%2\" is not available in %3 %4.%5.").arg(typeName).arg(name).arg(objectType.type->module()).arg(objectType.majorVersion).arg(objectType.minorVersion));
+ } else {
+ COMPILE_EXCEPTION(binding, tr("\"%1.%2\" is not available due to component versioning.").arg(typeName).arg(name));
+ }
+ }
+ } else {
+ pd = defaultProperty;
+ bindingToDefaultProperty = true;
+ }
+
+ if (!pd) {
+ if (customParser) {
+ customBindings << binding;
+ continue;
+ }
+ if (bindingToDefaultProperty) {
+ COMPILE_EXCEPTION(binding, tr("Cannot assign to non-existent default property"));
+ } else {
+ COMPILE_EXCEPTION(binding, tr("Cannot assign to non-existent property \"%1\"").arg(name));
+ }
+ }
+ }
+
+ if (customParser && !customBindings.isEmpty()) {
+ customParser->clearErrors();
+ customParser->compiler = this;
+ QByteArray data = customParser->compile(qmlUnit, customBindings);
+ customParser->compiler = 0;
+ customParserData->insert(objectIndex, data);
+ const QList<QQmlError> parserErrors = customParser->errors();
+ if (!parserErrors.isEmpty()) {
+ foreach (QQmlError error, parserErrors)
+ compiler->recordError(error);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/qml/compiler/qqmltypecompiler_p.h b/src/qml/compiler/qqmltypecompiler_p.h
new file mode 100644
index 0000000000..248cd12796
--- /dev/null
+++ b/src/qml/compiler/qqmltypecompiler_p.h
@@ -0,0 +1,201 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QQMLTYPECOMPILER_P_H
+#define QQMLTYPECOMPILER_P_H
+
+#include <qglobal.h>
+#include <qqmlerror.h>
+#include <qhash.h>
+#include <private/qqmlcompiler_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlEnginePrivate;
+class QQmlCompiledData;
+class QQmlError;
+class QQmlTypeData;
+class QQmlImports;
+
+namespace QtQml {
+struct ParsedQML;
+}
+
+namespace QV4 {
+namespace CompiledData {
+struct QmlUnit;
+struct Location;
+}
+}
+
+struct QQmlTypeCompiler
+{
+ QQmlTypeCompiler(QQmlEnginePrivate *engine, QQmlCompiledData *compiledData, QQmlTypeData *typeData, QtQml::ParsedQML *parsedQML);
+
+ bool compile();
+
+ QList<QQmlError> compilationErrors() const { return errors; }
+ void recordError(const QQmlError &error);
+
+ QString stringAt(int idx) const;
+ int registerString(const QString &str);
+
+ const QV4::CompiledData::QmlUnit *qmlUnit() const;
+
+ QQmlEnginePrivate *enginePrivate() const { return engine; }
+ const QQmlImports *imports() const;
+ QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes();
+ QList<QtQml::QmlObject*> *qmlObjects();
+ int rootObjectIndex() const;
+ void setPropertyCaches(const QVector<QQmlPropertyCache *> &caches);
+ const QVector<QQmlPropertyCache *> &propertyCaches() const;
+ void setVMEMetaObjects(const QVector<QByteArray> &metaObjects);
+ QVector<QByteArray> *vmeMetaObjects() const;
+ QHash<int, int> *objectIndexToIdForRoot();
+ QHash<int, QHash<int, int> > *objectIndexToIdPerComponent();
+ QHash<int, QByteArray> *customParserData();
+ QQmlJS::MemoryPool *memoryPool();
+
+private:
+ QList<QQmlError> errors;
+ QQmlEnginePrivate *engine;
+ QQmlCompiledData *compiledData;
+ QQmlTypeData *typeData;
+ QtQml::ParsedQML *parsedQML;
+};
+
+struct QQmlCompilePass
+{
+ virtual ~QQmlCompilePass() {}
+
+ QQmlCompilePass(QQmlTypeCompiler *typeCompiler);
+
+ QString stringAt(int idx) const { return compiler->stringAt(idx); }
+protected:
+ void recordError(const QV4::CompiledData::Location &location, const QString &description);
+
+ QQmlTypeCompiler *compiler;
+};
+
+class QQmlPropertyCacheCreator : public QQmlCompilePass
+{
+ Q_DECLARE_TR_FUNCTIONS(QQmlPropertyCacheCreator)
+public:
+ QQmlPropertyCacheCreator(QQmlTypeCompiler *typeCompiler);
+ ~QQmlPropertyCacheCreator();
+
+ bool buildMetaObjects();
+protected:
+ bool buildMetaObjectRecursively(int objectIndex, int referencingObjectIndex, const QV4::CompiledData::Binding *instantiatingBinding);
+ bool ensureMetaObject(int objectIndex);
+ bool createMetaObject(int objectIndex, const QtQml::QmlObject *obj, QQmlPropertyCache *baseTypeCache);
+
+ QQmlEnginePrivate *enginePrivate;
+ const QList<QtQml::QmlObject*> &qmlObjects;
+ const QQmlImports *imports;
+ QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes;
+ QVector<QByteArray> vmeMetaObjects;
+ QVector<QQmlPropertyCache*> propertyCaches;
+};
+
+class QQmlComponentAndAliasResolver : public QQmlCompilePass
+{
+ Q_DECLARE_TR_FUNCTIONS(QQmlAnonymousComponentResolver)
+public:
+ QQmlComponentAndAliasResolver(QQmlTypeCompiler *typeCompiler);
+
+ bool resolve();
+
+protected:
+ void findAndRegisterImplicitComponents(const QtQml::QmlObject *obj, int objectIndex);
+ bool collectIdsAndAliases(int objectIndex);
+ bool resolveAliases();
+
+ QQmlEnginePrivate *enginePrivate;
+ QQmlJS::MemoryPool *pool;
+
+ QList<QtQml::QmlObject*> *qmlObjects;
+ const int indexOfRootObject;
+
+ // indices of the objects that are actually Component {}
+ QVector<int> componentRoots;
+ // indices of objects that are the beginning of a new component
+ // scope. This is sorted and used for binary search.
+ QVector<int> componentBoundaries;
+
+ int _componentIndex;
+ QHash<int, int> _idToObjectIndex;
+ QHash<int, int> *_objectIndexToIdInScope;
+ QList<int> _objectsWithAliases;
+
+ QHash<int, QQmlCompiledData::TypeReference> *resolvedTypes;
+ const QVector<QQmlPropertyCache *> propertyCaches;
+ QVector<QByteArray> *vmeMetaObjectData;
+ QHash<int, int> *objectIndexToIdForRoot;
+ QHash<int, QHash<int, int> > *objectIndexToIdPerComponent;
+};
+
+class QQmlPropertyValidator : public QQmlCompilePass, public QQmlCustomParserCompilerBackend
+{
+ Q_DECLARE_TR_FUNCTIONS(QQmlPropertyValidator)
+public:
+ QQmlPropertyValidator(QQmlTypeCompiler *typeCompiler);
+
+ bool validate();
+
+ // Re-implemented for QQmlCustomParser
+ virtual const QQmlImports &imports() const;
+
+
+private:
+ bool validateObject(const QV4::CompiledData::Object *obj, int objectIndex, QQmlPropertyCache *propertyCache);
+
+ bool isComponent(int objectIndex) const { return objectIndexToIdPerComponent.contains(objectIndex); }
+
+ const QV4::CompiledData::QmlUnit *qmlUnit;
+ const QHash<int, QQmlCompiledData::TypeReference> &resolvedTypes;
+ const QVector<QQmlPropertyCache *> &propertyCaches;
+ const QHash<int, QHash<int, int> > objectIndexToIdPerComponent;
+ QHash<int, QByteArray> *customParserData;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQMLTYPECOMPILER_P_H
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index ce0c7abf9e..9eac0e678d 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -193,6 +193,57 @@ QString Binding::valueAsString(const Unit *unit) const
return QString();
}
+//reverse of Lexer::singleEscape()
+static QString escapedString(const QString &string)
+{
+ QString tmp = QLatin1String("\"");
+ for (int i = 0; i < string.length(); ++i) {
+ const QChar &c = string.at(i);
+ switch (c.unicode()) {
+ case 0x08:
+ tmp += QLatin1String("\\b");
+ break;
+ case 0x09:
+ tmp += QLatin1String("\\t");
+ break;
+ case 0x0A:
+ tmp += QLatin1String("\\n");
+ break;
+ case 0x0B:
+ tmp += QLatin1String("\\v");
+ break;
+ case 0x0C:
+ tmp += QLatin1String("\\f");
+ break;
+ case 0x0D:
+ tmp += QLatin1String("\\r");
+ break;
+ case 0x22:
+ tmp += QLatin1String("\\\"");
+ break;
+ case 0x27:
+ tmp += QLatin1String("\\\'");
+ break;
+ case 0x5C:
+ tmp += QLatin1String("\\\\");
+ break;
+ default:
+ tmp += c;
+ break;
+ }
+ }
+ tmp += QLatin1Char('\"');
+ return tmp;
+}
+
+QString Binding::valueAsScriptString(const Unit *unit) const
+{
+ if (type == Type_String)
+ return escapedString(unit->stringAt(stringIndex));
+ else
+ return valueAsString(unit);
+}
+
}
}
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 90f27d5f57..f9e85ef080 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -264,7 +264,7 @@ struct Function
// Qml data structures
-struct Binding
+struct Q_QML_EXPORT Binding
{
quint32 propertyNameIndex;
@@ -280,7 +280,8 @@ struct Binding
};
enum Flags {
- IsSignalHandlerExpression = 0x1
+ IsSignalHandlerExpression = 0x1,
+ IsOnAssignment = 0x2
};
quint32 flags : 16;
@@ -296,6 +297,7 @@ struct Binding
Location location;
QString valueAsString(const Unit *unit) const;
+ QString valueAsScriptString(const Unit *unit) const;
double valueAsNumber() const
{
if (type == Type_Number)
@@ -516,6 +518,8 @@ protected:
}
+Q_DECLARE_TYPEINFO(QV4::CompiledData::JSClassMember, Q_PRIMITIVE_TYPE);
+
QT_END_NAMESPACE
#endif
diff --git a/src/qml/compiler/qv4isel_masm.cpp b/src/qml/compiler/qv4isel_masm.cpp
index 35097bae49..415fdad8e9 100644
--- a/src/qml/compiler/qv4isel_masm.cpp
+++ b/src/qml/compiler/qv4isel_masm.cpp
@@ -1015,7 +1015,7 @@ void InstructionSelection::setQObjectProperty(V4IR::Expr *source, V4IR::Expr *ta
void InstructionSelection::getElement(V4IR::Expr *base, V4IR::Expr *index, V4IR::Temp *target)
{
-#if QT_POINTER_SIZE == 8
+#if 0 // QT_POINTER_SIZE == 8
V4IR::Temp *tbase = base->asTemp();
V4IR::Temp *tindex = index->asTemp();
if (tbase && tindex &&
@@ -1026,9 +1026,10 @@ void InstructionSelection::getElement(V4IR::Expr *base, V4IR::Expr *index, V4IR:
_as->urshift64(Assembler::TrustedImm32(QV4::Value::IsManaged_Shift), Assembler::ReturnValueRegister);
Assembler::Jump notManaged = _as->branch64(Assembler::NotEqual, Assembler::ReturnValueRegister, Assembler::TrustedImm64(0));
// check whether we have an object with a simple array
- Assembler::Address managedType(Assembler::ScratchRegister, qOffsetOf(QV4::Managed, flags));
+ // ### need to check we have an object first!
+ Assembler::Address managedType(Assembler::ScratchRegister, qOffsetOf(QV4::Object, arrayData) + qOffsetOf(QV4::ArrayData, flags));
_as->load8(managedType, Assembler::ReturnValueRegister);
- _as->and32(Assembler::TrustedImm32(QV4::Managed::SimpleArray), Assembler::ReturnValueRegister);
+ _as->and32(Assembler::TrustedImm32(QV4::ArrayData::SimpleArray), Assembler::ReturnValueRegister);
Assembler::Jump notSimple = _as->branch32(Assembler::Equal, Assembler::ReturnValueRegister, Assembler::TrustedImm32(0));
bool needNegativeCheck = false;
@@ -1069,12 +1070,12 @@ void InstructionSelection::getElement(V4IR::Expr *base, V4IR::Expr *index, V4IR:
// get data, ScratchRegister holds index
addr = _as->loadTempAddress(Assembler::ReturnValueRegister, tbase);
_as->load64(addr, Assembler::ReturnValueRegister);
- Address arrayDataLen(Assembler::ReturnValueRegister, qOffsetOf(Object, arrayDataLen));
+ Address dataLen(Assembler::ReturnValueRegister, qOffsetOf(Object, arrayData) + qOffsetOf(ArrayData, length));
Assembler::Jump outOfRange;
if (needNegativeCheck)
outOfRange = _as->branch32(Assembler::LessThan, Assembler::ScratchRegister, Assembler::TrustedImm32(0));
- Assembler::Jump outOfRange2 = _as->branch32(Assembler::GreaterThanOrEqual, Assembler::ScratchRegister, arrayDataLen);
- Address arrayData(Assembler::ReturnValueRegister, qOffsetOf(Object, arrayData));
+ Assembler::Jump outOfRange2 = _as->branch32(Assembler::GreaterThanOrEqual, Assembler::ScratchRegister, dataLen);
+ Address arrayData(Assembler::ReturnValueRegister, qOffsetOf(Object, arrayData) + qOffsetOf(ArrayData, data));
_as->load64(arrayData, Assembler::ReturnValueRegister);
Q_ASSERT(sizeof(Property) == (1<<4));
_as->lshift64(Assembler::TrustedImm32(4), Assembler::ScratchRegister);
diff --git a/src/qml/compiler/qv4regalloc.cpp b/src/qml/compiler/qv4regalloc.cpp
index 048aad8497..f95cd55b04 100644
--- a/src/qml/compiler/qv4regalloc.cpp
+++ b/src/qml/compiler/qv4regalloc.cpp
@@ -60,6 +60,9 @@ struct Use {
}
QT_BEGIN_NAMESPACE
+
+Q_DECLARE_TYPEINFO(Use, Q_MOVABLE_TYPE);
+
using namespace QQmlJS::V4IR;
namespace QQmlJS {
diff --git a/src/qml/debugger/qqmlprofilerservice.cpp b/src/qml/debugger/qqmlprofilerservice.cpp
index af2aea21ae..03bf464542 100644
--- a/src/qml/debugger/qqmlprofilerservice.cpp
+++ b/src/qml/debugger/qqmlprofilerservice.cpp
@@ -131,6 +131,7 @@ QQmlProfilerService::QQmlProfilerService()
QQmlProfilerService::~QQmlProfilerService()
{
+ enabled = false;
instance = 0;
}
@@ -426,153 +427,68 @@ void QQmlProfilerService::messageReceived(const QByteArray &message)
}
/*!
- * \brief QQmlVmeProfiler::Data::clear Reset to defaults
- * Reset the profiling data to defaults.
+ * \fn void QQmlVmeProfiler::Data::clear()
+ * Resets the profiling data to defaults.
*/
-void QQmlVmeProfiler::Data::clear()
-{
- url.clear();
- line = 0;
- column = 0;
- typeName.clear();
-}
/*!
- * \brief QQmlVmeProfiler::start Start profiler without data
+ * \fn bool QQmlVmeProfiler::start()
* Clears the current range data, then stops the profiler previously running in the
- * foreground if any, then starts a new one.
+ * foreground if any, then starts a new one if profiling is enabled.
+ * Returns whether the new profiler was actually started.
*/
-bool QQmlVmeProfiler::start()
-{
- if (QQmlProfilerService::enabled) {
- currentRange.clear();
- if (running)
- QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
- else
- running = true;
- QQmlProfilerService::instance->startRange(QQmlProfilerService::Creating);
- return true;
- }
- return false;
-}
/*!
- * \brief QQmlVmeProfiler::updateLocation Update current location information
- * \param url URL of file being executed
- * \param line line Curent line in file
- * \param column column Current column in file
- * Updates the current profiler's location information.
+ * \fn void QQmlVmeProfiler::updateLocation(const QUrl &url, int line, int column)
+ * Updates the current profiler's location information. \a url is the URL of
+ * file being executed, \line line is the current line in in that file, and
+ * \a column is the current column in that file.
*/
-void QQmlVmeProfiler::updateLocation(const QUrl &url, int line, int column)
-{
- if (QQmlProfilerService::enabled && running) {
- currentRange.url = url;
- currentRange.line = line;
- currentRange.column = column;
- QQmlProfilerService::instance->rangeLocation(
- QQmlProfilerService::Creating, url, line, column);
- }
-}
/*!
- * \brief QQmlVmeProfiler::updateTypeName Update current type information
- * \param typeName Type of object being created
- * Updates the current profiler's type information.
+ * \fn void QQmlVmeProfiler::updateTypeName(const QString &typename)
+ * Updates the current profiler's type information. \a typeName is the type of
+ * object being created.
*/
-void QQmlVmeProfiler::updateTypeName(const QString &typeName)
-{
- if (QQmlProfilerService::enabled && running) {
- currentRange.typeName = typeName;
- QQmlProfilerService::instance->rangeData(QQmlProfilerService::Creating, typeName);
- }
-}
/*!
- * \brief QQmlVmeProfiler::pop Pops a paused profiler from the stack and restarts it
+ * \fn bool QQmlVmeProfiler::pop()
* Stops the currently running profiler, if any, then retrieves an old one from the stack
- * of paused profilers and starts that.
+ * of paused profilers and starts that if possible.
+ * Returns whether there actually is a running profiler after that.
*/
-void QQmlVmeProfiler::pop()
-{
- if (QQmlProfilerService::enabled && ranges.count() > 0) {
- start();
- currentRange = ranges.pop();
- QQmlProfilerService::instance->rangeLocation(
- QQmlProfilerService::Creating, currentRange.url, currentRange.line, currentRange.column);
- QQmlProfilerService::instance->rangeData(QQmlProfilerService::Creating, currentRange.typeName);
- }
-}
/*!
- * \brief QQmlVmeProfiler::push Pushes the currently running profiler on the stack.
+ * \fn void QQmlVmeProfiler::push()
* Pushes the currently running profiler on the stack of paused profilers. Note: The profiler
* isn't paused here. That's a separate step. If it's never paused, but pop()'ed later that
* won't do any harm, though.
*/
-void QQmlVmeProfiler::push()
-{
- if (QQmlProfilerService::enabled && running)
- ranges.push(currentRange);
-}
/*!
- * \brief QQmlVmeProfiler::clear Stop all running profilers and clear all data.
+ * \fn void QQmlVmeProfiler::clear()
* Stops the currently running (foreground and background) profilers and removes all saved
* data about paused profilers.
*/
-void QQmlVmeProfiler::clear()
-{
- stop();
- ranges.clear();
- if (QQmlProfilerService::enabled) {
- for (int i = 0; i < backgroundRanges.count(); ++i) {
- QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
- }
- }
- backgroundRanges.clear();
- running = false;
-}
/*!
- * \brief QQmlVmeProfiler::stop Stop profiler running in the foreground, if any.
+ * \fn void QQmlVmeProfiler::stop()
+ * Stop profiler running in the foreground, if any.
*/
-void QQmlVmeProfiler::stop()
-{
- if (QQmlProfilerService::enabled && running) {
- QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
- currentRange.clear();
- running = false;
- }
-}
+
/*!
- * \brief QQmlVmeProfiler::background Push the current profiler to the background.
- * Push the profiler currently running in the foreground to the background so that it
+ * \fn void QQmlVmeProfiler::background()
+ * Pushes the profiler currently running in the foreground to the background so that it
* won't be stopped by stop() or start(). There can be multiple profilers in the background.
* You can retrieve them in reverse order by calling foreground().
*/
-void QQmlVmeProfiler::background()
-{
- if (QQmlProfilerService::enabled && running) {
- backgroundRanges.push(currentRange);
- running = false;
- }
-}
/*!
- * \brief QQmlVmeProfiler::foreground Retrieve a profiler from the background
- * Stop the profiler currently running in the foreground, if any and put the next profiler
- * from the background in its place.
+ * \fn bool QQmlVmeProfiler::foreground()
+ * Stops the profiler currently running in the foreground, if any and puts the next profiler
+ * from the background in its place if there are any profiles in the background.
+ * Returns Whethere there actually is a valid running profiler afterwards.
*/
-bool QQmlVmeProfiler::foreground()
-{
- if (QQmlProfilerService::enabled && backgroundRanges.count() > 0) {
- stop();
- currentRange = backgroundRanges.pop();
- running = true;
- return true;
- }
- return false;
-}
QT_END_NAMESPACE
diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h
index 86807eacec..1261597f1e 100644
--- a/src/qml/debugger/qqmlprofilerservice_p.h
+++ b/src/qml/debugger/qqmlprofilerservice_p.h
@@ -294,7 +294,13 @@ public:
int line;
int column;
QString typeName;
- void clear();
+ void clear()
+ {
+ url.clear();
+ line = 0;
+ column = 0;
+ typeName.clear();
+ }
};
QQmlVmeProfiler() :
@@ -307,19 +313,98 @@ public:
clear();
}
- void clear();
+ void clear()
+ {
+ stop();
+ ranges.clear();
+ if (QQmlProfilerService::enabled) {
+ for (int i = 0; i < backgroundRanges.count(); ++i) {
+ QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
+ }
+ }
+ backgroundRanges.clear();
+ running = false;
+ }
- bool start();
- void stop();
+ bool start()
+ {
+ if (QQmlProfilerService::enabled) {
+ currentRange.clear();
+ if (running)
+ QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
+ else
+ running = true;
+ QQmlProfilerService::instance->startRange(QQmlProfilerService::Creating);
+ return true;
+ }
+ return false;
+ }
- void updateLocation(const QUrl &url, int line, int column);
- void updateTypeName(const QString &typeName);
+ void stop()
+ {
+ if (QQmlProfilerService::enabled && running) {
+ QQmlProfilerService::instance->endRange(QQmlProfilerService::Creating);
+ currentRange.clear();
+ running = false;
+ }
+ }
- void pop();
- void push();
+ void updateLocation(const QUrl &url, int line, int column)
+ {
+ if (QQmlProfilerService::enabled && running) {
+ currentRange.url = url;
+ currentRange.line = line;
+ currentRange.column = column;
+ QQmlProfilerService::instance->rangeLocation(
+ QQmlProfilerService::Creating, url, line, column);
+ }
+ }
- void background();
- bool foreground();
+ void updateTypeName(const QString &typeName)
+ {
+ if (QQmlProfilerService::enabled && running) {
+ currentRange.typeName = typeName;
+ QQmlProfilerService::instance->rangeData(QQmlProfilerService::Creating, typeName);
+ }
+ }
+
+ bool pop()
+ {
+ if (QQmlProfilerService::enabled && ranges.count() > 0) {
+ start();
+ currentRange = ranges.pop();
+ QQmlProfilerService::instance->rangeLocation(
+ QQmlProfilerService::Creating, currentRange.url, currentRange.line, currentRange.column);
+ QQmlProfilerService::instance->rangeData(QQmlProfilerService::Creating, currentRange.typeName);
+ return true;
+ }
+ return false;
+ }
+
+ void push()
+ {
+ if (QQmlProfilerService::enabled && running)
+ ranges.push(currentRange);
+ }
+
+ void background()
+ {
+ if (QQmlProfilerService::enabled && running) {
+ backgroundRanges.push(currentRange);
+ running = false;
+ }
+ }
+
+ bool foreground()
+ {
+ if (QQmlProfilerService::enabled && backgroundRanges.count() > 0) {
+ stop();
+ currentRange = backgroundRanges.pop();
+ running = true;
+ return true;
+ }
+ return false;
+ }
private:
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index 6a0cf0cf6d..8e1ac38f4f 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -1049,7 +1049,7 @@ bool QJSValue::hasOwnProperty(const QString &name) const
return false;
ScopedString s(scope, engine->newIdentifier(name));
- return o->__getOwnProperty__(s);
+ return o->hasOwnProperty(s);
}
/*!
diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri
index 94983f51e5..a90cea96c2 100644
--- a/src/qml/jsruntime/jsruntime.pri
+++ b/src/qml/jsruntime/jsruntime.pri
@@ -14,6 +14,7 @@ SOURCES += \
$$PWD/qv4managed.cpp \
$$PWD/qv4internalclass.cpp \
$$PWD/qv4sparsearray.cpp \
+ $$PWD/qv4arraydata.cpp \
$$PWD/qv4arrayobject.cpp \
$$PWD/qv4argumentsobject.cpp \
$$PWD/qv4booleanobject.cpp \
@@ -58,6 +59,7 @@ HEADERS += \
$$PWD/qv4managed_p.h \
$$PWD/qv4internalclass_p.h \
$$PWD/qv4sparsearray_p.h \
+ $$PWD/qv4arraydata_p.h \
$$PWD/qv4arrayobject_p.h \
$$PWD/qv4argumentsobject_p.h \
$$PWD/qv4booleanobject_p.h \
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp
index 629c255b48..5094bafa66 100644
--- a/src/qml/jsruntime/qv4argumentsobject.cpp
+++ b/src/qml/jsruntime/qv4argumentsobject.cpp
@@ -51,8 +51,7 @@ ArgumentsObject::ArgumentsObject(CallContext *context)
, context(context)
, fullyCreated(false)
{
- type = Type_ArgumentsObject;
- flags &= ~SimpleArray;
+ setArrayType(ArrayData::Complex);
ExecutionEngine *v4 = context->engine;
Scope scope(v4);
@@ -66,14 +65,12 @@ ArgumentsObject::ArgumentsObject(CallContext *context)
memberData[CallerPropertyIndex] = pd;
arrayReserve(context->callData->argc);
- for (int i = 0; i < context->callData->argc; ++i)
- arrayData[i].value = context->callData->args[i];
- arrayDataLen = context->callData->argc;
+ arrayData->put(0, context->callData->args, context->callData->argc);
+ arrayData->setLength(context->callData->argc);
fullyCreated = true;
} else {
Q_ASSERT(CalleePropertyIndex == internalClass->find(context->engine->id_callee));
memberData[CalleePropertyIndex].value = context->function->asReturnedValue();
- isNonStrictArgumentsObject = true;
}
Q_ASSERT(LengthPropertyIndex == internalClass->find(context->engine->id_length));
Property *lp = memberData + ArrayObject::LengthPropertyIndex;
@@ -95,18 +92,18 @@ void ArgumentsObject::fullyCreate()
uint numAccessors = qMin((int)context->function->formalParameterCount, context->realArgumentCount);
uint argCount = qMin(context->realArgumentCount, context->callData->argc);
arrayReserve(argCount);
- ensureArrayAttributes();
+ arrayData->ensureAttributes();
context->engine->requireArgumentsAccessors(numAccessors);
for (uint i = 0; i < (uint)numAccessors; ++i) {
mappedArguments.append(context->callData->args[i]);
- arrayData[i] = context->engine->argumentsAccessors.at(i);
- arrayAttributes[i] = Attr_Accessor;
+ arrayData->data[i] = context->engine->argumentsAccessors.at(i);
+ arrayData->setAttributes(i, Attr_Accessor);
}
- for (uint i = numAccessors; i < argCount; ++i) {
- arrayData[i] = Property::fromValue(context->callData->args[i]);
- arrayAttributes[i] = Attr_Data;
- }
- arrayDataLen = argCount;
+ arrayData->setLength(numAccessors);
+ arrayData->put(numAccessors, context->callData->args + numAccessors, argCount - numAccessors);
+ for (uint i = numAccessors; i < argCount; ++i)
+ arrayData->setAttributes(i, Attr_Data);
+ arrayData->setLength(argCount);
fullyCreated = true;
}
@@ -116,27 +113,24 @@ bool ArgumentsObject::defineOwnProperty(ExecutionContext *ctx, uint index, const
fullyCreate();
Scope scope(ctx);
- uint pidx = propertyIndexFromArrayIndex(index);
- Property *pd = arrayData + pidx;
+ Property *pd = arrayData->getProperty(index);
Property map;
PropertyAttributes mapAttrs;
bool isMapped = false;
if (pd && index < (uint)mappedArguments.size())
- isMapped = arrayAttributes && arrayAttributes[pidx].isAccessor() && pd->getter() == context->engine->argumentsAccessors.at(index).getter();
+ isMapped = arrayData->attributes(index).isAccessor() && pd->getter() == context->engine->argumentsAccessors.at(index).getter();
if (isMapped) {
map = *pd;
- mapAttrs = arrayAttributes[pidx];
- arrayAttributes[pidx] = Attr_Data;
+ mapAttrs = arrayData->attributes(index);
+ arrayData->setAttributes(index, Attr_Data);
pd->value = mappedArguments.at(index);
}
- isNonStrictArgumentsObject = false;
bool strict = ctx->strictMode;
ctx->strictMode = false;
- bool result = Object::__defineOwnProperty__(ctx, index, desc, attrs);
+ bool result = Object::defineOwnProperty2(ctx, index, desc, attrs);
ctx->strictMode = strict;
- isNonStrictArgumentsObject = true;
if (isMapped && attrs.isData()) {
ScopedCallData callData(scope, 1);
@@ -146,7 +140,7 @@ bool ArgumentsObject::defineOwnProperty(ExecutionContext *ctx, uint index, const
if (attrs.isWritable()) {
*pd = map;
- arrayAttributes[pidx] = mapAttrs;
+ arrayData->setAttributes(index, mapAttrs);
}
}
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h
index d306fae92b..42b749cbb5 100644
--- a/src/qml/jsruntime/qv4argumentsobject_p.h
+++ b/src/qml/jsruntime/qv4argumentsobject_p.h
@@ -77,12 +77,17 @@ struct ArgumentsSetterFunction: FunctionObject
struct ArgumentsObject: Object {
Q_MANAGED
+ Q_MANAGED_TYPE(ArgumentsObject)
CallContext *context;
bool fullyCreated;
QVector<SafeValue> mappedArguments;
ArgumentsObject(CallContext *context);
~ArgumentsObject() {}
+ static bool isNonStrictArgumentsObject(Managed *m) {
+ return m->internalClass->vtable->type == Type_ArgumentsObject &&
+ !static_cast<ArgumentsObject *>(m)->context->strictMode;
+ }
enum {
LengthPropertyIndex = 0,
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
new file mode 100644
index 0000000000..0ec36bd9db
--- /dev/null
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -0,0 +1,563 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include "qv4arraydata_p.h"
+#include "qv4object_p.h"
+#include "qv4functionobject_p.h"
+
+using namespace QV4;
+
+const ArrayVTable ArrayData::static_vtbl =
+{
+ ArrayData::Simple,
+ ArrayData::freeData,
+ ArrayData::reserve,
+ ArrayData::get,
+ ArrayData::put,
+ ArrayData::putArray,
+ ArrayData::del,
+ ArrayData::setAttribute,
+ ArrayData::attribute,
+ ArrayData::push_front,
+ ArrayData::pop_front,
+ ArrayData::truncate
+};
+
+const ArrayVTable SparseArrayData::static_vtbl =
+{
+ ArrayData::Sparse,
+ SparseArrayData::freeData,
+ SparseArrayData::reserve,
+ SparseArrayData::get,
+ SparseArrayData::put,
+ SparseArrayData::putArray,
+ SparseArrayData::del,
+ SparseArrayData::setAttribute,
+ SparseArrayData::attribute,
+ SparseArrayData::push_front,
+ SparseArrayData::pop_front,
+ SparseArrayData::truncate
+};
+
+
+void ArrayData::getHeadRoom(ArrayData *d)
+{
+ Q_ASSERT(d);
+ Q_ASSERT(!d->offset);
+ d->offset = qMax(d->len >> 2, (uint)16);
+ Property *newArray = new Property[d->offset + d->alloc];
+ memcpy(newArray + d->offset, d->data, d->len*sizeof(Property));
+ delete [] d->data;
+ d->data = newArray + d->offset;
+ if (d->attrs) {
+ PropertyAttributes *newAttrs = new PropertyAttributes[d->offset + d->alloc];
+ memcpy(newAttrs + d->offset, d->attrs, d->len*sizeof(PropertyAttributes));
+ delete [] d->attrs;
+ d->attrs = newAttrs + d->offset;
+ }
+}
+
+void ArrayData::reserve(ArrayData *d, uint n)
+{
+ if (n < 8)
+ n = 8;
+ if (n <= d->alloc)
+ return;
+
+ d->alloc = qMax(n, 2*d->alloc);
+ Property *newArrayData = new Property[d->alloc + d->offset];
+ if (d->data) {
+ memcpy(newArrayData + d->offset, d->data, sizeof(Property)*d->len);
+ delete [] (d->data - d->offset);
+ }
+ d->data = newArrayData + d->offset;
+
+ if (d->attrs) {
+ PropertyAttributes *newAttrs = new PropertyAttributes[d->alloc];
+ memcpy(newAttrs, d->attrs, sizeof(PropertyAttributes)*d->len);
+ delete [] (d->attrs - d->offset);
+
+ d->attrs = newAttrs;
+ }
+}
+
+void ArrayData::ensureAttributes()
+{
+ if (attrs)
+ return;
+
+ if (type == Simple)
+ type = Complex;
+ attrs = new PropertyAttributes[alloc + offset];
+ attrs += offset;
+ for (uint i = 0; i < len; ++i)
+ attrs[i] = Attr_Data;
+}
+
+
+void ArrayData::freeData(ArrayData *d)
+{
+ delete [] (d->data - d->offset);
+ if (d->attrs)
+ delete [] (d->attrs - d->offset);
+ delete d;
+}
+
+ReturnedValue ArrayData::get(const ArrayData *d, uint index)
+{
+ if (index >= d->len)
+ return Primitive::emptyValue().asReturnedValue();
+ return d->data[index].value.asReturnedValue();
+}
+
+bool ArrayData::put(ArrayData *d, uint index, ValueRef value)
+{
+ Q_ASSERT(!d->attrs || !d->attrs->isAccessor());
+ // ### honour attributes
+ d->data[index].value = value;
+ return true;
+}
+
+bool ArrayData::del(ArrayData *d, uint index)
+{
+ if (index >= d->len)
+ return true;
+
+ if (!d->attrs || d->attrs[index].isConfigurable()) {
+ d->data[index].value = Primitive::emptyValue();
+ if (d->attrs)
+ d->attrs[index] = Attr_Data;
+ return true;
+ }
+ if (d->data[index].value.isEmpty())
+ return true;
+ return false;
+}
+
+void ArrayData::setAttribute(ArrayData *d, uint index, PropertyAttributes attrs)
+{
+ d->attrs[index] = attrs;
+}
+
+PropertyAttributes ArrayData::attribute(const ArrayData *d, uint index)
+{
+ return d->attrs[index];
+}
+
+void ArrayData::push_front(ArrayData *d, SafeValue *values, uint n)
+{
+ Q_ASSERT(!d->attrs);
+ for (int i = n - 1; i >= 0; --i) {
+ if (!d->offset)
+ ArrayData::getHeadRoom(d);
+
+ --d->offset;
+ --d->data;
+ ++d->len;
+ ++d->alloc;
+ d->data->value = values[i].asReturnedValue();
+ }
+
+}
+
+ReturnedValue ArrayData::pop_front(ArrayData *d)
+{
+ Q_ASSERT(!d->attrs);
+ if (!d->len)
+ return Encode::undefined();
+
+ ReturnedValue v = d->data[0].value.isEmpty() ? Encode::undefined() : d->data[0].value.asReturnedValue();
+ ++d->offset;
+ ++d->data;
+ --d->len;
+ --d->alloc;
+ return v;
+}
+
+uint ArrayData::truncate(ArrayData *d, uint newLen)
+{
+ if (d->attrs) {
+ Property *it = d->data + d->len;
+ const Property *begin = d->data + newLen;
+ while (--it >= begin) {
+ if (!it->value.isEmpty() && !d->attrs[it - d->data].isConfigurable()) {
+ newLen = it - d->data + 1;
+ break;
+ }
+ it->value = Primitive::emptyValue();
+ }
+ }
+ d->len = newLen;
+ return newLen;
+}
+
+bool ArrayData::putArray(ArrayData *d, uint index, SafeValue *values, uint n)
+{
+ if (index + n > d->alloc)
+ reserve(d, index + n + 1);
+ for (uint i = d->len; i < index; ++i)
+ d->data[i].value = Primitive::emptyValue();
+ for (uint i = 0; i < n; ++i)
+ d->data[index + i].value = values[i];
+ d->len = qMax(d->len, index + n);
+ return true;
+}
+
+void SparseArrayData::free(ArrayData *d, uint idx)
+{
+ Q_ASSERT(d && d->type == ArrayData::Sparse);
+ SparseArrayData *dd = static_cast<SparseArrayData *>(d);
+ Property &pd = dd->data[idx];
+ pd.value.uint_32 = dd->freeList;
+ dd->freeList = idx;
+ if (dd->attrs)
+ dd->attrs[idx].clear();
+}
+
+
+void SparseArrayData::freeData(ArrayData *d)
+{
+ delete static_cast<SparseArrayData *>(d)->sparse;
+ ArrayData::freeData(d);
+}
+
+void SparseArrayData::reserve(ArrayData *d, uint n)
+{
+ if (n < 8)
+ n = 8;
+ if (n <= d->alloc)
+ return;
+
+ SparseArrayData *dd = static_cast<SparseArrayData *>(d);
+ // ### FIXME
+ dd->len = dd->alloc;
+ dd->alloc = qMax(n, 2*dd->alloc);
+ Property *newArrayData = new Property[dd->alloc];
+ if (dd->data) {
+ memcpy(newArrayData, dd->data, sizeof(Property)*dd->len);
+ delete [] dd->data;
+ }
+ dd->data = newArrayData;
+ if (dd->attrs) {
+ PropertyAttributes *newAttrs = new PropertyAttributes[dd->alloc];
+ memcpy(newAttrs, dd->attrs, sizeof(PropertyAttributes)*dd->len);
+ delete [] dd->attrs;
+ dd->attrs = newAttrs;
+ }
+ for (uint i = dd->freeList; i < dd->alloc; ++i)
+ dd->data[i].value = Primitive::fromInt32(i + 1);
+}
+
+uint SparseArrayData::allocate(ArrayData *d)
+{
+ Q_ASSERT(d->type == ArrayData::Sparse);
+ SparseArrayData *dd = static_cast<SparseArrayData *>(d);
+ uint idx = dd->freeList;
+ if (dd->alloc == dd->freeList)
+ reserve(d, d->alloc + 1);
+ dd->freeList = dd->data[dd->freeList].value.uint_32;
+ if (dd->attrs)
+ dd->attrs[idx].setType(PropertyAttributes::Data);
+ return idx;
+}
+
+ReturnedValue SparseArrayData::get(const ArrayData *d, uint index)
+{
+ SparseArrayNode *n = static_cast<const SparseArrayData *>(d)->sparse->findNode(index);
+ if (!n)
+ return Primitive::emptyValue().asReturnedValue();
+ return d->data[n->value].value.asReturnedValue();
+}
+
+bool SparseArrayData::put(ArrayData *d, uint index, ValueRef value)
+{
+ // ### honour attributes
+ SparseArrayNode *n = static_cast<SparseArrayData *>(d)->sparse->insert(index);
+ if (n->value == UINT_MAX)
+ n->value = allocate(d);
+ d->data[n->value].value = value;
+ return true;
+}
+
+bool SparseArrayData::del(ArrayData *d, uint index)
+{
+ SparseArrayData *dd = static_cast<SparseArrayData *>(d);
+ SparseArrayNode *n = dd->sparse->findNode(index);
+ if (!n)
+ return true;
+
+ uint pidx = n->value;
+ Q_ASSERT(!dd->data[pidx].value.isEmpty());
+
+ if (!dd->attrs || dd->attrs[pidx].isConfigurable()) {
+ d->data[pidx].value.int_32 = static_cast<SparseArrayData *>(d)->freeList;
+ static_cast<SparseArrayData *>(d)->freeList = pidx;
+ static_cast<SparseArrayData *>(d)->sparse->erase(n);
+ return true;
+ }
+ return false;
+}
+
+void SparseArrayData::setAttribute(ArrayData *d, uint index, PropertyAttributes attrs)
+{
+ SparseArrayNode *n = static_cast<SparseArrayData *>(d)->sparse->insert(index);
+ if (n->value == UINT_MAX)
+ n->value = allocate(d);
+ d->attrs[n->value] = attrs;
+}
+
+PropertyAttributes SparseArrayData::attribute(const ArrayData *d, uint index)
+{
+ SparseArrayNode *n = static_cast<const SparseArrayData *>(d)->sparse->insert(index);
+ if (!n)
+ return PropertyAttributes();
+ return d->attrs[n->value];
+}
+
+void SparseArrayData::push_front(ArrayData *d, SafeValue *values, uint n)
+{
+ Q_ASSERT(!d->attrs);
+ for (int i = n - 1; i >= 0; --i) {
+ uint idx = allocate(d);
+ d->data[idx].value = values[i];
+ static_cast<SparseArrayData *>(d)->sparse->push_front(idx);
+ }
+}
+
+ReturnedValue SparseArrayData::pop_front(ArrayData *d)
+{
+ Q_ASSERT(!d->attrs);
+ uint idx = static_cast<SparseArrayData *>(d)->sparse->pop_front();
+ ReturnedValue v;
+ if (idx != UINT_MAX) {
+ v = d->data[idx].value.asReturnedValue();
+ SparseArrayData::free(d, idx);
+ } else {
+ v = Encode::undefined();
+ }
+ return v;
+}
+
+uint SparseArrayData::truncate(ArrayData *d, uint newLen)
+{
+ SparseArrayNode *begin = static_cast<SparseArrayData *>(d)->sparse->lowerBound(newLen);
+ if (begin != static_cast<SparseArrayData *>(d)->sparse->end()) {
+ SparseArrayNode *it = static_cast<SparseArrayData *>(d)->sparse->end()->previousNode();
+ while (1) {
+ Property &pd = d->data[it->value];
+ if (d->attrs) {
+ if (!d->attrs[it->value].isConfigurable()) {
+ newLen = it->key() + 1;
+ break;
+ }
+ }
+ pd.value.tag = Value::Empty_Type;
+ pd.value.int_32 = static_cast<SparseArrayData *>(d)->freeList;
+ static_cast<SparseArrayData *>(d)->freeList = it->value;
+ bool brk = (it == begin);
+ SparseArrayNode *prev = it->previousNode();
+ static_cast<SparseArrayData *>(d)->sparse->erase(it);
+ if (brk)
+ break;
+ it = prev;
+ }
+ }
+ return newLen;
+}
+
+bool SparseArrayData::putArray(ArrayData *d, uint index, SafeValue *values, uint n)
+{
+ for (uint i = 0; i < n; ++i)
+ put(d, index + i, values[i]);
+ d->len = qMax(d->len, index + n);
+ return true;
+}
+
+
+uint ArrayData::append(Object *o, const ArrayObject *otherObj, uint n)
+{
+ ArrayData *d = o->arrayData;
+ if (!n)
+ return d->len;
+
+ const ArrayData *other = otherObj->arrayData;
+
+ if (other->isSparse()) {
+ o->initSparseArray();
+ d = o->arrayData;
+ }
+
+ uint oldSize = d->len;
+
+ // ### copy attributes as well!
+ if (d->type == ArrayData::Sparse) {
+ if (other->isSparse()) {
+ for (const SparseArrayNode *it = static_cast<const SparseArrayData *>(other)->sparse->begin();
+ it != static_cast<const SparseArrayData *>(other)->sparse->end(); it = it->nextNode())
+ // ### accessor properties
+ o->arraySet(d->len + it->key(), other->data[it->value].value);
+ } else {
+ d->vtable->reserve(d, oldSize + n);
+ memcpy(d->data + oldSize, other->data, n*sizeof(Property));
+ if (d->attrs)
+ std::fill(d->attrs + oldSize, d->attrs + oldSize + n, PropertyAttributes(Attr_Data));
+ for (uint i = 0; i < n; ++i) {
+ SparseArrayNode *n = static_cast<SparseArrayData *>(d)->sparse->insert(d->len + i);
+ n->value = oldSize + i;
+ }
+ }
+ } else if (other->length()) {
+ d->vtable->reserve(d, oldSize + other->length());
+ if (oldSize > d->len) {
+ for (uint i = d->len; i < oldSize; ++i)
+ d->data[i].value = Primitive::emptyValue();
+ }
+ if (other->attrs) {
+ for (uint i = 0; i < other->len; ++i) {
+ bool exists;
+ d->data[oldSize + i].value = const_cast<ArrayObject *>(otherObj)->getIndexed(i, &exists);
+ d->len = oldSize + i + 1;
+ o->arrayData->setAttributes(oldSize + i, Attr_Data);
+ if (!exists)
+ d->data[oldSize + i].value = Primitive::emptyValue();
+ }
+ } else {
+ d->len = oldSize + other->len;
+ memcpy(d->data + oldSize, other->data, other->len*sizeof(Property));
+ if (d->attrs)
+ std::fill(d->attrs + oldSize, d->attrs + oldSize + other->len, PropertyAttributes(Attr_Data));
+ }
+ }
+
+ return oldSize + n;
+}
+
+Property *ArrayData::insert(Object *o, uint index)
+{
+ Property *pd;
+ if (o->arrayData->type != ArrayData::Sparse && (index < 0x1000 || index < o->arrayData->len + (o->arrayData->len >> 2))) {
+ if (index >= o->arrayData->alloc)
+ o->arrayReserve(index + 1);
+ if (index >= o->arrayData->len) {
+ // mark possible hole in the array
+ for (uint i = o->arrayData->len; i < index; ++i)
+ o->arrayData->data[i].value = Primitive::emptyValue();
+ o->arrayData->len = index + 1;
+ }
+ pd = o->arrayData->data + index;
+ } else {
+ o->initSparseArray();
+ SparseArrayNode *n = static_cast<SparseArrayData *>(o->arrayData)->sparse->insert(index);
+ if (n->value == UINT_MAX)
+ n->value = SparseArrayData::allocate(o->arrayData);
+ pd = o->arrayData->data + n->value;
+ }
+ return pd;
+}
+
+void ArrayData::markObjects(ExecutionEngine *e)
+{
+ if (type == ArrayData::Simple) {
+ for (uint i = 0; i < len; ++i)
+ data[i].value.mark(e);
+ return;
+ } else {
+ for (uint i = 0; i < len; ++i) {
+ const Property &pd = data[i];
+ if (attrs && attrs[i].isAccessor()) {
+ if (pd.getter())
+ pd.getter()->mark(e);
+ if (pd.setter())
+ pd.setter()->mark(e);
+ } else {
+ pd.value.mark(e);
+ }
+ }
+ }
+
+}
+
+void ArrayData::sort(ExecutionContext *context, ObjectRef thisObject, const ValueRef comparefn, uint len)
+{
+ ArrayData *d = thisObject->arrayData;
+ if (!d || !d->len)
+ return;
+
+ if (d->type == ArrayData::Sparse) {
+ context->throwUnimplemented(QStringLiteral("Object::sort unimplemented for sparse arrays"));
+ return;
+ }
+
+ if (len > d->len)
+ len = d->len;
+
+ // The spec says the sorting goes through a series of get,put and delete operations.
+ // this implies that the attributes don't get sorted around.
+ // behavior of accessor properties is implementation defined. We simply turn them all
+ // into data properties and then sort. This is in line with the sentence above.
+ if (d->attrs) {
+ for (uint i = 0; i < len; i++) {
+ if (d->data[i].value.isEmpty()) {
+ while (--len > i)
+ if (!d->data[len].value.isEmpty())
+ break;
+ d->data[i].value = thisObject->getValue(d->data + len, d->attrs ? d->attrs[len] : Attr_Data);
+ if (d->attrs)
+ d->attrs[i] = Attr_Data;
+ d->data[len].value = Primitive::emptyValue();
+ } else if (d->attrs && d->attrs[i].isAccessor()) {
+ d->data[i].value = thisObject->getValue(d->data + i, d->attrs[i]);
+ d->attrs[i] = Attr_Data;
+ }
+ }
+ }
+
+ if (!(comparefn->isUndefined() || comparefn->asObject())) {
+ context->throwTypeError();
+ return;
+ }
+
+ ArrayElementLessThan lessThan(context, thisObject, comparefn);
+
+ if (!len)
+ return;
+ Property *begin = d->data;
+ std::sort(begin, begin + len, lessThan);
+}
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h
new file mode 100644
index 0000000000..98968fada2
--- /dev/null
+++ b/src/qml/jsruntime/qv4arraydata_p.h
@@ -0,0 +1,242 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QV4ARRAYDATA_H
+#define QV4ARRAYDATA_H
+
+#include "qv4global_p.h"
+#include "qv4managed_p.h"
+#include "qv4property_p.h"
+#include "qv4sparsearray_p.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace QV4 {
+
+struct ArrayData;
+
+struct ArrayVTable
+{
+ uint type;
+ void (*freeData)(ArrayData *d);
+ void (*reserve)(ArrayData *d, uint n);
+ ReturnedValue (*get)(const ArrayData *d, uint index);
+ bool (*put)(ArrayData *d, uint index, ValueRef value);
+ bool (*putArray)(ArrayData *d, uint index, SafeValue *values, uint n);
+ bool (*del)(ArrayData *d, uint index);
+ void (*setAttribute)(ArrayData *d, uint index, PropertyAttributes attrs);
+ PropertyAttributes (*attribute)(const ArrayData *d, uint index);
+ void (*push_front)(ArrayData *d, SafeValue *values, uint n);
+ ReturnedValue (*pop_front)(ArrayData *d);
+ uint (*truncate)(ArrayData *d, uint newLen);
+};
+
+
+struct Q_QML_EXPORT ArrayData
+{
+ ArrayData()
+ : vtable(&static_vtbl)
+ , offset(0)
+ , len(0)
+ , alloc(0)
+ , type(0)
+ , attrs(0)
+ , data(0)
+ {
+ }
+
+ enum Type {
+ Simple = 0,
+ Complex = 1,
+ Sparse = 2,
+ Custom = 3
+ };
+
+ const ArrayVTable *vtable;
+ uint offset;
+ uint len;
+ uint alloc;
+ uint type;
+ PropertyAttributes *attrs;
+ Property *data;
+
+ bool isSparse() const { return this && type == Sparse; }
+
+ uint length() const {
+ return this ? len : 0;
+ }
+ void setLength(uint l) {
+ Q_ASSERT(this);
+ len = l;
+ }
+
+ bool hasAttributes() const {
+ return this && attrs;
+ }
+ void ensureAttributes();
+ PropertyAttributes attributes(int i) const {
+ Q_ASSERT(this);
+ return attrs ? vtable->attribute(this, i) : Attr_Data;
+ }
+ void setAttributes(uint i, PropertyAttributes a) {
+ Q_ASSERT(this);
+ if (attrs || a != Attr_Data) {
+ ensureAttributes();
+ a.resolve();
+ vtable->setAttribute(this, i, a);
+ }
+ }
+
+ bool isEmpty(uint i) const {
+ if (!this)
+ return true;
+ return (vtable->get(this, i) == Primitive::emptyValue().asReturnedValue());
+ }
+
+
+ inline void free() {
+ vtable->freeData(this);
+ }
+
+ inline void push_front(SafeValue *values, uint nValues) {
+ vtable->push_front(this, values, nValues);
+ }
+ inline ReturnedValue pop_front() {
+ return vtable->pop_front(this);
+ }
+ inline uint push_back(uint l, uint n, SafeValue *values) {
+ vtable->putArray(this, l, values, n);
+ return len;
+ }
+ inline bool deleteIndex(uint index) {
+ return vtable->del(this, index);
+ }
+ inline uint truncate(uint newLen) {
+ if (!this || len < newLen)
+ return newLen;
+ return vtable->truncate(this, newLen);
+ }
+ bool put(uint index, ValueRef value) {
+ return vtable->put(this, index, value);
+ }
+ bool put(uint index, SafeValue *values, uint n) {
+ return vtable->putArray(this, index, values, n);
+ }
+ ReturnedValue get(uint i) const {
+ if (!this)
+ return Primitive::emptyValue().asReturnedValue();
+ return vtable->get(this, i);
+ }
+ inline Property *getProperty(uint index) const;
+
+
+
+ static void sort(ExecutionContext *context, ObjectRef thisObject, const ValueRef comparefn, uint dataLen);
+ static uint append(Object *o, const ArrayObject *otherObj, uint n);
+ static Property *insert(Object *o, uint index);
+ void markObjects(ExecutionEngine *e);
+
+ static void getHeadRoom(ArrayData *d);
+ static void reserve(ArrayData *d, uint n);
+
+ static void freeData(ArrayData *d);
+ static ReturnedValue get(const ArrayData *d, uint index);
+ static bool put(ArrayData *d, uint index, ValueRef value);
+ static bool putArray(ArrayData *d, uint index, SafeValue *values, uint n);
+ static bool del(ArrayData *d, uint index);
+ static void setAttribute(ArrayData *d, uint index, PropertyAttributes attrs);
+ static PropertyAttributes attribute(const ArrayData *d, uint index);
+ static void push_front(ArrayData *d, SafeValue *values, uint n);
+ static ReturnedValue pop_front(ArrayData *d);
+ static uint truncate(ArrayData *d, uint newLen);
+
+ static const ArrayVTable static_vtbl;
+};
+
+struct Q_QML_EXPORT SparseArrayData : public ArrayData
+{
+ SparseArrayData()
+ : freeList(0)
+ , sparse(0)
+ { vtable = &static_vtbl; }
+
+ uint freeList;
+ SparseArray *sparse;
+
+ static uint allocate(ArrayData *d);
+ static void free(ArrayData *d, uint idx);
+
+ static void freeData(ArrayData *d);
+ static void reserve(ArrayData *d, uint n);
+ static ReturnedValue get(const ArrayData *d, uint index);
+ static bool put(ArrayData *d, uint index, ValueRef value);
+ static bool putArray(ArrayData *d, uint index, SafeValue *values, uint n);
+ static bool del(ArrayData *d, uint index);
+ static void setAttribute(ArrayData *d, uint index, PropertyAttributes attrs);
+ static PropertyAttributes attribute(const ArrayData *d, uint index);
+ static void push_front(ArrayData *d, SafeValue *values, uint n);
+ static ReturnedValue pop_front(ArrayData *d);
+ static uint truncate(ArrayData *d, uint newLen);
+
+ static const ArrayVTable static_vtbl;
+};
+
+
+inline Property *ArrayData::getProperty(uint index) const
+{
+ if (!this)
+ return 0;
+ if (type != Sparse) {
+ if (index >= len || data[index].value.isEmpty())
+ return 0;
+ return data + index;
+ } else {
+ SparseArrayNode *n = static_cast<const SparseArrayData *>(this)->sparse->findNode(index);
+ if (!n)
+ return 0;
+ return data + n->value;
+ }
+}
+
+}
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp
index 296471692c..eb8a5301de 100644
--- a/src/qml/jsruntime/qv4arrayobject.cpp
+++ b/src/qml/jsruntime/qv4arrayobject.cpp
@@ -72,9 +72,8 @@ ReturnedValue ArrayCtor::construct(Managed *m, CallData *callData)
} else {
len = callData->argc;
a->arrayReserve(len);
- for (unsigned int i = 0; i < len; ++i)
- a->arrayData[i].value = callData->args[i];
- a->arrayDataLen = len;
+ a->arrayData->put(0, callData->args, len);
+ a->arrayData->setLength(len);
}
a->setArrayLengthUnchecked(len);
@@ -122,15 +121,6 @@ void ArrayPrototype::init(ExecutionEngine *engine, ObjectRef ctor)
defineDefaultProperty(QStringLiteral("reduceRight"), method_reduceRight, 1);
}
-uint ArrayPrototype::getLength(ExecutionContext *ctx, ObjectRef o)
-{
- if (o->isArrayObject())
- return o->arrayLength();
- Scope scope(ctx);
- ScopedValue v(scope, o->get(ctx->engine->id_length));
- return v->toUInt32();
-}
-
ReturnedValue ArrayPrototype::method_isArray(CallContext *ctx)
{
bool isArray = ctx->callData->argc && ctx->callData->args[0].asArrayObject();
@@ -180,15 +170,17 @@ ReturnedValue ArrayPrototype::method_concat(CallContext *ctx)
eltAsObj = ctx->callData->args[i];
elt = ctx->callData->args[i];
if (elt) {
- result->arrayConcat(elt.getPointer());
+ uint n = elt->getLength();
+ uint newLen = ArrayData::append(result.getPointer(), elt.getPointer(), n);
+ result->setArrayLengthUnchecked(newLen);
} else if (eltAsObj && eltAsObj->isListType()) {
- const uint startIndex = getLength(ctx, result);
- for (int i = 0, len = getLength(ctx, eltAsObj); i < len; ++i) {
+ const uint startIndex = result->getLength();
+ for (int i = 0, len = eltAsObj->getLength(); i < len; ++i) {
entry = eltAsObj->getIndexed(i);
result->putIndexed(startIndex + i, entry);
}
} else {
- result->arraySet(getLength(ctx, result), ctx->callData->args[i]);
+ result->arraySet(result->getLength(), ctx->callData->args[i]);
}
}
@@ -218,7 +210,7 @@ ReturnedValue ArrayPrototype::method_join(CallContext *ctx)
// ### FIXME
if (ArrayObject *a = self->asArrayObject()) {
ScopedValue e(scope);
- for (uint i = 0; i < a->arrayLength(); ++i) {
+ for (uint i = 0; i < a->getLength(); ++i) {
if (i)
R += r4;
@@ -260,7 +252,7 @@ ReturnedValue ArrayPrototype::method_pop(CallContext *ctx)
ScopedObject instance(scope, ctx->callData->thisObject.toObject(ctx));
if (!instance)
return Encode::undefined();
- uint len = getLength(ctx, instance);
+ uint len = instance->getLength();
if (!len) {
if (!instance->isArrayObject())
@@ -288,7 +280,10 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx)
ScopedObject instance(scope, ctx->callData->thisObject.toObject(ctx));
if (!instance)
return Encode::undefined();
- uint len = getLength(ctx, instance);
+
+ instance->arrayCreate();
+
+ uint len = instance->getLength();
if (len + ctx->callData->argc < len) {
// ughh...
@@ -308,21 +303,8 @@ ReturnedValue ArrayPrototype::method_push(CallContext *ctx)
return Encode(newLen);
}
- if (!instance->protoHasArray() && instance->arrayDataLen <= len) {
- for (int i = 0; i < ctx->callData->argc; ++i) {
- if (!instance->sparseArray) {
- if (len >= instance->arrayAlloc)
- instance->arrayReserve(len + 1);
- instance->arrayData[len].value = ctx->callData->args[i];
- if (instance->arrayAttributes)
- instance->arrayAttributes[len] = Attr_Data;
- instance->arrayDataLen = len + 1;
- } else {
- uint j = instance->allocArrayValue(ctx->callData->args[i]);
- instance->sparseArray->push_back(j, len);
- }
- ++len;
- }
+ if (!instance->protoHasArray() && instance->arrayData->length() <= len) {
+ len = instance->arrayData->push_back(len, ctx->callData->argc, ctx->callData->args);
} else {
for (int i = 0; i < ctx->callData->argc; ++i)
instance->putIndexed(len + i, ctx->callData->args[i]);
@@ -342,7 +324,7 @@ ReturnedValue ArrayPrototype::method_reverse(CallContext *ctx)
ScopedObject instance(scope, ctx->callData->thisObject.toObject(ctx));
if (!instance)
return Encode::undefined();
- uint length = getLength(ctx, instance);
+ uint length = instance->getLength();
int lo = 0, hi = length - 1;
@@ -374,7 +356,10 @@ ReturnedValue ArrayPrototype::method_shift(CallContext *ctx)
ScopedObject instance(scope, ctx->callData->thisObject.toObject(ctx));
if (!instance)
return Encode::undefined();
- uint len = getLength(ctx, instance);
+
+ instance->arrayCreate();
+
+ uint len = instance->getLength();
if (!len) {
if (!instance->isArrayObject())
@@ -382,28 +367,14 @@ ReturnedValue ArrayPrototype::method_shift(CallContext *ctx)
return Encode::undefined();
}
- Property *front = 0;
- uint pidx = instance->propertyIndexFromArrayIndex(0);
- if (pidx < UINT_MAX && !instance->arrayData[pidx].value.isEmpty())
- front = instance->arrayData + pidx;
+ ScopedValue result(scope);
- ScopedValue result(scope, front ? instance->getValue(front, instance->arrayAttributes ? instance->arrayAttributes[pidx] : Attr_Data) : Encode::undefined());
-
- if (!instance->protoHasArray() && instance->arrayDataLen <= len) {
- if (!instance->sparseArray) {
- if (instance->arrayDataLen) {
- ++instance->arrayOffset;
- ++instance->arrayData;
- --instance->arrayDataLen;
- --instance->arrayAlloc;
- if (instance->arrayAttributes)
- ++instance->arrayAttributes;
- }
- } else {
- uint idx = instance->sparseArray->pop_front();
- instance->freeArrayValue(idx);
- }
+ if (!instance->protoHasArray() && !instance->arrayData->hasAttributes() && instance->arrayData->length() <= len) {
+ result = instance->arrayData->pop_front();
} else {
+ result = instance->getIndexed(0);
+ if (scope.hasException())
+ return Encode::undefined();
ScopedValue v(scope);
// do it the slow way
for (uint k = 1; k < len; ++k) {
@@ -415,6 +386,8 @@ ReturnedValue ArrayPrototype::method_shift(CallContext *ctx)
instance->putIndexed(k - 1, v);
else
instance->deleteIndexedProperty(k - 1);
+ if (scope.hasException())
+ return Encode::undefined();
}
instance->deleteIndexedProperty(len - 1);
if (scope.hasException())
@@ -436,7 +409,7 @@ ReturnedValue ArrayPrototype::method_slice(CallContext *ctx)
return Encode::undefined();
Scoped<ArrayObject> result(scope, ctx->engine->newArrayObject());
- uint len = getLength(ctx, o);
+ uint len = o->getLength();
double s = ScopedValue(scope, ctx->argument(0))->toInteger();
uint start;
if (s < 0)
@@ -477,10 +450,10 @@ ReturnedValue ArrayPrototype::method_sort(CallContext *ctx)
if (!instance)
return Encode::undefined();
- uint len = getLength(ctx, instance);
+ uint len = instance->getLength();
ScopedValue comparefn(scope, ctx->argument(0));
- instance->arraySort(ctx, instance, comparefn, len);
+ ArrayData::sort(ctx, instance, comparefn, len);
return ctx->callData->thisObject.asReturnedValue();
}
@@ -490,7 +463,7 @@ ReturnedValue ArrayPrototype::method_splice(CallContext *ctx)
ScopedObject instance(scope, ctx->callData->thisObject.toObject(ctx));
if (!instance)
return Encode::undefined();
- uint len = getLength(ctx, instance);
+ uint len = instance->getLength();
Scoped<ArrayObject> newArray(scope, ctx->engine->newArrayObject());
@@ -504,17 +477,21 @@ ReturnedValue ArrayPrototype::method_splice(CallContext *ctx)
uint deleteCount = (uint)qMin(qMax(ScopedValue(scope, ctx->argument(1))->toInteger(), 0.), (double)(len - start));
newArray->arrayReserve(deleteCount);
+ ScopedValue v(scope);
for (uint i = 0; i < deleteCount; ++i) {
- newArray->arrayData[i].value = instance->getIndexed(start + i);
+