aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/calendar/calendar.pro2
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-calendarmodel.png (renamed from src/imports/controls/doc/images/qtlabscalendar-calendarmodel.png)bin5724 -> 5724 bytes
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-dayofweekrow-layout.png (renamed from src/imports/controls/doc/images/qtlabscalendar-dayofweekrow-layout.png)bin7455 -> 7455 bytes
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-dayofweekrow.png (renamed from src/imports/controls/doc/images/qtlabscalendar-dayofweekrow.png)bin2017 -> 2017 bytes
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-monthgrid-layout.png (renamed from src/imports/controls/doc/images/qtlabscalendar-monthgrid-layout.png)bin8876 -> 8876 bytes
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-monthgrid.png (renamed from src/imports/controls/doc/images/qtlabscalendar-monthgrid.png)bin3827 -> 3827 bytes
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-weeknumbercolumn-layout.png (renamed from src/imports/controls/doc/images/qtlabscalendar-weeknumbercolumn-layout.png)bin4986 -> 4986 bytes
-rw-r--r--src/imports/calendar/doc/images/qtlabscalendar-weeknumbercolumn.png (renamed from src/imports/controls/doc/images/qtlabscalendar-weeknumbercolumn.png)bin1453 -> 1453 bytes
-rw-r--r--src/imports/calendar/doc/qtlabscalendar.qdocconf37
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-calendarmodel.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-calendarmodel.qml)2
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow-layout.qml)0
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow.qml)0
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid-layout.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid-layout.qml)0
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid.qml)0
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn-layout.qml)0
-rw-r--r--src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn.qml (renamed from src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn.qml)0
-rw-r--r--src/imports/calendar/doc/src/qtlabscalendar-index.qdoc (renamed from src/imports/controls/doc/src/calendar/qtlabscalendar-index.qdoc)8
-rw-r--r--src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc (renamed from src/imports/controls/doc/src/calendar/qtlabscalendar.qdoc)0
-rw-r--r--src/imports/controls/AbstractButton.qml4
-rw-r--r--src/imports/controls/ApplicationWindow.qml12
-rw-r--r--src/imports/controls/BusyIndicator.qml8
-rw-r--r--src/imports/controls/Button.qml16
-rw-r--r--src/imports/controls/CheckBox.qml10
-rw-r--r--src/imports/controls/CheckDelegate.qml12
-rw-r--r--src/imports/controls/CheckIndicator.qml16
-rw-r--r--src/imports/controls/ComboBox.qml21
-rw-r--r--src/imports/controls/Container.qml4
-rw-r--r--src/imports/controls/Control.qml4
-rw-r--r--src/imports/controls/Dial.qml12
-rw-r--r--src/imports/controls/Dialog.qml65
-rw-r--r--src/imports/controls/DialogButtonBox.qml73
-rw-r--r--src/imports/controls/Drawer.qml12
-rw-r--r--src/imports/controls/Frame.qml12
-rw-r--r--src/imports/controls/GroupBox.qml14
-rw-r--r--src/imports/controls/ItemDelegate.qml12
-rw-r--r--src/imports/controls/Label.qml10
-rw-r--r--src/imports/controls/Menu.qml11
-rw-r--r--src/imports/controls/MenuItem.qml10
-rw-r--r--src/imports/controls/MenuSeparator.qml59
-rw-r--r--src/imports/controls/Page.qml12
-rw-r--r--src/imports/controls/PageIndicator.qml8
-rw-r--r--src/imports/controls/Pane.qml12
-rw-r--r--src/imports/controls/Popup.qml10
-rw-r--r--src/imports/controls/ProgressBar.qml10
-rw-r--r--src/imports/controls/RadioButton.qml10
-rw-r--r--src/imports/controls/RadioDelegate.qml12
-rw-r--r--src/imports/controls/RadioIndicator.qml12
-rw-r--r--src/imports/controls/RangeSlider.qml24
-rw-r--r--src/imports/controls/RoundButton.qml79
-rw-r--r--src/imports/controls/ScrollBar.qml8
-rw-r--r--src/imports/controls/ScrollIndicator.qml8
-rw-r--r--src/imports/controls/Slider.qml16
-rw-r--r--src/imports/controls/SpinBox.qml26
-rw-r--r--src/imports/controls/StackView.qml6
-rw-r--r--src/imports/controls/SwipeDelegate.qml12
-rw-r--r--src/imports/controls/SwipeView.qml7
-rw-r--r--src/imports/controls/Switch.qml10
-rw-r--r--src/imports/controls/SwitchDelegate.qml12
-rw-r--r--src/imports/controls/SwitchIndicator.qml16
-rw-r--r--src/imports/controls/TabBar.qml4
-rw-r--r--src/imports/controls/TabButton.qml12
-rw-r--r--src/imports/controls/TextArea.qml12
-rw-r--r--src/imports/controls/TextField.qml16
-rw-r--r--src/imports/controls/ToolBar.qml12
-rw-r--r--src/imports/controls/ToolButton.qml10
-rw-r--r--src/imports/controls/ToolSeparator.qml59
-rw-r--r--src/imports/controls/ToolTip.qml9
-rw-r--r--src/imports/controls/Tumbler.qml31
-rw-r--r--src/imports/controls/controls.pri11
-rw-r--r--src/imports/controls/controls.pro2
-rw-r--r--src/imports/controls/dependencies.json17
-rw-r--r--src/imports/controls/designer/ToolSeparatorSpecifics.qml71
-rw-r--r--src/imports/controls/designer/images/toolseparator-icon.pngbin0 -> 198 bytes
-rw-r--r--src/imports/controls/designer/images/toolseparator-icon16.pngbin0 -> 192 bytes
-rw-r--r--src/imports/controls/designer/images/toolseparator-icon16@2x.pngbin0 -> 213 bytes
-rw-r--r--src/imports/controls/designer/images/toolseparator-icon@2x.pngbin0 -> 239 bytes
-rw-r--r--src/imports/controls/designer/qtquickcontrols2.metainfo41
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox-attached.pngbin0 -> 1993 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox.pngbin0 -> 1987 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-menuseparator-custom.pngbin0 -> 5574 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-menuseparator.pngbin0 -> 5614 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-roundbutton.pngbin0 -> 1001 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-toolseparator-custom.pngbin0 -> 4729 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-toolseparator.pngbin0 -> 7148 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-tumbler-wrap.gifbin54383 -> 54328 bytes
-rw-r--r--src/imports/controls/doc/qtquickcontrols2.qdocconf8
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml41
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml41
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml43
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml42
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml (renamed from src/imports/controls/doc/snippets/basic-example.qml)23
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml69
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml60
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml36
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml82
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml69
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml68
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml46
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml57
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml99
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-busyindicator-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-disabled.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-focused.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-normal.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-pressed.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-checked.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-disabled.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-focused.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-normal.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkdelegate-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-delegate.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-popup.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-handle.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-checkable.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-label.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-menu-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-delegate.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiodelegate-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-active.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-active.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-handle.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-double.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-down.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-textual.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-up.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipedelegate-custom.qml4
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipeview-indicator.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-checked.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-disabled.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-focused.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-normal.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switchdelegate-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbutton.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-flickable.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-disabled.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-focused.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-normal.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbutton-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-hover.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-pressandhold.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-slider.qml4
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip.qml2
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-custom.qml3
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-delegate.qml2
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc54
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc10
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc8
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc17
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-index.qdoc6
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-material.qdoc17
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc63
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc20
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc17
-rw-r--r--src/imports/controls/material/ApplicationWindow.qml6
-rw-r--r--src/imports/controls/material/BoxShadow.qml7
-rw-r--r--src/imports/controls/material/BusyIndicator.qml8
-rw-r--r--src/imports/controls/material/Button.qml43
-rw-r--r--src/imports/controls/material/CheckBox.qml22
-rw-r--r--src/imports/controls/material/CheckDelegate.qml24
-rw-r--r--src/imports/controls/material/CheckIndicator.qml16
-rw-r--r--src/imports/controls/material/ComboBox.qml43
-rw-r--r--src/imports/controls/material/Dial.qml18
-rw-r--r--src/imports/controls/material/Dialog.qml86
-rw-r--r--src/imports/controls/material/DialogButtonBox.qml79
-rw-r--r--src/imports/controls/material/Drawer.qml10
-rw-r--r--src/imports/controls/material/ElevationEffect.qml22
-rw-r--r--src/imports/controls/material/Frame.qml10
-rw-r--r--src/imports/controls/material/GroupBox.qml10
-rw-r--r--src/imports/controls/material/ItemDelegate.qml23
-rw-r--r--src/imports/controls/material/Label.qml6
-rw-r--r--src/imports/controls/material/Menu.qml10
-rw-r--r--src/imports/controls/material/MenuItem.qml24
-rw-r--r--src/imports/controls/material/MenuSeparator.qml (renamed from src/imports/controls/material/Ripple.qml)24
-rw-r--r--src/imports/controls/material/Page.qml8
-rw-r--r--src/imports/controls/material/PageIndicator.qml6
-rw-r--r--src/imports/controls/material/Pane.qml10
-rw-r--r--src/imports/controls/material/Popup.qml10
-rw-r--r--src/imports/controls/material/ProgressBar.qml8
-rw-r--r--src/imports/controls/material/RadioButton.qml22
-rw-r--r--src/imports/controls/material/RadioDelegate.qml23
-rw-r--r--src/imports/controls/material/RadioIndicator.qml17
-rw-r--r--src/imports/controls/material/RangeSlider.qml12
-rw-r--r--src/imports/controls/material/RectangularGlow.qml240
-rw-r--r--src/imports/controls/material/RoundButton.qml115
-rw-r--r--src/imports/controls/material/ScrollBar.qml50
-rw-r--r--src/imports/controls/material/ScrollIndicator.qml6
-rw-r--r--src/imports/controls/material/Slider.qml11
-rw-r--r--src/imports/controls/material/SliderHandle.qml17
-rw-r--r--src/imports/controls/material/SpinBox.qml46
-rw-r--r--src/imports/controls/material/StackView.qml4
-rw-r--r--src/imports/controls/material/SwipeDelegate.qml28
-rw-r--r--src/imports/controls/material/SwipeView.qml5
-rw-r--r--src/imports/controls/material/Switch.qml19
-rw-r--r--src/imports/controls/material/SwitchDelegate.qml24
-rw-r--r--src/imports/controls/material/SwitchIndicator.qml19
-rw-r--r--src/imports/controls/material/TabBar.qml8
-rw-r--r--src/imports/controls/material/TabButton.qml17
-rw-r--r--src/imports/controls/material/TextArea.qml8
-rw-r--r--src/imports/controls/material/TextField.qml8
-rw-r--r--src/imports/controls/material/ToolBar.qml10
-rw-r--r--src/imports/controls/material/ToolButton.qml27
-rw-r--r--src/imports/controls/material/ToolSeparator.qml59
-rw-r--r--src/imports/controls/material/ToolTip.qml6
-rw-r--r--src/imports/controls/material/Tumbler.qml27
-rw-r--r--src/imports/controls/material/material.pri9
-rw-r--r--src/imports/controls/material/material.pro2
-rw-r--r--src/imports/controls/material/qmldir1
-rw-r--r--src/imports/controls/material/qquickmaterialprogressring.cpp55
-rw-r--r--src/imports/controls/material/qquickmaterialprogressstrip.cpp19
-rw-r--r--src/imports/controls/material/qquickmaterialripple.cpp451
-rw-r--r--src/imports/controls/material/qquickmaterialripple_p.h119
-rw-r--r--src/imports/controls/material/qquickmaterialstyle.cpp117
-rw-r--r--src/imports/controls/material/qquickmaterialstyle_p.h31
-rw-r--r--src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp9
-rw-r--r--src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc3
-rw-r--r--src/imports/controls/material/shaders/+glslcore/RectangularGlow.frag25
-rw-r--r--src/imports/controls/material/shaders/+hlsl/RectangularGlow.frag21
-rw-r--r--src/imports/controls/material/shaders/RectangularGlow.frag19
-rw-r--r--src/imports/controls/plugins.qmltypes1435
-rw-r--r--src/imports/controls/qquickbusyindicatorring.cpp19
-rw-r--r--src/imports/controls/qquickdefaultstyle.cpp241
-rw-r--r--src/imports/controls/qquickdefaultstyle_p.h145
-rw-r--r--src/imports/controls/qquickprogressstrip.cpp22
-rw-r--r--src/imports/controls/qtquickcontrols2plugin.cpp33
-rw-r--r--src/imports/controls/universal/ApplicationWindow.qml8
-rw-r--r--src/imports/controls/universal/BusyIndicator.qml8
-rw-r--r--src/imports/controls/universal/Button.qml17
-rw-r--r--src/imports/controls/universal/CheckBox.qml10
-rw-r--r--src/imports/controls/universal/CheckDelegate.qml13
-rw-r--r--src/imports/controls/universal/CheckIndicator.qml23
-rw-r--r--src/imports/controls/universal/ComboBox.qml20
-rw-r--r--src/imports/controls/universal/Dial.qml11
-rw-r--r--src/imports/controls/universal/Dialog.qml69
-rw-r--r--src/imports/controls/universal/DialogButtonBox.qml75
-rw-r--r--src/imports/controls/universal/Drawer.qml8
-rw-r--r--src/imports/controls/universal/Frame.qml8
-rw-r--r--src/imports/controls/universal/GroupBox.qml8
-rw-r--r--src/imports/controls/universal/ItemDelegate.qml13
-rw-r--r--src/imports/controls/universal/Label.qml6
-rw-r--r--src/imports/controls/universal/Menu.qml8
-rw-r--r--src/imports/controls/universal/MenuItem.qml11
-rw-r--r--src/imports/controls/universal/MenuSeparator.qml60
-rw-r--r--src/imports/controls/universal/Page.qml8
-rw-r--r--src/imports/controls/universal/PageIndicator.qml6
-rw-r--r--src/imports/controls/universal/Pane.qml8
-rw-r--r--src/imports/controls/universal/Popup.qml8
-rw-r--r--src/imports/controls/universal/ProgressBar.qml8
-rw-r--r--src/imports/controls/universal/RadioButton.qml10
-rw-r--r--src/imports/controls/universal/RadioDelegate.qml13
-rw-r--r--src/imports/controls/universal/RadioIndicator.qml10
-rw-r--r--src/imports/controls/universal/RangeSlider.qml19
-rw-r--r--src/imports/controls/universal/RoundButton.qml87
-rw-r--r--src/imports/controls/universal/ScrollBar.qml11
-rw-r--r--src/imports/controls/universal/ScrollIndicator.qml6
-rw-r--r--src/imports/controls/universal/Slider.qml15
-rw-r--r--src/imports/controls/universal/SpinBox.qml27
-rw-r--r--src/imports/controls/universal/StackView.qml6
-rw-r--r--src/imports/controls/universal/SwipeDelegate.qml11
-rw-r--r--src/imports/controls/universal/Switch.qml8
-rw-r--r--src/imports/controls/universal/SwitchDelegate.qml13
-rw-r--r--src/imports/controls/universal/SwitchIndicator.qml32
-rw-r--r--src/imports/controls/universal/TabBar.qml6
-rw-r--r--src/imports/controls/universal/TabButton.qml12
-rw-r--r--src/imports/controls/universal/TextArea.qml11
-rw-r--r--src/imports/controls/universal/TextField.qml11
-rw-r--r--src/imports/controls/universal/ToolBar.qml8
-rw-r--r--src/imports/controls/universal/ToolButton.qml18
-rw-r--r--src/imports/controls/universal/ToolSeparator.qml59
-rw-r--r--src/imports/controls/universal/ToolTip.qml6
-rw-r--r--src/imports/controls/universal/Tumbler.qml27
-rw-r--r--src/imports/controls/universal/qquickuniversalprogressring.cpp4
-rw-r--r--src/imports/controls/universal/qquickuniversalprogressstrip.cpp12
-rw-r--r--src/imports/controls/universal/qquickuniversalstyle.cpp12
-rw-r--r--src/imports/controls/universal/qquickuniversalstyle_p.h2
-rw-r--r--src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp2
-rw-r--r--src/imports/controls/universal/universal.pri5
-rw-r--r--src/imports/controls/universal/universal.pro2
-rw-r--r--src/imports/imports.pro1
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-colordialog-gtk.pngbin0 -> 11057 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-filedialog-gtk.pngbin0 -> 49506 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-folderdialog-gtk.pngbin0 -> 49092 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-fontdialog-gtk.pngbin0 -> 43653 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-menu.pngbin0 -> 6377 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-menubar.pngbin0 -> 71036 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-messagedialog-android.pngbin0 -> 7946 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-messagedialog-informative-android.pngbin0 -> 15759 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-menu.pngbin0 -> 24016 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-message.pngbin0 -> 36932 bytes
-rw-r--r--src/imports/platform/doc/images/qtlabsplatform-systemtrayicon.pngbin0 -> 19927 bytes
-rw-r--r--src/imports/platform/doc/qtlabsplatform.qdocconf37
-rw-r--r--src/imports/platform/doc/src/includes/widgets.qdocinc29
-rw-r--r--src/imports/platform/doc/src/qtlabsplatform-index.qdoc50
-rw-r--r--src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc58
-rw-r--r--src/imports/platform/platform.pri31
-rw-r--r--src/imports/platform/platform.pro22
-rw-r--r--src/imports/platform/plugins.qmltypes460
-rw-r--r--src/imports/platform/qmldir3
-rw-r--r--src/imports/platform/qquickplatformcolordialog.cpp205
-rw-r--r--src/imports/platform/qquickplatformcolordialog_p.h98
-rw-r--r--src/imports/platform/qquickplatformdialog.cpp409
-rw-r--r--src/imports/platform/qquickplatformdialog_p.h153
-rw-r--r--src/imports/platform/qquickplatformfiledialog.cpp660
-rw-r--r--src/imports/platform/qquickplatformfiledialog_p.h196
-rw-r--r--src/imports/platform/qquickplatformfolderdialog.cpp281
-rw-r--r--src/imports/platform/qquickplatformfolderdialog_p.h110
-rw-r--r--src/imports/platform/qquickplatformfontdialog.cpp208
-rw-r--r--src/imports/platform/qquickplatformfontdialog_p.h98
-rw-r--r--src/imports/platform/qquickplatformiconloader.cpp111
-rw-r--r--src/imports/platform/qquickplatformiconloader_p.h89
-rw-r--r--src/imports/platform/qquickplatformmenu.cpp835
-rw-r--r--src/imports/platform/qquickplatformmenu_p.h213
-rw-r--r--src/imports/platform/qquickplatformmenubar.cpp330
-rw-r--r--src/imports/platform/qquickplatformmenubar_p.h120
-rw-r--r--src/imports/platform/qquickplatformmenuitem.cpp612
-rw-r--r--src/imports/platform/qquickplatformmenuitem_p.h191
-rw-r--r--src/imports/platform/qquickplatformmenuitemgroup.cpp390
-rw-r--r--src/imports/platform/qquickplatformmenuitemgroup_p.h123
-rw-r--r--src/imports/platform/qquickplatformmenuseparator.cpp65
-rw-r--r--src/imports/platform/qquickplatformmenuseparator_p.h67
-rw-r--r--src/imports/platform/qquickplatformmessagedialog.cpp383
-rw-r--r--src/imports/platform/qquickplatformmessagedialog_p.h121
-rw-r--r--src/imports/platform/qquickplatformstandardpaths.cpp159
-rw-r--r--src/imports/platform/qquickplatformstandardpaths_p.h90
-rw-r--r--src/imports/platform/qquickplatformsystemtrayicon.cpp441
-rw-r--r--src/imports/platform/qquickplatformsystemtrayicon_p.h139
-rw-r--r--src/imports/platform/qtlabsplatformplugin.cpp115
-rw-r--r--src/imports/platform/widgets/qwidgetplatform_p.h125
-rw-r--r--src/imports/platform/widgets/qwidgetplatformcolordialog.cpp87
-rw-r--r--src/imports/platform/widgets/qwidgetplatformcolordialog_p.h78
-rw-r--r--src/imports/platform/widgets/qwidgetplatformdialog.cpp58
-rw-r--r--src/imports/platform/widgets/qwidgetplatformdialog_p.h66
-rw-r--r--src/imports/platform/widgets/qwidgetplatformfiledialog.cpp140
-rw-r--r--src/imports/platform/widgets/qwidgetplatformfiledialog_p.h84
-rw-r--r--src/imports/platform/widgets/qwidgetplatformfontdialog.cpp87
-rw-r--r--src/imports/platform/widgets/qwidgetplatformfontdialog_p.h78
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmenu.cpp186
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmenu_p.h99
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmenuitem.cpp131
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmenuitem_p.h89
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmessagedialog.cpp85
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmessagedialog_p.h75
-rw-r--r--src/imports/platform/widgets/qwidgetplatformsystemtrayicon.cpp114
-rw-r--r--src/imports/platform/widgets/qwidgetplatformsystemtrayicon_p.h85
-rw-r--r--src/imports/platform/widgets/widgets.pri23
-rw-r--r--src/imports/templates/dependencies.json12
-rw-r--r--src/imports/templates/doc/src/qtquicktemplates2-index.qdoc (renamed from src/imports/controls/doc/src/templates/qtquicktemplates2-index.qdoc)0
-rw-r--r--src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc (renamed from src/imports/controls/doc/src/templates/qtquicktemplates2.qdoc)2
-rw-r--r--src/imports/templates/plugins.qmltypes1121
-rw-r--r--src/imports/templates/qtquicktemplates2plugin.cpp26
-rw-r--r--src/imports/templates/templates.pro2
385 files changed, 14715 insertions, 3081 deletions
diff --git a/src/imports/calendar/calendar.pro b/src/imports/calendar/calendar.pro
index 8e9446cc..981860b5 100644
--- a/src/imports/calendar/calendar.pro
+++ b/src/imports/calendar/calendar.pro
@@ -7,6 +7,8 @@ QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2
DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+QMAKE_DOCS = $$PWD/doc/qtlabscalendar.qdocconf
+
OTHER_FILES += \
qmldir
diff --git a/src/imports/controls/doc/images/qtlabscalendar-calendarmodel.png b/src/imports/calendar/doc/images/qtlabscalendar-calendarmodel.png
index 7a140d27..7a140d27 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-calendarmodel.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-calendarmodel.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscalendar-dayofweekrow-layout.png b/src/imports/calendar/doc/images/qtlabscalendar-dayofweekrow-layout.png
index 130e3757..130e3757 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-dayofweekrow-layout.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-dayofweekrow-layout.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscalendar-dayofweekrow.png b/src/imports/calendar/doc/images/qtlabscalendar-dayofweekrow.png
index 6c8424ab..6c8424ab 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-dayofweekrow.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-dayofweekrow.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscalendar-monthgrid-layout.png b/src/imports/calendar/doc/images/qtlabscalendar-monthgrid-layout.png
index dd903650..dd903650 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-monthgrid-layout.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-monthgrid-layout.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscalendar-monthgrid.png b/src/imports/calendar/doc/images/qtlabscalendar-monthgrid.png
index 0c3b3c41..0c3b3c41 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-monthgrid.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-monthgrid.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscalendar-weeknumbercolumn-layout.png b/src/imports/calendar/doc/images/qtlabscalendar-weeknumbercolumn-layout.png
index b015a3e6..b015a3e6 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-weeknumbercolumn-layout.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-weeknumbercolumn-layout.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtlabscalendar-weeknumbercolumn.png b/src/imports/calendar/doc/images/qtlabscalendar-weeknumbercolumn.png
index 65e25b29..65e25b29 100644
--- a/src/imports/controls/doc/images/qtlabscalendar-weeknumbercolumn.png
+++ b/src/imports/calendar/doc/images/qtlabscalendar-weeknumbercolumn.png
Binary files differ
diff --git a/src/imports/calendar/doc/qtlabscalendar.qdocconf b/src/imports/calendar/doc/qtlabscalendar.qdocconf
new file mode 100644
index 00000000..0e230aa1
--- /dev/null
+++ b/src/imports/calendar/doc/qtlabscalendar.qdocconf
@@ -0,0 +1,37 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = QtLabsCalendar
+description = Qt Labs Calendar Reference Documentation
+version = $QT_VERSION
+
+qhp.projects = QtLabsCalendar
+
+qhp.QtLabsCalendar.file = qtlabscalendar.qhp
+qhp.QtLabsCalendar.namespace = org.qt-project.qtlabscalendar.$QT_VERSION_TAG
+qhp.QtLabsCalendar.virtualFolder = qtlabscalendar
+qhp.QtLabsCalendar.indexTitle = Qt Labs Calendar
+qhp.QtLabsCalendar.indexRoot =
+
+qhp.QtLabsCalendar.filterAttributes = qtlabscalendar $QT_VERSION qtrefdoc
+qhp.QtLabsCalendar.customFilters.Qt.name = QtLabsCalendar $QT_VERSION
+qhp.QtLabsCalendar.customFilters.Qt.filterAttributes = qtlabscalendar $QT_VERSION
+
+qhp.QtLabsCalendar.subprojects = qmltypes
+qhp.QtLabsCalendar.subprojects.qmltypes.title = QML Types
+qhp.QtLabsCalendar.subprojects.qmltypes.indexTitle = Qt Labs Calendar QML Types
+qhp.QtLabsCalendar.subprojects.qmltypes.selectors = qmlclass
+qhp.QtLabsCalendar.subprojects.qmltypes.sortPages = true
+
+depends = qtcore qtgui qtdoc qtqml qtquick qtquickcontrols2
+
+headerdirs += ../
+sourcedirs += ../ src
+exampledirs += ../ snippets
+imagedirs += images
+
+navigation.landingpage = "Qt Labs Calendar"
+navigation.qmltypespage = "Qt Labs Calendar QML Types"
+
+tagfile = qtlabscalendar.tags
+
+macro.labs = "\\note \\e{Types in Qt.labs modules are not guaranteed to remain compatible in future versions.}"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-calendarmodel.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-calendarmodel.qml
index dfbf4fbc..37a6ced7 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-calendarmodel.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-calendarmodel.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import Qt.labs.calendar 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
ListView {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow-layout.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml
index ce41d224..ce41d224 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow-layout.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow.qml
index 5ea3714c..5ea3714c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow.qml
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid-layout.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid-layout.qml
index 346e6099..346e6099 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid-layout.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid-layout.qml
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid.qml
index 16f872b8..16f872b8 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid.qml
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn-layout.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml
index d105553f..d105553f 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn-layout.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml
diff --git a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn.qml b/src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn.qml
index e58e5c7b..e58e5c7b 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn.qml
+++ b/src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn.qml
diff --git a/src/imports/controls/doc/src/calendar/qtlabscalendar-index.qdoc b/src/imports/calendar/doc/src/qtlabscalendar-index.qdoc
index d99b3880..9456f1cb 100644
--- a/src/imports/controls/doc/src/calendar/qtlabscalendar-index.qdoc
+++ b/src/imports/calendar/doc/src/qtlabscalendar-index.qdoc
@@ -29,11 +29,11 @@
\page qtlabscalendar-index.html
\title Qt Labs Calendar
- \brief The Qt Labs Calendar module provides a set of UI controls for Qt
- Quick.
+ \brief The experimental Qt Labs Calendar module provides a set of UI controls
+ for Qt Quick.
- The Qt Labs Calendar module provides a set of types that can be used
- to build calendars in Qt Quick.
+ The experimental Qt Labs Calendar module provides a set of types that can be
+ used to build calendars in Qt Quick. The module was introduced in Qt 5.7.
\section1 QML Types
diff --git a/src/imports/controls/doc/src/calendar/qtlabscalendar.qdoc b/src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc
index a94e5ec6..a94e5ec6 100644
--- a/src/imports/controls/doc/src/calendar/qtlabscalendar.qdoc
+++ b/src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc
diff --git a/src/imports/controls/AbstractButton.qml b/src/imports/controls/AbstractButton.qml
index 487b452b..a45c6816 100644
--- a/src/imports/controls/AbstractButton.qml
+++ b/src/imports/controls/AbstractButton.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
T.AbstractButton {
id: control
diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml
index 98de8946..e82430e5 100644
--- a/src/imports/controls/ApplicationWindow.qml
+++ b/src/imports/controls/ApplicationWindow.qml
@@ -34,20 +34,22 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
import QtQuick.Window 2.2
-import QtQuick.Templates 2.0 as T
+import QtQuick.Templates 2.1 as T
T.ApplicationWindow {
id: window
- color: "#ffffff"
+ color: Default.backgroundColor
overlay.modal: Rectangle {
- color: "#7f28282a"
+ color: Default.overlayModalColor
}
overlay.modeless: Rectangle {
- color: "#1f28282a"
+ color: Default.overlayDimColor
}
}
diff --git a/src/imports/controls/BusyIndicator.qml b/src/imports/controls/BusyIndicator.qml
index 44c61355..936764fa 100644
--- a/src/imports/controls/BusyIndicator.qml
+++ b/src/imports/controls/BusyIndicator.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.BusyIndicator {
id: control
diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml
index f875a97a..6bf30df0 100644
--- a/src/imports/controls/Button.qml
+++ b/src/imports/controls/Button.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Button {
id: control
@@ -55,7 +57,9 @@ T.Button {
text: control.text
font: control.font
opacity: enabled || control.highlighted || control.checked ? 1 : 0.3
- color: control.checked || control.highlighted ? "#ffffff" : (control.visualFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637"))
+ color: control.checked || control.highlighted ?
+ Default.textLightColor :
+ (control.visualFocus ? Default.focusColor : (control.down ? Default.textDarkColor : Default.textColor))
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
@@ -69,9 +73,9 @@ T.Button {
opacity: enabled ? 1 : 0.3
visible: !control.flat || control.down || control.checked || control.highlighted
color: control.checked || control.highlighted ?
- (control.visualFocus ? (control.down ? "#599bff" : "#0066ff") : (control.down ? "#585a5c" : "#353637")) :
- (control.visualFocus ? (control.down ? "#cce0ff" : "#f0f6ff") : (control.down ? "#d0d0d0" : "#e0e0e0"))
- border.color: "#0066ff"
+ (control.visualFocus ? (control.down ? Default.buttonCheckedFocusColor : Default.focusColor) : (control.down ? Default.buttonCheckedPressedColor : Default.textColor)) :
+ (control.visualFocus ? (control.down ? Default.focusPressedColor : Default.focusLightColor) : (control.down ? Default.buttonPressedColor : Default.buttonColor))
+ border.color: Default.focusColor
border.width: control.visualFocus ? 2 : 0
}
//! [background]
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml
index 3615948a..dcfb54a7 100644
--- a/src/imports/controls/CheckBox.qml
+++ b/src/imports/controls/CheckBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
T.CheckBox {
id: control
@@ -68,7 +68,7 @@ T.CheckBox {
text: control.text
font: control.font
- color: control.down ? "#26282a" : "#353637"
+ color: control.down ? Default.textDarkColor : Default.textColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
diff --git a/src/imports/controls/CheckDelegate.qml b/src/imports/controls/CheckDelegate.qml
index dcef7f77..ad4bb44f 100644
--- a/src/imports/controls/CheckDelegate.qml
+++ b/src/imports/controls/CheckDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
T.CheckDelegate {
id: control
@@ -59,7 +59,7 @@ T.CheckDelegate {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
@@ -81,7 +81,7 @@ T.CheckDelegate {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted
- color: control.down ? "#bdbebf" : "#eeeeee"
+ color: control.down ? Default.delegatePressedColor : Default.delegateColor
}
//! [background]
}
diff --git a/src/imports/controls/CheckIndicator.qml b/src/imports/controls/CheckIndicator.qml
index d78e9e30..b3d1b25e 100644
--- a/src/imports/controls/CheckIndicator.qml
+++ b/src/imports/controls/CheckIndicator.qml
@@ -34,7 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
Rectangle {
id: indicator
@@ -44,14 +46,18 @@ Rectangle {
implicitWidth: 28
implicitHeight: 28
- color: control.enabled ? (control.down ? (control.visualFocus ? "#cce0ff" : "#f6f6f6") : "#ffffff") : "#353637"
+ color: control.enabled ? (control.down
+ ? (control.visualFocus ? Default.focusPressedColor : Default.indicatorPressedColor)
+ : Default.backgroundColor) : Default.disabledDarkColor
border.width: control.visualFocus ? 2 : 1
- border.color: control.enabled ? (control.visualFocus ? "#0066ff" : (control.down ? "#808080" : "#909090")) : "transparent"
+ border.color: control.enabled ? (control.visualFocus
+ ? Default.focusColor
+ : (control.down ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : "transparent"
Image {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
- source: "image://default/check/" + (control.visualFocus ? "#0066ff" : "#353637")
+ source: "image://default/check/" + (control.visualFocus ? Default.focusColor : Default.textColor)
sourceSize.width: width
sourceSize.height: height
visible: control.checkState === Qt.Checked
@@ -62,7 +68,7 @@ Rectangle {
y: (parent.height - height) / 2
width: 16
height: 3
- color: control.visualFocus ? "#0066ff" : "#353637"
+ color: control.visualFocus ? Default.focusColor : Default.frameDarkColor
visible: control.checkState === Qt.PartiallyChecked
}
}
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml
index 09930aad..85a9cc13 100644
--- a/src/imports/controls/ComboBox.qml
+++ b/src/imports/controls/ComboBox.qml
@@ -34,10 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
import QtQuick.Window 2.2
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ComboBox {
id: control
@@ -62,6 +63,7 @@ T.ComboBox {
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal
highlighted: control.highlightedIndex == index
+ hoverEnabled: control.hoverEnabled
}
//! [delegate]
@@ -69,7 +71,7 @@ T.ComboBox {
indicator: Image {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
- source: "image://default/double-arrow/" + (control.visualFocus ? "#0066ff" : "#353637")
+ source: "image://default/double-arrow/" + (control.visualFocus ? Default.focusColor : Default.textColor)
sourceSize.width: width
sourceSize.height: height
}
@@ -82,7 +84,7 @@ T.ComboBox {
text: control.displayText
font: control.font
- color: control.visualFocus ? "#0066ff" : "#353637"
+ color: control.visualFocus ? Default.focusColor : Default.textColor
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
@@ -94,10 +96,11 @@ T.ComboBox {
implicitWidth: 120
implicitHeight: 40
- color: control.visualFocus ? (control.pressed ? "#cce0ff" : "#f0f6ff") :
- (control.pressed || popup.visible ? "#d0d0d0" : "#e0e0e0")
- border.color: "#0066ff"
+ color: control.visualFocus ? (control.pressed ? Default.focusPressedColor : Default.focusLightColor) :
+ (control.pressed || popup.visible ? Default.buttonPressedColor : Default.buttonColor)
+ border.color: Default.focusColor
border.width: control.visualFocus ? 2 : 0
+ visible: !control.flat || control.pressed
}
//! [background]
@@ -124,7 +127,7 @@ T.ComboBox {
width: listview.width
height: listview.height
color: "transparent"
- border.color: "#bdbebf"
+ border.color: Default.frameLightColor
}
T.ScrollIndicator.vertical: ScrollIndicator { }
diff --git a/src/imports/controls/Container.qml b/src/imports/controls/Container.qml
index 9e9215f8..d3aa89bc 100644
--- a/src/imports/controls/Container.qml
+++ b/src/imports/controls/Container.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
T.Container {
id: control
diff --git a/src/imports/controls/Control.qml b/src/imports/controls/Control.qml
index a4bb95fe..92b1cfd2 100644
--- a/src/imports/controls/Control.qml
+++ b/src/imports/controls/Control.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
T.Control {
id: control
diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml
index aa138126..f19fcc2b 100644
--- a/src/imports/controls/Dial.qml
+++ b/src/imports/controls/Dial.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Dial {
id: control
@@ -49,7 +49,7 @@ T.Dial {
background: DialRing {
width: control.availableWidth
height: control.availableHeight
- color: control.visualFocus ? "#0066ff" : "#353637"
+ color: control.visualFocus ? Default.focusColor : Default.frameDarkColor
progress: control.position
opacity: control.enabled ? 1 : 0.3
}
@@ -62,7 +62,7 @@ T.Dial {
y: background.y + background.height / 2 - handle.height / 2
width: 14
height: 10
- source: "image://default/dial-indicator/" + (control.visualFocus ? "#0066ff" : "#353637")
+ source: "image://default/dial-indicator/" + (control.visualFocus ? Default.focusColor : Default.textColor)
sourceSize.width: width
sourceSize.height: height
antialiasing: true
diff --git a/src/imports/controls/Dialog.qml b/src/imports/controls/Dialog.qml
new file mode 100644
index 00000000..a2522398
--- /dev/null
+++ b/src/imports/controls/Dialog.qml
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+
+T.Dialog {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ header ? header.implicitWidth : 0,
+ footer ? footer.implicitWidth : 0,
+ contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ (header ? header.implicitHeight : 0) + (footer ? footer.implicitHeight : 0))
+ + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 12
+
+ background: Rectangle {
+ border.color: Default.frameDarkColor
+ }
+
+ buttonBox: DialogButtonBox {
+ position: DialogButtonBox.Footer
+ }
+}
diff --git a/src/imports/controls/DialogButtonBox.qml b/src/imports/controls/DialogButtonBox.qml
new file mode 100644
index 00000000..9f4ebce5
--- /dev/null
+++ b/src/imports/controls/DialogButtonBox.qml
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+
+T.DialogButtonBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ spacing: 1
+ padding: 12
+ alignment: count === 1 ? Qt.AlignRight : undefined
+
+ delegate: Button {
+ width: control.count === 1 ? control.availableWidth / 2 : undefined
+ }
+
+ contentItem: ListView {
+ implicitWidth: contentWidth
+ implicitHeight: 40
+
+ model: control.contentModel
+ spacing: control.spacing
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ snapMode: ListView.SnapToItem
+ }
+
+ background: Rectangle {
+ implicitHeight: 40
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ }
+}
diff --git a/src/imports/controls/Drawer.qml b/src/imports/controls/Drawer.qml
index 9791bf0c..90fef012 100644
--- a/src/imports/controls/Drawer.qml
+++ b/src/imports/controls/Drawer.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Drawer {
id: control
@@ -61,17 +63,13 @@ T.Drawer {
exit: Transition { SmoothedAnimation { velocity: 5 } }
//! [exit]
- //! [contentItem]
- contentItem: Item { }
- //! [contentItem]
-
//! [background]
background: Rectangle {
Rectangle {
readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge
width: horizontal ? 1 : parent.width
height: horizontal ? parent.height : 1
- color: "#353637"
+ color: Default.frameDarkColor
x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0
y: control.edge === Qt.TopEdge ? parent.height - 1 : 0
}
diff --git a/src/imports/controls/Frame.qml b/src/imports/controls/Frame.qml
index cb2ffd35..eae1f25d 100644
--- a/src/imports/controls/Frame.qml
+++ b/src/imports/controls/Frame.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Frame {
id: control
@@ -48,14 +50,10 @@ T.Frame {
padding: 12
- //! [contentItem]
- contentItem: Item { }
- //! [contentItem]
-
//! [background]
background: Rectangle {
color: "transparent"
- border.color: "#bdbebf"
+ border.color: Default.frameLightColor
}
//! [background]
}
diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml
index 0e9d79fc..a761c8dc 100644
--- a/src/imports/controls/GroupBox.qml
+++ b/src/imports/controls/GroupBox.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.GroupBox {
id: control
@@ -52,10 +54,6 @@ T.GroupBox {
padding: 12
topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
- //! [contentItem]
- contentItem: Item { }
- //! [contentItem]
-
//! [label]
label: Text {
x: control.leftPadding
@@ -63,7 +61,7 @@ T.GroupBox {
text: control.title
font: control.font
- color: control.enabled ? "#353637" : "#bdbebf"
+ color: control.enabled ? Default.textColor : Default.textDisabledColor
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
@@ -77,7 +75,7 @@ T.GroupBox {
height: parent.height - control.topPadding + control.padding
color: "transparent"
- border.color: "#bdbebf"
+ border.color: Default.frameLightColor
}
//! [background]
}
diff --git a/src/imports/controls/ItemDelegate.qml b/src/imports/controls/ItemDelegate.qml
index d884a328..a1bf9b22 100644
--- a/src/imports/controls/ItemDelegate.qml
+++ b/src/imports/controls/ItemDelegate.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ItemDelegate {
id: control
@@ -57,7 +59,7 @@ T.ItemDelegate {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
@@ -70,7 +72,9 @@ T.ItemDelegate {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted || control.visualFocus
- color: control.visualFocus ? (control.pressed ? "#cce0ff" : "#e5efff") : (control.down ? "#bdbebf" : "#eeeeee")
+ color: control.visualFocus
+ ? (control.pressed ? Default.focusPressedColor : Default.delegateFocusColor)
+ : (control.down ? Default.delegatePressedColor : Default.delegateColor)
}
//! [background]
}
diff --git a/src/imports/controls/Label.qml b/src/imports/controls/Label.qml
index d0f01613..c492cd7a 100644
--- a/src/imports/controls/Label.qml
+++ b/src/imports/controls/Label.qml
@@ -34,12 +34,14 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Label {
id: control
- color: "#26282a"
- linkColor: "#45a7d7" // TODO
+ color: Default.textDarkColor
+ linkColor: Default.textLinkColor
}
diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml
index e349a89d..0461b2b6 100644
--- a/src/imports/controls/Menu.qml
+++ b/src/imports/controls/Menu.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Menu {
id: control
@@ -66,8 +67,8 @@ T.Menu {
background: Rectangle {
implicitWidth: 200
implicitHeight: 40
- color: "#ffffff"
- border.color: "#353637"
+ color: Default.backgroundColor
+ border.color: Default.frameDarkColor
}
//! [background]
}
diff --git a/src/imports/controls/MenuItem.qml b/src/imports/controls/MenuItem.qml
index ead943b0..0d4b609d 100644
--- a/src/imports/controls/MenuItem.qml
+++ b/src/imports/controls/MenuItem.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.MenuItem {
id: control
@@ -56,7 +58,7 @@ T.MenuItem {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
@@ -84,7 +86,7 @@ T.MenuItem {
y: 1
width: parent.width - 2
height: parent.height - 2
- color: control.visualFocus || control.down ? "#eeeeee" : "transparent"
+ color: control.visualFocus || control.down ? Default.delegateColor : "transparent"
}
}
//! [background]
diff --git a/src/imports/controls/MenuSeparator.qml b/src/imports/controls/MenuSeparator.qml
new file mode 100644
index 00000000..ef075ef9
--- /dev/null
+++ b/src/imports/controls/MenuSeparator.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
+
+T.MenuSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: 2
+ topPadding: padding + 4
+ bottomPadding: padding + 4
+
+ //! [contentItem]
+ contentItem: Rectangle {
+ implicitWidth: 188
+ implicitHeight: 1
+ color: Default.separatorColor
+ }
+ //! [contentItem]
+}
diff --git a/src/imports/controls/Page.qml b/src/imports/controls/Page.qml
index 3cbb1569..630f8426 100644
--- a/src/imports/controls/Page.qml
+++ b/src/imports/controls/Page.qml
@@ -34,19 +34,17 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Page {
id: control
- //! [contentItem]
- contentItem: Item { }
- //! [contentItem]
-
//! [background]
background: Rectangle {
- color: "#ffffff"
+ color: Default.backgroundColor
}
//! [background]
}
diff --git a/src/imports/controls/PageIndicator.qml b/src/imports/controls/PageIndicator.qml
index 5b61acd5..b546a9cc 100644
--- a/src/imports/controls/PageIndicator.qml
+++ b/src/imports/controls/PageIndicator.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.PageIndicator {
id: control
@@ -54,7 +56,7 @@ T.PageIndicator {
implicitHeight: 8
radius: width / 2
- color: "#28282a" // TODO
+ color: Default.pageIndicatorColor
opacity: index === currentIndex ? 0.95 : pressed ? 0.7 : 0.45
Behavior on opacity { OpacityAnimator { duration: 100 } }
diff --git a/src/imports/controls/Pane.qml b/src/imports/controls/Pane.qml
index eb79129c..482ec18b 100644
--- a/src/imports/controls/Pane.qml
+++ b/src/imports/controls/Pane.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Pane {
id: control
@@ -48,13 +50,9 @@ T.Pane {
padding: 12
- //! [contentItem]
- contentItem: Item { }
- //! [contentItem]
-
//! [background]
background: Rectangle {
- color: "#ffffff"
+ color: Default.backgroundColor
}
//! [background]
}
diff --git a/src/imports/controls/Popup.qml b/src/imports/controls/Popup.qml
index 72428f23..476a1882 100644
--- a/src/imports/controls/Popup.qml
+++ b/src/imports/controls/Popup.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Popup {
id: control
@@ -50,9 +52,7 @@ T.Popup {
padding: 12
- contentItem: Item { }
-
background: Rectangle {
- border.color: "#353637"
+ border.color: Default.frameDarkColor
}
}
diff --git a/src/imports/controls/ProgressBar.qml b/src/imports/controls/ProgressBar.qml
index fb312b18..a0d0912a 100644
--- a/src/imports/controls/ProgressBar.qml
+++ b/src/imports/controls/ProgressBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
T.ProgressBar {
id: control
@@ -72,7 +72,7 @@ T.ProgressBar {
width: control.availableWidth
height: 6
- color: "#e4e4e4"
+ color: Default.progressBarColor
}
//! [background]
}
diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml
index 8a2d7c99..80e4e182 100644
--- a/src/imports/controls/RadioButton.qml
+++ b/src/imports/controls/RadioButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.RadioButton {
id: control
@@ -68,7 +68,7 @@ T.RadioButton {
text: control.text
font: control.font
- color: control.down ? "#26282a" : "#353637"
+ color: control.down ? Default.textDarkColor : Default.textColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
diff --git a/src/imports/controls/RadioDelegate.qml b/src/imports/controls/RadioDelegate.qml
index d745054a..85e66aa0 100644
--- a/src/imports/controls/RadioDelegate.qml
+++ b/src/imports/controls/RadioDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.RadioDelegate {
id: control
@@ -59,7 +59,7 @@ T.RadioDelegate {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
@@ -81,7 +81,7 @@ T.RadioDelegate {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted
- color: control.down ? "#bdbebf" : "#eeeeee"
+ color: control.down ? Default.delegatePressedColor : Default.delegateColor
}
//! [background]
}
diff --git a/src/imports/controls/RadioIndicator.qml b/src/imports/controls/RadioIndicator.qml
index 08c24cc5..43159e6c 100644
--- a/src/imports/controls/RadioIndicator.qml
+++ b/src/imports/controls/RadioIndicator.qml
@@ -34,16 +34,20 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
Rectangle {
implicitWidth: 28
implicitHeight: 28
radius: width / 2
- color: control.down ? (control.visualFocus ? "#cce0ff" : "#f6f6f6") : (control.visualFocus ? "#f0f6ff" : "#ffffff")
+ color: control.down
+ ? (control.visualFocus ? Default.focusPressedColor : Default.indicatorPressedColor)
+ : (control.visualFocus ? Default.focusLightColor : Default.backgroundColor)
border.width: control.visualFocus ? 2 : 1
- border.color: control.visualFocus ? "#0066ff" : (control.down ? "#808080" : "#909090")
+ border.color: control.visualFocus ? Default.focusColor : (control.down ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)
property Item control
@@ -53,7 +57,7 @@ Rectangle {
width: 20
height: 20
radius: width / 2
- color: control.down ? "#26282a" : "#353637"
+ color: control.down ? Default.textDarkColor : Default.buttonCheckedColor
visible: control.checked
}
}
diff --git a/src/imports/controls/RangeSlider.qml b/src/imports/controls/RangeSlider.qml
index 7353e2b5..6b892fd1 100644
--- a/src/imports/controls/RangeSlider.qml
+++ b/src/imports/controls/RangeSlider.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.RangeSlider {
id: control
@@ -57,8 +59,12 @@ T.RangeSlider {
implicitHeight: 28
radius: width / 2
border.width: activeFocus ? 2 : 1
- border.color: control.enabled ? (activeFocus ? "#0066ff" : (control.first.pressed ? "#808080" : "#909090")) : "#d6d6d6"
- color: control.enabled ? (first.pressed ? (activeFocus ? "#cce0ff" : "#f6f6f6") : (activeFocus ? "#f0f6ff" : "#ffffff")) : "#fdfdfd"
+ border.color: control.enabled ? (activeFocus
+ ? Default.focusColor
+ : (control.first.pressed ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : Default.indicatorFrameDisabledColor
+ color: control.enabled ? (first.pressed
+ ? (activeFocus ? Default.focusPressedColor : Default.indicatorPressedColor)
+ : (activeFocus ? Default.focusLightColor : Default.backgroundColor)) : Default.indicatorDisabledColor
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
@@ -72,8 +78,12 @@ T.RangeSlider {
implicitHeight: 28
radius: width / 2
border.width: activeFocus ? 2 : 1
- border.color: control.enabled ? (activeFocus ? "#0066ff" : (control.first.pressed ? "#808080" : "#909090")) : "#d6d6d6"
- color: control.enabled ? (second.pressed ? (activeFocus ? "#cce0ff" : "#f6f6f6") : (activeFocus ? "#f0f6ff" : "#ffffff")) : "#fdfdfd"
+ border.color: control.enabled ? (activeFocus
+ ? Default.focusColor
+ : (control.first.pressed ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : Default.indicatorFrameDisabledColor
+ color: control.enabled ? (second.pressed
+ ? (activeFocus ? Default.focusPressedColor : Default.indicatorPressedColor)
+ : (activeFocus ? Default.focusLightColor : Default.backgroundColor)) : Default.indicatorDisabledColor
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
@@ -89,7 +99,7 @@ T.RangeSlider {
height: horizontal ? implicitHeight : control.availableHeight
radius: 3
opacity: control.enabled ? 1 : 0.3
- color: "#e0e0e0"
+ color: Default.buttonColor
scale: horizontal && control.mirrored ? -1 : 1
readonly property bool horizontal: control.orientation === Qt.Horizontal
diff --git a/src/imports/controls/RoundButton.qml b/src/imports/controls/RoundButton.qml
new file mode 100644
index 00000000..15c01b48
--- /dev/null
+++ b/src/imports/controls/RoundButton.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
+
+T.RoundButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ padding: 6
+
+ //! [contentItem]
+ contentItem: Text {
+ text: control.text
+ font: control.font
+ opacity: enabled || control.highlighted || control.checked ? 1 : 0.3
+ color: control.checked || control.highlighted ? Default.textLightColor : (control.visualFocus ? Default.focusColor : (control.down ? Default.textDarkColor : Default.textColor))
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+ //! [contentItem]
+
+ //! [background]
+ background: Rectangle {
+ implicitWidth: 40
+ implicitHeight: 40
+ radius: control.radius
+ opacity: enabled ? 1 : 0.3
+ visible: !control.flat || control.down || control.checked || control.highlighted
+ color: control.checked || control.highlighted ?
+ (control.visualFocus ? (control.down ? Default.buttonCheckedFocusColor : Default.focusColor) : (control.down ? Default.buttonCheckedPressedColor : Default.buttonCheckedColor)) :
+ (control.visualFocus ? (control.down ? Default.focusPressedColor : Default.focusLightColor) : (control.down ? Default.buttonPressedColor : Default.buttonColor))
+ border.color: Default.focusColor
+ border.width: control.visualFocus ? 2 : 0
+ }
+ //! [background]
+}
diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml
index 8ccbc328..fcca30e8 100644
--- a/src/imports/controls/ScrollBar.qml
+++ b/src/imports/controls/ScrollBar.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ScrollBar {
id: control
@@ -55,7 +57,7 @@ T.ScrollBar {
implicitHeight: 6
radius: width / 2
- color: control.pressed ? "#28282a" : "#bdbebf"
+ color: control.pressed ? Default.scrollBarPressedColor : Default.scrollBarColor
visible: control.size < 1.0
opacity: 0.0
diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml
index cd7b53fd..50f58575 100644
--- a/src/imports/controls/ScrollIndicator.qml
+++ b/src/imports/controls/ScrollIndicator.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ScrollIndicator {
id: control
@@ -54,7 +56,7 @@ T.ScrollIndicator {
implicitWidth: 2
implicitHeight: 2
- color: "#bdbebf"
+ color: Default.scrollBarColor
visible: control.size < 1.0
opacity: 0.0
diff --git a/src/imports/controls/Slider.qml b/src/imports/controls/Slider.qml
index 896dbca0..f7e95db9 100644
--- a/src/imports/controls/Slider.qml
+++ b/src/imports/controls/Slider.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Slider {
id: control
@@ -54,9 +56,13 @@ T.Slider {
implicitWidth: 28
implicitHeight: 28
radius: width / 2
- color: control.enabled ? (control.pressed ? (control.visualFocus ? "#cce0ff" : "#f6f6f6") : (control.visualFocus ? "#f0f6ff" : "#ffffff")) : "#fdfdfd"
+ color: control.enabled ? (control.pressed
+ ? (control.visualFocus ? Default.focusPressedColor : Default.indicatorPressedColor)
+ : (control.visualFocus ? Default.focusLightColor : Default.backgroundColor)) : Default.indicatorDisabledColor
border.width: control.visualFocus ? 2 : 1
- border.color: control.enabled ? (control.visualFocus ? "#0066ff" : (control.pressed ? "#808080" : "#909090")) : "#d6d6d6"
+ border.color: control.enabled ? (control.visualFocus
+ ? Default.focusColor
+ : (control.pressed ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : Default.indicatorFrameDisabledColor
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
@@ -72,7 +78,7 @@ T.Slider {
height: horizontal ? implicitHeight : control.availableHeight
radius: 3
opacity: control.enabled ? 1 : 0.3
- color: "#e0e0e0"
+ color: Default.buttonColor
scale: horizontal && control.mirrored ? -1 : 1
readonly property bool horizontal: control.orientation === Qt.Horizontal
diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml
index 89853116..0a562110 100644
--- a/src/imports/controls/SpinBox.qml
+++ b/src/imports/controls/SpinBox.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.SpinBox {
id: control
@@ -69,9 +71,9 @@ T.SpinBox {
opacity: control.enabled ? 1 : 0.3
font: control.font
- color: "#353637"
- selectionColor: "#0066ff"
- selectedTextColor: "#ffffff"
+ color: Default.textColor
+ selectionColor: Default.focusColor
+ selectedTextColor: Default.textLightColor
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
@@ -86,7 +88,7 @@ T.SpinBox {
height: control.height
visible: control.activeFocus
color: "transparent"
- border.color: "#0066ff"
+ border.color: Default.focusColor
border.width: 2
}
}
@@ -98,21 +100,21 @@ T.SpinBox {
height: parent.height
implicitWidth: 40
implicitHeight: 40
- color: up.pressed ? "#d0d0d0" : "#e0e0e0"
+ color: up.pressed ? Default.buttonPressedColor : Default.buttonColor
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: parent.width / 3
height: 2
- color: enabled ? "#353637" : "#bdbebf"
+ color: enabled ? Default.textColor : Default.textDisabledColor
}
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: 2
height: parent.width / 3
- color: enabled ? "#353637" : "#bdbebf"
+ color: enabled ? Default.textColor : Default.textDisabledColor
}
}
//! [up.indicator]
@@ -123,14 +125,14 @@ T.SpinBox {
height: parent.height
implicitWidth: 40
implicitHeight: 40
- color: down.pressed ? "#d0d0d0" : "#e0e0e0"
+ color: down.pressed ? Default.buttonPressedColor : Default.buttonColor
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
width: parent.width / 3
height: 2
- color: enabled ? "#353637" : "#bdbebf"
+ color: enabled ? Default.textColor : Default.textDisabledColor
}
}
//! [down.indicator]
@@ -139,7 +141,7 @@ T.SpinBox {
background: Rectangle {
opacity: control.enabled ? 1 : 0.3
implicitWidth: 140
- border.color: "#e0e0e0"
+ border.color: Default.buttonColor
}
//! [background]
}
diff --git a/src/imports/controls/StackView.qml b/src/imports/controls/StackView.qml
index aa95c6a7..93e4503f 100644
--- a/src/imports/controls/StackView.qml
+++ b/src/imports/controls/StackView.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.4
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Templates 2.1 as T
T.StackView {
id: control
diff --git a/src/imports/controls/SwipeDelegate.qml b/src/imports/controls/SwipeDelegate.qml
index 7ffd5a29..8b9c9f2f 100644
--- a/src/imports/controls/SwipeDelegate.qml
+++ b/src/imports/controls/SwipeDelegate.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.SwipeDelegate {
id: control
@@ -57,7 +59,7 @@ T.SwipeDelegate {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
@@ -75,7 +77,9 @@ T.SwipeDelegate {
//! [background]
background: Rectangle {
- color: control.visualFocus ? (control.down ? "#cce0ff" : "#e5efff") : (control.down ? "#bdbebf" : "#ffffff")
+ color: control.visualFocus
+ ? (control.down ? Default.focusPressedColor : Default.delegateFocusColor)
+ : (control.down ? Default.delegatePressedColor : Default.backgroundColor)
Behavior on x {
enabled: !control.down
diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml
index 71676f12..cd026f7c 100644
--- a/src/imports/controls/SwipeView.qml
+++ b/src/imports/controls/SwipeView.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Templates 2.1 as T
T.SwipeView {
id: control
@@ -51,6 +51,7 @@ T.SwipeView {
//! [contentItem]
contentItem: ListView {
model: control.contentModel
+ interactive: control.interactive
currentIndex: control.currentIndex
spacing: control.spacing
diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml
index 0810626f..16f2744f 100644
--- a/src/imports/controls/Switch.qml
+++ b/src/imports/controls/Switch.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
T.Switch {
id: control
@@ -67,7 +67,7 @@ T.Switch {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
diff --git a/src/imports/controls/SwitchDelegate.qml b/src/imports/controls/SwitchDelegate.qml
index 430fc8ec..8f2af81c 100644
--- a/src/imports/controls/SwitchDelegate.qml
+++ b/src/imports/controls/SwitchDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls 2.0
-import QtQuick.Controls.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
T.SwitchDelegate {
id: control
@@ -67,7 +67,7 @@ T.SwitchDelegate {
text: control.text
font: control.font
- color: control.enabled ? "#26282a" : "#bdbebf"
+ color: control.enabled ? Default.textDarkColor : Default.textDisabledColor
elide: Text.ElideRight
visible: control.text
horizontalAlignment: Text.AlignLeft
@@ -80,7 +80,7 @@ T.SwitchDelegate {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted
- color: control.down ? "#bdbebf" : "#eeeeee"
+ color: control.down ? Default.delegatePressedColor : Default.delegateColor
}
//! [background]
}
diff --git a/src/imports/controls/SwitchIndicator.qml b/src/imports/controls/SwitchIndicator.qml
index f11f7147..37c23d80 100644
--- a/src/imports/controls/SwitchIndicator.qml
+++ b/src/imports/controls/SwitchIndicator.qml
@@ -34,7 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
Item {
implicitWidth: 56
@@ -48,9 +50,9 @@ Item {
height: 16
radius: 8
opacity: control.enabled ? 1 : 0.3
- color: control.checked ? (control.visualFocus ? "#0066ff" : "#353637") : "#e0e0e0"
+ color: control.checked ? (control.visualFocus ? Default.focusColor : Default.buttonCheckedColor) : Default.buttonColor
border.width: control.visualFocus ? 2 : 0
- border.color: "#0066ff"
+ border.color: Default.focusColor
}
Rectangle {
@@ -59,9 +61,13 @@ Item {
width: 28
height: 28
radius: 16
- color: control.enabled ? (control.down ? (control.visualFocus ? "#cce0ff" : "#f6f6f6") : (control.visualFocus ? "#f0f6ff" : "#ffffff")) : "#fdfdfd"
+ color: control.enabled ? (control.down
+ ? (control.visualFocus ? Default.focusPressedColor : Default.indicatorPressedColor)
+ : (control.visualFocus ? Default.focusLightColor : Default.backgroundColor)) : Default.indicatorDisabledColor
border.width: control.visualFocus ? 2 : 1
- border.color: control.enabled ? (control.visualFocus ? "#0066ff" : (control.down ? "#808080" : "#909090")) : "#d6d6d6"
+ border.color: control.enabled ? (control.visualFocus
+ ? Default.focusColor
+ : (control.down ? Default.indicatorFramePressedColor : Default.indicatorFrameColor)) : Default.indicatorFrameDisabledColor
Behavior on x {
enabled: !control.down
diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml
index 6a575167..8b23c94a 100644
--- a/src/imports/controls/TabBar.qml
+++ b/src/imports/controls/TabBar.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
T.TabBar {
id: control
diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml
index 56b57602..824c2737 100644
--- a/src/imports/controls/TabButton.qml
+++ b/src/imports/controls/TabButton.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.TabButton {
id: control
@@ -54,7 +56,7 @@ T.TabButton {
font: control.font
elide: Text.ElideRight
opacity: enabled ? 1 : 0.3
- color: !control.checked ? "#ffffff" : control.down ? "#26282a" : "#353637"
+ color: !control.checked ? Default.textLightColor : control.down ? Default.textDarkColor : Default.textColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
@@ -63,7 +65,9 @@ T.TabButton {
//! [background]
background: Rectangle {
implicitHeight: 40
- color: control.down ? (control.checked ? "#e4e4e4" : "#585a5c") : (control.checked ? "transparent" : "#353637")
+ color: control.down
+ ? (control.checked ? Default.tabButtonCheckedPressedColor : Default.tabButtonPressedColor)
+ : (control.checked ? "transparent" : Default.tabButtonColor)
}
//! [background]
}
diff --git a/src/imports/controls/TextArea.qml b/src/imports/controls/TextArea.qml
index f1ec6dfa..734cc9d0 100644
--- a/src/imports/controls/TextArea.qml
+++ b/src/imports/controls/TextArea.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.TextArea {
id: control
@@ -51,8 +53,8 @@ T.TextArea {
leftPadding: padding + 4
opacity: enabled ? 1 : 0.2
- color: "#353637"
- selectionColor: "#fddd5c"
+ color: Default.textColor
+ selectionColor: Default.textSelectionColor
selectedTextColor: color
Text {
@@ -64,7 +66,7 @@ T.TextArea {
text: control.placeholderText
font: control.font
- color: "#c2c2c2"
+ color: Default.textDisabledLightColor
horizontalAlignment: control.horizontalAlignment
verticalAlignment: control.verticalAlignment
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
diff --git a/src/imports/controls/TextField.qml b/src/imports/controls/TextField.qml
index 35703940..e58b94c0 100644
--- a/src/imports/controls/TextField.qml
+++ b/src/imports/controls/TextField.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.TextField {
id: control
@@ -51,8 +53,8 @@ T.TextField {
leftPadding: padding + 4
opacity: enabled ? 1 : 0.2
- color: "#353637"
- selectionColor: "#fddd5c"
+ color: Default.textColor
+ selectionColor: Default.textSelectionColor
selectedTextColor: color
verticalAlignment: TextInput.AlignVCenter
@@ -65,7 +67,7 @@ T.TextField {
text: control.placeholderText
font: control.font
- color: "#bdbebf"
+ color: Default.textDisabledColor
horizontalAlignment: control.horizontalAlignment
verticalAlignment: control.verticalAlignment
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
@@ -77,8 +79,8 @@ T.TextField {
implicitWidth: 200
implicitHeight: 40
border.width: control.activeFocus ? 2 : 1
- color: control.enabled ? "#ffffff" : "#353637"
- border.color: control.activeFocus ? "#0066ff" : (control.enabled ? "#bdbebf" : "transparent")
+ color: control.enabled ? Default.backgroundColor : Default.disabledDarkColor
+ border.color: control.activeFocus ? Default.focusColor : (control.enabled ? Default.disabledLightColor : "transparent")
}
//! [background]
}
diff --git a/src/imports/controls/ToolBar.qml b/src/imports/controls/ToolBar.qml
index a787df61..f5e5076c 100644
--- a/src/imports/controls/ToolBar.qml
+++ b/src/imports/controls/ToolBar.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ToolBar {
id: control
@@ -46,14 +48,10 @@ T.ToolBar {
contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
- //! [contentItem]
- contentItem: Item { }
- //! [contentItem]
-
//! [background]
background: Rectangle {
implicitHeight: 40
- color: "#eeeeee"
+ color: Default.delegateColor
}
//! [background]
}
diff --git a/src/imports/controls/ToolButton.qml b/src/imports/controls/ToolButton.qml
index 2887d6b4..f92845f8 100644
--- a/src/imports/controls/ToolButton.qml
+++ b/src/imports/controls/ToolButton.qml
@@ -34,8 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ToolButton {
id: control
@@ -52,7 +54,7 @@ T.ToolButton {
contentItem: Text {
text: control.text
font: control.font
- color: control.enabled ? (control.visualFocus ? "#0066ff" : "#26282a") : "#c2c2c2"
+ color: control.enabled ? (control.visualFocus ? Default.focusColor : Default.textDarkColor) : Default.textDisabledLightColor
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
@@ -64,7 +66,7 @@ T.ToolButton {
implicitWidth: 40
implicitHeight: 40
- color: Qt.darker("#33333333", control.enabled && (control.checked || control.highlighted) ? 1.5 : 1.0)
+ color: Qt.darker(Default.toolButtonColor, control.enabled && (control.checked || control.highlighted) ? 1.5 : 1.0)
opacity: control.down ? 1.0 : control.enabled && (control.checked || control.highlighted) ? 0.5 : 0
visible: control.down || (control.enabled && (control.checked || control.highlighted))
}
diff --git a/src/imports/controls/ToolSeparator.qml b/src/imports/controls/ToolSeparator.qml
new file mode 100644
index 00000000..dca746d7
--- /dev/null
+++ b/src/imports/controls/ToolSeparator.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
+
+T.ToolSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: vertical ? 6 : 2
+ topPadding: vertical ? 2 : 6
+ bottomPadding: vertical ? 2 : 6
+
+ //! [contentItem]
+ contentItem: Rectangle {
+ implicitWidth: vertical ? 1 : 30
+ implicitHeight: vertical ? 30 : 1
+ color: Default.separatorColor
+ }
+ //! [contentItem]
+}
diff --git a/src/imports/controls/ToolTip.qml b/src/imports/controls/ToolTip.qml
index 876e2274..783dc224 100644
--- a/src/imports/controls/ToolTip.qml
+++ b/src/imports/controls/ToolTip.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.ToolTip {
id: control
@@ -64,7 +65,7 @@ T.ToolTip {
//! [background]
background: Rectangle {
- border.color: "#353637"
+ border.color: Default.frameDarkColor
}
//! [background]
}
diff --git a/src/imports/controls/Tumbler.qml b/src/imports/controls/Tumbler.qml
index 13bc0859..6c89b86d 100644
--- a/src/imports/controls/Tumbler.qml
+++ b/src/imports/controls/Tumbler.qml
@@ -34,48 +34,39 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Tumbler {
id: control
implicitWidth: 60
implicitHeight: 200
- //! [delegate]
delegate: Text {
id: label
text: modelData
- color: control.visualFocus ? "#0066ff" : "#26282a"
+ color: control.visualFocus ? Default.focusColor : Default.textDarkColor
font: control.font
opacity: (1.0 - Math.abs(Tumbler.displacement) / (visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
- //! [delegate]
- //! [contentItem]
- contentItem: PathView {
- id: pathView
+ contentItem: TumblerView {
+ id: tumblerView
model: control.model
delegate: control.delegate
- clip: true
- pathItemCount: control.visibleItemCount + 1
- preferredHighlightBegin: 0.5
- preferredHighlightEnd: 0.5
- dragMargin: width / 2
-
path: Path {
- startX: pathView.width / 2
- startY: -pathView.delegateHeight / 2
+ startX: tumblerView.width / 2
+ startY: -tumblerView.delegateHeight / 2
PathLine {
- x: pathView.width / 2
- y: pathView.pathItemCount * pathView.delegateHeight - pathView.delegateHeight / 2
+ x: tumblerView.width / 2
+ y: (control.visibleItemCount + 1) * tumblerView.delegateHeight - tumblerView.delegateHeight / 2
}
}
property real delegateHeight: control.availableHeight / control.visibleItemCount
}
- //! [contentItem]
}
diff --git a/src/imports/controls/controls.pri b/src/imports/controls/controls.pri
index dcbcf8e1..79e03db5 100644
--- a/src/imports/controls/controls.pri
+++ b/src/imports/controls/controls.pri
@@ -1,12 +1,14 @@
HEADERS += \
$$PWD/qquickbusyindicatorring_p.h \
$$PWD/qquickprogressstrip_p.h \
- $$PWD/qquickdialring_p.h
+ $$PWD/qquickdialring_p.h \
+ $$PWD/qquickdefaultstyle_p.h
SOURCES += \
$$PWD/qquickbusyindicatorring.cpp \
$$PWD/qquickprogressstrip.cpp \
- $$PWD/qquickdialring.cpp
+ $$PWD/qquickdialring.cpp \
+ $$PWD/qquickdefaultstyle.cpp
QML_CONTROLS = \
AbstractButton.qml \
@@ -20,6 +22,8 @@ QML_CONTROLS = \
Container.qml \
Control.qml \
Dial.qml \
+ Dialog.qml \
+ DialogButtonBox.qml \
Drawer.qml \
Frame.qml \
GroupBox.qml \
@@ -27,6 +31,7 @@ QML_CONTROLS = \
Label.qml \
Menu.qml \
MenuItem.qml \
+ MenuSeparator.qml \
Page.qml \
PageIndicator.qml \
Pane.qml \
@@ -36,6 +41,7 @@ QML_CONTROLS = \
RadioDelegate.qml \
RadioIndicator.qml \
RangeSlider.qml \
+ RoundButton.qml \
ScrollBar.qml \
ScrollIndicator.qml \
Slider.qml \
@@ -52,6 +58,7 @@ QML_CONTROLS = \
TextField.qml \
ToolBar.qml \
ToolButton.qml \
+ ToolSeparator.qml \
ToolTip.qml \
Tumbler.qml
diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro
index 15c07cf0..9e8a3c27 100644
--- a/src/imports/controls/controls.pro
+++ b/src/imports/controls/controls.pro
@@ -1,6 +1,6 @@
TARGET = qtquickcontrols2plugin
TARGETPATH = QtQuick/Controls.2
-IMPORT_VERSION = 2.0
+IMPORT_VERSION = 2.1
QT += qml quick
QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private
diff --git a/src/imports/controls/dependencies.json b/src/imports/controls/dependencies.json
new file mode 100644
index 00000000..4481dd1c
--- /dev/null
+++ b/src/imports/controls/dependencies.json
@@ -0,0 +1,17 @@
+[
+ {
+ "name": "QtQuick",
+ "type": "module",
+ "version": "2.8"
+ },
+ {
+ "name": "QtQuick.Window",
+ "type": "module",
+ "version": "2.2"
+ },
+ {
+ "name": "QtQuick.Templates",
+ "type": "module",
+ "version": "2.1"
+ }
+]
diff --git a/src/imports/controls/designer/ToolSeparatorSpecifics.qml b/src/imports/controls/designer/ToolSeparatorSpecifics.qml
new file mode 100644
index 00000000..2e967a6e
--- /dev/null
+++ b/src/imports/controls/designer/ToolSeparatorSpecifics.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import HelperWidgets 2.0
+import QtQuick.Layouts 1.3
+
+Column {
+ width: parent.width
+
+ Section {
+ width: parent.width
+ caption: qsTr("ToolSeparator")
+
+ SectionLayout {
+ Label {
+ text: qsTr("Orientation")
+ tooltip: qsTr("The orientation of the separator.")
+ }
+ SecondColumnLayout {
+ ComboBox {
+ backendValue: backendValues.orientation
+ model: [ "Horizontal", "Vertical" ]
+ scope: "Qt"
+ Layout.fillWidth: true
+ }
+ }
+ }
+ }
+
+ ControlSection {
+ width: parent.width
+ }
+
+ PaddingSection {
+ width: parent.width
+ }
+}
diff --git a/src/imports/controls/designer/images/toolseparator-icon.png b/src/imports/controls/designer/images/toolseparator-icon.png
new file mode 100644
index 00000000..3d2e152f
--- /dev/null
+++ b/src/imports/controls/designer/images/toolseparator-icon.png
Binary files differ
diff --git a/src/imports/controls/designer/images/toolseparator-icon16.png b/src/imports/controls/designer/images/toolseparator-icon16.png
new file mode 100644
index 00000000..97672506
--- /dev/null
+++ b/src/imports/controls/designer/images/toolseparator-icon16.png
Binary files differ
diff --git a/src/imports/controls/designer/images/toolseparator-icon16@2x.png b/src/imports/controls/designer/images/toolseparator-icon16@2x.png
new file mode 100644
index 00000000..979b6426
--- /dev/null
+++ b/src/imports/controls/designer/images/toolseparator-icon16@2x.png
Binary files differ
diff --git a/src/imports/controls/designer/images/toolseparator-icon@2x.png b/src/imports/controls/designer/images/toolseparator-icon@2x.png
new file mode 100644
index 00000000..19287154
--- /dev/null
+++ b/src/imports/controls/designer/images/toolseparator-icon@2x.png
Binary files differ
diff --git a/src/imports/controls/designer/qtquickcontrols2.metainfo b/src/imports/controls/designer/qtquickcontrols2.metainfo
index 81a6d914..c697b3c2 100644
--- a/src/imports/controls/designer/qtquickcontrols2.metainfo
+++ b/src/imports/controls/designer/qtquickcontrols2.metainfo
@@ -388,6 +388,19 @@ MetaInfo {
}
Type {
+ name: "QtQuick.Controls.ToolSeparator"
+ icon: "images/toolseparator-icon16.png"
+
+ ItemLibraryEntry {
+ name: "ToolSeparator"
+ category: "Qt Quick - Controls 2"
+ libraryIcon: "images/toolseparator-icon.png"
+ version: "2.1"
+ requiredImport: "QtQuick.Controls"
+ }
+ }
+
+ Type {
name: "QtQuick.Controls.Tumbler"
icon: "images/tumbler-icon16.png"
@@ -399,4 +412,32 @@ MetaInfo {
requiredImport: "QtQuick.Controls"
}
}
+
+ Type {
+ name: "QtQuick.Controls.TabBar"
+ icon: "images/toolbar-icon16.png"
+
+ ItemLibraryEntry {
+ name: "Tab Bar"
+ category: "Qt Quick - Controls 2"
+ libraryIcon: "images/toolbar-icon.png"
+ version: "2.0"
+ requiredImport: "QtQuick.Controls"
+ Property { name: "width"; type: "int"; value: 240 }
+ }
+ }
+
+ Type {
+ name: "QtQuick.Controls.TabButton"
+ icon: "images/toolbutton-icon16.png"
+
+ ItemLibraryEntry {
+ name: "Tab Button"
+ category: "Qt Quick - Controls 2"
+ libraryIcon: "images/toolbutton-icon.png"
+ version: "2.0"
+ requiredImport: "QtQuick.Controls"
+ Property { name: "text"; type: "binding"; value: "qsTr(\"Tab Button\")" }
+ }
+ }
}
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox-attached.png b/src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox-attached.png
new file mode 100644
index 00000000..53ecf83d
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox-attached.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox.png b/src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox.png
new file mode 100644
index 00000000..87cece98
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-dialogbuttonbox.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-menuseparator-custom.png b/src/imports/controls/doc/images/qtquickcontrols2-menuseparator-custom.png
new file mode 100644
index 00000000..48785b73
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-menuseparator-custom.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-menuseparator.png b/src/imports/controls/doc/images/qtquickcontrols2-menuseparator.png
new file mode 100644
index 00000000..beb1cfeb
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-menuseparator.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-roundbutton.png b/src/imports/controls/doc/images/qtquickcontrols2-roundbutton.png
new file mode 100644
index 00000000..9f1d44fc
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-roundbutton.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-toolseparator-custom.png b/src/imports/controls/doc/images/qtquickcontrols2-toolseparator-custom.png
new file mode 100644
index 00000000..4f423154
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-toolseparator-custom.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-toolseparator.png b/src/imports/controls/doc/images/qtquickcontrols2-toolseparator.png
new file mode 100644
index 00000000..253c429b
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-toolseparator.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-tumbler-wrap.gif b/src/imports/controls/doc/images/qtquickcontrols2-tumbler-wrap.gif
index 4821a4e8..8f59eedc 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-tumbler-wrap.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-tumbler-wrap.gif
Binary files differ
diff --git a/src/imports/controls/doc/qtquickcontrols2.qdocconf b/src/imports/controls/doc/qtquickcontrols2.qdocconf
index e83e418e..15da00ad 100644
--- a/src/imports/controls/doc/qtquickcontrols2.qdocconf
+++ b/src/imports/controls/doc/qtquickcontrols2.qdocconf
@@ -29,7 +29,7 @@ qhp.QtQuickControls2.subprojects.examples.title = Examples
qhp.QtQuickControls2.subprojects.examples.indexTitle = Qt Quick Controls 2 Examples
qhp.QtQuickControls2.subprojects.examples.selectors = fake:example
-depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols qtquickextras qmake qtsql qtwidgets
+depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols qtquickextras qmake qtsql qtwidgets qtlabscalendar qtlabsplatform
# Specify the install path under QT_INSTALL_EXAMPLES
# Note: paths passed to \example command must contain the parent directory, e.g.
@@ -37,20 +37,17 @@ depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols qtquic
exampledirs += ../../../../examples/quickcontrols2 \
../ \
../../../quicktemplates2 \
- ../../calendar \
- ../../../../tests/auto/controls/data \
snippets \
snippets/screenshots
examplesinstallpath = quickcontrols2
headerdirs += ../../../quicktemplates2 \
- ../../calendar \
../../../quickcontrols2
sourcedirs += ../../../quicktemplates2 \
- ../../calendar \
../../../quickcontrols2 \
+ ../../templates/doc/src \
src
imagedirs += images
@@ -92,7 +89,6 @@ macro.endstylemethod2 = "\\br"
macro.stylecolor.HTML = "<div style=\"padding:10px;color:#fff;background:\1;\">\1 \2</div>"
macro.nbsp.HTML = "&nbsp;"
-macro.labs = "\\note \\e{Types in Qt.labs modules are not guaranteed to remain compatible in future versions.}"
#Add output suffix to the html filenames
outputsuffixes = QML
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml
new file mode 100644
index 00000000..c151ceed
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modal.qml
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 2.1
+
+Item {
+ width: dialog.implicitWidth
+ height: dialog.implicitHeight
+//! [1]
+Dialog {
+ id: dialog
+ modal: true
+ standardButtons: Dialog.Ok
+}
+//! [1]
+}
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml
new file mode 100644
index 00000000..45e1c2c0
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog-modeless.qml
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 2.1
+
+Item {
+ width: dialog.implicitWidth
+ height: dialog.implicitHeight
+//! [1]
+Dialog {
+ id: dialog
+ modal: false
+ standardButtons: Dialog.Ok
+}
+//! [1]
+}
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml
new file mode 100644
index 00000000..c5de0b71
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialog.qml
@@ -0,0 +1,43 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 2.1
+
+Item {
+ width: dialog.implicitWidth
+ height: dialog.implicitHeight
+//! [1]
+Dialog {
+ id: dialog
+ standardButtons: Dialog.Ok | Dialog.Cancel
+
+ onAccepted: console.log("Ok clicked")
+ onRejected: console.log("Cancel clicked")
+}
+//! [1]
+}
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml
new file mode 100644
index 00000000..a93cda30
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox-attached.qml
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 2.1
+
+//! [1]
+DialogButtonBox {
+ Button {
+ text: qsTr("Save")
+ DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
+ }
+ Button {
+ text: qsTr("Close")
+ DialogButtonBox.buttonRole: DialogButtonBox.DestructiveRole
+ }
+}
+//! [1]
diff --git a/src/imports/controls/doc/snippets/basic-example.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml
index 62ab2466..41e6cf23 100644
--- a/src/imports/controls/doc/snippets/basic-example.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-dialogbuttonbox.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -25,19 +25,14 @@
**
****************************************************************************/
-//! [0]
-import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick 2.0
+import QtQuick.Controls 2.1
-ApplicationWindow {
- title: "My Application"
- width: 640
- height: 480
- visible: true
+//! [1]
+DialogButtonBox {
+ standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel
- Button {
- text: "Push Me"
- anchors.centerIn: parent
- }
+ onAccepted: console.log("Ok clicked")
+ onRejected: console.log("Cancel clicked")
}
-//! [0]
+//! [1]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml
new file mode 100644
index 00000000..b5d8b18b
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator-custom.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+//! [file]
+import QtQuick 2.6
+import QtQuick.Controls 2.1
+
+Item {
+ id: window
+ width: menu.contentItem.width
+ height: menu.contentItem.height
+ visible: true
+
+// Indent it like this so that the indenting in the generated doc is normal.
+Menu {
+ id: menu
+ contentItem.parent: window
+
+ MenuItem {
+ text: qsTr("New...")
+ }
+ MenuItem {
+ text: qsTr("Open...")
+ }
+ MenuItem {
+ text: qsTr("Save")
+ }
+
+ MenuSeparator {
+ padding: 0
+ topPadding: 12
+ bottomPadding: 12
+ contentItem: Rectangle {
+ implicitWidth: 200
+ implicitHeight: 1
+ color: "#1E000000"
+ }
+ }
+
+ MenuItem {
+ text: qsTr("Exit")
+ }
+}
+}
+//! [file]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml
new file mode 100644
index 00000000..d41d3cf9
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-menuseparator.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+//! [file]
+import QtQuick 2.6
+import QtQuick.Controls 2.1
+
+Item {
+ id: window
+ width: menu.contentItem.width
+ height: menu.contentItem.height
+ visible: true
+
+// Indent it like this so that the indenting in the generated doc is normal.
+Menu {
+ id: menu
+ contentItem.parent: window
+
+ MenuItem {
+ text: qsTr("New...")
+ }
+ MenuItem {
+ text: qsTr("Open...")
+ }
+ MenuItem {
+ text: qsTr("Save")
+ }
+
+ MenuSeparator {}
+
+ MenuItem {
+ text: qsTr("Exit")
+ }
+}
+}
+//! [file]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml
new file mode 100644
index 00000000..fa926302
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-roundbutton.qml
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 2.1
+
+//! [1]
+RoundButton {
+ text: "\u2713" // Unicode Character 'CHECK MARK'
+ onClicked: textArea.readOnly = true
+}
+//! [1]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml
index 3e40ea2d..898ff6af 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-stackview-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
StackView {
id: control
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml
new file mode 100644
index 00000000..36c96190
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+
+//! [file]
+ListView {
+ id: listView
+ anchors.fill: parent
+ model: ListModel {
+ ListElement { sender: "Bob Bobbleton"; title: "How are you going?" }
+ ListElement { sender: "Rug Emporium"; title: "SALE! All rugs MUST go!" }
+ ListElement { sender: "Electric Co."; title: "Electricity bill 15/07/2016 overdue" }
+ ListElement { sender: "Tips"; title: "Five ways this tip will save your life" }
+ }
+ delegate: SwipeDelegate {
+ id: swipeDelegate
+ text: model.sender + " - " + model.title
+ width: parent.width
+
+ ListView.onRemove: SequentialAnimation {
+ PropertyAction {
+ target: swipeDelegate
+ property: "ListView.delayRemove"
+ value: true
+ }
+ NumberAnimation {
+ target: swipeDelegate
+ property: "height"
+ to: 0
+ easing.type: Easing.InOutQuad
+ }
+ PropertyAction {
+ target: swipeDelegate;
+ property: "ListView.delayRemove";
+ value: false
+ }
+ }
+
+ swipe.right: Label {
+ id: deleteLabel
+ text: qsTr("Delete")
+ color: "white"
+ verticalAlignment: Label.AlignVCenter
+ padding: 12
+ height: parent.height
+ anchors.right: parent.right
+
+ SwipeDelegate.onClicked: listView.model.remove(index)
+
+ background: Rectangle {
+ color: deleteLabel.SwipeDelegate.pressed ? Qt.darker("tomato", 1.1) : "tomato"
+ }
+ }
+ }
+}
+//! [file]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml
index 04b12512..0f862276 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipeview-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
SwipeView {
id: control
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml
new file mode 100644
index 00000000..7495a993
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator-custom.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.1
+
+//! [file]
+ToolBar {
+ RowLayout {
+ anchors.fill: parent
+
+ ToolButton {
+ text: qsTr("Action 1")
+ }
+ ToolButton {
+ text: qsTr("Action 2")
+ }
+
+ ToolSeparator {
+ padding: vertical ? 10 : 2
+ topPadding: vertical ? 2 : 10
+ bottomPadding: vertical ? 2 : 10
+
+ contentItem: Rectangle {
+ implicitWidth: parent.vertical ? 1 : 24
+ implicitHeight: parent.vertical ? 24 : 1
+ color: "#c3c3c3"
+ }
+ }
+
+ ToolButton {
+ text: qsTr("Action 3")
+ }
+ ToolButton {
+ text: qsTr("Action 4")
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+ }
+}
+//! [file]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml
new file mode 100644
index 00000000..7770d14c
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-toolseparator.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.1
+
+//! [1]
+ToolBar {
+ RowLayout {
+ anchors.fill: parent
+
+ ToolButton {
+ text: qsTr("Action 1")
+ }
+ ToolButton {
+ text: qsTr("Action 2")
+ }
+
+ ToolSeparator {}
+
+ ToolButton {
+ text: qsTr("Action 3")
+ }
+ ToolButton {
+ text: qsTr("Action 4")
+ }
+
+ ToolSeparator {}
+
+ ToolButton {
+ text: qsTr("Action 5")
+ }
+ ToolButton {
+ text: qsTr("Action 6")
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+ }
+}
+//! [1]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml
index 94d9c12e..6bb8a45e 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tooltip-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
ToolTip {
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml
new file mode 100644
index 00000000..ff3ecd81
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-listView.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+
+//! [contentItem]
+Tumbler {
+ id: tumbler
+
+ contentItem: ListView {
+ model: tumbler.model
+ delegate: tumbler.delegate
+
+ snapMode: ListView.SnapToItem
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ preferredHighlightBegin: height / 2 - (height / tumbler.visibleItemCount / 2)
+ preferredHighlightEnd: height / 2 + (height / tumbler.visibleItemCount / 2)
+ clip: true
+ }
+}
+//! [contentItem]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml
new file mode 100644
index 00000000..957112e0
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-pathView.qml
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+
+//! [contentItem]
+Tumbler {
+ id: tumbler
+
+ contentItem: PathView {
+ id: pathView
+ model: tumbler.model
+ delegate: tumbler.delegate
+ clip: true
+ pathItemCount: tumbler.visibleItemCount + 1
+ preferredHighlightBegin: 0.5
+ preferredHighlightEnd: 0.5
+ dragMargin: width / 2
+
+ path: Path {
+ startX: pathView.width / 2
+ startY: -pathView.delegateHeight / 2
+ PathLine {
+ x: pathView.width / 2
+ y: pathView.pathItemCount * pathView.delegateHeight - pathView.delegateHeight / 2
+ }
+ }
+
+ property real delegateHeight: tumbler.availableHeight / tumbler.visibleItemCount
+ }
+}
+//! [contentItem]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml
new file mode 100644
index 00000000..86276266
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-tumbler-timePicker.qml
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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 The Qt Company Ltd 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$
+**
+****************************************************************************/
+
+//! [tumbler]
+import QtQuick 2.8
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.1
+
+Rectangle {
+ width: frame.implicitWidth + 10
+ height: frame.implicitHeight + 10
+
+ function formatText(count, modelData) {
+ var data = count === 12 ? modelData + 1 : modelData;
+ return data.toString().length < 2 ? "0" + data : data;
+ }
+
+ FontMetrics {
+ id: fontMetrics
+ }
+
+ Component {
+ id: delegateComponent
+
+ Label {
+ text: formatText(Tumbler.tumbler.count, modelData)
+ opacity: 1.0 - Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2)
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: fontMetrics.font.pixelSize * 1.25
+ }
+ }
+
+ Frame {
+ id: frame
+ padding: 0
+ anchors.centerIn: parent
+
+ Row {
+ id: row
+
+ Tumbler {
+ id: hoursTumbler
+ model: 12
+ delegate: delegateComponent
+ }
+
+ Tumbler {
+ id: minutesTumbler
+ model: 60
+ delegate: delegateComponent
+ }
+
+ Tumbler {
+ id: amPmTumbler
+ model: ["AM", "PM"]
+ delegate: delegateComponent
+ }
+ }
+ }
+}
+//! [tumbler]
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-busyindicator-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-busyindicator-custom.qml
index 82ed9cdc..847ad736 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-busyindicator-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-busyindicator-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
BusyIndicator {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-custom.qml
index eac6b831..dbe53f4d 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Button {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-disabled.qml
index f4555c90..c7399b9a 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-disabled.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-disabled.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Button {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-focused.qml
index a99346a6..ea220fde 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-focused.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-focused.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Button {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-normal.qml
index f206bcec..385d4abb 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-normal.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-normal.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Button {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-pressed.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-pressed.qml
index 8a941561..edf0b324 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-pressed.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-button-pressed.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Button {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-checked.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-checked.qml
index 075e6342..e5c466da 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-checked.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-checked.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
CheckBox {
text: "Checked"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-custom.qml
index 0465ec80..9645a4b6 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
CheckBox {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-disabled.qml
index 4878cf31..3bfbb730 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-disabled.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-disabled.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
CheckBox {
text: "Disabled"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-focused.qml
index 93f1c214..fd7c7fea 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-focused.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-focused.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
CheckBox {
text: "Focused"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-normal.qml
index a840116e..dba9e7e9 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-normal.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkbox-normal.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
CheckBox {
text: "Normal"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkdelegate-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkdelegate-custom.qml
index 483f9838..83f0ef86 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkdelegate-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-checkdelegate-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
CheckDelegate {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-custom.qml
index bd261e52..12d56a56 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
ComboBox {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-delegate.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-delegate.qml
index d8b5d1fa..2817d956 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-delegate.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-delegate.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
id: root
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-popup.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-popup.qml
index 36569e15..1ac43234 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-popup.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-combobox-popup.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
id: root
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml
index efe061d3..1bf9baf4 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Dial {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-handle.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-handle.qml
index 19d943a6..d9a61682 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-handle.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-dial-handle.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Dial {
id: dial
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame-custom.qml
index d11c431e..f2b5d254 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Frame {
background: Rectangle {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame.qml
index 1ede733d..98f177ef 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-frame.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
Frame {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-checkable.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-checkable.qml
index a2999925..db58593f 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-checkable.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-checkable.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
GroupBox {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-custom.qml
index cb9ed049..bf21e022 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
GroupBox {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-label.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-label.qml
index 74d0ea52..bef99d0b 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-label.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox-label.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
GroupBox {
width: 100
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox.qml
index f79f3aef..7d4f328c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-groupbox.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
GroupBox {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate-custom.qml
index 002aae69..0935d8f6 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
ItemDelegate {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate.qml
index 143b3323..733434e8 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-itemdelegate.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
ListView {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label-custom.qml
index 98dbdc5e..2eedb29f 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Label {
text: qsTr("Label")
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label.qml
index 4346c0eb..cf59c49a 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-label.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
Label {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-menu-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-menu-custom.qml
index a6971232..f4507714 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-menu-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-menu-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
id: window
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-custom.qml
index 65112ef4..225ba423 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
PageIndicator {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-delegate.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-delegate.qml
index 4b3ccf23..c7ae046f 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-delegate.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator-delegate.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
PageIndicator {
count: 5
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator.qml
index 237bc6e7..cf91d6f2 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pageindicator.qml
@@ -25,7 +25,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
PageIndicator {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane-custom.qml
index 80519939..42c30795 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Pane {
background: Rectangle {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane.qml
index 3d86499f..b7b8fa5d 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-pane.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
Pane {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml
index 88faed20..9e6779d6 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
ProgressBar {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-custom.qml
index dba262be..1d9661a5 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
RadioButton {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiodelegate-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiodelegate-custom.qml
index 6efb7803..91125921 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiodelegate-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiodelegate-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
RadioDelegate {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-custom.qml
index 7e488d14..86fae061 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
RangeSlider {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-active.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-active.qml
index 086541c8..1570aff4 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-active.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-active.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
width: 100
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-custom.qml
index 0bf13b3c..05b3f3aa 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollbar-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
ScrollBar {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-active.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-active.qml
index c118c7aa..954b449c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-active.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-active.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
width: 100
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-custom.qml
index 5720f4f7..97930e1e 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-scrollindicator-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
ScrollIndicator {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-custom.qml
index ebc11f46..6201cbf8 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Slider {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-handle.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-handle.qml
index 20b569f3..fa23972c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-handle.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-handle.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Slider {
value: 0.5
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-custom.qml
index 6433fd80..cfbd8400 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
SpinBox {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-double.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-double.qml
index 15af31ae..ad22b856 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-double.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-double.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
SpinBox {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-down.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-down.qml
index 419dae5c..ecd2a659 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-down.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-down.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
SpinBox {
value: 50
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-textual.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-textual.qml
index 814b8b28..e6b7c735 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-textual.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-textual.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
SpinBox {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-up.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-up.qml
index b4b0fab3..0b2c3fea 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-up.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox-up.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
SpinBox {
value: 50
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox.qml
index 6616ed60..d8c54714 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-spinbox.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
SpinBox {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipedelegate-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipedelegate-custom.qml
index ae63efed..087e17fe 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipedelegate-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipedelegate-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
SwipeDelegate {
id: control
@@ -37,7 +37,7 @@ SwipeDelegate {
id: component
Rectangle {
- color: control.swipe.complete && control.down ? "#333" : "#444"
+ color: SwipeDelegate.pressed ? "#333" : "#444"
width: parent.width
height: parent.height
clip: true
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipeview-indicator.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipeview-indicator.qml
index 2ba8df9c..3afcc3e2 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipeview-indicator.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-swipeview-indicator.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
width: 200
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-checked.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-checked.qml
index f9a18b1c..3a6dfc7c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-checked.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-checked.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Switch {
text: "Checked"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-custom.qml
index 698c1a05..5152040d 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Switch {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-disabled.qml
index a40586b5..6eb53084 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-disabled.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-disabled.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Switch {
text: "Disabled"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-focused.qml
index f98f2c90..6ca19062 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-focused.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-focused.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Switch {
text: "Focused"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-normal.qml
index a55c2854..339874d7 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-normal.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switch-normal.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Switch {
text: "Normal"
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switchdelegate-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switchdelegate-custom.qml
index 8d0daa0a..e06af484 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switchdelegate-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-switchdelegate-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
SwitchDelegate {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-custom.qml
index 1873fba9..305101c0 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TabBar {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar.qml
index b445ee67..e3a67c30 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.3
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Column {
width: 300
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbutton.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbutton.qml
index 67e5e1e0..9fef1e59 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbutton.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbutton.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
TabBar {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-custom.qml
index f70c7135..dd6035c0 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TextArea {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-flickable.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-flickable.qml
index e11750cb..500e09c3 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-flickable.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textarea-flickable.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
width: 100
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-custom.qml
index 0deb0e5c..8e5d897c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TextField {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-disabled.qml
index ac798f53..21c351c4 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-disabled.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-disabled.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TextField {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-focused.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-focused.qml
index a4e1b3b1..ddea7c51 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-focused.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-focused.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TextField {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-normal.qml
index 12c7ead9..29f7fb9c 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-normal.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-textfield-normal.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
TextField {
width: 80
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar-custom.qml
index 3e98808c..e8d268c5 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar-custom.qml
@@ -27,7 +27,7 @@
import QtQuick 2.6
import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [file]
ToolBar {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml
index fd6754f8..98a13b7b 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
ToolBar {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbutton-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbutton-custom.qml
index 10491cb5..449266c1 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbutton-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbutton-custom.qml
@@ -27,7 +27,7 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
ToolButton {
id: control
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-hover.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-hover.qml
index 330ab83c..27b03a63 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-hover.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-hover.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
Button {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-pressandhold.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-pressandhold.qml
index eddb09e6..7d285528 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-pressandhold.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-pressandhold.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
//! [1]
Button {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-slider.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-slider.qml
index e6a386c1..ca08ce72 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-slider.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip-slider.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Window 2.2
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
id: root
@@ -46,7 +46,7 @@ Item {
ToolTip {
parent: slider.handle
visible: slider.pressed
- text: slider.position.toFixed(1)
+ text: slider.valueAt(slider.position).toFixed(1)
}
}
//! [1]
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip.qml
index c85f91bb..ef08e174 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tooltip.qml
@@ -27,7 +27,7 @@
import QtQuick 2.0
import QtQuick.Window 2.2
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Item {
id: root
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-custom.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-custom.qml
index d2b4f960..f1c2b806 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-custom.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-custom.qml
@@ -27,12 +27,11 @@
//! [file]
import QtQuick 2.6
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Tumbler {
id: control
model: 15
- visibleItemCount: 5
background: Item {
Rectangle {
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-delegate.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-delegate.qml
index 4d389ab7..4d2c7349 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-delegate.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tumbler-delegate.qml
@@ -26,7 +26,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Controls 2.0
+import QtQuick.Controls 2.1
Tumbler {
id: tumbler
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
index 71ffe350..866aef23 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -49,7 +49,7 @@
\qml
import QtQuick 2.6
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
ApplicationWindow {
width: 400
@@ -92,7 +92,7 @@
your application, refer to it by its filename:
\qml
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
ApplicationWindow {
MyButton {
@@ -108,7 +108,7 @@
control, first import the folder into a namespace:
\qml
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
import "controls" as MyControls
ApplicationWindow {
@@ -299,7 +299,7 @@
\qml
import QtQuick 2.6
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
import MyStyle 1.0
@@ -488,7 +488,7 @@
\quotefromfile qtquickcontrols2-menu-custom.qml
\skipto import QtQuick 2.6
- \printuntil import QtQuick.Controls 2.0
+ \printuntil import QtQuick.Controls 2.1
\skipto Menu
\printto contentItem.parent: window
\skipline contentItem.parent: window
@@ -503,6 +503,23 @@
\l {Customizing Button}{Button}.
+ \section2 Customizing MenuSeparator
+
+ MenuSeparator consists of two visual items: \l {Control::background}{background}
+ and \l {Control::contentItem}{content item}.
+
+ \image qtquickcontrols2-menuseparator-custom.png
+
+ \quotefromfile qtquickcontrols2-menuseparator-custom.qml
+ \skipto import QtQuick 2.6
+ \printuntil import QtQuick.Controls 2.1
+ \skipto Menu
+ \printto contentItem.parent: window
+ \skipline contentItem.parent: window
+ \printuntil text: qsTr("Exit")
+ \printuntil }
+ \printuntil }
+
\section2 Customizing PageIndicator
PageIndicator consists of a \l {Control::background}{background}, \l {Control::contentItem}{content item}, and \l {PageIndicator::delegate}{delegate}.
@@ -581,6 +598,12 @@
\snippet qtquickcontrols2-rangeslider-custom.qml file
+ \section2 Customizing RoundButton
+
+ RoundButton can be customized in the same manner as
+ \l {Customizing Button}{Button}.
+
+
\section2 Customizing ScrollBar
ScrollBar consists of two visual items: \l {Control::background}{background}
@@ -723,6 +746,16 @@
\snippet qtquickcontrols2-toolbutton-custom.qml file
+ \section2 Customizing ToolSeparator
+
+ ToolSeparator consists of two visual items: \l {Control::background}{background}
+ and \l {Control::contentItem}{content item}.
+
+ \image qtquickcontrols2-toolseparator-custom.png
+
+ \snippet qtquickcontrols2-toolseparator-custom.qml file
+
+
\section2 Customizing ToolTip
ToolTip consists of two visual items: \l {Popup::background}{background}
@@ -730,7 +763,7 @@
\quotefromfile qtquickcontrols2-tooltip-custom.qml
\skipto import QtQuick 2.6
- \printuntil import QtQuick.Controls 2.0
+ \printuntil import QtQuick.Controls 2.1
\skipto ToolTip
\printuntil }
\printuntil }
@@ -747,4 +780,13 @@
\image qtquickcontrols2-tumbler-custom.png
\snippet qtquickcontrols2-tumbler-custom.qml file
+
+ If you want to define your own contentItem, use either a \l ListView or
+ \l PathView as the root item. For a wrapping Tumbler, use PathView:
+
+ \snippet qtquickcontrols2-tumbler-pathView.qml contentItem
+
+ For a non-wrapping Tumbler, use ListView:
+
+ \snippet qtquickcontrols2-tumbler-listView.qml contentItem
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
index 45ea7db7..5cb7a9a5 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
@@ -115,7 +115,7 @@
\row
\li Can be used on Desktop
\li Yes
- \li Yes \b *
+ \li Yes
\row
\li Can be used on Mobile
\li Yes
@@ -130,8 +130,6 @@
\li C++
\endtable
- \b {* No hover effects}
-
\section2 Porting Qt Quick Controls Code
The API of Qt Quick Controls 2 is very similar to Qt Quick Controls, but it
@@ -262,6 +260,9 @@
\li \l [QML QtQuickControls] {MenuItem}
\li \l [QML QtQuickControls2] {MenuItem}
\row
+ \li \l [QML QtQuickControls] {MenuSeparator}
+ \li \l [QML QtQuickControls2] {MenuSeparator}
+ \row
\li \mdash
\li \l [QML QtQuickControls2] {Page}
\row
@@ -352,6 +353,9 @@
\li \l [QML QtQuickControls2] {ToolButton}
\row
\li \mdash
+ \li \l [QML QtQuickControls2] {ToolSeparator}
+ \row
+ \li \mdash
\li \l [QML QtQuickControls2] {ToolTip}
\row
\li \l [QML QtQuickControls] {TreeView}
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc
index 86df60c7..a132c6f0 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc
@@ -62,7 +62,7 @@
\code
// main.qml
import QtQuick 2.6
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
ApplicationWindow {
id: window
@@ -81,7 +81,7 @@
\code
// CustomButton.qml
import QtQuick 2.6
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
Button {
id: control
@@ -103,8 +103,8 @@
// +material/CustomButton.qml
import QtQuick 2.6
import QtGraphicalEffects 1.0
- import QtQuick.Controls 2.0
- import QtQuick.Controls.Material 2.0
+ import QtQuick.Controls 2.1
+ import QtQuick.Controls.Material 2.1
Button {
id: control
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc
index 4661e8c9..7eb9eaf4 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc
@@ -31,7 +31,22 @@
A basic example of a QML file that makes use of controls is shown here:
- \snippet basic-example.qml 0
+ \qml
+ import QtQuick 2.6
+ import QtQuick.Controls 2.1
+
+ ApplicationWindow {
+ title: "My Application"
+ width: 640
+ height: 480
+ visible: true
+
+ Button {
+ text: "Push Me"
+ anchors.centerIn: parent
+ }
+ }
+ \endqml
\section1 Setting Up Controls from C++
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
index de3d0c37..1fadfd75 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
@@ -32,7 +32,8 @@
\brief Provides a set of UI controls for Qt Quick.
Qt Quick Controls 2 provides a set of controls that can be used
- to build complete interfaces in Qt Quick.
+ to build complete interfaces in Qt Quick. The module was introduced
+ in Qt 5.7.
\section1 Prerequisites
@@ -40,7 +41,7 @@
application using the following import statement in your \c {.qml} file:
\code
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
\endcode
The \l{Qt Quick Controls 2 C++ Classes}{C++ classes} can be included into
@@ -93,5 +94,6 @@
\li \l{Qt Quick Layouts}
\li \l{Qt Quick Templates 2}
\li \l{Qt Labs Calendar}
+ \li \l{Qt Labs Platform}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc
index a90581ec..eed4efe8 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc
@@ -32,7 +32,7 @@
The Material Style is based on the Google Material Design Guidelines.
\l{detailed-desc-material}{More...}
- \styleimport {QtQuick.Controls.Material 2.0} {Qt 5.7}
+ \styleimport {QtQuick.Controls.Material 2.1} {Qt 5.7}
\section1 Attached Properties
@@ -86,8 +86,8 @@
\li
\qml
import QtQuick 2.0
- import QtQuick.Controls 2.0
- import QtQuick.Controls.Material 2.0
+ import QtQuick.Controls 2.1
+ import QtQuick.Controls.Material 2.1
Button {
text: "Stop"
@@ -111,8 +111,8 @@
\li
\qml
import QtQuick 2.0
- import QtQuick.Controls 2.0
- import QtQuick.Controls.Material 2.0
+ import QtQuick.Controls 2.1
+ import QtQuick.Controls.Material 2.1
ApplicationWindow {
visible: true
@@ -318,6 +318,11 @@
Available themes:
\value Material.Light Light theme (default)
\value Material.Dark Dark theme
+ \value Material.System System theme
+
+ Setting the theme to \c System chooses either the light or dark theme based
+ on the system theme colors. However, when reading the value of the theme
+ property, the value is never \c System, but the actual theme.
\endstyleproperty
@@ -332,7 +337,7 @@
\qml
import QtQuick 2.0
- import QtQuick.Controls.Material 2.0
+ import QtQuick.Controls.Material 2.1
Rectangle {
color: Material.color(Material.Red)
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc
index 52da41a7..2add71b2 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \qmlmodule QtQuick.Controls 2.0
+ \qmlmodule QtQuick.Controls 2.1
\title Qt Quick Controls 2 QML Types
\ingroup qmlmodules
\brief Provides QML types for user interfaces (Qt Quick Controls 2).
@@ -39,7 +39,7 @@
using the following import statement in your .qml file:
\badcode
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
\endcode
\section1 QML Types
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc
new file mode 100644
index 00000000..c4ef1c76
--- /dev/null
+++ b/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+/*!
+ \page qtquickcontrols2-separators.html
+ \title Separator Controls
+ \ingroup qtquickcontrols2-guidelines
+ \brief Guidelines for separator controls
+
+ Qt Quick Controls 2 offers a selection of separators.
+
+ \annotatedlist qtquickcontrols2-separators
+
+ Each type of separator has its own specific use case. The following
+ sections offer guidelines for choosing the appropriate type of separator,
+ depending on the use case.
+
+ \section1 MenuSeparator Control
+
+ \image qtquickcontrols2-menuseparator.png
+
+ \l MenuSeparator should be used to separate items (typically MenuItem
+ controls) in a Menu. Grouping related menu items together makes it easier
+ for the user to interact with the menu. For example, a typical desktop
+ user interface might have \c Undo and \c Redo items in one group, and
+ \c Cut, \c Copy and \c Paste in another.
+
+ \section1 ToolSeparator Control
+
+ \image qtquickcontrols2-toolseparator.png
+
+ \l ToolSeparator should be used to separate items (typically ToolButton
+ controls) in a ToolBar. It can be used in horizontal or vertical toolbars.
+
+ \section1 Related Information
+ \list
+ \li \l {Qt Quick Controls 2 Guidelines}
+ \endlist
+*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
index d63cbe69..a1c4eeef 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
@@ -137,14 +137,15 @@
example specifies that the preferred style is the Material style. Furthermore, when the
application is run with the Material style, its theme is light and the accent and primary
colors are teal and blue grey, respectively. However, if the application is run with the
- Universal style instead, the theme is dark and the accent color is red.
+ Universal style instead, the accent color is red and the appropriate theme is chosen based
+ on the system theme colors.
\code
[Controls]
Style=Material
[Universal]
- Theme=Dark
+ Theme=System
Accent=Red
[Material]
@@ -155,25 +156,16 @@
In order to make it possible for Qt Quick Controls 2 to find the configuration file,
it must be built into application's resources using the \l {The Qt Resource System}.
- Here's an example \c .qrc file:
-
- \code
- <!DOCTYPE RCC><RCC version="1.0">
- <qresource prefix="/">
- <file>qtquickcontrols2.conf</file>
- </qresource>
- </RCC>
- \endcode
\note Qt Quick Controls 2 uses a file selector to load the configuration file. It
is possible to provide a different configuration file for different platforms and
locales. See \l QFileSelector documentation for more details.
- Finally, the \c .qrc file must be listed in the application's \c .pro file so that
- the build system knows about it. For example:
+ Finally, the configuration file must be listed in the application's \c .pro file so
+ that the build system knows about it. For example:
\code
- RESOURCES = application.qrc
+ RESOURCES += qtquickcontrols2.conf
\endcode
\section1 Related Information
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc
index 02dc93c9..c3e75185 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc
@@ -32,7 +32,7 @@
The Universal Style is based on the Microsoft Universal Design Guidelines.
\l {detailed-desc-universal}{More...}
- \styleimport {QtQuick.Controls.Universal 2.0} {Qt 5.7}
+ \styleimport {QtQuick.Controls.Universal 2.1} {Qt 5.7}
\section1 Attached Properties
@@ -85,8 +85,8 @@
\li
\qml
import QtQuick 2.0
- import QtQuick.Controls 2.0
- import QtQuick.Controls.Universal 2.0
+ import QtQuick.Controls 2.1
+ import QtQuick.Controls.Universal 2.1
Button {
text: "Stop"
@@ -110,8 +110,8 @@
\li
\qml
import QtQuick 2.0
- import QtQuick.Controls 2.0
- import QtQuick.Controls.Universal 2.0
+ import QtQuick.Controls 2.1
+ import QtQuick.Controls.Universal 2.1
ApplicationWindow {
visible: true
@@ -239,6 +239,11 @@
Available themes:
\value Universal.Light Light theme (default)
\value Universal.Dark Dark theme
+ \value Universal.System System theme
+
+ Setting the theme to \c System chooses either the light or dark theme based
+ on the system theme colors. However, when reading the value of the theme
+ property, the value is never \c System, but the actual theme.
\endstyleproperty
@@ -251,7 +256,7 @@
\qml
import QtQuick 2.0
- import QtQuick.Controls.Universal 2.0
+ import QtQuick.Controls.Universal 2.1
Rectangle {
color: Universal.color(Universal.Red)
diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml
index db27f25b..0a6b71a3 100644
--- a/src/imports/controls/material/ApplicationWindow.qml
+++ b/src/imports/controls/material/ApplicationWindow.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
import QtQuick.Window 2.2
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.ApplicationWindow {
id: window
diff --git a/src/imports/controls/material/BoxShadow.qml b/src/imports/controls/material/BoxShadow.qml
index b70fcee5..4809838e 100644
--- a/src/imports/controls/material/BoxShadow.qml
+++ b/src/imports/controls/material/BoxShadow.qml
@@ -34,10 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtGraphicalEffects 1.0
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
-/*!
+/*
A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design
elevation shadow effect.
*/
diff --git a/src/imports/controls/material/BusyIndicator.qml b/src/imports/controls/material/BusyIndicator.qml
index 387ffb71..3077ceb7 100644
--- a/src/imports/controls/material/BusyIndicator.qml
+++ b/src/imports/controls/material/BusyIndicator.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.BusyIndicator {
id: control
diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml
index f2fad313..971992ab 100644
--- a/src/imports/controls/material/Button.qml
+++ b/src/imports/controls/material/Button.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Button {
id: control
@@ -53,6 +53,8 @@ T.Button {
leftPadding: padding - 4
rightPadding: padding - 4
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
Material.elevation: flat ? control.down || control.hovered ? 2 : 0
: control.down ? 8 : 2
Material.background: flat ? "transparent" : undefined
@@ -78,16 +80,19 @@ T.Button {
width: parent.width
height: parent.height - 12
radius: 2
- color: !control.enabled
- ? control.Material.buttonDisabledColor
- : control.down
- ? control.highlighted ? control.Material.highlightedButtonPressColor
- : control.Material.buttonPressColor
- : control.visualFocus || control.checked
- ? control.highlighted ? control.Material.highlightedButtonHoverColor
- : control.Material.buttonHoverColor
- : control.highlighted ? control.Material.highlightedButtonColor
- : control.Material.buttonColor
+ color: !control.enabled ? control.Material.buttonDisabledColor :
+ control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor
+
+ PaddedRectangle {
+ y: parent.height - 4
+ width: parent.width
+ height: 4
+ radius: 2
+ topPadding: -2
+ clip: true
+ visible: control.checkable && (!control.highlighted || control.flat)
+ color: control.checked && control.enabled ? control.Material.accentColor : control.Material.secondaryTextColor
+ }
Behavior on color {
ColorAnimation {
@@ -102,5 +107,15 @@ T.Button {
layer.effect: ElevationEffect {
elevation: control.Material.elevation
}
+
+ Ripple {
+ clipRadius: 2
+ width: parent.width
+ height: parent.height
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
}
}
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml
index 1c6848d8..60b23004 100644
--- a/src/imports/controls/material/CheckBox.qml
+++ b/src/imports/controls/material/CheckBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.CheckBox {
id: control
@@ -54,10 +54,24 @@ T.CheckBox {
topPadding: padding + 7
bottomPadding: padding + 7
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: CheckIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
+
+ Ripple {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 28; height: 28
+
+ z: -1
+ anchor: control
+ pressed: control.pressed
+ active: control.down || control.visualFocus || control.hovered
+ color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
+ }
}
contentItem: Text {
diff --git a/src/imports/controls/material/CheckDelegate.qml b/src/imports/controls/material/CheckDelegate.qml
index d5785467..c932b69e 100644
--- a/src/imports/controls/material/CheckDelegate.qml
+++ b/src/imports/controls/material/CheckDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.CheckDelegate {
id: control
@@ -54,6 +54,8 @@ T.CheckDelegate {
bottomPadding: 14
spacing: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: CheckIndicator {
x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
@@ -76,7 +78,17 @@ T.CheckDelegate {
background: Rectangle {
implicitHeight: 48
- visible: control.down || control.highlighted
- color: control.down ? control.Material.buttonPressColor : control.Material.listHighlightColor
+ color: control.highlighted ? control.Material.listHighlightColor : "transparent"
+
+ Ripple {
+ width: parent.width
+ height: parent.height
+
+ clip: visible
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
}
}
diff --git a/src/imports/controls/material/CheckIndicator.qml b/src/imports/controls/material/CheckIndicator.qml
index f64ca168..afc19bc2 100644
--- a/src/imports/controls/material/CheckIndicator.qml
+++ b/src/imports/controls/material/CheckIndicator.qml
@@ -34,8 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
Rectangle {
id: indicatorItem
@@ -46,7 +47,7 @@ Rectangle {
border.width: control.checked ? width / 2 : 2
radius: 2
- property alias control: ripple.control
+ property Item control
Behavior on border.width {
NumberAnimation {
@@ -62,15 +63,6 @@ Rectangle {
}
}
- Ripple {
- id: ripple
- width: parent.width
- height: width
- control: control
- colored: control.checked
- opacity: control.down || control.visualFocus ? 1 : 0
- }
-
// TODO: This needs to be transparent
Image {
id: checkImage
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml
index 05981baa..6847ba6a 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -34,18 +34,16 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
import QtQuick.Window 2.2
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick.Controls 2.1
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.ComboBox {
id: control
- Material.elevation: control.pressed ? 8 : 2
-
implicitWidth: Math.max(background ? background.implicitWidth : 0,
contentItem.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0,
@@ -56,21 +54,25 @@ T.ComboBox {
spacing: 6
padding: 16
- // Don't use toolTextColor, as that is often white when we have a white background.
- Material.foreground: Material.foreground === Material.toolTextColor ? undefined : Material.foreground
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
+ Material.elevation: flat ? control.pressed || control.hovered ? 2 : 0
+ : control.pressed ? 8 : 2
+ Material.background: flat ? "transparent" : undefined
+ Material.foreground: flat ? undefined : Material.foreground
delegate: MenuItem {
width: control.popup.width
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
- Material.foreground: control.currentIndex === index ? control.Material.accent : control.Material.foreground
+ Material.foreground: control.currentIndex === index ? control.popup.Material.accent : control.popup.Material.foreground
highlighted: control.highlightedIndex === index
+ hoverEnabled: control.hoverEnabled
}
indicator: Image {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
- opacity: !control.enabled ? 0.5 : 1.0
- source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/drop-indicator.png"
+ source: "image://material/drop-indicator/" + (control.enabled ? control.Material.primaryTextColor : control.Material.hintTextColor)
}
contentItem: Text {
@@ -89,7 +91,7 @@ T.ComboBox {
implicitWidth: 120
implicitHeight: 48
- radius: 2
+ radius: control.flat ? 0 : 2
color: control.Material.dialogColor
Behavior on color {
@@ -98,17 +100,20 @@ T.ComboBox {
}
}
- layer.enabled: control.enabled && control.Material.elevation > 0
+ layer.enabled: control.enabled && control.Material.background.a > 0
layer.effect: ElevationEffect {
elevation: control.Material.elevation
}
- Rectangle {
+ Ripple {
+ clip: control.flat
+ clipRadius: control.flat ? 0 : 2
width: parent.width
height: parent.height
- radius: parent.radius
- visible: control.visualFocus
- color: control.Material.checkBoxUncheckedRippleColor
+ pressed: control.pressed
+ anchor: control
+ active: control.pressed || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
}
}
@@ -148,7 +153,7 @@ T.ComboBox {
background: Rectangle {
radius: 2
- color: control.Material.dialogColor
+ color: control.popup.Material.dialogColor
layer.enabled: control.enabled
layer.effect: ElevationEffect {
diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml
index c07cd423..9f5d88c3 100644
--- a/src/imports/controls/material/Dial.qml
+++ b/src/imports/controls/material/Dial.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Dial {
id: control
@@ -44,6 +45,8 @@ T.Dial {
implicitWidth: 100
implicitHeight: 100
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
background: Rectangle {
x: control.width / 2 - width / 2
y: control.height / 2 - height / 2
@@ -55,7 +58,7 @@ T.Dial {
border.color: control.enabled ? control.Material.accentColor : control.Material.hintTextColor
}
- handle: Rectangle {
+ handle: SliderHandle {
id: handleItem
x: background.x + background.width / 2 - handle.width / 2
@@ -72,7 +75,10 @@ T.Dial {
]
implicitWidth: 14
implicitHeight: 14
- radius: width / 2
- color: control.enabled ? control.Material.accentColor : control.Material.hintTextColor
+
+ value: control.value
+ handleHasFocus: control.visualFocus
+ handlePressed: control.pressed
+ handleHovered: control.hovered
}
}
diff --git a/src/imports/controls/material/Dialog.qml b/src/imports/controls/material/Dialog.qml
new file mode 100644
index 00000000..58bbe99e
--- /dev/null
+++ b/src/imports/controls/material/Dialog.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
+
+T.Dialog {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ header ? header.implicitWidth : 0,
+ footer ? footer.implicitWidth : 0,
+ contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ (header ? header.implicitHeight : 0) + (footer ? footer.implicitHeight : 0))
+ + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 24
+
+ Material.elevation: 24
+
+ enter: Transition {
+ // grow_fade_in
+ NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 }
+ NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 }
+ }
+
+ exit: Transition {
+ // shrink_fade_out
+ NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 }
+ NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
+ }
+
+ background: Rectangle {
+ radius: 2
+ color: control.Material.dialogColor
+
+ layer.enabled: control.Material.elevation > 0
+ layer.effect: ElevationEffect {
+ elevation: control.Material.elevation
+ }
+ }
+
+ buttonBox: DialogButtonBox {
+ position: DialogButtonBox.Footer
+ }
+}
diff --git a/src/imports/controls/material/DialogButtonBox.qml b/src/imports/controls/material/DialogButtonBox.qml
new file mode 100644
index 00000000..312aa4eb
--- /dev/null
+++ b/src/imports/controls/material/DialogButtonBox.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
+
+T.DialogButtonBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ spacing: 8
+ padding: 8
+ topPadding: padding - 4
+ bottomPadding: padding - 4
+ alignment: Qt.AlignRight
+
+ Material.foreground: Material.accent
+
+ delegate: Button { flat: true }
+
+ contentItem: ListView {
+ implicitWidth: contentWidth
+ implicitHeight: 48
+
+ model: control.contentModel
+ spacing: control.spacing
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ snapMode: ListView.SnapToItem
+ }
+
+ background: PaddedRectangle {
+ implicitHeight: 52
+ radius: 2
+ color: control.Material.dialogColor
+ topPadding: control.position === T.DialogButtonBox.Footer ? -2 : 0
+ bottomPadding: control.position === T.DialogButtonBox.Header ? -2 : 0
+ clip: true
+ }
+}
diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml
index 1c15e689..a4b2e3bc 100644
--- a/src/imports/controls/material/Drawer.qml
+++ b/src/imports/controls/material/Drawer.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Drawer {
id: control
@@ -53,8 +53,6 @@ T.Drawer {
enter: Transition { SmoothedAnimation { velocity: 5 } }
exit: Transition { SmoothedAnimation { velocity: 5 } }
- contentItem: Item { }
-
background: Rectangle {
color: control.Material.dialogColor
diff --git a/src/imports/controls/material/ElevationEffect.qml b/src/imports/controls/material/ElevationEffect.qml
index 4ee4369c..3cf6623c 100644
--- a/src/imports/controls/material/ElevationEffect.qml
+++ b/src/imports/controls/material/ElevationEffect.qml
@@ -34,27 +34,27 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
-/*!
+/*
An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect.
*/
Item {
id: effect
- /*!
+ /*
The source the effect is applied to.
*/
property var source
- /*!
+ /*
The elevation of the \l source Item.
*/
property int elevation: 0
- /*!
+ /*
Set to \c true if the \l source Item is the same width as its parent and the shadow
should be full width instead of rounding around the corner of the Item.
@@ -62,7 +62,7 @@ Item {
*/
property bool fullWidth: false
- /*!
+ /*
Set to \c true if the \l source Item is the same height as its parent and the shadow
should be full height instead of rounding around the corner of the Item.
@@ -70,7 +70,7 @@ Item {
*/
property bool fullHeight: false
- /*!
+ /*
\internal
The actual source Item the effect is applied to.
@@ -102,7 +102,7 @@ Item {
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
- /*!
+ /*
\internal
The shadows to use for each possible elevation. There are three shadows that when combined
@@ -210,7 +210,7 @@ Item {
{offset: 9, blur: 46, spread: 8}]
]
- /*!
+ /*
\internal
The current shadow based on the elevation.
diff --git a/src/imports/controls/material/Frame.qml b/src/imports/controls/material/Frame.qml
index c2f623ae..08c01353 100644
--- a/src/imports/controls/material/Frame.qml
+++ b/src/imports/controls/material/Frame.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Frame {
id: control
@@ -50,8 +50,6 @@ T.Frame {
padding: 12
- contentItem: Item { }
-
background: Rectangle {
radius: 2
color: control.Material.elevation > 0 ? control.Material.backgroundColor : "transparent"
diff --git a/src/imports/controls/material/GroupBox.qml b/src/imports/controls/material/GroupBox.qml
index 6d84197c..afd1c8d1 100644
--- a/src/imports/controls/material/GroupBox.qml
+++ b/src/imports/controls/material/GroupBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.GroupBox {
id: control
@@ -54,8 +54,6 @@ T.GroupBox {
padding: 12
topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
- contentItem: Item {}
-
label: Text {
x: control.leftPadding
width: control.availableWidth
diff --git a/src/imports/controls/material/ItemDelegate.qml b/src/imports/controls/material/ItemDelegate.qml
index e43fc981..ec03b129 100644
--- a/src/imports/controls/material/ItemDelegate.qml
+++ b/src/imports/controls/material/ItemDelegate.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.ItemDelegate {
id: control
@@ -51,6 +52,8 @@ T.ItemDelegate {
padding: 16
spacing: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
contentItem: Text {
leftPadding: control.checkable && !control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0
rightPadding: control.checkable && control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0
@@ -67,7 +70,17 @@ T.ItemDelegate {
background: Rectangle {
implicitHeight: 48
- visible: control.down || control.highlighted
- color: control.down ? control.Material.buttonPressColor : control.Material.listHighlightColor
+ color: control.highlighted ? control.Material.listHighlightColor : "transparent"
+
+ Ripple {
+ width: parent.width
+ height: parent.height
+
+ clip: visible
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
}
}
diff --git a/src/imports/controls/material/Label.qml b/src/imports/controls/material/Label.qml
index 8bda5cc2..f4e12813 100644
--- a/src/imports/controls/material/Label.qml
+++ b/src/imports/controls/material/Label.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.Label {
id: control
diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml
index b11c00b6..7fe6af0e 100644
--- a/src/imports/controls/material/Menu.qml
+++ b/src/imports/controls/material/Menu.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Menu {
id: control
diff --git a/src/imports/controls/material/MenuItem.qml b/src/imports/controls/material/MenuItem.qml
index 27c2922c..09a9909c 100644
--- a/src/imports/controls/material/MenuItem.qml
+++ b/src/imports/controls/material/MenuItem.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.MenuItem {
id: control
@@ -54,6 +54,8 @@ T.MenuItem {
bottomPadding: 12
spacing: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: CheckIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
@@ -77,7 +79,17 @@ T.MenuItem {
background: Rectangle {
implicitWidth: 200
implicitHeight: 48
- visible: control.down || control.highlighted
- color: control.down ? control.Material.buttonPressColor : control.Material.listHighlightColor
+ color: control.highlighted ? control.Material.listHighlightColor : "transparent"
+
+ Ripple {
+ width: parent.width
+ height: parent.height
+
+ clip: visible
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
}
}
diff --git a/src/imports/controls/material/Ripple.qml b/src/imports/controls/material/MenuSeparator.qml
index 15650384..76cac31b 100644
--- a/src/imports/controls/material/Ripple.qml
+++ b/src/imports/controls/material/MenuSeparator.qml
@@ -34,18 +34,22 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
-Rectangle {
- property Item control
- property bool colored: false
+T.MenuSeparator {
+ id: control
- radius: width / 2
- scale: 2.5
- color: colored ? control.Material.checkBoxCheckedRippleColor : control.Material.checkBoxUncheckedRippleColor
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
- Behavior on opacity {
- NumberAnimation {}
+ topPadding: 8
+ bottomPadding: 8
+
+ contentItem: Rectangle {
+ implicitWidth: 200
+ implicitHeight: 1
+ color: control.Material.dividerColor
}
}
diff --git a/src/imports/controls/material/Page.qml b/src/imports/controls/material/Page.qml
index 92c85b58..ec343d04 100644
--- a/src/imports/controls/material/Page.qml
+++ b/src/imports/controls/material/Page.qml
@@ -34,15 +34,13 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.Page {
id: control
- contentItem: Item { }
-
background: Rectangle {
color: control.Material.backgroundColor
}
diff --git a/src/imports/controls/material/PageIndicator.qml b/src/imports/controls/material/PageIndicator.qml
index 78372afe..7378dbbf 100644
--- a/src/imports/controls/material/PageIndicator.qml
+++ b/src/imports/controls/material/PageIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.PageIndicator {
id: control
diff --git a/src/imports/controls/material/Pane.qml b/src/imports/controls/material/Pane.qml
index 251492ea..4aedbd40 100644
--- a/src/imports/controls/material/Pane.qml
+++ b/src/imports/controls/material/Pane.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Pane {
id: control
@@ -50,8 +50,6 @@ T.Pane {
padding: 12
- contentItem: Item { }
-
background: Rectangle {
color: control.Material.backgroundColor
radius: control.Material.elevation > 0 ? 2 : 0
diff --git a/src/imports/controls/material/Popup.qml b/src/imports/controls/material/Popup.qml
index 19fd6b79..01b3951a 100644
--- a/src/imports/controls/material/Popup.qml
+++ b/src/imports/controls/material/Popup.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Popup {
id: control
@@ -66,8 +66,6 @@ T.Popup {
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
}
- contentItem: Item { }
-
background: Rectangle {
radius: 2
color: control.Material.dialogColor
diff --git a/src/imports/controls/material/ProgressBar.qml b/src/imports/controls/material/ProgressBar.qml
index eb8bf3ce..2b78be49 100644
--- a/src/imports/controls/material/ProgressBar.qml
+++ b/src/imports/controls/material/ProgressBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.ProgressBar {
id: control
diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml
index 3ea2cf4d..c3afbfd9 100644
--- a/src/imports/controls/material/RadioButton.qml
+++ b/src/imports/controls/material/RadioButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.RadioButton {
id: control
@@ -54,10 +54,24 @@ T.RadioButton {
topPadding: padding + 6
bottomPadding: padding + 6
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: RadioIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
+
+ Ripple {
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 28; height: 28
+
+ z: -1
+ anchor: control
+ pressed: control.pressed
+ active: control.down || control.visualFocus || control.hovered
+ color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
+ }
}
contentItem: Text {
diff --git a/src/imports/controls/material/RadioDelegate.qml b/src/imports/controls/material/RadioDelegate.qml
index 95bfb19b..150d72ae 100644
--- a/src/imports/controls/material/RadioDelegate.qml
+++ b/src/imports/controls/material/RadioDelegate.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.RadioDelegate {
id: control
@@ -53,6 +54,8 @@ T.RadioDelegate {
bottomPadding: 8
spacing: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: RadioIndicator {
x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
@@ -75,7 +78,17 @@ T.RadioDelegate {
background: Rectangle {
implicitHeight: 48
- visible: control.down || control.highlighted
- color: control.down ? control.Material.buttonPressColor : control.Material.listHighlightColor
+ color: control.highlighted ? control.Material.listHighlightColor : "transparent"
+
+ Ripple {
+ width: parent.width
+ height: parent.height
+
+ clip: visible
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
}
}
diff --git a/src/imports/controls/material/RadioIndicator.qml b/src/imports/controls/material/RadioIndicator.qml
index 4090c732..b1e19656 100644
--- a/src/imports/controls/material/RadioIndicator.qml
+++ b/src/imports/controls/material/RadioIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
Rectangle {
implicitWidth: 20
@@ -46,16 +46,7 @@ Rectangle {
border.color: control.checked || control.down ? control.Material.accentColor : control.Material.secondaryTextColor
color: "transparent"
- property alias control: ripple.control
-
- Ripple {
- id: ripple
- width: parent.width
- height: width
- control: control
- colored: control.checked
- opacity: control.down || control.visualFocus ? 1 : 0
- }
+ property Item control
Rectangle {
x: (parent.width - width) / 2
diff --git a/src/imports/controls/material/RangeSlider.qml b/src/imports/controls/material/RangeSlider.qml
index dc2c25fa..641c00f1 100644
--- a/src/imports/controls/material/RangeSlider.qml
+++ b/src/imports/controls/material/RangeSlider.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.RangeSlider {
id: control
@@ -51,12 +51,15 @@ T.RangeSlider {
padding: 6
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
first.handle: SliderHandle {
x: control.leftPadding + (horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height))
value: first.value
handleHasFocus: activeFocus
handlePressed: first.pressed
+ handleHovered: first.hovered
}
second.handle: SliderHandle {
@@ -65,6 +68,7 @@ T.RangeSlider {
value: second.value
handleHasFocus: activeFocus
handlePressed: second.pressed
+ handleHovered: second.hovered
}
background: Rectangle {
diff --git a/src/imports/controls/material/RectangularGlow.qml b/src/imports/controls/material/RectangularGlow.qml
new file mode 100644
index 00000000..32c10500
--- /dev/null
+++ b/src/imports/controls/material/RectangularGlow.qml
@@ -0,0 +1,240 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+/*
+ A cross-graphics API implementation of QtGraphicalEffects' RectangularGlow.
+ */
+Item {
+ id: rootItem
+
+ /*
+ This property defines how many pixels outside the item area are reached
+ by the glow.
+
+ The value ranges from 0.0 (no glow) to inf (infinite glow). By default,
+ the property is set to \c 0.0.
+
+ \table
+ \header
+ \li Output examples with different glowRadius values
+ \li
+ \li
+ \row
+ \li \image RectangularGlow_glowRadius1.png
+ \li \image RectangularGlow_glowRadius2.png
+ \li \image RectangularGlow_glowRadius3.png
+ \row
+ \li \b { glowRadius: 10 }
+ \li \b { glowRadius: 20 }
+ \li \b { glowRadius: 40 }
+ \row
+ \li \l spread: 0
+ \li \l spread: 0
+ \li \l spread: 0
+ \row
+ \li \l color: #ffffff
+ \li \l color: #ffffff
+ \li \l color: #ffffff
+ \row
+ \li \l cornerRadius: 25
+ \li \l cornerRadius: 25
+ \li \l cornerRadius: 25
+ \endtable
+
+ */
+ property real glowRadius: 0.0
+
+ /*
+ This property defines how large part of the glow color is strenghtened
+ near the source edges.
+
+ The value ranges from 0.0 (no strenght increase) to 1.0 (maximum
+ strenght increase). By default, the property is set to \c 0.0.
+
+ \table
+ \header
+ \li Output examples with different spread values
+ \li
+ \li
+ \row
+ \li \image RectangularGlow_spread1.png
+ \li \image RectangularGlow_spread2.png
+ \li \image RectangularGlow_spread3.png
+ \row
+ \li \b { spread: 0.0 }
+ \li \b { spread: 0.5 }
+ \li \b { spread: 1.0 }
+ \row
+ \li \l glowRadius: 20
+ \li \l glowRadius: 20
+ \li \l glowRadius: 20
+ \row
+ \li \l color: #ffffff
+ \li \l color: #ffffff
+ \li \l color: #ffffff
+ \row
+ \li \l cornerRadius: 25
+ \li \l cornerRadius: 25
+ \li \l cornerRadius: 25
+ \endtable
+ */
+ property real spread: 0.0
+
+ /*
+ This property defines the RGBA color value which is used for the glow.
+
+ By default, the property is set to \c "white".
+
+ \table
+ \header
+ \li Output examples with different color values
+ \li
+ \li
+ \row
+ \li \image RectangularGlow_color1.png
+ \li \image RectangularGlow_color2.png
+ \li \image RectangularGlow_color3.png
+ \row
+ \li \b { color: #ffffff }
+ \li \b { color: #55ff55 }
+ \li \b { color: #5555ff }
+ \row
+ \li \l glowRadius: 20
+ \li \l glowRadius: 20
+ \li \l glowRadius: 20
+ \row
+ \li \l spread: 0
+ \li \l spread: 0
+ \li \l spread: 0
+ \row
+ \li \l cornerRadius: 25
+ \li \l cornerRadius: 25
+ \li \l cornerRadius: 25
+ \endtable
+ */
+ property color color: "white"
+
+ /*
+ This property defines the corner radius that is used to draw a glow with
+ rounded corners.
+
+ The value ranges from 0.0 to half of the effective width or height of
+ the glow, whichever is smaller. This can be calculated with: \c{
+ min(width, height) / 2.0 + glowRadius}
+
+ By default, the property is bound to glowRadius property. The glow
+ behaves as if the rectangle was blurred when adjusting the glowRadius
+ property.
+
+ \table
+ \header
+ \li Output examples with different cornerRadius values
+ \li
+ \li
+ \row
+ \li \image RectangularGlow_cornerRadius1.png
+ \li \image RectangularGlow_cornerRadius2.png
+ \li \image RectangularGlow_cornerRadius3.png
+ \row
+ \li \b { cornerRadius: 0 }
+ \li \b { cornerRadius: 25 }
+ \li \b { cornerRadius: 50 }
+ \row
+ \li \l glowRadius: 20
+ \li \l glowRadius: 20
+ \li \l glowRadius: 20
+ \row
+ \li \l spread: 0
+ \li \l spread: 0
+ \li \l spread: 0
+ \row
+ \li \l color: #ffffff
+ \li \l color: #ffffff
+ \li \l color: #ffffff
+ \endtable
+ */
+ property real cornerRadius: glowRadius
+
+ /*
+ This property allows the effect output pixels to be cached in order to
+ improve the rendering performance.
+
+ Every time the source or effect properties are changed, the pixels in
+ the cache must be updated. Memory consumption is increased, because an
+ extra buffer of memory is required for storing the effect output.
+
+ It is recommended to disable the cache when the source or the effect
+ properties are animated.
+
+ By default, the property is set to \c false.
+ */
+ property bool cached: false
+
+ ShaderEffectSource {
+ id: cacheItem
+ anchors.fill: shaderItem
+ visible: rootItem.cached
+ smooth: true
+ sourceItem: shaderItem
+ live: true
+ hideSource: visible
+ }
+
+ ShaderEffect {
+ id: shaderItem
+
+ x: (parent.width - width) / 2.0
+ y: (parent.height - height) / 2.0
+ width: parent.width + rootItem.glowRadius * 2 + cornerRadius * 2
+ height: parent.height + rootItem.glowRadius * 2 + cornerRadius * 2
+
+ function clampedCornerRadius() {
+ var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + glowRadius;
+ return Math.max(0, Math.min(rootItem.cornerRadius, maxCornerRadius))
+ }
+
+ property color color: rootItem.color
+ property real inverseSpread: 1.0 - rootItem.spread
+ property real relativeSizeX: ((inverseSpread * inverseSpread) * rootItem.glowRadius + cornerRadius * 2.0) / width
+ property real relativeSizeY: relativeSizeX * (width / height)
+ property real spread: rootItem.spread / 2.0
+ property real cornerRadius: clampedCornerRadius()
+
+ fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/shaders/RectangularGlow.frag"
+ }
+}
diff --git a/src/imports/controls/material/RoundButton.qml b/src/imports/controls/material/RoundButton.qml
new file mode 100644
index 00000000..c020db74
--- /dev/null
+++ b/src/imports/controls/material/RoundButton.qml
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
+
+T.RoundButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ // external vertical padding is 6 (to increase touch area)
+ padding: 12
+
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
+ Material.elevation: flat ? control.down || control.hovered ? 2 : 0
+ : control.down ? 8 : 2
+ Material.background: flat ? "transparent" : undefined
+
+ contentItem: Text {
+ text: control.text
+ font: control.font
+ color: !control.enabled ? control.Material.hintTextColor :
+ control.flat && control.highlighted ? control.Material.accentColor :
+ control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.primaryTextColor
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ elide: Text.ElideRight
+ }
+
+ // TODO: Add a proper ripple/ink effect for mouse/touch input and focus state
+ background: Rectangle {
+ implicitWidth: 48
+ implicitHeight: 48
+
+ // external vertical padding is 6 (to increase touch area)
+ x: 6
+ y: 6
+ width: parent.width - 12
+ height: parent.height - 12
+ radius: control.radius
+ color: !control.enabled ? control.Material.buttonDisabledColor
+ : control.checked || control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ radius: control.radius
+ visible: control.hovered || control.visualFocus
+ color: control.Material.rippleColor
+ }
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ radius: control.radius
+ visible: control.down
+ color: control.Material.rippleColor
+ }
+
+ Behavior on color {
+ ColorAnimation {
+ duration: 400
+ }
+ }
+
+ // The layer is disabled when the button color is transparent so that you can do
+ // Material.background: "transparent" and get a proper flat button without needing
+ // to set Material.elevation as well
+ layer.enabled: control.enabled && control.Material.buttonColor.a > 0
+ layer.effect: ElevationEffect {
+ elevation: control.Material.elevation
+ }
+ }
+}
diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml
index 84f2d33a..afc30723 100644
--- a/src/imports/controls/material/ScrollBar.qml
+++ b/src/imports/controls/material/ScrollBar.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.ScrollBar {
id: control
@@ -46,33 +46,45 @@ T.ScrollBar {
implicitHeight: Math.max(background ? background.implicitHeight : 0,
contentItem.implicitHeight + topPadding + bottomPadding)
- padding: 2
- topPadding: padding + (control.orientation === Qt.Horizontal ? 12 : 0)
- leftPadding: padding + (control.orientation === Qt.Vertical && !control.mirrored ? 12 : 0)
- rightPadding: padding + (control.orientation === Qt.Vertical && control.mirrored ? 12 : 0)
+ padding: 1
+
+ hoverEnabled: Qt.styleHints.useHoverEffects
contentItem: Rectangle {
id: handle
- implicitWidth: 4
- implicitHeight: 4
+ implicitWidth: 13
+ implicitHeight: 13
- color: control.pressed ? control.Material.scrollBarPressedColor : control.Material.scrollBarColor
+ color: control.pressed ? control.Material.scrollBarPressedColor :
+ control.hovered ? control.Material.scrollBarHoveredColor : control.Material.scrollBarColor
visible: control.size < 1.0
opacity: 0.0
+ }
- states: State {
- name: "active"
- when: control.active
- PropertyChanges { target: handle; opacity: 0.75 }
- }
+ background: Rectangle {
+ implicitWidth: 16
+ implicitHeight: 16
+ color: "#0e000000"
+ opacity: 0.0
+ }
+
+ states: State {
+ name: "active"
+ when: control.active
+ }
- transitions: Transition {
+ transitions: [
+ Transition {
+ to: "active"
+ NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 1.0 }
+ },
+ Transition {
from: "active"
SequentialAnimation {
- PauseAnimation { duration: 450 }
- NumberAnimation { target: handle; duration: 200; property: "opacity"; to: 0.0 }
+ PauseAnimation { duration: 2450 }
+ NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 }
}
}
- }
+ ]
}
diff --git a/src/imports/controls/material/ScrollIndicator.qml b/src/imports/controls/material/ScrollIndicator.qml
index b5f25d33..3b1dd2c3 100644
--- a/src/imports/controls/material/ScrollIndicator.qml
+++ b/src/imports/controls/material/ScrollIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.ScrollIndicator {
id: control
diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml
index 15c8edb2..1c915b32 100644
--- a/src/imports/controls/material/Slider.qml
+++ b/src/imports/controls/material/Slider.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.Slider {
id: control
@@ -49,12 +49,15 @@ T.Slider {
padding: 6
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
handle: SliderHandle {
x: control.leftPadding + (horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
value: control.value
handleHasFocus: control.visualFocus
handlePressed: control.pressed
+ handleHovered: control.hovered
}
background: Rectangle {
diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml
index 49f833d0..ba6260e9 100644
--- a/src/imports/controls/material/SliderHandle.qml
+++ b/src/imports/controls/material/SliderHandle.qml
@@ -34,8 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
Item {
id: root
@@ -45,6 +46,7 @@ Item {
property real value: 0
property bool handleHasFocus: false
property bool handlePressed: false
+ property bool handleHovered: false
readonly property int initialSize: 13
readonly property bool horizontal: control.orientation === Qt.Horizontal
readonly property var control: parent
@@ -65,10 +67,11 @@ Item {
}
Ripple {
- width: parent.width
- height: width
- control: root.control
- colored: true
- opacity: root.handleHasFocus && !root.handlePressed ? 1 : 0
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 22; height: 22
+ pressed: root.handlePressed
+ active: root.handlePressed || root.handleHasFocus || root.handleHovered
+ color: control.Material.rippleColor
}
}
diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml
index e28815e8..257e9bf2 100644
--- a/src/imports/controls/material/SpinBox.qml
+++ b/src/imports/controls/material/SpinBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.SpinBox {
id: control
@@ -58,6 +58,8 @@ T.SpinBox {
leftPadding: (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0))
rightPadding: (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0))
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
validator: IntValidator {
locale: control.locale.name
bottom: Math.min(control.from, control.to)
@@ -104,17 +106,23 @@ T.SpinBox {
inputMethodHints: Qt.ImhFormattedNumbersOnly
}
- up.indicator: PaddedRectangle {
+ up.indicator: Item {
x: control.mirrored ? 0 : parent.width - width
implicitWidth: 48
implicitHeight: 48
height: parent.height
width: height
- padding: control.spacing
- radius: 2
- color: Qt.tint(Qt.tint(control.Material.buttonColor,
- control.activeFocus ? control.Material.buttonHoverColor : "transparent"),
- control.up.pressed ? control.Material.buttonPressColor: "transparent")
+
+ Ripple {
+ clipRadius: 2
+ x: control.spacing
+ y: control.spacing
+ width: parent.width - 2 * control.spacing
+ height: parent.height - 2 * control.spacing
+ pressed: control.up.pressed
+ active: control.up.pressed || control.up.hovered || control.visualFocus
+ color: control.Material.rippleColor
+ }
Rectangle {
x: (parent.width - width) / 2
@@ -132,17 +140,23 @@ T.SpinBox {
}
}
- down.indicator: PaddedRectangle {
+ down.indicator: Item {
x: control.mirrored ? parent.width - width : 0
implicitWidth: 48
implicitHeight: 48
height: parent.height
width: height
- padding: control.spacing
- radius: 2
- color: Qt.tint(Qt.tint(control.Material.buttonColor,
- control.activeFocus ? control.Material.buttonHoverColor : "transparent"),
- control.down.pressed ? control.Material.buttonPressColor : "transparent")
+
+ Ripple {
+ clipRadius: 2
+ x: control.spacing
+ y: control.spacing
+ width: parent.width - 2 * control.spacing
+ height: parent.height - 2 * control.spacing
+ pressed: control.down.pressed
+ active: control.down.pressed || control.down.hovered || control.visualFocus
+ color: control.Material.rippleColor
+ }
Rectangle {
x: (parent.width - width) / 2
diff --git a/src/imports/controls/material/StackView.qml b/src/imports/controls/material/StackView.qml
index 982a37cb..916e910f 100644
--- a/src/imports/controls/material/StackView.qml
+++ b/src/imports/controls/material/StackView.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.4
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
T.StackView {
id: control
diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml
index dec2d12f..6f614833 100644
--- a/src/imports/controls/material/SwipeDelegate.qml
+++ b/src/imports/controls/material/SwipeDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.SwipeDelegate {
id: control
@@ -54,6 +54,8 @@ T.SwipeDelegate {
bottomPadding: 8
spacing: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
contentItem: Text {
leftPadding: !control.mirrored ? (control.indicator ? control.indicator.width + control.spacing : 0) : 0
rightPadding: control.mirrored ? (control.indicator ? control.indicator.width + control.spacing : 0) : 0
@@ -83,10 +85,20 @@ T.SwipeDelegate {
Rectangle {
width: parent.width
height: parent.height
- visible: control.down || control.highlighted || control.visualFocus
- color: control.down ? control.Material.buttonPressColor :
- control.visualFocus || control.hovered ? control.Material.swipeDelegateHoverColor :
- control.Material.listHighlightColor
+ visible: control.highlighted
+ color: control.Material.listHighlightColor
+ }
+
+ Ripple {
+ width: parent.width
+ height: parent.height
+
+ clip: visible
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ enabled: control.swipe.position === 0
}
Behavior on x {
diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml
index 38c12b6b..3ac373d5 100644
--- a/src/imports/controls/material/SwipeView.qml
+++ b/src/imports/controls/material/SwipeView.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
T.SwipeView {
id: control
@@ -47,6 +47,7 @@ T.SwipeView {
contentItem: ListView {
model: control.contentModel
+ interactive: control.interactive
currentIndex: control.currentIndex
spacing: control.spacing
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml
index ca739e62..b833fbbf 100644
--- a/src/imports/controls/material/Switch.qml
+++ b/src/imports/controls/material/Switch.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
-import QtQuick.Templates 2.0 as T
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
+import QtQuick.Templates 2.1 as T
T.Switch {
id: control
@@ -52,10 +52,21 @@ T.Switch {
padding: 8
spacing: 8
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: SwitchIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
+
+ Ripple {
+ x: parent.handle.x + parent.handle.width / 2 - width / 2
+ y: parent.handle.y + parent.handle.height / 2 - height / 2
+ width: 28; height: 28
+ pressed: control.pressed
+ active: control.down || control.visualFocus || control.hovered
+ color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
+ }
}
contentItem: Text {
diff --git a/src/imports/controls/material/SwitchDelegate.qml b/src/imports/controls/material/SwitchDelegate.qml
index 097f0acd..da084168 100644
--- a/src/imports/controls/material/SwitchDelegate.qml
+++ b/src/imports/controls/material/SwitchDelegate.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.SwitchDelegate {
id: control
@@ -54,6 +54,8 @@ T.SwitchDelegate {
bottomPadding: 8
spacing: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
indicator: SwitchIndicator {
x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
@@ -76,7 +78,17 @@ T.SwitchDelegate {
background: Rectangle {
implicitHeight: 48
- visible: control.down || control.highlighted
- color: control.down ? control.Material.buttonPressColor : control.Material.listHighlightColor
+ color: control.highlighted ? control.Material.listHighlightColor : "transparent"
+
+ Ripple {
+ width: parent.width
+ height: parent.height
+
+ clip: visible
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
+ }
}
}
diff --git a/src/imports/controls/material/SwitchIndicator.qml b/src/imports/controls/material/SwitchIndicator.qml
index 0d2163b2..c59e6ac2 100644
--- a/src/imports/controls/material/SwitchIndicator.qml
+++ b/src/imports/controls/material/SwitchIndicator.qml
@@ -34,29 +34,20 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
Item {
id: indicator
implicitWidth: 38
implicitHeight: 32
- property alias control: ripple.control
+ property Item control
+ property alias handle: handle
Material.elevation: 1
- Ripple {
- id: ripple
- x: handle.x + handle.width / 2 - width / 2
- y: handle.y + handle.height / 2 - height / 2
- width: handle.width
- height: width
- colored: control.checked
- opacity: control.pressed || control.visualFocus ? 1 : 0
- }
-
Rectangle {
width: parent.width
height: 14
diff --git a/src/imports/controls/material/TabBar.qml b/src/imports/controls/material/TabBar.qml
index 901e3328..1c3b5c0c 100644
--- a/src/imports/controls/material/TabBar.qml
+++ b/src/imports/controls/material/TabBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.TabBar {
id: control
diff --git a/src/imports/controls/material/TabButton.qml b/src/imports/controls/material/TabButton.qml
index 535dfc02..0fb16e63 100644
--- a/src/imports/controls/material/TabButton.qml
+++ b/src/imports/controls/material/TabButton.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.TabButton {
id: control
@@ -49,6 +50,8 @@ T.TabButton {
padding: 12
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
contentItem: Text {
text: control.text
font: control.font
@@ -58,7 +61,13 @@ T.TabButton {
verticalAlignment: Text.AlignVCenter
}
- background: Item {
+ background: Ripple {
implicitHeight: 48
+
+ clip: true
+ pressed: control.pressed
+ anchor: control
+ active: control.down || control.visualFocus || control.hovered
+ color: control.Material.rippleColor
}
}
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml
index 38502ed6..3f30af00 100644
--- a/src/imports/controls/material/TextArea.qml
+++ b/src/imports/controls/material/TextArea.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.TextArea {
id: control
@@ -51,6 +51,8 @@ T.TextArea {
topPadding: 8
bottomPadding: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
color: enabled ? Material.primaryTextColor : Material.hintTextColor
selectionColor: Material.accentColor
selectedTextColor: Material.primaryHighlightedTextColor
diff --git a/src/imports/controls/material/TextField.qml b/src/imports/controls/material/TextField.qml
index ab6f6187..edab2385 100644
--- a/src/imports/controls/material/TextField.qml
+++ b/src/imports/controls/material/TextField.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.TextField {
id: control
@@ -51,6 +51,8 @@ T.TextField {
topPadding: 8
bottomPadding: 16
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
color: enabled ? Material.primaryTextColor : Material.hintTextColor
selectionColor: Material.accentColor
selectedTextColor: Material.primaryHighlightedTextColor
diff --git a/src/imports/controls/material/ToolBar.qml b/src/imports/controls/material/ToolBar.qml
index f0b50f73..38acf43e 100644
--- a/src/imports/controls/material/ToolBar.qml
+++ b/src/imports/controls/material/ToolBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
-import QtQuick.Controls.Material.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.ToolBar {
id: control
@@ -52,8 +52,6 @@ T.ToolBar {
Material.foreground: Material.toolTextColor
- contentItem: Item { }
-
background: Rectangle {
implicitHeight: 48
color: control.Material.toolBarColor
diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml
index d8c945a7..dbeb7a05 100644
--- a/src/imports/controls/material/ToolButton.qml
+++ b/src/imports/controls/material/ToolButton.qml
@@ -34,9 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+import QtQuick.Controls.Material.impl 2.1
T.ToolButton {
id: control
@@ -49,20 +50,32 @@ T.ToolButton {
padding: 6
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
contentItem: Text {
text: control.text
font: control.font
- color: control.enabled ? control.Material.primaryTextColor : control.Material.hintTextColor
+ color: !control.enabled ? control.Material.hintTextColor :
+ control.checked || control.highlighted ? control.Material.accent : control.Material.primaryTextColor
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
- background: Rectangle {
+ background: Ripple {
implicitWidth: 48
implicitHeight: 48
- color: control.down ? control.Material.buttonPressColor : control.Material.buttonHoverColor
- visible: control.enabled && (control.down || control.visualFocus || control.checked || control.highlighted)
+ readonly property bool square: control.contentItem.implicitWidth <= control.contentItem.implicitHeight
+
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ clip: !square
+ width: square ? parent.height / 2 : parent.width
+ height: square ? parent.height / 2 : parent.height
+ pressed: control.pressed
+ anchor: control
+ active: control.enabled && (control.down || control.visualFocus || control.hovered)
+ color: control.Material.rippleColor
}
}
diff --git a/src/imports/controls/material/ToolSeparator.qml b/src/imports/controls/material/ToolSeparator.qml
new file mode 100644
index 00000000..c241750a
--- /dev/null
+++ b/src/imports/controls/material/ToolSeparator.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
+
+T.ToolSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ leftPadding: vertical ? 12 : 5
+ rightPadding: vertical ? 12 : 5
+ topPadding: vertical ? 5 : 12
+ bottomPadding: vertical ? 5 : 12
+
+ //! [contentItem]
+ contentItem: Rectangle {
+ implicitWidth: vertical ? 1 : 38
+ implicitHeight: vertical ? 38 : 1
+ color: control.Material.hintTextColor
+ }
+ //! [contentItem]
+}
diff --git a/src/imports/controls/material/ToolTip.qml b/src/imports/controls/material/ToolTip.qml
index ab3b05d8..455f79c6 100644
--- a/src/imports/controls/material/ToolTip.qml
+++ b/src/imports/controls/material/ToolTip.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.ToolTip {
id: control
diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml
index 7e914319..88750855 100644
--- a/src/imports/controls/material/Tumbler.qml
+++ b/src/imports/controls/material/Tumbler.qml
@@ -34,10 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Material 2.0
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Material 2.1
T.Tumbler {
id: control
@@ -54,22 +55,16 @@ T.Tumbler {
verticalAlignment: Text.AlignVCenter
}
- contentItem: PathView {
- id: pathView
+ contentItem: TumblerView {
+ id: tumblerView
model: control.model
delegate: control.delegate
- clip: true
- pathItemCount: control.visibleItemCount + 1
- preferredHighlightBegin: 0.5
- preferredHighlightEnd: 0.5
- dragMargin: width / 2
-
path: Path {
- startX: pathView.width / 2
- startY: -pathView.delegateHeight / 2
+ startX: tumblerView.width / 2
+ startY: -tumblerView.delegateHeight / 2
PathLine {
- x: pathView.width / 2
- y: pathView.pathItemCount * pathView.delegateHeight - pathView.delegateHeight / 2
+ x: tumblerView.width / 2
+ y: (control.visibleItemCount + 1) * tumblerView.delegateHeight - tumblerView.delegateHeight / 2
}
}
diff --git a/src/imports/controls/material/material.pri b/src/imports/controls/material/material.pri
index d6247895..3170a695 100644
--- a/src/imports/controls/material/material.pri
+++ b/src/imports/controls/material/material.pri
@@ -1,10 +1,12 @@
HEADERS += \
+ $$PWD/qquickmaterialripple_p.h \
$$PWD/qquickmaterialstyle_p.h \
$$PWD/qquickmaterialtheme_p.h \
$$PWD/qquickmaterialprogressring_p.h \
$$PWD/qquickmaterialprogressstrip_p.h
SOURCES += \
+ $$PWD/qquickmaterialripple.cpp \
$$PWD/qquickmaterialstyle.cpp \
$$PWD/qquickmaterialtheme.cpp \
$$PWD/qquickmaterialprogressring.cpp \
@@ -20,6 +22,8 @@ QML_FILES += \
$$PWD/CheckIndicator.qml \
$$PWD/ComboBox.qml \
$$PWD/Dial.qml \
+ $$PWD/Dialog.qml \
+ $$PWD/DialogButtonBox.qml \
$$PWD/Drawer.qml \
$$PWD/ElevationEffect.qml \
$$PWD/Frame.qml \
@@ -28,6 +32,7 @@ QML_FILES += \
$$PWD/Label.qml \
$$PWD/Menu.qml \
$$PWD/MenuItem.qml \
+ $$PWD/MenuSeparator.qml \
$$PWD/Page.qml \
$$PWD/PageIndicator.qml \
$$PWD/Pane.qml \
@@ -37,7 +42,8 @@ QML_FILES += \
$$PWD/RadioDelegate.qml \
$$PWD/RadioIndicator.qml \
$$PWD/RangeSlider.qml \
- $$PWD/Ripple.qml \
+ $$PWD/RoundButton.qml \
+ $$PWD/RectangularGlow.qml \
$$PWD/ScrollBar.qml \
$$PWD/ScrollIndicator.qml \
$$PWD/Slider.qml \
@@ -55,5 +61,6 @@ QML_FILES += \
$$PWD/TextField.qml \
$$PWD/ToolBar.qml \
$$PWD/ToolButton.qml \
+ $$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
$$PWD/Tumbler.qml
diff --git a/src/imports/controls/material/material.pro b/src/imports/controls/material/material.pro
index 06499467..363e4861 100644
--- a/src/imports/controls/material/material.pro
+++ b/src/imports/controls/material/material.pro
@@ -1,6 +1,6 @@
TARGET = qtquickcontrols2materialstyleplugin
TARGETPATH = QtQuick/Controls.2/Material
-IMPORT_VERSION = 2.0
+IMPORT_VERSION = 2.1
QT += qml quick
QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private
diff --git a/src/imports/controls/material/qmldir b/src/imports/controls/material/qmldir
index 51dafa08..6125e67d 100644
--- a/src/imports/controls/material/qmldir
+++ b/src/imports/controls/material/qmldir
@@ -2,4 +2,3 @@ module QtQuick.Controls.Material
plugin qtquickcontrols2materialstyleplugin
classname QtQuickControls2MaterialStylePlugin
depends QtQuick.Controls 2.0
-depends QtGraphicalEffects 1.0
diff --git a/src/imports/controls/material/qquickmaterialprogressring.cpp b/src/imports/controls/material/qquickmaterialprogressring.cpp
index 8407c7c2..a3564c17 100644
--- a/src/imports/controls/material/qquickmaterialprogressring.cpp
+++ b/src/imports/controls/material/qquickmaterialprogressring.cpp
@@ -41,8 +41,8 @@
#include <QtCore/qset.h>
#include <QtGui/qpainter.h>
#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/qsgsimplerectnode.h>
-#include <QtQuick/qsgsimpletexturenode.h>
+#include <QtQuick/qsgrectanglenode.h>
+#include <QtQuick/qsgimagenode.h>
#include <QtQuick/qquickwindow.h>
QT_BEGIN_NAMESPACE
@@ -79,18 +79,6 @@ private:
qreal m_devicePixelRatio;
QSGNode *m_containerNode;
QQuickWindow *m_window;
-};
-
-class QQuickMaterialRingTexture : public QSGSimpleTextureNode
-{
-public:
- QQuickMaterialRingTexture();
- ~QQuickMaterialRingTexture();
-
- QColor color() const;
- void setColor(QColor color);
-
-private:
QColor m_color;
};
@@ -106,14 +94,15 @@ QQuickMaterialProgressRing::~QQuickMaterialProgressRing()
QSGNode *QQuickMaterialProgressRing::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *)
{
- if (!oldNode)
- oldNode = new QSGSimpleRectNode(boundingRect(), Qt::transparent);
-
- static_cast<QSGSimpleRectNode *>(oldNode)->setRect(boundingRect());
+ if (!oldNode) {
+ oldNode = window()->createRectangleNode();
+ static_cast<QSGRectangleNode *>(oldNode)->setColor(Qt::transparent);
+ }
+ static_cast<QSGRectangleNode *>(oldNode)->setRect(boundingRect());
- QQuickMaterialRingTexture *textureNode = static_cast<QQuickMaterialRingTexture*>(oldNode->firstChild());
+ QSGImageNode *textureNode = static_cast<QSGImageNode *>(oldNode->firstChild());
if (!textureNode) {
- textureNode = new QQuickMaterialRingTexture;
+ textureNode = window()->createImageNode();
textureNode->setOwnsTexture(true);
oldNode->appendChildNode(textureNode);
}
@@ -122,7 +111,6 @@ QSGNode *QQuickMaterialProgressRing::updatePaintNode(QSGNode *oldNode, QQuickIte
// so just use a blank image.
QImage blankImage(width(), height(), QImage::Format_ARGB32_Premultiplied);
blankImage.fill(Qt::transparent);
- textureNode->setColor(m_color);
textureNode->setRect(boundingRect());
textureNode->setTexture(window()->createTextureFromImage(blankImage));
@@ -194,7 +182,7 @@ void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time)
if (!m_containerNode)
return;
- QSGSimpleRectNode *rectNode = static_cast<QSGSimpleRectNode*>(m_containerNode->firstChild());
+ QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(m_containerNode->firstChild());
if (!rectNode)
return;
@@ -209,8 +197,8 @@ void QQuickMaterialRingAnimatorJob::updateCurrentTime(int time)
painter.setRenderHint(QPainter::Antialiasing);
QPen pen;
- QQuickMaterialRingTexture *textureNode = static_cast<QQuickMaterialRingTexture*>(rectNode->firstChild());
- pen.setColor(textureNode->color());
+ QSGImageNode *textureNode = static_cast<QSGImageNode *>(rectNode->firstChild());
+ pen.setColor(m_color);
pen.setWidth(4 * m_devicePixelRatio);
painter.setPen(pen);
@@ -266,24 +254,7 @@ void QQuickMaterialRingAnimatorJob::nodeWasDestroyed()
void QQuickMaterialRingAnimatorJob::afterNodeSync()
{
m_containerNode = QQuickItemPrivate::get(m_target)->childContainerNode();
-}
-
-QQuickMaterialRingTexture::QQuickMaterialRingTexture()
-{
-}
-
-QQuickMaterialRingTexture::~QQuickMaterialRingTexture()
-{
-}
-
-QColor QQuickMaterialRingTexture::color() const
-{
- return m_color;
-}
-
-void QQuickMaterialRingTexture::setColor(QColor color)
-{
- m_color = color;
+ m_color = static_cast<QQuickMaterialProgressRing *>(m_target.data())->color();
}
QT_END_NAMESPACE
diff --git a/src/imports/controls/material/qquickmaterialprogressstrip.cpp b/src/imports/controls/material/qquickmaterialprogressstrip.cpp
index ce4d676e..542d312f 100644
--- a/src/imports/controls/material/qquickmaterialprogressstrip.cpp
+++ b/src/imports/controls/material/qquickmaterialprogressstrip.cpp
@@ -38,10 +38,11 @@
#include <QtCore/qmath.h>
#include <QtCore/qeasingcurve.h>
-#include <QtQuick/qsgsimplerectnode.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickanimatorjob_p.h>
#include <QtQuick/private/qsgadaptationlayer_p.h>
+#include <QtQuick/qsgrectanglenode.h>
+#include <QtQuick/qsgimagenode.h>
QT_BEGIN_NAMESPACE
@@ -81,7 +82,7 @@ void QQuickMaterialProgressStripAnimatorJob::updateCurrentTime(int time)
if (!m_node)
return;
- QSGSimpleRectNode *geometryNode = static_cast<QSGSimpleRectNode *>(m_node->firstChild());
+ QSGRectangleNode *geometryNode = static_cast<QSGRectangleNode *>(m_node->firstChild());
Q_ASSERT(!geometryNode || geometryNode->type() == QSGNode::GeometryNodeType);
if (!geometryNode)
return;
@@ -128,7 +129,7 @@ void QQuickMaterialProgressStripAnimatorJob::moveNode(QSGTransformNode *transfor
matrix.translate(x, 0);
transformNode->setMatrix(matrix);
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(transformNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(transformNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
QRectF r = geometry;
@@ -211,9 +212,11 @@ QSGNode *QQuickMaterialProgressStrip::updatePaintNode(QSGNode *oldNode, UpdatePa
bounds.setHeight(implicitHeight());
bounds.moveTop((height() - bounds.height()) / 2.0);
- if (!oldNode)
- oldNode = new QSGSimpleRectNode(bounds, Qt::transparent);
- static_cast<QSGSimpleRectNode *>(oldNode)->setRect(bounds);
+ if (!oldNode) {
+ oldNode = window()->createRectangleNode();
+ static_cast<QSGRectangleNode *>(oldNode)->setColor(Qt::transparent);
+ }
+ static_cast<QSGRectangleNode *>(oldNode)->setRect(bounds);
const int count = m_indeterminate ? 2 : 1;
const qreal w = m_indeterminate ? 0 : m_progress * width();
@@ -225,14 +228,14 @@ QSGNode *QQuickMaterialProgressStrip::updatePaintNode(QSGNode *oldNode, UpdatePa
transformNode = new QSGTransformNode;
oldNode->appendChildNode(transformNode);
- QSGRectangleNode *rectNode = d->sceneGraphContext()->createRectangleNode();
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
rectNode->setAntialiasing(true);
transformNode->appendChildNode(rectNode);
}
Q_ASSERT(transformNode->type() == QSGNode::TransformNodeType);
static_cast<QSGTransformNode *>(transformNode)->setMatrix(QMatrix4x4());
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(transformNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(transformNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
rectNode->setRect(rect);
diff --git a/src/imports/controls/material/qquickmaterialripple.cpp b/src/imports/controls/material/qquickmaterialripple.cpp
new file mode 100644
index 00000000..645b0289
--- /dev/null
+++ b/src/imports/controls/material/qquickmaterialripple.cpp
@@ -0,0 +1,451 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickmaterialripple_p.h"
+
+#include <QtCore/qmath.h>
+#include <QtQuick/private/qquickitem_p.h>
+#include <QtQuick/private/qquickanimator_p.h>
+#include <QtQuick/private/qquickrectangle_p.h>
+#include <QtQuick/private/qquickanimatorjob_p.h>
+#include <QtQuick/private/qsgadaptationlayer_p.h>
+#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
+#include <QtQuickTemplates2/private/qquickabstractbutton_p_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace {
+ enum WavePhase { WaveEnter, WaveExit };
+}
+
+static const int RIPPLE_ENTER_DELAY = 80;
+static const int OPACITY_ENTER_DURATION_FAST = 120;
+static const int WAVE_OPACITY_DECAY_DURATION = 333;
+static const qreal WAVE_TOUCH_UP_ACCELERATION = 3400.0;
+static const qreal WAVE_TOUCH_DOWN_ACCELERATION = 1024.0;
+
+class QQuickMaterialRippleAnimatorJob : public QQuickAnimatorJob
+{
+public:
+ QQuickMaterialRippleAnimatorJob(WavePhase phase, const QPointF &anchor, const QRectF &bounds);
+
+ void initialize(QQuickAnimatorController *controller) override;
+ void updateCurrentTime(int time) override;
+ void writeBack() override;
+ void nodeWasDestroyed() override;
+ void afterNodeSync() override;
+
+private:
+ qreal m_diameter;
+ WavePhase m_phase;
+ QRectF m_bounds;
+ QPointF m_anchor;
+ QSGTransformNode *m_itemNode;
+ QSGOpacityNode *m_opacityNode;
+ QSGInternalRectangleNode *m_rectNode;
+};
+
+QQuickMaterialRippleAnimatorJob::QQuickMaterialRippleAnimatorJob(WavePhase phase, const QPointF &anchor, const QRectF &bounds)
+ : m_diameter(qSqrt(bounds.width() * bounds.width() + bounds.height() * bounds.height())),
+ m_phase(phase),
+ m_bounds(bounds),
+ m_anchor(anchor),
+ m_itemNode(nullptr),
+ m_opacityNode(nullptr),
+ m_rectNode(nullptr)
+{
+}
+
+void QQuickMaterialRippleAnimatorJob::initialize(QQuickAnimatorController *controller)
+{
+ QQuickAnimatorJob::initialize(controller);
+ afterNodeSync();
+}
+
+void QQuickMaterialRippleAnimatorJob::updateCurrentTime(int time)
+{
+ if (!m_itemNode || !m_rectNode)
+ return;
+
+ qreal duration = 0;
+ if (m_phase == WaveEnter)
+ duration = QQuickAnimatorJob::duration();
+ else
+ duration = 1000.0 * qSqrt((m_diameter - m_from) / 2.0 / (WAVE_TOUCH_UP_ACCELERATION + WAVE_TOUCH_DOWN_ACCELERATION));
+
+ qreal p = 1.0;
+ if (!qFuzzyIsNull(duration) && time < duration)
+ p = time / duration;
+
+ m_value = m_from + (m_to - m_from) * p;
+ p = m_value / m_diameter;
+
+ const qreal dx = (1.0 - p) * (m_anchor.x() - m_bounds.width() / 2);
+ const qreal dy = (1.0 - p) * (m_anchor.y() - m_bounds.height() / 2);
+
+ m_rectNode->setRect(QRectF(0, 0, m_value, m_value));
+ m_rectNode->setRadius(m_value / 2);
+ m_rectNode->update();
+
+ QMatrix4x4 m;
+ m.translate((m_bounds.width() - m_value) / 2 + dx,
+ (m_bounds.height() - m_value) / 2 + dy);
+ m_itemNode->setMatrix(m);
+
+ if (m_opacityNode) {
+ qreal opacity = 1.0;
+ if (m_phase == WaveExit)
+ opacity -= static_cast<qreal>(time) / WAVE_OPACITY_DECAY_DURATION;
+ m_opacityNode->setOpacity(opacity);
+ }
+}
+
+void QQuickMaterialRippleAnimatorJob::writeBack()
+{
+ if (m_target)
+ m_target->setSize(QSizeF(m_value, m_value));
+ if (m_phase == WaveExit)
+ m_target->deleteLater();
+}
+
+void QQuickMaterialRippleAnimatorJob::nodeWasDestroyed()
+{
+ m_itemNode = nullptr;
+ m_opacityNode = nullptr;
+ m_rectNode = nullptr;
+}
+
+void QQuickMaterialRippleAnimatorJob::afterNodeSync()
+{
+ m_itemNode = QQuickItemPrivate::get(m_target)->itemNode();
+ m_opacityNode = QQuickItemPrivate::get(m_target)->opacityNode();
+ m_rectNode = static_cast<QSGInternalRectangleNode *>(QQuickItemPrivate::get(m_target)->childContainerNode()->firstChild());
+}
+
+class QQuickMaterialRippleAnimator : public QQuickAnimator
+{
+public:
+ QQuickMaterialRippleAnimator(const QPointF &anchor, const QRectF &bounds, QObject *parent = nullptr);
+
+ WavePhase phase() const;
+ void setPhase(WavePhase phase);
+
+protected:
+ QString propertyName() const override;
+ QQuickAnimatorJob *createJob() const override;
+
+private:
+ QPointF m_anchor;
+ QRectF m_bounds;
+ WavePhase m_phase;
+};
+
+QQuickMaterialRippleAnimator::QQuickMaterialRippleAnimator(const QPointF &anchor, const QRectF &bounds, QObject *parent)
+ : QQuickAnimator(parent), m_anchor(anchor), m_bounds(bounds), m_phase(WaveEnter)
+{
+}
+
+WavePhase QQuickMaterialRippleAnimator::phase() const
+{
+ return m_phase;
+}
+
+void QQuickMaterialRippleAnimator::setPhase(WavePhase phase)
+{
+ if (m_phase == phase)
+ return;
+
+ m_phase = phase;
+}
+
+QString QQuickMaterialRippleAnimator::propertyName() const
+{
+ return QString();
+}
+
+QQuickAnimatorJob *QQuickMaterialRippleAnimator::createJob() const
+{
+ return new QQuickMaterialRippleAnimatorJob(m_phase, m_anchor, m_bounds);
+}
+
+QQuickMaterialRipple::QQuickMaterialRipple(QQuickItem *parent)
+ : QQuickItem(parent), m_active(false), m_pressed(false), m_enterDelay(0), m_trigger(Press), m_clipRadius(0.0), m_anchor(nullptr), m_opacityAnimator(nullptr)
+{
+ setOpacity(0.0);
+ setFlag(ItemHasContents);
+}
+
+bool QQuickMaterialRipple::isActive() const
+{
+ return m_active;
+}
+
+void QQuickMaterialRipple::setActive(bool active)
+{
+ if (active == m_active)
+ return;
+
+ m_active = active;
+
+ if (!m_opacityAnimator) {
+ m_opacityAnimator = new QQuickOpacityAnimator(this);
+ m_opacityAnimator->setTargetItem(this);
+ }
+ m_opacityAnimator->setDuration(active ? OPACITY_ENTER_DURATION_FAST : WAVE_OPACITY_DECAY_DURATION);
+
+ const int time = m_opacityAnimator->currentTime();
+ m_opacityAnimator->stop();
+ m_opacityAnimator->setFrom(opacity());
+ m_opacityAnimator->setTo(active ? 1.0 : 0.0);
+ m_opacityAnimator->setCurrentTime(time);
+ m_opacityAnimator->start();
+}
+
+QColor QQuickMaterialRipple::color() const
+{
+ return m_color;
+}
+
+void QQuickMaterialRipple::setColor(const QColor &color)
+{
+ if (m_color == color)
+ return;
+
+ m_color = color;
+ update();
+}
+
+qreal QQuickMaterialRipple::clipRadius() const
+{
+ return m_clipRadius;
+}
+
+void QQuickMaterialRipple::setClipRadius(qreal radius)
+{
+ if (qFuzzyCompare(m_clipRadius, radius))
+ return;
+
+ m_clipRadius = radius;
+ setClip(!qFuzzyIsNull(radius));
+ update();
+}
+
+bool QQuickMaterialRipple::isPressed() const
+{
+ return m_pressed;
+}
+
+void QQuickMaterialRipple::setPressed(bool pressed)
+{
+ if (pressed == m_pressed)
+ return;
+
+ m_pressed = pressed;
+
+ if (!isEnabled())
+ return;
+
+ if (pressed) {
+ if (m_trigger == Press)
+ prepareWave();
+ else
+ exitWave();
+ } else {
+ if (m_trigger == Release)
+ enterWave();
+ else
+ exitWave();
+ }
+}
+
+QQuickMaterialRipple::Trigger QQuickMaterialRipple::trigger() const
+{
+ return m_trigger;
+}
+
+void QQuickMaterialRipple::setTrigger(Trigger trigger)
+{
+ m_trigger = trigger;
+}
+
+QPointF QQuickMaterialRipple::anchorPoint() const
+{
+ const QRectF bounds = boundingRect();
+ const QPointF center = bounds.center();
+ if (!m_anchor)
+ return center;
+
+ QPointF anchorPoint = bounds.center();
+ if (QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(m_anchor))
+ anchorPoint = QQuickAbstractButtonPrivate::get(button)->pressPoint;
+ anchorPoint = mapFromItem(m_anchor, anchorPoint);
+
+ // calculate whether the anchor point is within the ripple circle bounds,
+ // that is, whether waves should start expanding from the anchor point
+ const qreal r = qSqrt(bounds.width() * bounds.width() + bounds.height() * bounds.height()) / 2;
+ if (QLineF(center, anchorPoint).length() < r)
+ return anchorPoint;
+
+ // if the anchor point is outside the ripple circle bounds, start expanding
+ // from the intersection point of the ripple circle and a line from its center
+ // to the the anchor point
+ const qreal p = qAtan2(anchorPoint.y() - center.y(), anchorPoint.x() - center.x());
+ return QPointF(center.x() + r * qCos(p), center.y() + r * qSin(p));
+}
+
+QQuickItem *QQuickMaterialRipple::anchor() const
+{
+ return m_anchor;
+}
+
+void QQuickMaterialRipple::setAnchor(QQuickItem *item)
+{
+ m_anchor = item;
+}
+
+void QQuickMaterialRipple::itemChange(ItemChange change, const ItemChangeData &data)
+{
+ QQuickItem::itemChange(change, data);
+
+ if (change == ItemChildRemovedChange) {
+ QQuickMaterialRippleAnimator *animator = data.item->findChild<QQuickMaterialRippleAnimator *>();
+ if (animator)
+ m_rippleAnimators.removeOne(animator);
+ }
+}
+
+QSGNode *QQuickMaterialRipple::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
+{
+ QQuickItemPrivate *d = QQuickItemPrivate::get(this);
+ QQuickDefaultClipNode *clipNode = d->clipNode();
+ if (clipNode) {
+ // TODO: QTBUG-51894
+ // clipNode->setRadius(m_clipRadius);
+ clipNode->setRect(boundingRect());
+ clipNode->update();
+ }
+
+ const qreal w = width();
+ const qreal h = height();
+ const qreal sz = qSqrt(w * w + h * h);
+
+ QSGTransformNode *transformNode = static_cast<QSGTransformNode *>(oldNode);
+ if (!transformNode)
+ transformNode = new QSGTransformNode;
+
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(transformNode->firstChild());
+ if (!rectNode) {
+ rectNode = d->sceneGraphContext()->createInternalRectangleNode();
+ rectNode->setAntialiasing(true);
+ transformNode->appendChildNode(rectNode);
+ }
+
+ QMatrix4x4 matrix;
+ if (qFuzzyIsNull(m_clipRadius)) {
+ matrix.translate((w - sz) / 2, (h - sz) / 2);
+ rectNode->setRect(QRectF(0, 0, sz, sz));
+ rectNode->setRadius(sz / 2);
+ } else {
+ rectNode->setRect(QRectF(0, 0, w, h));
+ rectNode->setRadius(m_clipRadius);
+ }
+ transformNode->setMatrix(matrix);
+ rectNode->setColor(m_color);
+ rectNode->update();
+
+ return transformNode;
+}
+
+void QQuickMaterialRipple::timerEvent(QTimerEvent *event)
+{
+ QQuickItem::timerEvent(event);
+
+ if (event->timerId() == m_enterDelay)
+ enterWave();
+}
+
+void QQuickMaterialRipple::prepareWave()
+{
+ if (m_enterDelay <= 0)
+ m_enterDelay = startTimer(RIPPLE_ENTER_DELAY);
+}
+
+void QQuickMaterialRipple::enterWave()
+{
+ if (m_enterDelay > 0) {
+ killTimer(m_enterDelay);
+ m_enterDelay = 0;
+ }
+
+ const qreal w = width();
+ const qreal h = height();
+ const qreal sz = qSqrt(w * w + h * h);
+
+ QQuickRectangle *wave = new QQuickRectangle(this);
+ wave->setPosition(QPointF((w - sz) / 2, (h - sz) / 2));
+ wave->setSize(QSizeF(sz, sz));
+ wave->setRadius(sz / 2);
+ wave->setColor(color());
+ wave->setOpacity(0.0);
+
+ QQuickMaterialRippleAnimator *animator = new QQuickMaterialRippleAnimator(anchorPoint(), boundingRect(), wave);
+ animator->setDuration(qRound(1000.0 * qSqrt(sz / 2.0 / WAVE_TOUCH_DOWN_ACCELERATION)));
+ animator->setTargetItem(wave);
+ animator->setTo(sz);
+ animator->start();
+ m_rippleAnimators += animator;
+}
+
+void QQuickMaterialRipple::exitWave()
+{
+ if (m_enterDelay > 0) {
+ killTimer(m_enterDelay);
+ m_enterDelay = 0;
+ }
+
+ for (QQuickMaterialRippleAnimator *animator : m_rippleAnimators) {
+ if (animator->phase() == WaveEnter) {
+ animator->stop(); // -> writeBack() -> setSize()
+ if (QQuickItem *wave = animator->targetItem())
+ animator->setFrom(wave->width());
+ animator->setDuration(WAVE_OPACITY_DECAY_DURATION);
+ animator->setPhase(WaveExit);
+ animator->restart();
+ }
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/material/qquickmaterialripple_p.h b/src/imports/controls/material/qquickmaterialripple_p.h
new file mode 100644
index 00000000..a1cfed94
--- /dev/null
+++ b/src/imports/controls/material/qquickmaterialripple_p.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKMATERIALRIPPLE_P_H
+#define QQUICKMATERIALRIPPLE_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 <QtQuick/qquickitem.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickOpacityAnimator;
+class QQuickMaterialRippleAnimator;
+
+class QQuickMaterialRipple : public QQuickItem
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor FINAL)
+ Q_PROPERTY(qreal clipRadius READ clipRadius WRITE setClipRadius FINAL)
+ Q_PROPERTY(bool pressed READ isPressed WRITE setPressed FINAL)
+ Q_PROPERTY(bool active READ isActive WRITE setActive FINAL)
+ Q_PROPERTY(QQuickItem *anchor READ anchor WRITE setAnchor FINAL)
+ Q_PROPERTY(Trigger trigger READ trigger WRITE setTrigger FINAL)
+
+public:
+ QQuickMaterialRipple(QQuickItem *parent = nullptr);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ qreal clipRadius() const;
+ void setClipRadius(qreal radius);
+
+ bool isActive() const;
+ void setActive(bool active);
+
+ bool isPressed() const;
+ void setPressed(bool pressed);
+
+ enum Trigger { Press, Release };
+ Q_ENUM (Trigger)
+
+ Trigger trigger() const;
+ void setTrigger(Trigger trigger);
+
+ QPointF anchorPoint() const;
+
+ QQuickItem *anchor() const;
+ void setAnchor(QQuickItem *anchor);
+
+protected:
+ void itemChange(ItemChange change, const ItemChangeData &data) override;
+ QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) override;
+ void timerEvent(QTimerEvent *event) override;
+
+ void prepareWave();
+ void enterWave();
+ void exitWave();
+
+private:
+ bool m_active;
+ bool m_pressed;
+ int m_enterDelay;
+ Trigger m_trigger;
+ qreal m_clipRadius;
+ QColor m_color;
+ QQuickItem *m_anchor;
+ QQuickOpacityAnimator *m_opacityAnimator;
+ QVector<QQuickMaterialRippleAnimator *> m_rippleAnimators;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickMaterialRipple)
+
+#endif // QQUICKMATERIALRIPPLE_P_H
diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp
index 6c6a0e3e..3fb2a7f8 100644
--- a/src/imports/controls/material/qquickmaterialstyle.cpp
+++ b/src/imports/controls/material/qquickmaterialstyle.cpp
@@ -404,37 +404,24 @@ static const QRgb raisedButtonColorLight = 0xFFD6D7D7;
static const QRgb raisedButtonColorDark = 0x3FCCCCCC;
static const QRgb raisedButtonDisabledColorLight = dividerColorLight;
static const QRgb raisedButtonDisabledColorDark = dividerColorDark;
-static const QRgb flatButtonPressColorLight = 0x66999999;
-static const QRgb flatButtonPressColorDark = 0x3FCCCCCC;
-static const QRgb flatButtonFocusColorLight = 0x33CCCCCC;
-static const QRgb flatButtonFocusColorDark = 0x26CCCCCC;
-static const QRgb swipeDelegateColorLight = 0xFFD6D7D7;
-static const QRgb swipeDelegateColorDark = 0xFF525252;
-static const QRgb swipeDelegateHoverColorLight = 0xFFDFDFDF;
-static const QRgb swipeDelegateHoverColorDark = 0xFF5D5D5D;
-static const QRgb swipeDelegatePressColorLight = 0xFFCFCFCF;
-static const QRgb swipeDelegatePressColorDark = 0xFF484848;
-static const QRgb swipeDelegateDisabledColorLight = 0xFFEFEFEF;
-static const QRgb swipeDelegateDisabledColorDark = 0xFF7C7C7C;
static const QRgb frameColorLight = hintTextColorLight;
static const QRgb frameColorDark = hintTextColorDark;
static const QRgb switchUncheckedTrackColorLight = 0x42000000;
static const QRgb switchUncheckedTrackColorDark = 0x4CFFFFFF;
static const QRgb switchDisabledTrackColorLight = 0x1E000000;
static const QRgb switchDisabledTrackColorDark = 0x19FFFFFF;
-static const QRgb checkBoxUncheckedRippleColorLight = 0x10000000;
-static const QRgb checkBoxUncheckedRippleColorDark = 0x20FFFFFF;
+static const QRgb rippleColorLight = 0x10000000;
+static const QRgb rippleColorDark = 0x20FFFFFF;
static const QRgb spinBoxDisabledIconColorLight = 0xFFCCCCCC;
static const QRgb spinBoxDisabledIconColorDark = 0xFF666666;
-static QColor alphaBlend(const QColor &bg, const QColor &fg)
+extern bool qt_is_dark_system_theme();
+
+static QQuickMaterialStyle::Theme effectiveTheme(QQuickMaterialStyle::Theme theme)
{
- QColor result;
- result.setRedF(fg.redF() * fg.alphaF() + bg.redF() * (1.0 - fg.alphaF()));
- result.setGreenF(fg.greenF() * fg.alphaF() + bg.greenF() * (1.0 - fg.alphaF()));
- result.setBlueF(fg.blueF() * fg.alphaF() + bg.blueF() * (1.0 - fg.alphaF()));
- result.setAlphaF(bg.alphaF() + fg.alphaF() * (1.0 - bg.alphaF()));
- return result;
+ if (theme == QQuickMaterialStyle::System)
+ theme = qt_is_dark_system_theme() ? QQuickMaterialStyle::Dark : QQuickMaterialStyle::Light;
+ return theme;
}
QQuickMaterialStyle::QQuickMaterialStyle(QObject *parent) : QQuickStyleAttached(parent),
@@ -471,6 +458,9 @@ QQuickMaterialStyle::Theme QQuickMaterialStyle::theme() const
void QQuickMaterialStyle::setTheme(Theme theme)
{
+ if (theme == System)
+ theme = qt_is_dark_system_theme() ? Dark : Light;
+
m_explicitTheme = true;
if (m_theme == theme)
return;
@@ -863,10 +853,9 @@ QColor QQuickMaterialStyle::dividerColor() const
return QColor::fromRgba(m_theme == Light ? dividerColorLight : dividerColorDark);
}
-QColor QQuickMaterialStyle::buttonColor(bool highlighted, bool pressed, bool hover) const
+QColor QQuickMaterialStyle::buttonColor(bool highlighted) const
{
- Shade shade = pressed ? (m_theme == Light ? Shade700 : Shade100)
- : themeShade();
+ Shade shade = themeShade();
QColor color = Qt::transparent;
@@ -877,45 +866,14 @@ QColor QQuickMaterialStyle::buttonColor(bool highlighted, bool pressed, bool hov
} else if (elevation() > 0) {
color = QColor::fromRgba(m_theme == Light ? raisedButtonColorLight
: raisedButtonColorDark);
-
- if (pressed) {
- color = this->shade(color, shade);
- }
- }
-
- if (color == Qt::transparent) {
- if (pressed) {
- return QColor::fromRgba(m_theme == Light ? flatButtonPressColorLight
- : flatButtonPressColorDark);
- } else if (hover) {
- return QColor::fromRgba(m_theme == Light ? flatButtonFocusColorLight
- : flatButtonFocusColorDark);
- } else {
- return color;
- }
}
- if (pressed || hover) {
- // Add overlaying black shadow 12% opacity
- return alphaBlend(color, QColor::fromRgba(0x1F000000));
- } else {
- return color;
- }
+ return color;
}
QColor QQuickMaterialStyle::buttonColor() const
{
- return buttonColor(false, false, false);
-}
-
-QColor QQuickMaterialStyle::buttonHoverColor() const
-{
- return buttonColor(false, false, true);
-}
-
-QColor QQuickMaterialStyle::buttonPressColor() const
-{
- return buttonColor(false, true, false);
+ return buttonColor(false);
}
QColor QQuickMaterialStyle::buttonDisabledColor() const
@@ -930,37 +888,7 @@ QColor QQuickMaterialStyle::buttonDisabledColor() const
QColor QQuickMaterialStyle::highlightedButtonColor() const
{
- return buttonColor(true, false, false);
-}
-
-QColor QQuickMaterialStyle::highlightedButtonHoverColor() const
-{
- return buttonColor(true, false, true);
-}
-
-QColor QQuickMaterialStyle::highlightedButtonPressColor() const
-{
- return buttonColor(true, true, false);
-}
-
-QColor QQuickMaterialStyle::swipeDelegateColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegateColorLight : swipeDelegateColorDark);
-}
-
-QColor QQuickMaterialStyle::swipeDelegateHoverColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegateHoverColorLight : swipeDelegateHoverColorDark);
-}
-
-QColor QQuickMaterialStyle::swipeDelegatePressColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegatePressColorLight : swipeDelegatePressColorDark);
-}
-
-QColor QQuickMaterialStyle::swipeDelegateDisabledColor() const
-{
- return QColor::fromRgba(m_theme == Light ? swipeDelegateDisabledColorLight : swipeDelegateDisabledColorDark);
+ return buttonColor(true);
}
QColor QQuickMaterialStyle::frameColor() const
@@ -968,12 +896,12 @@ QColor QQuickMaterialStyle::frameColor() const
return QColor::fromRgba(m_theme == Light ? frameColorLight : frameColorDark);
}
-QColor QQuickMaterialStyle::checkBoxUncheckedRippleColor() const
+QColor QQuickMaterialStyle::rippleColor() const
{
- return QColor::fromRgba(m_theme == Light ? checkBoxUncheckedRippleColorLight : checkBoxUncheckedRippleColorDark);
+ return QColor::fromRgba(m_theme == Light ? rippleColorLight : rippleColorDark);
}
-QColor QQuickMaterialStyle::checkBoxCheckedRippleColor() const
+QColor QQuickMaterialStyle::highlightedRippleColor() const
{
QColor pressColor = accentColor();
pressColor.setAlpha(m_theme == Light ? 30 : 50);
@@ -1017,6 +945,11 @@ QColor QQuickMaterialStyle::scrollBarColor() const
return QColor::fromRgba(m_theme == Light ? 0x40000000 : 0x40FFFFFF);
}
+QColor QQuickMaterialStyle::scrollBarHoveredColor() const
+{
+ return QColor::fromRgba(m_theme == Light ? 0x60000000 : 0x60FFFFFF);
+}
+
QColor QQuickMaterialStyle::scrollBarPressedColor() const
{
return QColor::fromRgba(m_theme == Light ? 0x80000000 : 0x80FFFFFF);
@@ -1228,7 +1161,7 @@ void QQuickMaterialStyle::init()
QByteArray themeValue = resolveSetting("QT_QUICK_CONTROLS_MATERIAL_THEME", settings, QStringLiteral("Theme"));
Theme themeEnum = toEnumValue<Theme>(themeValue, &ok);
if (ok)
- globalTheme = m_theme = themeEnum;
+ globalTheme = m_theme = effectiveTheme(themeEnum);
else if (!themeValue.isEmpty())
qWarning().nospace().noquote() << "Material: unknown theme value: " << themeValue;
diff --git a/src/imports/controls/material/qquickmaterialstyle_p.h b/src/imports/controls/material/qquickmaterialstyle_p.h
index 6a841803..6ff779a5 100644
--- a/src/imports/controls/material/qquickmaterialstyle_p.h
+++ b/src/imports/controls/material/qquickmaterialstyle_p.h
@@ -75,19 +75,11 @@ class QQuickMaterialStyle : public QQuickStyleAttached
Q_PROPERTY(QColor dropShadowColor READ dropShadowColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor dividerColor READ dividerColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor buttonColor READ buttonColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor buttonHoverColor READ buttonHoverColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor buttonPressColor READ buttonPressColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor buttonDisabledColor READ buttonDisabledColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor highlightedButtonColor READ highlightedButtonColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor highlightedButtonHoverColor READ highlightedButtonHoverColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor highlightedButtonPressColor READ highlightedButtonPressColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegateColor READ swipeDelegateColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegateHoverColor READ swipeDelegateHoverColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegatePressColor READ swipeDelegatePressColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor swipeDelegateDisabledColor READ swipeDelegateDisabledColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor frameColor READ frameColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor checkBoxUncheckedRippleColor READ checkBoxUncheckedRippleColor NOTIFY paletteChanged FINAL)
- Q_PROPERTY(QColor checkBoxCheckedRippleColor READ checkBoxCheckedRippleColor NOTIFY paletteChanged FINAL)
+ Q_PROPERTY(QColor rippleColor READ rippleColor NOTIFY paletteChanged FINAL)
+ Q_PROPERTY(QColor highlightedRippleColor READ highlightedRippleColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor switchUncheckedTrackColor READ switchUncheckedTrackColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor switchCheckedTrackColor READ switchCheckedTrackColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor switchUncheckedHandleColor READ switchUncheckedHandleColor NOTIFY paletteChanged FINAL)
@@ -95,6 +87,7 @@ class QQuickMaterialStyle : public QQuickStyleAttached
Q_PROPERTY(QColor switchDisabledTrackColor READ switchDisabledTrackColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor switchDisabledHandleColor READ switchDisabledHandleColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor scrollBarColor READ scrollBarColor NOTIFY paletteChanged FINAL)
+ Q_PROPERTY(QColor scrollBarHoveredColor READ scrollBarHoveredColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor dialogColor READ dialogColor NOTIFY paletteChanged FINAL)
Q_PROPERTY(QColor backgroundDimColor READ backgroundDimColor NOTIFY paletteChanged FINAL)
@@ -107,7 +100,8 @@ class QQuickMaterialStyle : public QQuickStyleAttached
public:
enum Theme {
Light,
- Dark
+ Dark,
+ System
};
enum Color {
@@ -202,20 +196,12 @@ public:
QColor dropShadowColor() const;
QColor dividerColor() const;
QColor buttonColor() const;
- QColor buttonHoverColor() const;
- QColor buttonPressColor() const;
QColor buttonDisabledColor() const;
QColor highlightedButtonColor() const;
- QColor highlightedButtonHoverColor() const;
- QColor highlightedButtonPressColor() const;
QColor highlightedButtonDisabledColor() const;
- QColor swipeDelegateColor() const;
- QColor swipeDelegateHoverColor() const;
- QColor swipeDelegatePressColor() const;
- QColor swipeDelegateDisabledColor() const;
QColor frameColor() const;
- QColor checkBoxUncheckedRippleColor() const;
- QColor checkBoxCheckedRippleColor() const;
+ QColor rippleColor() const;
+ QColor highlightedRippleColor() const;
QColor switchUncheckedTrackColor() const;
QColor switchCheckedTrackColor() const;
QColor switchUncheckedHandleColor() const;
@@ -223,6 +209,7 @@ public:
QColor switchDisabledTrackColor() const;
QColor switchDisabledHandleColor() const;
QColor scrollBarColor() const;
+ QColor scrollBarHoveredColor() const;
QColor scrollBarPressedColor() const;
QColor dialogColor() const;
QColor backgroundDimColor() const;
@@ -254,7 +241,7 @@ private:
QColor backgroundColor(Shade shade) const;
QColor accentColor(Shade shade) const;
- QColor buttonColor(bool highlighted, bool pressed, bool hover) const;
+ QColor buttonColor(bool highlighted) const;
Shade themeShade() const;
// These reflect whether a color value was explicitly set on the specific
diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp
index ac11e95b..27d2c5a6 100644
--- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp
+++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.cpp
@@ -40,9 +40,11 @@
#include "qquickmaterialtheme_p.h"
#include "qquickmaterialprogressring_p.h"
#include "qquickmaterialprogressstrip_p.h"
+#include "qquickmaterialripple_p.h"
#include <QtQuickControls2/private/qquickstyleselector_p.h>
#include <QtQuickControls2/private/qquickpaddedrectangle_p.h>
+#include <QtQuickControls2/private/qquickcolorimageprovider_p.h>
static inline void initResources()
{
@@ -77,22 +79,27 @@ QtQuickControls2MaterialStylePlugin::QtQuickControls2MaterialStylePlugin(QObject
void QtQuickControls2MaterialStylePlugin::registerTypes(const char *uri)
{
qmlRegisterUncreatableType<QQuickMaterialStyle>(uri, 2, 0, "Material", tr("Material is an attached property"));
+ qmlRegisterRevision<QQuickMaterialStyle, 1>(uri, 2, 1);
}
void QtQuickControls2MaterialStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri)
{
QQuickStylePlugin::initializeEngine(engine, uri);
+ engine->addImageProvider(name(), new QQuickColorImageProvider(QStringLiteral(":/qt-project.org/imports/QtQuick/Controls.2/Material/images")));
+
QByteArray import = QByteArray(uri) + ".impl";
qmlRegisterType<QQuickPaddedRectangle>(import, 2, 0, "PaddedRectangle");
+ qmlRegisterRevision<QQuickPaddedRectangle, 1>(import, 2, 1);
qmlRegisterType<QQuickMaterialProgressRing>(import, 2, 0, "ProgressRing");
qmlRegisterType<QQuickMaterialProgressStrip>(import, 2, 0, "ProgressStrip");
qmlRegisterType<QQuickMaterialRingAnimator>(import, 2, 0, "RingAnimator");
+ qmlRegisterType<QQuickMaterialRipple>(import, 2, 0, "Ripple");
qmlRegisterType<QQuickMaterialStripAnimator>(import, 2, 0, "StripAnimator");
qmlRegisterType(typeUrl(QStringLiteral("BoxShadow.qml")), import, 2, 0, "BoxShadow");
qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator");
qmlRegisterType(typeUrl(QStringLiteral("ElevationEffect.qml")), import, 2, 0, "ElevationEffect");
- qmlRegisterType(typeUrl(QStringLiteral("Ripple.qml")), import, 2, 0, "Ripple");
+ qmlRegisterType(typeUrl(QStringLiteral("RectangularGlow.qml")), import, 2, 0, "RectangularGlow");
qmlRegisterType(typeUrl(QStringLiteral("SliderHandle.qml")), import, 2, 0, "SliderHandle");
qmlRegisterType(typeUrl(QStringLiteral("SwitchIndicator.qml")), import, 2, 0, "SwitchIndicator");
}
diff --git a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc
index 47257ce4..e2cc90fa 100644
--- a/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc
+++ b/src/imports/controls/material/qtquickcontrols2materialstyleplugin.qrc
@@ -8,5 +8,8 @@
<file>images/drop-indicator@2x.png</file>
<file>images/drop-indicator@3x.png</file>
<file>images/drop-indicator@4x.png</file>
+ <file>shaders/RectangularGlow.frag</file>
+ <file>shaders/+glslcore/RectangularGlow.frag</file>
+ <file>shaders/+hlsl/RectangularGlow.frag</file>
</qresource>
</RCC>
diff --git a/src/imports/controls/material/shaders/+glslcore/RectangularGlow.frag b/src/imports/controls/material/shaders/+glslcore/RectangularGlow.frag
new file mode 100644
index 00000000..432d86b5
--- /dev/null
+++ b/src/imports/controls/material/shaders/+glslcore/RectangularGlow.frag
@@ -0,0 +1,25 @@
+#version 150
+
+uniform float qt_Opacity;
+uniform float relativeSizeX;
+uniform float relativeSizeY;
+uniform float spread;
+uniform vec4 color;
+
+in vec2 qt_TexCoord0;
+out vec4 fragColor;
+
+float linearstep(float e0, float e1, float x)
+{
+ return clamp((x - e0) / (e1 - e0), 0.0, 1.0);
+}
+
+void main()
+{
+ float alpha =
+ smoothstep(0.0, relativeSizeX, 0.5 - abs(0.5 - qt_TexCoord0.x)) *
+ smoothstep(0.0, relativeSizeY, 0.5 - abs(0.5 - qt_TexCoord0.y));
+
+ float spreadMultiplier = linearstep(spread, 1.0 - spread, alpha);
+ fragColor = color * qt_Opacity * spreadMultiplier * spreadMultiplier;
+}
diff --git a/src/imports/controls/material/shaders/+hlsl/RectangularGlow.frag b/src/imports/controls/material/shaders/+hlsl/RectangularGlow.frag
new file mode 100644
index 00000000..69d9f852
--- /dev/null
+++ b/src/imports/controls/material/shaders/+hlsl/RectangularGlow.frag
@@ -0,0 +1,21 @@
+cbuffer ConstantBuffer : register(b0)
+{
+ float4x4 qt_Matrix;
+ float qt_Opacity;
+ float relativeSizeX;
+ float relativeSizeY;
+ float spread;
+ float4 color;
+}
+
+float linearstep(float e0, float e1, float x) { return clamp((x - e0) / (e1 - e0), 0.0, 1.0); }
+
+float4 main(float4 position : SV_POSITION, float2 coord : TEXCOORD0) : SV_TARGET
+{
+ float alpha =
+ smoothstep(0.0, relativeSizeX, 0.5 - abs(0.5 - coord.x)) *
+ smoothstep(0.0, relativeSizeY, 0.5 - abs(0.5 - coord.y));
+
+ float spreadMultiplier = linearstep(spread, 1.0 - spread, alpha);
+ return color * qt_Opacity * spreadMultiplier * spreadMultiplier;
+}
diff --git a/src/imports/controls/material/shaders/RectangularGlow.frag b/src/imports/controls/material/shaders/RectangularGlow.frag
new file mode 100644
index 00000000..40bab580
--- /dev/null
+++ b/src/imports/controls/material/shaders/RectangularGlow.frag
@@ -0,0 +1,19 @@
+uniform highp float qt_Opacity;
+uniform mediump float relativeSizeX;
+uniform mediump float relativeSizeY;
+uniform mediump float spread;
+uniform lowp vec4 color;
+varying highp vec2 qt_TexCoord0;
+
+highp float linearstep(highp float e0, highp float e1, highp float x) {
+ return clamp((x - e0) / (e1 - e0), 0.0, 1.0);
+}
+
+void main() {
+ lowp float alpha =
+ smoothstep(0.0, relativeSizeX, 0.5 - abs(0.5 - qt_TexCoord0.x)) *
+ smoothstep(0.0, relativeSizeY, 0.5 - abs(0.5 - qt_TexCoord0.y));
+
+ highp float spreadMultiplier = linearstep(spread, 1.0 - spread, alpha);
+ gl_FragColor = color * qt_Opacity * spreadMultiplier * spreadMultiplier;
+}
diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes
index e661056c..d1adb16c 100644
--- a/src/imports/controls/plugins.qmltypes
+++ b/src/imports/controls/plugins.qmltypes
@@ -4,82 +4,14 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Controls 2.0 -merge ..\templates\plugins.qmltypes -dependencies dep.json'
+// 'qmlplugindump -nonrelocatable QtQuick.Controls 2.1 -merge ../templates/plugins.qmltypes -dependencies dependencies.json'
Module {
- dependencies: ["QtQuick.Templates 2.0", "QtQuick.Window 2.2", "QtQuick 2.7"]
- Component {
- name: "QQuickAbstractAnimation"
- prototype: "QObject"
- Enum {
- name: "Loops"
- values: {
- "Infinite": -2
- }
- }
- Property { name: "running"; type: "bool" }
- Property { name: "paused"; type: "bool" }
- Property { name: "alwaysRunToEnd"; type: "bool" }
- Property { name: "loops"; type: "int" }
- Signal { name: "started" }
- Signal { name: "stopped" }
- Signal {
- name: "runningChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "pausedChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "alwaysRunToEndChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "loopCountChanged"
- Parameter { type: "int" }
- }
- Method { name: "restart" }
- Method { name: "start" }
- Method { name: "pause" }
- Method { name: "resume" }
- Method { name: "stop" }
- Method { name: "complete" }
- }
- Component {
- name: "QQuickAnimator"
- prototype: "QQuickAbstractAnimation"
- exports: [
- "QtQuick.Controls.impl/BusyRingAnimator 2.0",
- "QtQuick.Controls.impl/ProgressStripAnimator 2.0"
- ]
- exportMetaObjectRevisions: [0, 0]
- Property { name: "target"; type: "QQuickItem"; isPointer: true }
- Property { name: "easing"; type: "QEasingCurve" }
- Property { name: "duration"; type: "int" }
- Property { name: "to"; type: "double" }
- Property { name: "from"; type: "double" }
- Signal {
- name: "targetItemChanged"
- Parameter { type: "QQuickItem"; isPointer: true }
- }
- Signal {
- name: "durationChanged"
- Parameter { name: "duration"; type: "int" }
- }
- Signal {
- name: "easingChanged"
- Parameter { name: "curve"; type: "QEasingCurve" }
- }
- Signal {
- name: "toChanged"
- Parameter { name: "to"; type: "double" }
- }
- Signal {
- name: "fromChanged"
- Parameter { name: "from"; type: "double" }
- }
- }
+ dependencies: [
+ "QtQuick 2.8",
+ "QtQuick.Templates 2.1",
+ "QtQuick.Window 2.2"
+ ]
Component {
name: "QQuickBusyIndicatorRing"
defaultProperty: "data"
@@ -88,26 +20,51 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
- name: "QQuickButtonGroup"
- prototype: "QObject"
- exports: ["QtQuick.Controls/ButtonGroup 2.0"]
- exportMetaObjectRevisions: [0]
- attachedType: "QQuickButtonGroupAttached"
- Property { name: "checkedButton"; type: "QQuickAbstractButton"; isPointer: true }
- Property { name: "buttons"; type: "QQuickAbstractButton"; isList: true; isReadonly: true }
- Method {
- name: "addButton"
- Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
- }
- Method {
- name: "removeButton"
- Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
- }
- }
- Component {
- name: "QQuickButtonGroupAttached"
+ name: "QQuickDefaultStyle"
prototype: "QObject"
- Property { name: "group"; type: "QQuickButtonGroup"; isPointer: true }
+ exports: ["QtQuick.Controls.impl/Default 2.1"]
+ isCreatable: false
+ isSingleton: true
+ exportMetaObjectRevisions: [0]
+ Property { name: "backgroundColor"; type: "QColor"; isReadonly: true }
+ Property { name: "overlayModalColor"; type: "QColor"; isReadonly: true }
+ Property { name: "overlayDimColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textDarkColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textLightColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textLinkColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textSelectionColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textDisabledColor"; type: "QColor"; isReadonly: true }
+ Property { name: "textDisabledLightColor"; type: "QColor"; isReadonly: true }
+ Property { name: "focusColor"; type: "QColor"; isReadonly: true }
+ Property { name: "focusLightColor"; type: "QColor"; isReadonly: true }
+ Property { name: "focusPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "buttonColor"; type: "QColor"; isReadonly: true }
+ Property { name: "buttonPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "buttonCheckedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "buttonCheckedPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "buttonCheckedFocusColor"; type: "QColor"; isReadonly: true }
+ Property { name: "toolButtonColor"; type: "QColor"; isReadonly: true }
+ Property { name: "tabButtonColor"; type: "QColor"; isReadonly: true }
+ Property { name: "tabButtonPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "tabButtonCheckedPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "delegateColor"; type: "QColor"; isReadonly: true }
+ Property { name: "delegatePressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "delegateFocusColor"; type: "QColor"; isReadonly: true }
+ Property { name: "indicatorPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "indicatorDisabledColor"; type: "QColor"; isReadonly: true }
+ Property { name: "indicatorFrameColor"; type: "QColor"; isReadonly: true }
+ Property { name: "indicatorFramePressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "indicatorFrameDisabledColor"; type: "QColor"; isReadonly: true }
+ Property { name: "frameDarkColor"; type: "QColor"; isReadonly: true }
+ Property { name: "frameLightColor"; type: "QColor"; isReadonly: true }
+ Property { name: "scrollBarColor"; type: "QColor"; isReadonly: true }
+ Property { name: "scrollBarPressedColor"; type: "QColor"; isReadonly: true }
+ Property { name: "progressBarColor"; type: "QColor"; isReadonly: true }
+ Property { name: "pageIndicatorColor"; type: "QColor"; isReadonly: true }
+ Property { name: "separatorColor"; type: "QColor"; isReadonly: true }
+ Property { name: "disabledDarkColor"; type: "QColor"; isReadonly: true }
+ Property { name: "disabledLightColor"; type: "QColor"; isReadonly: true }
}
Component {
name: "QQuickDialRing"
@@ -119,24 +76,6 @@ Module {
Property { name: "color"; type: "QColor" }
}
Component {
- name: "QQuickPaintedItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- Enum {
- name: "RenderTarget"
- values: {
- "Image": 0,
- "FramebufferObject": 1,
- "InvertedYFramebufferObject": 2
- }
- }
- Property { name: "contentsSize"; type: "QSize" }
- Property { name: "fillColor"; type: "QColor" }
- Property { name: "contentsScale"; type: "double" }
- Property { name: "renderTarget"; type: "RenderTarget" }
- Property { name: "textureSize"; type: "QSize" }
- }
- Component {
name: "QQuickProgressStrip"
defaultProperty: "data"
prototype: "QQuickItem"
@@ -146,6 +85,24 @@ Module {
Property { name: "progress"; type: "double" }
}
Component {
+ name: "QQuickTumblerView"
+ defaultProperty: "data"
+ prototype: "QQuickItem"
+ exports: ["QtQuick.Controls.impl/TumblerView 2.1"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "model"; type: "QVariant" }
+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "path"; type: "QQuickPath"; isPointer: true }
+ }
+ Component {
+ prototype: "QQuickAbstractButton"
+ name: "QtQuick.Controls/AbstractButton 2.0"
+ exports: ["QtQuick.Controls/AbstractButton 2.0"]
+ exportMetaObjectRevisions: [0]
+ isComposite: true
+ defaultProperty: "data"
+ }
+ Component {
prototype: "QQuickApplicationWindow"
name: "QtQuick.Controls/ApplicationWindow 2.0"
exports: ["QtQuick.Controls/ApplicationWindow 2.0"]
@@ -186,17 +143,13 @@ Module {
defaultProperty: "data"
}
Component {
- prototype: "QQuickItem"
+ prototype: "QQuickRectangle"
name: "QtQuick.Controls.impl/CheckIndicator 2.0"
exports: ["QtQuick.Controls.impl/CheckIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
- Property { name: "color"; type: "QColor" }
- Property { name: "gradient"; type: "QQuickGradient"; isPointer: true }
- Property { name: "border"; type: "QQuickPen"; isReadonly: true; isPointer: true }
- Property { name: "radius"; type: "double" }
}
Component {
prototype: "QQuickComboBox"
@@ -207,6 +160,22 @@ Module {
defaultProperty: "data"
}
Component {
+ prototype: "QQuickContainer"
+ name: "QtQuick.Controls/Container 2.0"
+ exports: ["QtQuick.Controls/Container 2.0"]
+ exportMetaObjectRevisions: [0]
+ isComposite: true
+ defaultProperty: "contentData"
+ }
+ Component {
+ prototype: "QQuickControl"
+ name: "QtQuick.Controls/Control 2.0"
+ exports: ["QtQuick.Controls/Control 2.0"]
+ exportMetaObjectRevisions: [0]
+ isComposite: true
+ defaultProperty: "data"
+ }
+ Component {
prototype: "QQuickDial"
name: "QtQuick.Controls/Dial 2.0"
exports: ["QtQuick.Controls/Dial 2.0"]
@@ -215,6 +184,22 @@ Module {
defaultProperty: "data"
}
Component {
+ prototype: "QQuickDialog"
+ name: "QtQuick.Controls/Dialog 2.1"
+ exports: ["QtQuick.Controls/Dialog 2.1"]
+ exportMetaObjectRevisions: [1]
+ isComposite: true
+ defaultProperty: "contentData"
+ }
+ Component {
+ prototype: "QQuickDialogButtonBox"
+ name: "QtQuick.Controls/DialogButtonBox 2.1"
+ exports: ["QtQuick.Controls/DialogButtonBox 2.1"]
+ exportMetaObjectRevisions: [1]
+ isComposite: true
+ defaultProperty: "contentData"
+ }
+ Component {
prototype: "QQuickDrawer"
name: "QtQuick.Controls/Drawer 2.0"
exports: ["QtQuick.Controls/Drawer 2.0"]
@@ -271,6 +256,14 @@ Module {
defaultProperty: "data"
}
Component {
+ prototype: "QQuickMenuSeparator"
+ name: "QtQuick.Controls/MenuSeparator 2.1"
+ exports: ["QtQuick.Controls/MenuSeparator 2.1"]
+ exportMetaObjectRevisions: [1]
+ isComposite: true
+ defaultProperty: "data"
+ }
+ Component {
prototype: "QQuickPage"
name: "QtQuick.Controls/Page 2.0"
exports: ["QtQuick.Controls/Page 2.0"]
@@ -327,17 +320,13 @@ Module {
defaultProperty: "data"
}
Component {
- prototype: "QQuickItem"
+ prototype: "QQuickRectangle"
name: "QtQuick.Controls.impl/RadioIndicator 2.0"
exports: ["QtQuick.Controls.impl/RadioIndicator 2.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "QQuickItem"; isPointer: true }
- Property { name: "color"; type: "QColor" }
- Property { name: "gradient"; type: "QQuickGradient"; isPointer: true }
- Property { name: "border"; type: "QQuickPen"; isReadonly: true; isPointer: true }
- Property { name: "radius"; type: "double" }
}
Component {
prototype: "QQuickRangeSlider"
@@ -348,6 +337,14 @@ Module {
defaultProperty: "data"
}
Component {
+ prototype: "QQuickRoundButton"
+ name: "QtQuick.Controls/RoundButton 2.1"
+ exports: ["QtQuick.Controls/RoundButton 2.1"]
+ exportMetaObjectRevisions: [1]
+ isComposite: true
+ defaultProperty: "data"
+ }
+ Component {
prototype: "QQuickScrollBar"
name: "QtQuick.Controls/ScrollBar 2.0"
exports: ["QtQuick.Controls/ScrollBar 2.0"]
@@ -477,6 +474,14 @@ Module {
defaultProperty: "data"
}
Component {
+ prototype: "QQuickToolSeparator"
+ name: "QtQuick.Controls/ToolSeparator 2.1"
+ exports: ["QtQuick.Controls/ToolSeparator 2.1"]
+ exportMetaObjectRevisions: [1]
+ isComposite: true
+ defaultProperty: "data"
+ }
+ Component {
prototype: "QQuickToolTip"
name: "QtQuick.Controls/ToolTip 2.0"
exports: ["QtQuick.Controls/ToolTip 2.0"]
@@ -492,6 +497,7 @@ Module {
isComposite: true
defaultProperty: "data"
}
+
Component {
name: "QQuickAbstractButton"
defaultProperty: "data"
@@ -559,6 +565,36 @@ Module {
Property { name: "flat"; type: "bool" }
}
Component {
+ name: "QQuickButtonGroup"
+ prototype: "QObject"
+ exports: [
+ "QtQuick.Templates/ButtonGroup 2.0",
+ "QtQuick.Templates/ButtonGroup 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
+ attachedType: "QQuickButtonGroupAttached"
+ Property { name: "checkedButton"; type: "QQuickAbstractButton"; isPointer: true }
+ Property { name: "buttons"; type: "QQuickAbstractButton"; isList: true; isReadonly: true }
+ Signal {
+ name: "clicked"
+ revision: 1
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ Method {
+ name: "addButton"
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ Method {
+ name: "removeButton"
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ }
+ Component {
+ name: "QQuickButtonGroupAttached"
+ prototype: "QObject"
+ Property { name: "group"; type: "QQuickButtonGroup"; isPointer: true }
+ }
+ Component {
name: "QQuickCheckBox"
defaultProperty: "data"
prototype: "QQuickAbstractButton"
@@ -580,11 +616,15 @@ Module {
name: "QQuickComboBox"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/ComboBox 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/ComboBox 2.0",
+ "QtQuick.Templates/ComboBox 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "count"; type: "int"; isReadonly: true }
Property { name: "model"; type: "QVariant" }
Property { name: "delegateModel"; type: "QQmlInstanceModel"; isReadonly: true; isPointer: true }
+ Property { name: "flat"; revision: 1; type: "bool" }
Property { name: "pressed"; type: "bool" }
Property { name: "highlightedIndex"; type: "int"; isReadonly: true }
Property { name: "currentIndex"; type: "int" }
@@ -594,6 +634,7 @@ Module {
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "indicator"; type: "QQuickItem"; isPointer: true }
Property { name: "popup"; type: "QQuickPopup"; isPointer: true }
+ Signal { name: "flatChanged"; revision: 1 }
Signal {
name: "activated"
Parameter { name: "index"; type: "int" }
@@ -625,8 +666,11 @@ Module {
name: "QQuickContainer"
defaultProperty: "contentData"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/Container 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/Container 2.0",
+ "QtQuick.Templates/Container 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "count"; type: "int"; isReadonly: true }
Property { name: "contentModel"; type: "QVariant"; isReadonly: true }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
@@ -637,6 +681,8 @@ Module {
name: "setCurrentIndex"
Parameter { name: "index"; type: "int" }
}
+ Method { name: "incrementCurrentIndex"; revision: 1 }
+ Method { name: "decrementCurrentIndex"; revision: 1 }
Method {
name: "itemAt"
type: "QQuickItem*"
@@ -715,6 +761,58 @@ Module {
Method { name: "decrease" }
}
Component {
+ name: "QQuickDialog"
+ defaultProperty: "contentData"
+ prototype: "QQuickPopup"
+ exports: ["QtQuick.Templates/Dialog 2.1"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "header"; type: "QQuickItem"; isPointer: true }
+ Property { name: "footer"; type: "QQuickItem"; isPointer: true }
+ Property { name: "buttonBox"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" }
+ Signal { name: "accepted" }
+ Signal { name: "rejected" }
+ Method { name: "accept" }
+ Method { name: "reject" }
+ }
+ Component {
+ name: "QQuickDialogButtonBox"
+ defaultProperty: "contentData"
+ prototype: "QQuickContainer"
+ exports: ["QtQuick.Templates/DialogButtonBox 2.1"]
+ exportMetaObjectRevisions: [0]
+ attachedType: "QQuickDialogButtonBoxAttached"
+ Enum {
+ name: "Position"
+ values: {
+ "Header": 0,
+ "Footer": 1
+ }
+ }
+ Property { name: "position"; type: "Position" }
+ Property { name: "alignment"; type: "Qt::Alignment" }
+ Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" }
+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
+ Signal { name: "accepted" }
+ Signal { name: "rejected" }
+ Signal { name: "helpRequested" }
+ Signal {
+ name: "clicked"
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ Method {
+ name: "standardButton"
+ type: "QQuickAbstractButton*"
+ Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" }
+ }
+ }
+ Component {
+ name: "QQuickDialogButtonBoxAttached"
+ prototype: "QObject"
+ Property { name: "buttonBox"; type: "QQuickDialogButtonBox"; isReadonly: true; isPointer: true }
+ Property { name: "buttonRole"; type: "QPlatformDialogHelper::ButtonRole" }
+ }
+ Component {
name: "QQuickDrawer"
defaultProperty: "contentData"
prototype: "QQuickPopup"
@@ -741,15 +839,6 @@ Module {
Property { name: "label"; type: "QQuickItem"; isPointer: true }
}
Component {
- name: "QQuickImplicitSizeItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- Property { name: "implicitWidth"; type: "double"; isReadonly: true }
- Property { name: "implicitHeight"; type: "double"; isReadonly: true }
- Signal { name: "implicitWidthChanged2"; revision: 1 }
- Signal { name: "implicitHeightChanged2"; revision: 1 }
- }
- Component {
name: "QQuickItemDelegate"
defaultProperty: "data"
prototype: "QQuickAbstractButton"
@@ -810,11 +899,18 @@ Module {
Signal { name: "triggered" }
}
Component {
+ name: "QQuickMenuSeparator"
+ defaultProperty: "data"
+ prototype: "QQuickControl"
+ exports: ["QtQuick.Templates/MenuSeparator 2.1"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "QQuickOverlay"
defaultProperty: "data"
prototype: "QQuickItem"
- Property { name: "modal"; type: "QQuickItem"; isPointer: true }
- Property { name: "modeless"; type: "QQuickItem"; isPointer: true }
+ Property { name: "modal"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "modeless"; type: "QQmlComponent"; isPointer: true }
Signal { name: "pressed" }
Signal { name: "released" }
}
@@ -933,6 +1029,11 @@ Module {
Signal { name: "closed" }
Method { name: "open" }
Method { name: "close" }
+ Method {
+ name: "forceActiveFocus"
+ Parameter { name: "reason"; type: "Qt::FocusReason" }
+ }
+ Method { name: "forceActiveFocus" }
}
Component {
name: "QQuickProgressBar"
@@ -965,8 +1066,11 @@ Module {
name: "QQuickRangeSlider"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/RangeSlider 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/RangeSlider 2.0",
+ "QtQuick.Templates/RangeSlider 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "SnapMode"
values: {
@@ -996,21 +1100,18 @@ Module {
Property { name: "visualPosition"; type: "double"; isReadonly: true }
Property { name: "handle"; type: "QQuickItem"; isPointer: true }
Property { name: "pressed"; type: "bool" }
+ Property { name: "hovered"; revision: 1; type: "bool" }
+ Signal { name: "hoveredChanged"; revision: 1 }
Method { name: "increase" }
Method { name: "decrease" }
}
Component {
- name: "QQuickRootItem"
+ name: "QQuickRoundButton"
defaultProperty: "data"
- prototype: "QQuickItem"
- Method {
- name: "setWidth"
- Parameter { name: "w"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "h"; type: "int" }
- }
+ prototype: "QQuickButton"
+ exports: ["QtQuick.Templates/RoundButton 2.1"]
+ exportMetaObjectRevisions: [1]
+ Property { name: "radius"; type: "double" }
}
Component {
name: "QQuickScrollBar"
@@ -1072,8 +1173,11 @@ Module {
name: "QQuickSlider"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/Slider 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/Slider 2.0",
+ "QtQuick.Templates/Slider 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "SnapMode"
values: {
@@ -1094,13 +1198,22 @@ Module {
Property { name: "handle"; type: "QQuickItem"; isPointer: true }
Method { name: "increase" }
Method { name: "decrease" }
+ Method {
+ name: "valueAt"
+ revision: 1
+ type: "double"
+ Parameter { name: "position"; type: "double" }
+ }
}
Component {
name: "QQuickSpinBox"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/SpinBox 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/SpinBox 2.0",
+ "QtQuick.Templates/SpinBox 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "from"; type: "int" }
Property { name: "to"; type: "int" }
Property { name: "value"; type: "int" }
@@ -1118,7 +1231,9 @@ Module {
name: "QQuickSpinButton"
prototype: "QObject"
Property { name: "pressed"; type: "bool" }
+ Property { name: "hovered"; revision: 1; type: "bool" }
Property { name: "indicator"; type: "QQuickItem"; isPointer: true }
+ Signal { name: "hoveredChanged"; revision: 1 }
}
Component {
name: "QQuickStackAttached"
@@ -1126,13 +1241,21 @@ Module {
Property { name: "index"; type: "int"; isReadonly: true }
Property { name: "view"; type: "QQuickStackView"; isReadonly: true; isPointer: true }
Property { name: "status"; type: "QQuickStackView::Status"; isReadonly: true }
+ Signal { name: "activated" }
+ Signal { name: "activating" }
+ Signal { name: "deactivated" }
+ Signal { name: "deactivating" }
+ Signal { name: "removed" }
}
Component {
name: "QQuickStackView"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/StackView 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/StackView 2.0",
+ "QtQuick.Templates/StackView 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickStackAttached"
Enum {
name: "Status"
@@ -1153,8 +1276,11 @@ Module {
Enum {
name: "Operation"
values: {
- "Transition": 0,
- "Immediate": 1
+ "Transition": -1,
+ "Immediate": 0,
+ "PushTransition": 1,
+ "ReplaceTransition": 2,
+ "PopTransition": 3
}
}
Property { name: "busy"; type: "bool"; isReadonly: true }
@@ -1214,28 +1340,47 @@ Module {
Property { name: "leftItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "behindItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "rightItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
+ Signal { name: "completed"; revision: 1 }
+ Method { name: "close"; revision: 1 }
}
Component {
name: "QQuickSwipeDelegate"
defaultProperty: "data"
prototype: "QQuickItemDelegate"
- exports: ["QtQuick.Templates/SwipeDelegate 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/SwipeDelegate 2.0",
+ "QtQuick.Templates/SwipeDelegate 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
+ attachedType: "QQuickSwipeDelegateAttached"
Property { name: "swipe"; type: "QQuickSwipe"; isReadonly: true; isPointer: true }
}
Component {
+ name: "QQuickSwipeDelegateAttached"
+ prototype: "QObject"
+ Property { name: "pressed"; type: "bool"; isReadonly: true }
+ Signal { name: "clicked" }
+ }
+ Component {
name: "QQuickSwipeView"
defaultProperty: "contentData"
prototype: "QQuickContainer"
- exports: ["QtQuick.Templates/SwipeView 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/SwipeView 2.0",
+ "QtQuick.Templates/SwipeView 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickSwipeViewAttached"
+ Property { name: "interactive"; revision: 1; type: "bool" }
+ Signal { name: "interactiveChanged"; revision: 1 }
}
Component {
name: "QQuickSwipeViewAttached"
prototype: "QObject"
Property { name: "index"; type: "int"; isReadonly: true }
Property { name: "isCurrentItem"; type: "bool"; isReadonly: true }
+ Property { name: "isNextItem"; revision: 1; type: "bool"; isReadonly: true }
+ Property { name: "isPreviousItem"; revision: 1; type: "bool"; isReadonly: true }
Property { name: "view"; type: "QQuickSwipeView"; isReadonly: true; isPointer: true }
}
Component {
@@ -1279,188 +1424,14 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
- name: "QQuickText"
- defaultProperty: "data"
- prototype: "QQuickImplicitSizeItem"
- Enum {
- name: "HAlignment"
- values: {
- "AlignLeft": 1,
- "AlignRight": 2,
- "AlignHCenter": 4,
- "AlignJustify": 8
- }
- }
- Enum {
- name: "VAlignment"
- values: {
- "AlignTop": 32,
- "AlignBottom": 64,
- "AlignVCenter": 128
- }
- }
- Enum {
- name: "TextStyle"
- values: {
- "Normal": 0,
- "Outline": 1,
- "Raised": 2,
- "Sunken": 3
- }
- }
- Enum {
- name: "TextFormat"
- values: {
- "PlainText": 0,
- "RichText": 1,
- "AutoText": 2,
- "StyledText": 4
- }
- }
- Enum {
- name: "TextElideMode"
- values: {
- "ElideLeft": 0,
- "ElideRight": 1,
- "ElideMiddle": 2,
- "ElideNone": 3
- }
- }
- Enum {
- name: "WrapMode"
- values: {
- "NoWrap": 0,
- "WordWrap": 1,
- "WrapAnywhere": 3,
- "WrapAtWordBoundaryOrAnywhere": 4,
- "Wrap": 4
- }
- }
- Enum {
- name: "RenderType"
- values: {
- "QtRendering": 0,
- "NativeRendering": 1
- }
- }
- Enum {
- name: "LineHeightMode"
- values: {
- "ProportionalHeight": 0,
- "FixedHeight": 1
- }
- }
- Enum {
- name: "FontSizeMode"
- values: {
- "FixedSize": 0,
- "HorizontalFit": 1,
- "VerticalFit": 2,
- "Fit": 3
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "font"; type: "QFont" }
- Property { name: "color"; type: "QColor" }
- Property { name: "linkColor"; type: "QColor" }
- Property { name: "style"; type: "TextStyle" }
- Property { name: "styleColor"; type: "QColor" }
- Property { name: "horizontalAlignment"; type: "HAlignment" }
- Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true }
- Property { name: "verticalAlignment"; type: "VAlignment" }
- Property { name: "wrapMode"; type: "WrapMode" }
- Property { name: "lineCount"; type: "int"; isReadonly: true }
- Property { name: "truncated"; type: "bool"; isReadonly: true }
- Property { name: "maximumLineCount"; type: "int" }
- Property { name: "textFormat"; type: "TextFormat" }
- Property { name: "elide"; type: "TextElideMode" }
- Property { name: "contentWidth"; type: "double"; isReadonly: true }
- Property { name: "contentHeight"; type: "double"; isReadonly: true }
- Property { name: "paintedWidth"; type: "double"; isReadonly: true }
- Property { name: "paintedHeight"; type: "double"; isReadonly: true }
- Property { name: "lineHeight"; type: "double" }
- Property { name: "lineHeightMode"; type: "LineHeightMode" }
- Property { name: "baseUrl"; type: "QUrl" }
- Property { name: "minimumPixelSize"; type: "int" }
- Property { name: "minimumPointSize"; type: "int" }
- Property { name: "fontSizeMode"; type: "FontSizeMode" }
- Property { name: "renderType"; type: "RenderType" }
- Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true }
- Property { name: "padding"; revision: 6; type: "double" }
- Property { name: "topPadding"; revision: 6; type: "double" }
- Property { name: "leftPadding"; revision: 6; type: "double" }
- Property { name: "rightPadding"; revision: 6; type: "double" }
- Property { name: "bottomPadding"; revision: 6; type: "double" }
- Signal {
- name: "textChanged"
- Parameter { name: "text"; type: "string" }
- }
- Signal {
- name: "linkActivated"
- Parameter { name: "link"; type: "string" }
- }
- Signal {
- name: "linkHovered"
- revision: 2
- Parameter { name: "link"; type: "string" }
- }
- Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "styleChanged"
- Parameter { name: "style"; type: "QQuickText::TextStyle" }
- }
- Signal {
- name: "horizontalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickText::HAlignment" }
- }
- Signal {
- name: "verticalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickText::VAlignment" }
- }
- Signal {
- name: "textFormatChanged"
- Parameter { name: "textFormat"; type: "QQuickText::TextFormat" }
- }
- Signal {
- name: "elideModeChanged"
- Parameter { name: "mode"; type: "QQuickText::TextElideMode" }
- }
- Signal { name: "contentSizeChanged" }
- Signal {
- name: "lineHeightChanged"
- Parameter { name: "lineHeight"; type: "double" }
- }
- Signal {
- name: "lineHeightModeChanged"
- Parameter { name: "mode"; type: "LineHeightMode" }
- }
- Signal {
- name: "lineLaidOut"
- Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true }
- }
- Signal { name: "paddingChanged"; revision: 6 }
- Signal { name: "topPaddingChanged"; revision: 6 }
- Signal { name: "leftPaddingChanged"; revision: 6 }
- Signal { name: "rightPaddingChanged"; revision: 6 }
- Signal { name: "bottomPaddingChanged"; revision: 6 }
- Method { name: "doLayout" }
- Method {
- name: "linkAt"
- revision: 3
- type: "string"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- }
- }
- Component {
name: "QQuickTextArea"
defaultProperty: "data"
prototype: "QQuickTextEdit"
- exports: ["QtQuick.Templates/TextArea 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/TextArea 2.0",
+ "QtQuick.Templates/TextArea 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickTextAreaAttached"
Property { name: "font"; type: "QFont" }
Property { name: "implicitWidth"; type: "double" }
@@ -1468,539 +1439,72 @@ Module {
Property { name: "background"; type: "QQuickItem"; isPointer: true }
Property { name: "placeholderText"; type: "string" }
Property { name: "focusReason"; type: "Qt::FocusReason" }
+ Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true }
+ Property { name: "hoverEnabled"; revision: 1; type: "bool" }
Signal { name: "implicitWidthChanged3" }
Signal { name: "implicitHeightChanged3" }
+ Signal { name: "hoveredChanged"; revision: 1 }
+ Signal { name: "hoverEnabledChanged"; revision: 1 }
Signal {
name: "pressAndHold"
Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
- }
- Component {
- name: "QQuickTextAreaAttached"
- prototype: "QObject"
- Property { name: "flickable"; type: "QQuickTextArea"; isPointer: true }
- }
- Component {
- name: "QQuickTextEdit"
- defaultProperty: "data"
- prototype: "QQuickImplicitSizeItem"
- Enum {
- name: "HAlignment"
- values: {
- "AlignLeft": 1,
- "AlignRight": 2,
- "AlignHCenter": 4,
- "AlignJustify": 8
- }
- }
- Enum {
- name: "VAlignment"
- values: {
- "AlignTop": 32,
- "AlignBottom": 64,
- "AlignVCenter": 128
- }
- }
- Enum {
- name: "TextFormat"
- values: {
- "PlainText": 0,
- "RichText": 1,
- "AutoText": 2
- }
- }
- Enum {
- name: "WrapMode"
- values: {
- "NoWrap": 0,
- "WordWrap": 1,
- "WrapAnywhere": 3,
- "WrapAtWordBoundaryOrAnywhere": 4,
- "Wrap": 4
- }
- }
- Enum {
- name: "SelectionMode"
- values: {
- "SelectCharacters": 0,
- "SelectWords": 1
- }
- }
- Enum {
- name: "RenderType"
- values: {
- "QtRendering": 0,
- "NativeRendering": 1
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "color"; type: "QColor" }
- Property { name: "selectionColor"; type: "QColor" }
- Property { name: "selectedTextColor"; type: "QColor" }
- Property { name: "font"; type: "QFont" }
- Property { name: "horizontalAlignment"; type: "HAlignment" }
- Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true }
- Property { name: "verticalAlignment"; type: "VAlignment" }
- Property { name: "wrapMode"; type: "WrapMode" }
- Property { name: "lineCount"; type: "int"; isReadonly: true }
- Property { name: "length"; type: "int"; isReadonly: true }
- Property { name: "contentWidth"; type: "double"; isReadonly: true }
- Property { name: "contentHeight"; type: "double"; isReadonly: true }
- Property { name: "paintedWidth"; type: "double"; isReadonly: true }
- Property { name: "paintedHeight"; type: "double"; isReadonly: true }
- Property { name: "textFormat"; type: "TextFormat" }
- Property { name: "readOnly"; type: "bool" }
- Property { name: "cursorVisible"; type: "bool" }
- Property { name: "cursorPosition"; type: "int" }
- Property { name: "cursorRectangle"; type: "QRectF"; isReadonly: true }
- Property { name: "cursorDelegate"; type: "QQmlComponent"; isPointer: true }
- Property { name: "selectionStart"; type: "int"; isReadonly: true }
- Property { name: "selectionEnd"; type: "int"; isReadonly: true }
- Property { name: "selectedText"; type: "string"; isReadonly: true }
- Property { name: "activeFocusOnPress"; type: "bool" }
- Property { name: "persistentSelection"; type: "bool" }
- Property { name: "textMargin"; type: "double" }
- Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" }
- Property { name: "selectByKeyboard"; revision: 1; type: "bool" }
- Property { name: "selectByMouse"; type: "bool" }
- Property { name: "mouseSelectionMode"; type: "SelectionMode" }
- Property { name: "canPaste"; type: "bool"; isReadonly: true }
- Property { name: "canUndo"; type: "bool"; isReadonly: true }
- Property { name: "canRedo"; type: "bool"; isReadonly: true }
- Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true }
- Property { name: "baseUrl"; type: "QUrl" }
- Property { name: "renderType"; type: "RenderType" }
- Property {
- name: "textDocument"
- revision: 1
- type: "QQuickTextDocument"
- isReadonly: true
- isPointer: true
- }
- Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true }
- Property { name: "padding"; revision: 6; type: "double" }
- Property { name: "topPadding"; revision: 6; type: "double" }
- Property { name: "leftPadding"; revision: 6; type: "double" }
- Property { name: "rightPadding"; revision: 6; type: "double" }
- Property { name: "bottomPadding"; revision: 6; type: "double" }
- Property { name: "preeditText"; revision: 7; type: "string"; isReadonly: true }
- Signal { name: "preeditTextChanged"; revision: 7 }
- Signal { name: "contentSizeChanged" }
- Signal {
- name: "colorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Signal {
- name: "selectionColorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Signal {
- name: "selectedTextColorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "horizontalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextEdit::HAlignment" }
- }
Signal {
- name: "verticalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextEdit::VAlignment" }
- }
- Signal {
- name: "textFormatChanged"
- Parameter { name: "textFormat"; type: "QQuickTextEdit::TextFormat" }
- }
- Signal {
- name: "readOnlyChanged"
- Parameter { name: "isReadOnly"; type: "bool" }
- }
- Signal {
- name: "cursorVisibleChanged"
- Parameter { name: "isCursorVisible"; type: "bool" }
- }
- Signal {
- name: "activeFocusOnPressChanged"
- Parameter { name: "activeFocusOnPressed"; type: "bool" }
- }
- Signal {
- name: "persistentSelectionChanged"
- Parameter { name: "isPersistentSelection"; type: "bool" }
- }
- Signal {
- name: "textMarginChanged"
- Parameter { name: "textMargin"; type: "double" }
- }
- Signal {
- name: "selectByKeyboardChanged"
+ name: "pressed"
revision: 1
- Parameter { name: "selectByKeyboard"; type: "bool" }
- }
- Signal {
- name: "selectByMouseChanged"
- Parameter { name: "selectByMouse"; type: "bool" }
- }
- Signal {
- name: "mouseSelectionModeChanged"
- Parameter { name: "mode"; type: "QQuickTextEdit::SelectionMode" }
- }
- Signal {
- name: "linkActivated"
- Parameter { name: "link"; type: "string" }
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
Signal {
- name: "linkHovered"
- revision: 2
- Parameter { name: "link"; type: "string" }
- }
- Signal { name: "editingFinished"; revision: 6 }
- Signal { name: "paddingChanged"; revision: 6 }
- Signal { name: "topPaddingChanged"; revision: 6 }
- Signal { name: "leftPaddingChanged"; revision: 6 }
- Signal { name: "rightPaddingChanged"; revision: 6 }
- Signal { name: "bottomPaddingChanged"; revision: 6 }
- Method { name: "selectAll" }
- Method { name: "selectWord" }
- Method {
- name: "select"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "deselect" }
- Method {
- name: "isRightToLeft"
- type: "bool"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "cut" }
- Method { name: "copy" }
- Method { name: "paste" }
- Method { name: "undo" }
- Method { name: "redo" }
- Method {
- name: "insert"
- Parameter { name: "position"; type: "int" }
- Parameter { name: "text"; type: "string" }
- }
- Method {
- name: "remove"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "append"
- revision: 2
- Parameter { name: "text"; type: "string" }
- }
- Method { name: "clear"; revision: 7 }
- Method {
- name: "inputMethodQuery"
- revision: 4
- type: "QVariant"
- Parameter { name: "query"; type: "Qt::InputMethodQuery" }
- Parameter { name: "argument"; type: "QVariant" }
- }
- Method {
- name: "positionToRectangle"
- type: "QRectF"
- Parameter { type: "int" }
- }
- Method {
- name: "positionAt"
- type: "int"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- Parameter { name: "mode"; type: "SelectionMode" }
- }
- Method {
- name: "getText"
- type: "string"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "getFormattedText"
- type: "string"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "linkAt"
- revision: 3
- type: "string"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
+ name: "released"
+ revision: 1
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
}
Component {
+ name: "QQuickTextAreaAttached"
+ prototype: "QObject"
+ Property { name: "flickable"; type: "QQuickTextArea"; isPointer: true }
+ }
+ Component {
name: "QQuickTextField"
defaultProperty: "data"
prototype: "QQuickTextInput"
- exports: ["QtQuick.Templates/TextField 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/TextField 2.0",
+ "QtQuick.Templates/TextField 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "font"; type: "QFont" }
Property { name: "implicitWidth"; type: "double" }
Property { name: "implicitHeight"; type: "double" }
Property { name: "background"; type: "QQuickItem"; isPointer: true }
Property { name: "placeholderText"; type: "string" }
Property { name: "focusReason"; type: "Qt::FocusReason" }
+ Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true }
+ Property { name: "hoverEnabled"; revision: 1; type: "bool" }
Signal { name: "implicitWidthChanged3" }
Signal { name: "implicitHeightChanged3" }
+ Signal { name: "hoveredChanged"; revision: 1 }
+ Signal { name: "hoverEnabledChanged"; revision: 1 }
Signal {
name: "pressAndHold"
- Parameter { name: "mouse"; type: "QQuickMouseEvent"; isPointer: true }
- }
- }
- Component {
- name: "QQuickTextInput"
- defaultProperty: "data"
- prototype: "QQuickImplicitSizeItem"
- Enum {
- name: "EchoMode"
- values: {
- "Normal": 0,
- "NoEcho": 1,
- "Password": 2,
- "PasswordEchoOnEdit": 3
- }
- }
- Enum {
- name: "HAlignment"
- values: {
- "AlignLeft": 1,
- "AlignRight": 2,
- "AlignHCenter": 4
- }
- }
- Enum {
- name: "VAlignment"
- values: {
- "AlignTop": 32,
- "AlignBottom": 64,
- "AlignVCenter": 128
- }
- }
- Enum {
- name: "WrapMode"
- values: {
- "NoWrap": 0,
- "WordWrap": 1,
- "WrapAnywhere": 3,
- "WrapAtWordBoundaryOrAnywhere": 4,
- "Wrap": 4
- }
- }
- Enum {
- name: "SelectionMode"
- values: {
- "SelectCharacters": 0,
- "SelectWords": 1
- }
- }
- Enum {
- name: "CursorPosition"
- values: {
- "CursorBetweenCharacters": 0,
- "CursorOnCharacter": 1
- }
- }
- Enum {
- name: "RenderType"
- values: {
- "QtRendering": 0,
- "NativeRendering": 1
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "length"; type: "int"; isReadonly: true }
- Property { name: "color"; type: "QColor" }
- Property { name: "selectionColor"; type: "QColor" }
- Property { name: "selectedTextColor"; type: "QColor" }
- Property { name: "font"; type: "QFont" }
- Property { name: "horizontalAlignment"; type: "HAlignment" }
- Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true }
- Property { name: "verticalAlignment"; type: "VAlignment" }
- Property { name: "wrapMode"; type: "WrapMode" }
- Property { name: "readOnly"; type: "bool" }
- Property { name: "cursorVisible"; type: "bool" }
- Property { name: "cursorPosition"; type: "int" }
- Property { name: "cursorRectangle"; type: "QRectF"; isReadonly: true }
- Property { name: "cursorDelegate"; type: "QQmlComponent"; isPointer: true }
- Property { name: "selectionStart"; type: "int"; isReadonly: true }
- Property { name: "selectionEnd"; type: "int"; isReadonly: true }
- Property { name: "selectedText"; type: "string"; isReadonly: true }
- Property { name: "maximumLength"; type: "int" }
- Property { name: "validator"; type: "QValidator"; isPointer: true }
- Property { name: "inputMask"; type: "string" }
- Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" }
- Property { name: "acceptableInput"; type: "bool"; isReadonly: true }
- Property { name: "echoMode"; type: "EchoMode" }
- Property { name: "activeFocusOnPress"; type: "bool" }
- Property { name: "passwordCharacter"; type: "string" }
- Property { name: "passwordMaskDelay"; revision: 3; type: "int" }
- Property { name: "displayText"; type: "string"; isReadonly: true }
- Property { name: "preeditText"; revision: 7; type: "string"; isReadonly: true }
- Property { name: "autoScroll"; type: "bool" }
- Property { name: "selectByMouse"; type: "bool" }
- Property { name: "mouseSelectionMode"; type: "SelectionMode" }
- Property { name: "persistentSelection"; type: "bool" }
- Property { name: "canPaste"; type: "bool"; isReadonly: true }
- Property { name: "canUndo"; type: "bool"; isReadonly: true }
- Property { name: "canRedo"; type: "bool"; isReadonly: true }
- Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true }
- Property { name: "contentWidth"; type: "double"; isReadonly: true }
- Property { name: "contentHeight"; type: "double"; isReadonly: true }
- Property { name: "renderType"; type: "RenderType" }
- Property { name: "padding"; revision: 6; type: "double" }
- Property { name: "topPadding"; revision: 6; type: "double" }
- Property { name: "leftPadding"; revision: 6; type: "double" }
- Property { name: "rightPadding"; revision: 6; type: "double" }
- Property { name: "bottomPadding"; revision: 6; type: "double" }
- Signal { name: "accepted" }
- Signal { name: "editingFinished"; revision: 2 }
- Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "horizontalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextInput::HAlignment" }
- }
- Signal {
- name: "verticalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextInput::VAlignment" }
- }
- Signal {
- name: "readOnlyChanged"
- Parameter { name: "isReadOnly"; type: "bool" }
- }
- Signal {
- name: "cursorVisibleChanged"
- Parameter { name: "isCursorVisible"; type: "bool" }
- }
- Signal {
- name: "maximumLengthChanged"
- Parameter { name: "maximumLength"; type: "int" }
- }
- Signal {
- name: "inputMaskChanged"
- Parameter { name: "inputMask"; type: "string" }
- }
- Signal {
- name: "echoModeChanged"
- Parameter { name: "echoMode"; type: "QQuickTextInput::EchoMode" }
- }
- Signal {
- name: "passwordMaskDelayChanged"
- revision: 3
- Parameter { name: "delay"; type: "int" }
- }
- Signal { name: "preeditTextChanged"; revision: 7 }
- Signal {
- name: "activeFocusOnPressChanged"
- Parameter { name: "activeFocusOnPress"; type: "bool" }
- }
- Signal {
- name: "autoScrollChanged"
- Parameter { name: "autoScroll"; type: "bool" }
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
Signal {
- name: "selectByMouseChanged"
- Parameter { name: "selectByMouse"; type: "bool" }
+ name: "pressed"
+ revision: 1
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
Signal {
- name: "mouseSelectionModeChanged"
- Parameter { name: "mode"; type: "QQuickTextInput::SelectionMode" }
- }
- Signal { name: "contentSizeChanged" }
- Signal { name: "paddingChanged"; revision: 6 }
- Signal { name: "topPaddingChanged"; revision: 6 }
- Signal { name: "leftPaddingChanged"; revision: 6 }
- Signal { name: "rightPaddingChanged"; revision: 6 }
- Signal { name: "bottomPaddingChanged"; revision: 6 }
- Method { name: "selectAll" }
- Method { name: "selectWord" }
- Method {
- name: "select"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "deselect" }
- Method {
- name: "isRightToLeft"
- type: "bool"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "cut" }
- Method { name: "copy" }
- Method { name: "paste" }
- Method { name: "undo" }
- Method { name: "redo" }
- Method {
- name: "insert"
- Parameter { name: "position"; type: "int" }
- Parameter { name: "text"; type: "string" }
- }
- Method {
- name: "remove"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "ensureVisible"
- revision: 3
- Parameter { name: "position"; type: "int" }
- }
- Method { name: "clear"; revision: 7 }
- Method {
- name: "positionAt"
- Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true }
- }
- Method {
- name: "positionToRectangle"
- type: "QRectF"
- Parameter { name: "pos"; type: "int" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- Parameter { name: "mode"; type: "SelectionMode" }
- }
- Method {
- name: "inputMethodQuery"
- revision: 3
- type: "QVariant"
- Parameter { name: "query"; type: "Qt::InputMethodQuery" }
- Parameter { name: "argument"; type: "QVariant" }
- }
- Method {
- name: "getText"
- type: "string"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
+ name: "released"
+ revision: 1
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
}
Component {
name: "QQuickToolBar"
defaultProperty: "contentData"
- prototype: "QQuickFrame"
+ prototype: "QQuickPane"
exports: ["QtQuick.Templates/ToolBar 2.0"]
exportMetaObjectRevisions: [0]
Enum {
@@ -2020,6 +1524,16 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
+ name: "QQuickToolSeparator"
+ defaultProperty: "data"
+ prototype: "QQuickControl"
+ exports: ["QtQuick.Templates/ToolSeparator 2.1"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "orientation"; type: "Qt::Orientation" }
+ Property { name: "horizontal"; type: "bool"; isReadonly: true }
+ Property { name: "vertical"; type: "bool"; isReadonly: true }
+ }
+ Component {
name: "QQuickToolTip"
defaultProperty: "contentData"
prototype: "QQuickPopup"
@@ -2029,8 +1543,6 @@ Module {
Property { name: "delay"; type: "int" }
Property { name: "timeout"; type: "int" }
Property { name: "text"; type: "string" }
- Method { name: "open" }
- Method { name: "close" }
}
Component {
name: "QQuickToolTipAttached"
@@ -2055,8 +1567,11 @@ Module {
name: "QQuickTumbler"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/Tumbler 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/Tumbler 2.0",
+ "QtQuick.Templates/Tumbler 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickTumblerAttached"
Property { name: "model"; type: "QVariant" }
Property { name: "count"; type: "int"; isReadonly: true }
@@ -2064,6 +1579,8 @@ Module {
Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "visibleItemCount"; type: "int" }
+ Property { name: "wrap"; revision: 1; type: "bool" }
+ Signal { name: "wrapChanged"; revision: 1 }
}
Component {
name: "QQuickTumblerAttached"
@@ -2071,240 +1588,4 @@ Module {
Property { name: "tumbler"; type: "QQuickTumbler"; isReadonly: true; isPointer: true }
Property { name: "displacement"; type: "double"; isReadonly: true }
}
-
- Component {
- name: "QQuickWindowQmlImpl"
- defaultProperty: "data"
- prototype: "QQuickWindow"
- exports: ["QtQuick.Window/Window 2.1", "QtQuick.Window/Window 2.2"]
- exportMetaObjectRevisions: [0, 1]
- attachedType: "QQuickWindowAttached"
- Property { name: "visible"; type: "bool" }
- Property { name: "visibility"; type: "Visibility" }
- Signal {
- name: "visibleChanged"
- Parameter { name: "arg"; type: "bool" }
- }
- Signal {
- name: "visibilityChanged"
- Parameter { name: "visibility"; type: "QWindow::Visibility" }
- }
- }
-
- Component {
- name: "QQuickWindow"
- defaultProperty: "data"
- prototype: "QWindow"
- exports: ["QtQuick.Window/Window 2.0"]
- exportMetaObjectRevisions: [0]
- Enum {
- name: "SceneGraphError"
- values: {
- "ContextNotAvailable": 1
- }
- }
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "color"; type: "QColor" }
- Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
- Property {
- name: "activeFocusItem"
- revision: 1
- type: "QQuickItem"
- isReadonly: true
- isPointer: true
- }
- Signal { name: "frameSwapped" }
- Signal {
- name: "openglContextCreated"
- revision: 2
- Parameter { name: "context"; type: "QOpenGLContext"; isPointer: true }
- }
- Signal { name: "sceneGraphInitialized" }
- Signal { name: "sceneGraphInvalidated" }
- Signal { name: "beforeSynchronizing" }
- Signal { name: "afterSynchronizing"; revision: 2 }
- Signal { name: "beforeRendering" }
- Signal { name: "afterRendering" }
- Signal { name: "afterAnimating"; revision: 2 }
- Signal { name: "sceneGraphAboutToStop"; revision: 2 }
- Signal {
- name: "closing"
- revision: 1
- Parameter { name: "close"; type: "QQuickCloseEvent"; isPointer: true }
- }
- Signal {
- name: "colorChanged"
- Parameter { type: "QColor" }
- }
- Signal { name: "activeFocusItemChanged"; revision: 1 }
- Signal {
- name: "sceneGraphError"
- revision: 2
- Parameter { name: "error"; type: "QQuickWindow::SceneGraphError" }
- Parameter { name: "message"; type: "string" }
- }
- Method { name: "update" }
- Method { name: "releaseResources" }
- }
-
- Component {
- name: "QWindow"
- prototype: "QObject"
- Enum {
- name: "Visibility"
- values: {
- "Hidden": 0,
- "AutomaticVisibility": 1,
- "Windowed": 2,
- "Minimized": 3,
- "Maximized": 4,
- "FullScreen": 5
- }
- }
- Property { name: "title"; type: "string" }
- Property { name: "modality"; type: "Qt::WindowModality" }
- Property { name: "flags"; type: "Qt::WindowFlags" }
- Property { name: "x"; type: "int" }
- Property { name: "y"; type: "int" }
- Property { name: "width"; type: "int" }
- Property { name: "height"; type: "int" }
- Property { name: "minimumWidth"; type: "int" }
- Property { name: "minimumHeight"; type: "int" }
- Property { name: "maximumWidth"; type: "int" }
- Property { name: "maximumHeight"; type: "int" }
- Property { name: "visible"; type: "bool" }
- Property { name: "active"; revision: 1; type: "bool"; isReadonly: true }
- Property { name: "visibility"; revision: 1; type: "Visibility" }
- Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" }
- Property { name: "opacity"; revision: 1; type: "double" }
- Signal {
- name: "screenChanged"
- Parameter { name: "screen"; type: "QScreen"; isPointer: true }
- }
- Signal {
- name: "modalityChanged"
- Parameter { name: "modality"; type: "Qt::WindowModality" }
- }
- Signal {
- name: "windowStateChanged"
- Parameter { name: "windowState"; type: "Qt::WindowState" }
- }
- Signal {
- name: "windowTitleChanged"
- revision: 2
- Parameter { name: "title"; type: "string" }
- }
- Signal {
- name: "xChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "yChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "widthChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "heightChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "minimumWidthChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "minimumHeightChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "maximumWidthChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "maximumHeightChanged"
- Parameter { name: "arg"; type: "int" }
- }
- Signal {
- name: "visibleChanged"
- Parameter { name: "arg"; type: "bool" }
- }
- Signal {
- name: "visibilityChanged"
- revision: 1
- Parameter { name: "visibility"; type: "QWindow::Visibility" }
- }
- Signal { name: "activeChanged"; revision: 1 }
- Signal {
- name: "contentOrientationChanged"
- Parameter { name: "orientation"; type: "Qt::ScreenOrientation" }
- }
- Signal {
- name: "focusObjectChanged"
- Parameter { name: "object"; type: "QObject"; isPointer: true }
- }
- Signal {
- name: "opacityChanged"
- revision: 1
- Parameter { name: "opacity"; type: "double" }
- }
- Method { name: "requestActivate"; revision: 1 }
- Method {
- name: "setVisible"
- Parameter { name: "visible"; type: "bool" }
- }
- Method { name: "show" }
- Method { name: "hide" }
- Method { name: "showMinimized" }
- Method { name: "showMaximized" }
- Method { name: "showFullScreen" }
- Method { name: "showNormal" }
- Method { name: "close"; type: "bool" }
- Method { name: "raise" }
- Method { name: "lower" }
- Method {
- name: "setTitle"
- Parameter { type: "string" }
- }
- 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" }
- }
- Method {
- name: "setMinimumWidth"
- Parameter { name: "w"; type: "int" }
- }
- Method {
- name: "setMinimumHeight"
- Parameter { name: "h"; type: "int" }
- }
- Method {
- name: "setMaximumWidth"
- Parameter { name: "w"; type: "int" }
- }
- Method {
- name: "setMaximumHeight"
- Parameter { name: "h"; type: "int" }
- }
- Method {
- name: "alert"
- revision: 1
- Parameter { name: "msec"; type: "int" }
- }
- Method { name: "requestUpdate"; revision: 3 }
- }
-
}
diff --git a/src/imports/controls/qquickbusyindicatorring.cpp b/src/imports/controls/qquickbusyindicatorring.cpp
index 4f9e9977..d8c035d2 100644
--- a/src/imports/controls/qquickbusyindicatorring.cpp
+++ b/src/imports/controls/qquickbusyindicatorring.cpp
@@ -39,8 +39,9 @@
#include <QtCore/qset.h>
#include <QtGui/qpainter.h>
#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/qsgsimplerectnode.h>
+#include <QtQuick/qsgnode.h>
#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qsgrectanglenode.h>
QT_BEGIN_NAMESPACE
@@ -84,9 +85,11 @@ QSGNode *QQuickBusyIndicatorRing::updatePaintNode(QSGNode *oldNode, QQuickItem::
{
QQuickItemPrivate *d = QQuickItemPrivate::get(this);
- if (!oldNode)
- oldNode = new QSGSimpleRectNode(boundingRect(), Qt::transparent);
- static_cast<QSGSimpleRectNode *>(oldNode)->setRect(boundingRect());
+ if (!oldNode) {
+ oldNode = window()->createRectangleNode();
+ static_cast<QSGRectangleNode *>(oldNode)->setColor(Qt::transparent);
+ }
+ static_cast<QSGRectangleNode *>(oldNode)->setRect(boundingRect());
QSGTransformNode *rootTransformNode = static_cast<QSGTransformNode *>(oldNode->firstChild());
if (!rootTransformNode) {
@@ -112,7 +115,7 @@ QSGNode *QQuickBusyIndicatorRing::updatePaintNode(QSGNode *oldNode, QQuickItem::
QSGOpacityNode *opacityNode = new QSGOpacityNode;
transformNode->appendChildNode(opacityNode);
- QSGRectangleNode *rectNode = d->sceneGraphContext()->createRectangleNode();
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
rectNode->setAntialiasing(true);
rectNode->setColor(color);
rectNode->setPenColor(color);
@@ -122,7 +125,7 @@ QSGNode *QQuickBusyIndicatorRing::updatePaintNode(QSGNode *oldNode, QQuickItem::
QSGNode *opacityNode = transformNode->firstChild();
Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(opacityNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(opacityNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
QPointF pos = QPointF(sz / 2 - circleRadius, sz / 2 - circleRadius);
@@ -178,7 +181,7 @@ void QQuickBusyIndicatorAnimatorJob::updateCurrentTime(int time)
if (!m_node)
return;
- QSGSimpleRectNode *rootRectNode = static_cast<QSGSimpleRectNode*>(m_node->firstChild());
+ QSGRectangleNode *rootRectNode = static_cast<QSGRectangleNode *>(m_node->firstChild());
if (!rootRectNode)
return;
@@ -199,7 +202,7 @@ void QQuickBusyIndicatorAnimatorJob::updateCurrentTime(int time)
QSGOpacityNode *opacityNode = static_cast<QSGOpacityNode*>(transformNode->firstChild());
Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode*>(opacityNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode*>(opacityNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
const bool fill = (firstPhaseProgress > qreal(i) / circles) || (secondPhaseProgress > 0 && secondPhaseProgress < qreal(i) / circles);
diff --git a/src/imports/controls/qquickdefaultstyle.cpp b/src/imports/controls/qquickdefaultstyle.cpp
new file mode 100644
index 00000000..7dfedfb7
--- /dev/null
+++ b/src/imports/controls/qquickdefaultstyle.cpp
@@ -0,0 +1,241 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickdefaultstyle_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QQuickDefaultStyle::QQuickDefaultStyle(QObject *parent) :
+ QObject(parent)
+{
+}
+
+QColor QQuickDefaultStyle::backgroundColor() const
+{
+ return QColor::fromRgba(0xFFFFFFFF);
+}
+
+QColor QQuickDefaultStyle::overlayModalColor() const
+{
+ return QColor::fromRgba(0x7F28282A);
+}
+
+QColor QQuickDefaultStyle::overlayDimColor() const
+{
+ return QColor::fromRgba(0x1F28282A);
+}
+
+QColor QQuickDefaultStyle::textColor() const
+{
+ return QColor::fromRgba(0xFF353637);
+}
+
+QColor QQuickDefaultStyle::textDarkColor() const
+{
+ return QColor::fromRgba(0xFF26282A);
+}
+
+QColor QQuickDefaultStyle::textLightColor() const
+{
+ return QColor::fromRgba(0xFFFFFFFF);
+}
+
+QColor QQuickDefaultStyle::textLinkColor() const
+{
+ return QColor::fromRgba(0xFF45A7D7);
+}
+
+QColor QQuickDefaultStyle::textSelectionColor() const
+{
+ return QColor::fromRgba(0xFFFDDD5C);
+}
+
+QColor QQuickDefaultStyle::textDisabledColor() const
+{
+ return QColor::fromRgba(0xFFBDBEBF);
+}
+
+QColor QQuickDefaultStyle::textDisabledLightColor() const
+{
+ return QColor::fromRgba(0xFFC2C2C2);
+}
+
+QColor QQuickDefaultStyle::focusColor() const
+{
+ return QColor::fromRgba(0xFF0066FF);
+}
+
+QColor QQuickDefaultStyle::focusLightColor() const
+{
+ return QColor::fromRgba(0xFFF0F6FF);
+}
+
+QColor QQuickDefaultStyle::focusPressedColor() const
+{
+ return QColor::fromRgba(0xFFCCE0FF);
+}
+
+QColor QQuickDefaultStyle::buttonColor() const
+{
+ return QColor::fromRgba(0xFFE0E0E0);
+}
+
+QColor QQuickDefaultStyle::buttonPressedColor() const
+{
+ return QColor::fromRgba(0xFFD0D0D0);
+}
+
+QColor QQuickDefaultStyle::buttonCheckedColor() const
+{
+ return QColor::fromRgba(0xFF353637);
+}
+
+QColor QQuickDefaultStyle::buttonCheckedPressedColor() const
+{
+ return QColor::fromRgba(0xFF585A5C);
+}
+
+QColor QQuickDefaultStyle::buttonCheckedFocusColor() const
+{
+ return QColor::fromRgba(0xFF599BFF);
+}
+
+QColor QQuickDefaultStyle::toolButtonColor() const
+{
+ return QColor::fromRgba(0x33333333);
+}
+
+QColor QQuickDefaultStyle::tabButtonColor() const
+{
+ return QColor::fromRgba(0xFF353637);
+}
+
+QColor QQuickDefaultStyle::tabButtonPressedColor() const
+{
+ return QColor::fromRgba(0xFF585A5C);
+}
+
+QColor QQuickDefaultStyle::tabButtonCheckedPressedColor() const
+{
+ return QColor::fromRgba(0xFFE4E4E4);
+}
+
+QColor QQuickDefaultStyle::delegateColor() const
+{
+ return QColor::fromRgba(0xFFEEEEEE);
+}
+
+QColor QQuickDefaultStyle::delegatePressedColor() const
+{
+ return QColor::fromRgba(0xFFBDBEBF);
+}
+
+QColor QQuickDefaultStyle::delegateFocusColor() const
+{
+ return QColor::fromRgba(0xFFE5EFFF);
+}
+
+QColor QQuickDefaultStyle::indicatorPressedColor() const
+{
+ return QColor::fromRgba(0xFFF6F6F6);
+}
+
+QColor QQuickDefaultStyle::indicatorDisabledColor() const
+{
+ return QColor::fromRgba(0xFFFDFDFD);
+}
+
+QColor QQuickDefaultStyle::indicatorFrameColor() const
+{
+ return QColor::fromRgba(0xFF909090);
+}
+
+QColor QQuickDefaultStyle::indicatorFramePressedColor() const
+{
+ return QColor::fromRgba(0xFF808080);
+}
+
+QColor QQuickDefaultStyle::indicatorFrameDisabledColor() const
+{
+ return QColor::fromRgba(0xFFD6D6D6);
+}
+
+QColor QQuickDefaultStyle::frameDarkColor() const
+{
+ return QColor::fromRgba(0xFF353637);
+}
+
+QColor QQuickDefaultStyle::frameLightColor() const
+{
+ return QColor::fromRgba(0xFFBDBEBF);
+}
+
+QColor QQuickDefaultStyle::scrollBarColor() const
+{
+ return QColor::fromRgba(0xFFBDBEBF);
+}
+
+QColor QQuickDefaultStyle::scrollBarPressedColor() const
+{
+ return QColor::fromRgba(0xFF28282A);
+}
+
+QColor QQuickDefaultStyle::progressBarColor() const
+{
+ return QColor::fromRgba(0xFFE4E4E4);
+}
+
+QColor QQuickDefaultStyle::pageIndicatorColor() const
+{
+ return QColor::fromRgba(0xFF28282A);
+}
+
+QColor QQuickDefaultStyle::separatorColor() const
+{
+ return QColor::fromRgba(0xFFCCCCCC);
+}
+
+QColor QQuickDefaultStyle::disabledDarkColor() const
+{
+ return QColor::fromRgba(0xFF353637);
+}
+
+QColor QQuickDefaultStyle::disabledLightColor() const
+{
+ return QColor::fromRgba(0xFFBDBEBF);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/controls/qquickdefaultstyle_p.h b/src/imports/controls/qquickdefaultstyle_p.h
new file mode 100644
index 00000000..854dc6c8
--- /dev/null
+++ b/src/imports/controls/qquickdefaultstyle_p.h
@@ -0,0 +1,145 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKDEFAULTSTYLE_P_H
+#define QQUICKDEFAULTSTYLE_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 <QtCore/qobject.h>
+#include <QtGui/qcolor.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickDefaultStyle : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor backgroundColor READ backgroundColor CONSTANT FINAL)
+ Q_PROPERTY(QColor overlayModalColor READ overlayModalColor CONSTANT FINAL)
+ Q_PROPERTY(QColor overlayDimColor READ overlayDimColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textColor READ textColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textDarkColor READ textDarkColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textLightColor READ textLightColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textLinkColor READ textLinkColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textSelectionColor READ textSelectionColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textDisabledColor READ textDisabledColor CONSTANT FINAL)
+ Q_PROPERTY(QColor textDisabledLightColor READ textDisabledLightColor CONSTANT FINAL)
+ Q_PROPERTY(QColor focusColor READ focusColor CONSTANT FINAL)
+ Q_PROPERTY(QColor focusLightColor READ focusLightColor CONSTANT FINAL)
+ Q_PROPERTY(QColor focusPressedColor READ focusPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor buttonColor READ buttonColor CONSTANT FINAL)
+ Q_PROPERTY(QColor buttonPressedColor READ buttonPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor buttonCheckedColor READ buttonCheckedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor buttonCheckedPressedColor READ buttonCheckedPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor buttonCheckedFocusColor READ buttonCheckedFocusColor CONSTANT FINAL)
+ Q_PROPERTY(QColor toolButtonColor READ toolButtonColor CONSTANT FINAL)
+ Q_PROPERTY(QColor tabButtonColor READ tabButtonColor CONSTANT FINAL)
+ Q_PROPERTY(QColor tabButtonPressedColor READ tabButtonPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor tabButtonCheckedPressedColor READ tabButtonCheckedPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor delegateColor READ delegateColor CONSTANT FINAL)
+ Q_PROPERTY(QColor delegatePressedColor READ delegatePressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor delegateFocusColor READ delegateFocusColor CONSTANT FINAL)
+ Q_PROPERTY(QColor indicatorPressedColor READ indicatorPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor indicatorDisabledColor READ indicatorDisabledColor CONSTANT FINAL)
+ Q_PROPERTY(QColor indicatorFrameColor READ indicatorFrameColor CONSTANT FINAL)
+ Q_PROPERTY(QColor indicatorFramePressedColor READ indicatorFramePressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor indicatorFrameDisabledColor READ indicatorFrameDisabledColor CONSTANT FINAL)
+ Q_PROPERTY(QColor frameDarkColor READ frameDarkColor CONSTANT FINAL)
+ Q_PROPERTY(QColor frameLightColor READ frameLightColor CONSTANT FINAL)
+ Q_PROPERTY(QColor scrollBarColor READ scrollBarColor CONSTANT FINAL)
+ Q_PROPERTY(QColor scrollBarPressedColor READ scrollBarPressedColor CONSTANT FINAL)
+ Q_PROPERTY(QColor progressBarColor READ progressBarColor CONSTANT FINAL)
+ Q_PROPERTY(QColor pageIndicatorColor READ pageIndicatorColor CONSTANT FINAL)
+ Q_PROPERTY(QColor separatorColor READ separatorColor CONSTANT FINAL)
+ Q_PROPERTY(QColor disabledDarkColor READ disabledDarkColor CONSTANT FINAL)
+ Q_PROPERTY(QColor disabledLightColor READ disabledLightColor CONSTANT FINAL)
+
+public:
+ explicit QQuickDefaultStyle(QObject *parent = nullptr);
+
+ QColor backgroundColor() const;
+ QColor overlayModalColor() const;
+ QColor overlayDimColor() const;
+ QColor textColor() const;
+ QColor textDarkColor() const;
+ QColor textLightColor() const;
+ QColor textLinkColor() const;
+ QColor textSelectionColor() const;
+ QColor textDisabledColor() const;
+ QColor textDisabledLightColor() const;
+ QColor focusColor() const;
+ QColor focusLightColor() const;
+ QColor focusPressedColor() const;
+ QColor buttonColor() const;
+ QColor buttonPressedColor() const;
+ QColor buttonCheckedColor() const;
+ QColor buttonCheckedPressedColor() const;
+ QColor buttonCheckedFocusColor() const;
+ QColor toolButtonColor() const;
+ QColor tabButtonColor() const;
+ QColor tabButtonPressedColor() const;
+ QColor tabButtonCheckedPressedColor() const;
+ QColor delegateColor() const;
+ QColor delegatePressedColor() const;
+ QColor delegateFocusColor() const;
+ QColor indicatorPressedColor() const;
+ QColor indicatorDisabledColor() const;
+ QColor indicatorFrameColor() const;
+ QColor indicatorFramePressedColor() const;
+ QColor indicatorFrameDisabledColor() const;
+ QColor frameDarkColor() const;
+ QColor frameLightColor() const;
+ QColor scrollBarColor() const;
+ QColor scrollBarPressedColor() const;
+ QColor progressBarColor() const;
+ QColor pageIndicatorColor() const;
+ QColor separatorColor() const;
+ QColor disabledDarkColor() const;
+ QColor disabledLightColor() const;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKDEFAULTSTYLE_P_H
diff --git a/src/imports/controls/qquickprogressstrip.cpp b/src/imports/controls/qquickprogressstrip.cpp
index 5b50a28d..33a21848 100644
--- a/src/imports/controls/qquickprogressstrip.cpp
+++ b/src/imports/controls/qquickprogressstrip.cpp
@@ -37,7 +37,7 @@
#include "qquickprogressstrip_p.h"
#include <QtQuick/private/qquickitem_p.h>
-#include <QtQuick/qsgsimplerectnode.h>
+#include <QtQuick/qsgrectanglenode.h>
QT_BEGIN_NAMESPACE
@@ -129,9 +129,11 @@ QSGNode *QQuickProgressStrip::updatePaintNode(QSGNode *oldNode, QQuickItem::Upda
{
QQuickItemPrivate *d = QQuickItemPrivate::get(this);
- if (!oldNode)
- oldNode = new QSGSimpleRectNode(boundingRect(), Qt::transparent);
- static_cast<QSGSimpleRectNode *>(oldNode)->setRect(boundingRect());
+ if (!oldNode) {
+ oldNode = window()->createRectangleNode();
+ static_cast<QSGRectangleNode *>(oldNode)->setColor(Qt::transparent);
+ }
+ static_cast<QSGRectangleNode *>(oldNode)->setRect(boundingRect());
QSGTransformNode *rootTransformNode = static_cast<QSGTransformNode *>(oldNode->firstChild());
if (!rootTransformNode) {
@@ -155,9 +157,9 @@ QSGNode *QQuickProgressStrip::updatePaintNode(QSGNode *oldNode, QQuickItem::Upda
rootTransformNode->appendChildNode(transformNode);
}
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode*>(transformNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode*>(transformNode->firstChild());
if (!rectNode) {
- rectNode = d->sceneGraphContext()->createRectangleNode();
+ rectNode = d->sceneGraphContext()->createInternalRectangleNode();
rectNode->setColor(color);
transformNode->appendChildNode(rectNode);
}
@@ -177,9 +179,9 @@ QSGNode *QQuickProgressStrip::updatePaintNode(QSGNode *oldNode, QQuickItem::Upda
rootTransformNode->removeAllChildNodes();
}
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(rootTransformNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(rootTransformNode->firstChild());
if (!rectNode) {
- rectNode = d->sceneGraphContext()->createRectangleNode();
+ rectNode = d->sceneGraphContext()->createInternalRectangleNode();
rectNode->setColor(color);
rootTransformNode->appendChildNode(rectNode);
}
@@ -233,7 +235,7 @@ void QQuickProgressAnimatorJob::updateCurrentTime(int time)
if (!m_node)
return;
- QSGSimpleRectNode *rootRectNode = static_cast<QSGSimpleRectNode*>(m_node->firstChild());
+ QSGRectangleNode *rootRectNode = static_cast<QSGRectangleNode *>(m_node->firstChild());
if (!rootRectNode)
return;
Q_ASSERT(rootRectNode->type() == QSGNode::GeometryNodeType);
@@ -250,7 +252,7 @@ void QQuickProgressAnimatorJob::updateCurrentTime(int time)
const qreal pixelsPerSecond = rootRectNode->rect().width();
for (int i = 0; i < blocks; ++i) {
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode*>(transformNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode*>(transformNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
QMatrix4x4 m;
diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp
index 8e41a58c..5b8868fe 100644
--- a/src/imports/controls/qtquickcontrols2plugin.cpp
+++ b/src/imports/controls/qtquickcontrols2plugin.cpp
@@ -36,12 +36,15 @@
#include <QtCore/private/qfileselector_p.h>
#include <QtQuickControls2/qquickstyle.h>
+#include <QtQuickControls2/private/qquickstyle_p.h>
#include <QtQuickControls2/private/qquickstyleplugin_p.h>
#include <QtQuickControls2/private/qquickstyleselector_p.h>
#include <QtQuickControls2/private/qquickcolorimageprovider_p.h>
#include <QtQuickTemplates2/private/qquickbuttongroup_p.h>
+#include <QtQuickControls2/private/qquicktumblerview_p.h>
#include "qquickbusyindicatorring_p.h"
+#include "qquickdefaultstyle_p.h"
#include "qquickdialring_p.h"
#include "qquickprogressstrip_p.h"
@@ -73,20 +76,21 @@ QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQuickStylePlu
void QtQuickControls2Plugin::registerTypes(const char *uri)
{
- qmlRegisterType<QQuickButtonGroup>(uri, 2, 0, "ButtonGroup");
- qmlRegisterType<QQuickButtonGroupAttached>();
-
- QQuickStyleSelector selector;
- selector.setBaseUrl(typeUrl());
-
+ QQuickStylePrivate::init(typeUrl());
const QString style = QQuickStyle::name();
if (!style.isEmpty())
QFileSelectorPrivate::addStatics(QStringList() << style.toLower());
+ QQuickStyleSelector selector;
+ selector.setBaseUrl(typeUrl());
+
+ // QtQuick.Controls 2.0 (Qt 5.7)
qmlRegisterType(selector.select(QStringLiteral("AbstractButton.qml")), uri, 2, 0, "AbstractButton");
qmlRegisterType(selector.select(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow");
qmlRegisterType(selector.select(QStringLiteral("BusyIndicator.qml")), uri, 2, 0, "BusyIndicator");
qmlRegisterType(selector.select(QStringLiteral("Button.qml")), uri, 2, 0, "Button");
+ qmlRegisterType<QQuickButtonGroup>(uri, 2, 0, "ButtonGroup");
+ qmlRegisterType<QQuickButtonGroupAttached>();
qmlRegisterType(selector.select(QStringLiteral("CheckBox.qml")), uri, 2, 0, "CheckBox");
qmlRegisterType(selector.select(QStringLiteral("CheckDelegate.qml")), uri, 2, 0, "CheckDelegate");
qmlRegisterType(selector.select(QStringLiteral("ComboBox.qml")), uri, 2, 0, "ComboBox");
@@ -125,6 +129,21 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
qmlRegisterType(selector.select(QStringLiteral("ToolButton.qml")), uri, 2, 0, "ToolButton");
qmlRegisterType(selector.select(QStringLiteral("ToolTip.qml")), uri, 2, 0, "ToolTip");
qmlRegisterType(selector.select(QStringLiteral("Tumbler.qml")), uri, 2, 0, "Tumbler");
+
+ // QtQuick.Controls 2.1 (Qt 5.8)
+ qmlRegisterType<QQuickButtonGroup,1 >(uri, 2, 1, "ButtonGroup");
+ qmlRegisterType(selector.select(QStringLiteral("Dialog.qml")), uri, 2, 1, "Dialog");
+ qmlRegisterType(selector.select(QStringLiteral("DialogButtonBox.qml")), uri, 2, 1, "DialogButtonBox");
+ qmlRegisterType(selector.select(QStringLiteral("MenuSeparator.qml")), uri, 2, 1, "MenuSeparator");
+ qmlRegisterType(selector.select(QStringLiteral("RoundButton.qml")), uri, 2, 1, "RoundButton");
+ qmlRegisterType(selector.select(QStringLiteral("ToolSeparator.qml")), uri, 2, 1, "ToolSeparator");
+}
+
+static QObject *styleSingleton(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(scriptEngine);
+ return new QQuickDefaultStyle;
}
void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *uri)
@@ -139,6 +158,8 @@ void QtQuickControls2Plugin::initializeEngine(QQmlEngine *engine, const char *ur
qmlRegisterType<QQuickProgressStrip>(import, 2, 0, "ProgressStrip");
qmlRegisterType<QQuickProgressAnimator>(import, 2, 0, "ProgressStripAnimator");
qmlRegisterType<QQuickDialRing>(import, 2, 0, "DialRing");
+ qmlRegisterType<QQuickTumblerView>(import, 2, 1, "TumblerView");
+ qmlRegisterSingletonType<QQuickDefaultStyle>(import, 2, 1, "Default", styleSingleton);
qmlRegisterType(typeUrl(QStringLiteral("CheckIndicator.qml")), import, 2, 0, "CheckIndicator");
qmlRegisterType(typeUrl(QStringLiteral("RadioIndicator.qml")), import, 2, 0, "RadioIndicator");
diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml
index 70bd403c..ba07021a 100644
--- a/src/imports/controls/universal/ApplicationWindow.qml
+++ b/src/imports/controls/universal/ApplicationWindow.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
-import QtQuick.Controls.Universal.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+import QtQuick.Controls.Universal.impl 2.1
T.ApplicationWindow {
id: window
diff --git a/src/imports/controls/universal/BusyIndicator.qml b/src/imports/controls/universal/BusyIndicator.qml
index fe2186a7..514a233e 100644
--- a/src/imports/controls/universal/BusyIndicator.qml
+++ b/src/imports/controls/universal/BusyIndicator.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
-import QtQuick.Controls.Universal.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+import QtQuick.Controls.Universal.impl 2.1
T.BusyIndicator {
id: control
diff --git a/src/imports/controls/universal/Button.qml b/src/imports/controls/universal/Button.qml
index 6954d31a..30d30380 100644
--- a/src/imports/controls/universal/Button.qml
+++ b/src/imports/controls/universal/Button.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Button {
id: control
@@ -47,6 +47,8 @@ T.Button {
contentItem.implicitHeight + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 8
topPadding: padding - 4
bottomPadding: padding - 4
@@ -72,5 +74,14 @@ T.Button {
color: control.down ? control.Universal.baseMediumLowColor :
control.enabled && (control.highlighted || control.checked) ? control.Universal.accent :
control.Universal.baseLowColor
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ color: "transparent"
+ visible: control.hovered
+ border.width: 2 // ButtonBorderThemeThickness
+ border.color: control.Universal.baseMediumLowColor
+ }
}
}
diff --git a/src/imports/controls/universal/CheckBox.qml b/src/imports/controls/universal/CheckBox.qml
index a1c3ba6b..bfaf266e 100644
--- a/src/imports/controls/universal/CheckBox.qml
+++ b/src/imports/controls/universal/CheckBox.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
-import QtQuick.Controls.Universal.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+import QtQuick.Controls.Universal.impl 2.1
T.CheckBox {
id: control
@@ -49,6 +49,8 @@ T.CheckBox {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 6
spacing: 8
diff --git a/src/imports/controls/universal/CheckDelegate.qml b/src/imports/controls/universal/CheckDelegate.qml
index c0ca272e..e48687e5 100644
--- a/src/imports/controls/universal/CheckDelegate.qml
+++ b/src/imports/controls/universal/CheckDelegate.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.CheckDelegate {
id: control
@@ -48,6 +48,8 @@ T.CheckDelegate {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
spacing: 12
padding: 12
@@ -76,8 +78,9 @@ T.CheckDelegate {
}
background: Rectangle {
- visible: control.down || control.highlighted || control.visualFocus
- color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ visible: control.down || control.highlighted || control.visualFocus || control.hovered
+ color: control.down ? control.Universal.listMediumColor :
+ control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
Rectangle {
width: parent.width
height: parent.height
diff --git a/src/imports/controls/universal/CheckIndicator.qml b/src/imports/controls/universal/CheckIndicator.qml
index eeecf264..166cf184 100644
--- a/src/imports/controls/universal/CheckIndicator.qml
+++ b/src/imports/controls/universal/CheckIndicator.qml
@@ -34,16 +34,16 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
Rectangle {
implicitWidth: 20
implicitHeight: 20
color: !control.enabled ? "transparent" :
- control.down && control.checkState !== Qt.PartiallyChecked ? control.Universal.baseMediumColor :
+ control.down && !partiallyChecked ? control.Universal.baseMediumColor :
control.checkState === Qt.Checked ? control.Universal.accent : "transparent"
border.color: !control.enabled ? control.Universal.baseLowColor :
control.down ? control.Universal.baseMediumColor :
@@ -51,6 +51,7 @@ Rectangle {
border.width: 2 // CheckBoxBorderThemeThickness
property Item control
+ readonly property bool partiallyChecked: control.checkState === Qt.PartiallyChecked
Image {
x: (parent.width - width) / 2
@@ -65,11 +66,15 @@ Rectangle {
Rectangle {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
- width: parent.width / 2
- height: parent.height / 2
+ width: partiallyChecked ? parent.width / 2 : parent.width
+ height: partiallyChecked ? parent.height / 2 : parent.height
- visible: control.checkState === Qt.PartiallyChecked
- color: !control.enabled ? control.Universal.baseLowColor :
- control.down ? control.Universal.baseMediumColor : control.Universal.baseMediumHighColor
+ visible: !control.pressed && control.hovered || partiallyChecked
+ color: !partiallyChecked ? "transparent" :
+ !control.enabled ? control.Universal.baseLowColor :
+ control.down ? control.Universal.baseMediumColor :
+ control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor
+ border.width: partiallyChecked ? 0 : 2 // CheckBoxBorderThemeThickness
+ border.color: control.Universal.baseMediumLowColor
}
}
diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml
index bb816fc1..39cd7d20 100644
--- a/src/imports/controls/universal/ComboBox.qml
+++ b/src/imports/controls/universal/ComboBox.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.6
+import QtQuick 2.8
import QtQuick.Window 2.2
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick.Controls 2.1
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ComboBox {
id: control
@@ -50,6 +50,8 @@ T.ComboBox {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
spacing: 10
padding: 12
topPadding: padding - 7
@@ -60,6 +62,7 @@ T.ComboBox {
width: control.popup.width
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
highlighted: control.highlightedIndex === index
+ hoverEnabled: control.hoverEnabled
}
indicator: Image {
@@ -88,11 +91,14 @@ T.ComboBox {
implicitWidth: 120
implicitHeight: 32
- border.width: 2 // ComboBoxBorderThemeThickness
+ border.width: control.flat ? 0 : 2 // ComboBoxBorderThemeThickness
border.color: !control.enabled ? control.Universal.baseLowColor :
- control.pressed || popup.visible ? control.Universal.baseMediumLowColor : control.Universal.baseMediumLowColor
+ control.pressed || popup.visible ? control.Universal.baseMediumLowColor :
+ control.hovered ? control.Universal.baseMediumColor : control.Universal.baseMediumLowColor
color: !control.enabled ? control.Universal.baseLowColor :
- control.pressed || popup.visible ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ control.pressed || popup.visible ? control.Universal.listMediumColor :
+ control.flat && control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
+ visible: !control.flat || control.pressed || control.hovered || control.visualFocus
Rectangle {
x: 2
diff --git a/src/imports/controls/universal/Dial.qml b/src/imports/controls/universal/Dial.qml
index 6781d387..d50b066b 100644
--- a/src/imports/controls/universal/Dial.qml
+++ b/src/imports/controls/universal/Dial.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Dial {
id: control
@@ -44,6 +44,8 @@ T.Dial {
implicitWidth: 100
implicitHeight: 100
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
background: Rectangle {
x: control.width / 2 - width / 2
y: control.height / 2 - height / 2
@@ -64,7 +66,8 @@ T.Dial {
radius: width / 2
color: !control.enabled ? control.Universal.baseLowColor :
- control.pressed ? control.Universal.baseMediumColor : control.Universal.baseMediumHighColor
+ control.pressed ? control.Universal.baseMediumColor :
+ control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor
transform: [
Translate {
diff --git a/src/imports/controls/universal/Dialog.qml b/src/imports/controls/universal/Dialog.qml
new file mode 100644
index 00000000..e282d055
--- /dev/null
+++ b/src/imports/controls/universal/Dialog.qml
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls 2.1
+import QtQuick.Controls.Universal 2.1
+
+T.Dialog {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ header ? header.implicitWidth : 0,
+ footer ? footer.implicitWidth : 0,
+ contentWidth > 0 ? contentWidth + leftPadding + rightPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ (header ? header.implicitHeight : 0) + (footer ? footer.implicitHeight : 0))
+ + (contentHeight > 0 ? contentHeight + topPadding + bottomPadding : 0)
+
+ contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
+ contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
+
+ padding: 24
+ topPadding: 18
+ bottomPadding: 0
+
+ background: Rectangle {
+ color: control.Universal.chromeMediumLowColor
+ border.color: control.Universal.chromeHighColor
+ border.width: 1 // FlyoutBorderThemeThickness
+ }
+
+ buttonBox: DialogButtonBox {
+ position: DialogButtonBox.Footer
+ }
+}
diff --git a/src/imports/controls/universal/DialogButtonBox.qml b/src/imports/controls/universal/DialogButtonBox.qml
new file mode 100644
index 00000000..4c2481c9
--- /dev/null
+++ b/src/imports/controls/universal/DialogButtonBox.qml
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+
+T.DialogButtonBox {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+
+ spacing: 4
+ padding: 24
+ alignment: count === 1 ? Qt.AlignRight : undefined
+
+ delegate: Button {
+ width: control.count === 1 ? control.availableWidth / 2 : undefined
+ }
+
+ contentItem: ListView {
+ implicitWidth: contentWidth
+ implicitHeight: 32
+
+ model: control.contentModel
+ spacing: control.spacing
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ snapMode: ListView.SnapToItem
+ }
+
+ background: Rectangle {
+ implicitHeight: 32
+ color: control.Universal.chromeMediumLowColor
+ x: 1; y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ }
+}
diff --git a/src/imports/controls/universal/Drawer.qml b/src/imports/controls/universal/Drawer.qml
index 84831323..09b3751d 100644
--- a/src/imports/controls/universal/Drawer.qml
+++ b/src/imports/controls/universal/Drawer.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Drawer {
id: control
@@ -57,8 +57,6 @@ T.Drawer {
enter: Transition { SmoothedAnimation { velocity: 5 } }
exit: Transition { SmoothedAnimation { velocity: 5 } }
- contentItem: Item { }
-
background: Rectangle {
color: control.Universal.chromeMediumLowColor
Rectangle {
diff --git a/src/imports/controls/universal/Frame.qml b/src/imports/controls/universal/Frame.qml
index d5b327c1..1c83f3fd 100644
--- a/src/imports/controls/universal/Frame.qml
+++ b/src/imports/controls/universal/Frame.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Frame {
id: control
@@ -49,8 +49,6 @@ T.Frame {
padding: 12
- contentItem: Item { }
-
background: Rectangle {
color: "transparent"
border.color: control.Universal.chromeDisabledLowColor
diff --git a/src/imports/controls/universal/GroupBox.qml b/src/imports/controls/universal/GroupBox.qml
index c75c81a6..435a9755 100644
--- a/src/imports/controls/universal/GroupBox.qml
+++ b/src/imports/controls/universal/GroupBox.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.GroupBox {
id: control
@@ -53,8 +53,6 @@ T.GroupBox {
padding: 12
topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
- contentItem: Item { }
-
label: Text {
x: control.leftPadding
width: control.availableWidth
diff --git a/src/imports/controls/universal/ItemDelegate.qml b/src/imports/controls/universal/ItemDelegate.qml
index 6822d658..afba2b10 100644
--- a/src/imports/controls/universal/ItemDelegate.qml
+++ b/src/imports/controls/universal/ItemDelegate.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ItemDelegate {
id: control
@@ -48,6 +48,8 @@ T.ItemDelegate {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
spacing: 12
padding: 12
@@ -70,8 +72,9 @@ T.ItemDelegate {
}
background: Rectangle {
- visible: control.down || control.highlighted || control.visualFocus
- color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ visible: control.down || control.highlighted || control.visualFocus || control.hovered
+ color: control.down ? control.Universal.listMediumColor :
+ control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
Rectangle {
width: parent.width
height: parent.height
diff --git a/src/imports/controls/universal/Label.qml b/src/imports/controls/universal/Label.qml
index 9b50f4f5..9e377f61 100644
--- a/src/imports/controls/universal/Label.qml
+++ b/src/imports/controls/universal/Label.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Label {
id: control
diff --git a/src/imports/controls/universal/Menu.qml b/src/imports/controls/universal/Menu.qml
index 5ee2c243..afae51f0 100644
--- a/src/imports/controls/universal/Menu.qml
+++ b/src/imports/controls/universal/Menu.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls 2.0
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Controls 2.1
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Menu {
id: control
diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml
index d8fdbcd0..24f34440 100644
--- a/src/imports/controls/universal/MenuItem.qml
+++ b/src/imports/controls/universal/MenuItem.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.MenuItem {
id: control
@@ -48,6 +48,8 @@ T.MenuItem {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 12
topPadding: padding - 1
bottomPadding: padding + 1
@@ -81,7 +83,8 @@ T.MenuItem {
implicitHeight: 40
color: !control.enabled ? control.Universal.baseLowColor :
- control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ control.down ? control.Universal.listMediumColor :
+ control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
Rectangle {
x: 1; y: 1
diff --git a/src/imports/controls/universal/MenuSeparator.qml b/src/imports/controls/universal/MenuSeparator.qml
new file mode 100644
index 00000000..cd79c60f
--- /dev/null
+++ b/src/imports/controls/universal/MenuSeparator.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+
+T.MenuSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ padding: 12
+ topPadding: 9
+ bottomPadding: 10
+
+ contentItem: Rectangle {
+ implicitWidth: 188
+ implicitHeight: 1
+ color: control.Universal.baseMediumLowColor
+ }
+
+ background: Rectangle {
+ color: control.Universal.altMediumLowColor
+ }
+}
diff --git a/src/imports/controls/universal/Page.qml b/src/imports/controls/universal/Page.qml
index 3150715f..7b7efa44 100644
--- a/src/imports/controls/universal/Page.qml
+++ b/src/imports/controls/universal/Page.qml
@@ -34,15 +34,13 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Page {
id: control
- contentItem: Item { }
-
background: Rectangle {
color: control.Universal.background
}
diff --git a/src/imports/controls/universal/PageIndicator.qml b/src/imports/controls/universal/PageIndicator.qml
index 0c4e3b80..817c89fb 100644
--- a/src/imports/controls/universal/PageIndicator.qml
+++ b/src/imports/controls/universal/PageIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.PageIndicator {
id: control
diff --git a/src/imports/controls/universal/Pane.qml b/src/imports/controls/universal/Pane.qml
index cd62b65c..903e501a 100644
--- a/src/imports/controls/universal/Pane.qml
+++ b/src/imports/controls/universal/Pane.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Pane {
id: control
@@ -49,8 +49,6 @@ T.Pane {
padding: 12
- contentItem: Item { }
-
background: Rectangle {
color: control.Universal.background
}
diff --git a/src/imports/controls/universal/Popup.qml b/src/imports/controls/universal/Popup.qml
index 892db087..53178b71 100644
--- a/src/imports/controls/universal/Popup.qml
+++ b/src/imports/controls/universal/Popup.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Popup {
id: control
@@ -51,8 +51,6 @@ T.Popup {
padding: 12
- contentItem: Item { }
-
background: Rectangle {
color: control.Universal.chromeMediumLowColor
border.color: control.Universal.chromeHighColor
diff --git a/src/imports/controls/universal/ProgressBar.qml b/src/imports/controls/universal/ProgressBar.qml
index 66d1aeb8..cd314c27 100644
--- a/src/imports/controls/universal/ProgressBar.qml
+++ b/src/imports/controls/universal/ProgressBar.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
-import QtQuick.Controls.Universal.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+import QtQuick.Controls.Universal.impl 2.1
T.ProgressBar {
id: control
diff --git a/src/imports/controls/universal/RadioButton.qml b/src/imports/controls/universal/RadioButton.qml
index b8986488..99a5c6d6 100644
--- a/src/imports/controls/universal/RadioButton.qml
+++ b/src/imports/controls/universal/RadioButton.qml
@@ -34,10 +34,10 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
-import QtQuick.Controls.Universal.impl 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+import QtQuick.Controls.Universal.impl 2.1
T.RadioButton {
id: control
@@ -49,6 +49,8 @@ T.RadioButton {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 6
spacing: 8
diff --git a/src/imports/controls/universal/RadioDelegate.qml b/src/imports/controls/universal/RadioDelegate.qml
index 09f86f15..0794a082 100644
--- a/src/imports/controls/universal/RadioDelegate.qml
+++ b/src/imports/controls/universal/RadioDelegate.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.RadioDelegate {
id: control
@@ -48,6 +48,8 @@ T.RadioDelegate {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
spacing: 12
padding: 12
@@ -78,8 +80,9 @@ T.RadioDelegate {
}
background: Rectangle {
- visible: control.down || control.highlighted || control.visualFocus
- color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ visible: control.down || control.highlighted || control.visualFocus || control.hovered
+ color: control.down ? control.Universal.listMediumColor :
+ control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
Rectangle {
width: parent.width
height: parent.height
diff --git a/src/imports/controls/universal/RadioIndicator.qml b/src/imports/controls/universal/RadioIndicator.qml
index 65790e6a..c745b04e 100644
--- a/src/imports/controls/universal/RadioIndicator.qml
+++ b/src/imports/controls/universal/RadioIndicator.qml
@@ -34,8 +34,8 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Controls.Universal 2.1
Rectangle {
implicitWidth: 20
@@ -45,7 +45,8 @@ Rectangle {
border.width: 2 // RadioButtonBorderThemeThickness
border.color: control.checked ? "transparent" :
!control.enabled ? control.Universal.baseLowColor :
- control.down ? control.Universal.baseMediumColor : control.Universal.baseMediumHighColor
+ control.down ? control.Universal.baseMediumColor :
+ control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor
property var control
@@ -72,6 +73,7 @@ Rectangle {
radius: width / 2
opacity: control.checked ? 1 : 0
color: !control.enabled ? control.Universal.baseLowColor :
- control.down ? control.Universal.baseMediumColor : control.Universal.baseMediumHighColor
+ control.down ? control.Universal.baseMediumColor :
+ control.hovered ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor
}
}
diff --git a/src/imports/controls/universal/RangeSlider.qml b/src/imports/controls/universal/RangeSlider.qml
index ec2ff7c8..0b78962e 100644
--- a/src/imports/controls/universal/RangeSlider.qml
+++ b/src/imports/controls/universal/RangeSlider.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.RangeSlider {
id: control
@@ -48,6 +48,8 @@ T.RangeSlider {
Math.max(first.handle ? first.handle.implicitHeight : 0,
second.handle ? second.handle.implicitHeight : 0) + topPadding + bottomPadding)
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 6
first.handle: Rectangle {
@@ -60,7 +62,9 @@ T.RangeSlider {
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height))
radius: 4
- color: control.first.pressed ? control.Universal.chromeHighColor : control.enabled ? control.Universal.accent : control.Universal.chromeDisabledHighColor
+ color: control.first.pressed ? control.Universal.chromeHighColor :
+ control.first.hovered ? control.Universal.chromeAltLowColor :
+ control.enabled ? control.Universal.accent : control.Universal.chromeDisabledHighColor
}
second.handle: Rectangle {
@@ -73,7 +77,9 @@ T.RangeSlider {
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height))
radius: 4
- color: control.second.pressed ? control.Universal.chromeHighColor : control.enabled ? control.Universal.accent : control.Universal.chromeDisabledHighColor
+ color: control.second.pressed ? control.Universal.chromeHighColor :
+ control.second.hovered ? control.Universal.chromeAltLowColor :
+ control.enabled ? control.Universal.accent : control.Universal.chromeDisabledHighColor
}
background: Item {
@@ -95,7 +101,8 @@ T.RangeSlider {
width: parent.horizontal ? parent.width : 2 // SliderBackgroundThemeHeight
height: !parent.horizontal ? parent.height : 2 // SliderBackgroundThemeHeight
- color: control.enabled ? control.Universal.baseMediumLowColor : control.Universal.chromeDisabledHighColor
+ color: control.hovered && !control.pressed ? control.Universal.baseMediumColor :
+ control.enabled ? control.Universal.baseMediumLowColor : control.Universal.chromeDisabledHighColor
}
Rectangle {
diff --git a/src/imports/controls/universal/RoundButton.qml b/src/imports/controls/universal/RoundButton.qml
new file mode 100644
index 00000000..6062b985
--- /dev/null
+++ b/src/imports/controls/universal/RoundButton.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+
+T.RoundButton {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0,
+ contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem.implicitHeight + topPadding + bottomPadding)
+ baselineOffset: contentItem.y + contentItem.baselineOffset
+
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
+ padding: 8
+
+ property bool useSystemFocusVisuals: true
+
+ contentItem: Text {
+ text: control.text
+ font: control.font
+ elide: Text.ElideRight
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+
+ opacity: enabled ? 1.0 : 0.2
+ color: control.Universal.foreground
+ }
+
+ background: Rectangle {
+ implicitWidth: 32
+ implicitHeight: 32
+
+ radius: control.radius
+ visible: !control.flat || control.down || control.checked || control.highlighted
+ color: control.down ? control.Universal.baseMediumLowColor :
+ control.enabled && (control.highlighted || control.checked) ? control.Universal.accent :
+ control.Universal.baseLowColor
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ radius: control.radius
+ color: "transparent"
+ visible: control.hovered
+ border.width: 2 // ButtonBorderThemeThickness
+ border.color: control.Universal.baseMediumLowColor
+ }
+ }
+}
diff --git a/src/imports/controls/universal/ScrollBar.qml b/src/imports/controls/universal/ScrollBar.qml
index 1ac627a7..7c1242fb 100644
--- a/src/imports/controls/universal/ScrollBar.qml
+++ b/src/imports/controls/universal/ScrollBar.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ScrollBar {
id: control
@@ -46,13 +46,16 @@ T.ScrollBar {
implicitHeight: Math.max(background ? background.implicitHeight : 0,
contentItem.implicitHeight + topPadding + bottomPadding)
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
// TODO: arrows
contentItem: Rectangle {
implicitWidth: 12
implicitHeight: 12
- color: control.pressed ? control.Universal.baseMediumColor : control.Universal.chromeHighColor
+ color: control.pressed ? control.Universal.baseMediumColor :
+ control.hovered ? control.Universal.baseMediumLowColor : control.Universal.chromeHighColor
visible: control.size < 1.0
opacity: 0.0
}
diff --git a/src/imports/controls/universal/ScrollIndicator.qml b/src/imports/controls/universal/ScrollIndicator.qml
index ce289ce3..f03bc819 100644
--- a/src/imports/controls/universal/ScrollIndicator.qml
+++ b/src/imports/controls/universal/ScrollIndicator.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ScrollIndicator {
id: control
diff --git a/src/imports/controls/universal/Slider.qml b/src/imports/controls/universal/Slider.qml
index baf91211..b059a9c5 100644
--- a/src/imports/controls/universal/Slider.qml
+++ b/src/imports/controls/universal/Slider.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Slider {
id: control
@@ -46,6 +46,8 @@ T.Slider {
implicitHeight: Math.max(background ? background.implicitHeight : 0,
(handle ? handle.implicitHeight : 0) + topPadding + bottomPadding)
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 6
property bool useSystemFocusVisuals: true
@@ -60,7 +62,9 @@ T.Slider {
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
radius: 4
- color: control.pressed ? control.Universal.chromeHighColor : control.enabled ? control.Universal.accent : control.Universal.chromeDisabledHighColor
+ color: control.pressed ? control.Universal.chromeHighColor :
+ control.hovered ? control.Universal.chromeAltLowColor :
+ control.enabled ? control.Universal.accent : control.Universal.chromeDisabledHighColor
}
background: Item {
@@ -82,7 +86,8 @@ T.Slider {
width: parent.horizontal ? parent.width : 2 // SliderTrackThemeHeight
height: !parent.horizontal ? parent.height : 2 // SliderTrackThemeHeight
- color: control.enabled ? control.Universal.baseMediumLowColor : control.Universal.chromeDisabledHighColor
+ color: control.hovered && !control.pressed ? control.Universal.baseMediumColor :
+ control.enabled ? control.Universal.baseMediumLowColor : control.Universal.chromeDisabledHighColor
}
Rectangle {
diff --git a/src/imports/controls/universal/SpinBox.qml b/src/imports/controls/universal/SpinBox.qml
index d3647114..b527fc8f 100644
--- a/src/imports/controls/universal/SpinBox.qml
+++ b/src/imports/controls/universal/SpinBox.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.SpinBox {
id: control
@@ -51,6 +51,8 @@ T.SpinBox {
down.indicator ? down.indicator.implicitHeight : 0)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
// TextControlThemePadding + 2 (border)
padding: 12
topPadding: padding - 7
@@ -92,9 +94,11 @@ T.SpinBox {
x: 2; y: 4
width: parent.width - 4
height: parent.height - 8
- color: !control.up.pressed ? "transparent" :
- control.activeFocus ? control.Universal.accent
- : control.Universal.chromeDisabledLowColor
+ color: control.activeFocus ? control.Universal.accent :
+ control.up.pressed ? control.Universal.baseMediumLowColor :
+ control.up.hovered ? control.Universal.baseLowColor : "transparent"
+ visible: control.up.pressed || control.up.hovered
+ opacity: control.activeFocus && !control.up.pressed ? 0.4 : 1.0
}
Image {
@@ -118,9 +122,11 @@ T.SpinBox {
x: 2; y: 4
width: parent.width - 4
height: parent.height - 8
- color: !control.down.pressed ? "transparent" :
- control.activeFocus ? control.Universal.accent
- : control.Universal.chromeDisabledLowColor
+ color: control.activeFocus ? control.Universal.accent :
+ control.down.pressed ? control.Universal.baseMediumLowColor :
+ control.down.hovered ? control.Universal.baseLowColor : "transparent"
+ visible: control.down.pressed || control.down.hovered
+ opacity: control.activeFocus && !control.down.pressed ? 0.4 : 1.0
}
Image {
@@ -140,7 +146,8 @@ T.SpinBox {
border.width: 2 // TextControlBorderThemeThickness
border.color: !control.enabled ? control.Universal.baseLowColor :
- control.activeFocus ? control.Universal.accent : control.Universal.chromeDisabledLowColor
+ control.activeFocus ? control.Universal.accent :
+ control.hovered ? control.Universal.baseMediumColor : control.Universal.chromeDisabledLowColor
color: control.enabled ? control.Universal.background : control.Universal.baseLowColor
}
}
diff --git a/src/imports/controls/universal/StackView.qml b/src/imports/controls/universal/StackView.qml
index 4f37bb76..6e6d1b50 100644
--- a/src/imports/controls/universal/StackView.qml
+++ b/src/imports/controls/universal/StackView.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.StackView {
id: control
diff --git a/src/imports/controls/universal/SwipeDelegate.qml b/src/imports/controls/universal/SwipeDelegate.qml
index 82c1e744..71720ef2 100644
--- a/src/imports/controls/universal/SwipeDelegate.qml
+++ b/src/imports/controls/universal/SwipeDelegate.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.SwipeDelegate {
id: control
@@ -48,6 +48,8 @@ T.SwipeDelegate {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
spacing: 12
padding: 12
@@ -84,7 +86,8 @@ T.SwipeDelegate {
Rectangle {
width: parent.width
height: parent.height
- color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ color: control.down ? control.Universal.listMediumColor :
+ control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
Rectangle {
width: parent.width
height: parent.height
diff --git a/src/imports/controls/universal/Switch.qml b/src/imports/controls/universal/Switch.qml
index b42361dc..23703dee 100644
--- a/src/imports/controls/universal/Switch.qml
+++ b/src/imports/controls/universal/Switch.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.Switch {
id: control
@@ -48,6 +48,8 @@ T.Switch {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 5
spacing: 8
diff --git a/src/imports/controls/universal/SwitchDelegate.qml b/src/imports/controls/universal/SwitchDelegate.qml
index 558f5cfb..b45a3795 100644
--- a/src/imports/controls/universal/SwitchDelegate.qml
+++ b/src/imports/controls/universal/SwitchDelegate.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.SwitchDelegate {
id: control
@@ -48,6 +48,8 @@ T.SwitchDelegate {
indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
spacing: 12
padding: 12
@@ -76,8 +78,9 @@ T.SwitchDelegate {
}
background: Rectangle {
- visible: control.down || control.highlighted || control.visualFocus
- color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor
+ visible: control.down || control.highlighted || control.visualFocus || control.hovered
+ color: control.down ? control.Universal.listMediumColor :
+ control.hovered ? control.Universal.listLowColor : control.Universal.altMediumLowColor
Rectangle {
width: parent.width
height: parent.height
diff --git a/src/imports/controls/universal/SwitchIndicator.qml b/src/imports/controls/universal/SwitchIndicator.qml
index b3d44d9e..0f68d26a 100644
--- a/src/imports/controls/universal/SwitchIndicator.qml
+++ b/src/imports/controls/universal/SwitchIndicator.qml
@@ -34,21 +34,28 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
-Rectangle {
+Item {
implicitWidth: 44
implicitHeight: 20
- radius: 10
- color: !control.enabled ? "transparent" :
- control.pressed ? control.Universal.baseMediumColor :
- control.checked ? control.Universal.accent : "transparent"
- border.color: !control.enabled ? control.Universal.baseLowColor :
- control.checked && !control.pressed ? control.Universal.accent : control.Universal.baseMediumColor
- border.width: 2
+ Rectangle {
+ width: parent.width
+ height: parent.height
+
+ radius: 10
+ color: !control.enabled ? "transparent" :
+ control.pressed ? control.Universal.baseMediumColor :
+ control.checked ? control.Universal.accent : "transparent"
+ border.color: !control.enabled ? control.Universal.baseLowColor :
+ control.checked && !control.pressed ? control.Universal.accent :
+ control.hovered && !control.checked && !control.pressed ? control.Universal.baseHighColor : control.Universal.baseMediumColor
+ opacity: control.hovered && control.checked && !control.pressed ? (control.Universal.theme === Universal.Light ? 0.7 : 0.9) : 1.0
+ border.width: 2
+ }
property Item control
@@ -58,7 +65,8 @@ Rectangle {
radius: 5
color: !control.enabled ? control.Universal.baseLowColor :
- control.pressed || control.checked ? control.Universal.chromeWhiteColor : control.Universal.baseMediumHighColor
+ control.pressed || control.checked ? control.Universal.chromeWhiteColor :
+ control.hovered && !control.checked ? control.Universal.baseHighColor : control.Universal.baseMediumHighColor
x: Math.max(5, Math.min(parent.width - width - 5,
control.visualPosition * parent.width - (width / 2)))
diff --git a/src/imports/controls/universal/TabBar.qml b/src/imports/controls/universal/TabBar.qml
index 7c2e83a6..a8d80fec 100644
--- a/src/imports/controls/universal/TabBar.qml
+++ b/src/imports/controls/universal/TabBar.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.7
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.TabBar {
id: control
diff --git a/src/imports/controls/universal/TabButton.qml b/src/imports/controls/universal/TabButton.qml
index d503c86a..2b54b30f 100644
--- a/src/imports/controls/universal/TabButton.qml
+++ b/src/imports/controls/universal/TabButton.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.TabButton {
id: control
@@ -47,6 +47,8 @@ T.TabButton {
contentItem.implicitHeight + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 12 // PivotItemMargin
contentItem: Text {
@@ -56,7 +58,7 @@ T.TabButton {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
- opacity: control.checked || control.down ? 1.0 : 0.2
- color: control.Universal.foreground
+ opacity: control.checked || control.down || control.hovered ? 1.0 : 0.2
+ color: control.hovered ? control.Universal.baseMediumHighColor : control.Universal.foreground
}
}
diff --git a/src/imports/controls/universal/TextArea.qml b/src/imports/controls/universal/TextArea.qml
index 43fd40f4..57ccaac2 100644
--- a/src/imports/controls/universal/TextArea.qml
+++ b/src/imports/controls/universal/TextArea.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.TextArea {
id: control
@@ -48,6 +48,8 @@ T.TextArea {
background ? background.implicitHeight : 0,
placeholder.implicitHeight + topPadding + bottomPadding)
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
// TextControlThemePadding + 2 (border)
padding: 12
topPadding: padding - 7
@@ -83,7 +85,8 @@ T.TextArea {
border.width: 2 // TextControlBorderThemeThickness
border.color: !control.enabled ? control.Universal.baseLowColor :
- control.activeFocus ? control.Universal.accent : control.Universal.chromeDisabledLowColor
+ control.activeFocus ? control.Universal.accent :
+ control.hovered ? control.Universal.baseMediumColor : control.Universal.chromeDisabledLowColor
color: control.enabled ? control.Universal.background : control.Universal.baseLowColor
}
}
diff --git a/src/imports/controls/universal/TextField.qml b/src/imports/controls/universal/TextField.qml
index bd496ecc..6395e995 100644
--- a/src/imports/controls/universal/TextField.qml
+++ b/src/imports/controls/universal/TextField.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.TextField {
id: control
@@ -48,6 +48,8 @@ T.TextField {
background ? background.implicitHeight : 0,
placeholder.implicitHeight + topPadding + bottomPadding)
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
// TextControlThemePadding + 2 (border)
padding: 12
topPadding: padding - 7
@@ -84,7 +86,8 @@ T.TextField {
border.width: 2 // TextControlBorderThemeThickness
border.color: !control.enabled ? control.Universal.baseLowColor :
- control.activeFocus ? control.Universal.accent : control.Universal.chromeDisabledLowColor
+ control.activeFocus ? control.Universal.accent :
+ control.hovered ? control.Universal.baseMediumColor : control.Universal.chromeDisabledLowColor
color: control.enabled ? control.Universal.background : control.Universal.baseLowColor
}
}
diff --git a/src/imports/controls/universal/ToolBar.qml b/src/imports/controls/universal/ToolBar.qml
index 48e200c0..35f79806 100644
--- a/src/imports/controls/universal/ToolBar.qml
+++ b/src/imports/controls/universal/ToolBar.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ToolBar {
id: control
@@ -47,8 +47,6 @@ T.ToolBar {
contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
- contentItem: Item { }
-
background: Rectangle {
implicitHeight: 48 // AppBarThemeCompactHeight
color: control.Universal.chromeMediumColor
diff --git a/src/imports/controls/universal/ToolButton.qml b/src/imports/controls/universal/ToolButton.qml
index cb87130d..ee00ca54 100644
--- a/src/imports/controls/universal/ToolButton.qml
+++ b/src/imports/controls/universal/ToolButton.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ToolButton {
id: control
@@ -47,6 +47,8 @@ T.ToolButton {
contentItem.implicitHeight + topPadding + bottomPadding)
baselineOffset: contentItem.y + contentItem.baselineOffset
+ hoverEnabled: Qt.styleHints.useHoverEffects
+
padding: 6
property bool useSystemFocusVisuals: true
@@ -66,7 +68,13 @@ T.ToolButton {
implicitWidth: 68
implicitHeight: 48 // AppBarThemeCompactHeight
- color: control.down ? control.Universal.listMediumColor :
- control.enabled && (control.highlighted || control.checked) ? control.Universal.accent : "transparent"
+ color: control.enabled && (control.highlighted || control.checked) ? control.Universal.accent : "transparent"
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ visible: control.down || control.hovered
+ color: control.down ? control.Universal.listMediumColor : control.Universal.listLowColor
+ }
}
}
diff --git a/src/imports/controls/universal/ToolSeparator.qml b/src/imports/controls/universal/ToolSeparator.qml
new file mode 100644
index 00000000..a4a5f18c
--- /dev/null
+++ b/src/imports/controls/universal/ToolSeparator.qml
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+
+T.ToolSeparator {
+ id: control
+
+ implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding)
+
+ leftPadding: vertical ? 16 : 12
+ rightPadding: vertical ? 15 : 12
+ topPadding: vertical ? 12 : 16
+ bottomPadding: vertical ? 12 : 15
+
+ //! [contentItem]
+ contentItem: Rectangle {
+ implicitWidth: vertical ? 1 : 20
+ implicitHeight: vertical ? 20 : 1
+ color: control.Universal.baseMediumLowColor
+ }
+ //! [contentItem]
+}
diff --git a/src/imports/controls/universal/ToolTip.qml b/src/imports/controls/universal/ToolTip.qml
index 423e729d..bd3d54e7 100644
--- a/src/imports/controls/universal/ToolTip.qml
+++ b/src/imports/controls/universal/ToolTip.qml
@@ -34,9 +34,9 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
T.ToolTip {
id: control
diff --git a/src/imports/controls/universal/Tumbler.qml b/src/imports/controls/universal/Tumbler.qml
index 7b134b84..e7093d0a 100644
--- a/src/imports/controls/universal/Tumbler.qml
+++ b/src/imports/controls/universal/Tumbler.qml
@@ -34,10 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Templates 2.0 as T
-import QtQuick.Controls.Universal 2.0
-import QtQuick.Controls 2.0
+import QtQuick 2.8
+import QtQuick.Templates 2.1 as T
+import QtQuick.Controls.Universal 2.1
+import QtQuick.Controls 2.1
+import QtQuick.Controls.impl 2.1
T.Tumbler {
id: control
@@ -54,22 +55,16 @@ T.Tumbler {
verticalAlignment: Text.AlignVCenter
}
- contentItem: PathView {
- id: pathView
+ contentItem: TumblerView {
+ id: tumblerView
model: control.model
delegate: control.delegate
- clip: true
- pathItemCount: control.visibleItemCount + 1
- preferredHighlightBegin: 0.5
- preferredHighlightEnd: 0.5
- dragMargin: width / 2
-
path: Path {
- startX: pathView.width / 2
- startY: -pathView.delegateHeight / 2
+ startX: tumblerView.width / 2
+ startY: -tumblerView.delegateHeight / 2
PathLine {
- x: pathView.width / 2
- y: pathView.pathItemCount * pathView.delegateHeight - pathView.delegateHeight / 2
+ x: tumblerView.width / 2
+ y: (control.visibleItemCount + 1) * tumblerView.delegateHeight - tumblerView.delegateHeight / 2
}
}
diff --git a/src/imports/controls/universal/qquickuniversalprogressring.cpp b/src/imports/controls/universal/qquickuniversalprogressring.cpp
index ac087c78..1d733fed 100644
--- a/src/imports/controls/universal/qquickuniversalprogressring.cpp
+++ b/src/imports/controls/universal/qquickuniversalprogressring.cpp
@@ -241,7 +241,7 @@ QSGNode *QQuickUniversalProgressRing::updatePaintNode(QSGNode *oldNode, UpdatePa
QSGOpacityNode *opacityNode = new QSGOpacityNode;
transformNode->appendChildNode(opacityNode);
- QSGRectangleNode *rectNode = d->sceneGraphContext()->createRectangleNode();
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
rectNode->setAntialiasing(true);
opacityNode->appendChildNode(rectNode);
}
@@ -249,7 +249,7 @@ QSGNode *QQuickUniversalProgressRing::updatePaintNode(QSGNode *oldNode, UpdatePa
QSGNode *opacityNode = transformNode->firstChild();
Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(opacityNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(opacityNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
rectNode->setRect(rect);
diff --git a/src/imports/controls/universal/qquickuniversalprogressstrip.cpp b/src/imports/controls/universal/qquickuniversalprogressstrip.cpp
index 16f394f1..32af5113 100644
--- a/src/imports/controls/universal/qquickuniversalprogressstrip.cpp
+++ b/src/imports/controls/universal/qquickuniversalprogressstrip.cpp
@@ -38,10 +38,10 @@
#include <QtCore/qmath.h>
#include <QtCore/qeasingcurve.h>
-#include <QtQuick/qsgsimplerectnode.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickanimatorjob_p.h>
#include <QtQuick/private/qsgadaptationlayer_p.h>
+#include <QtQuick/qsgrectanglenode.h>
QT_BEGIN_NAMESPACE
@@ -106,7 +106,7 @@ void QQuickUniversalProgressStripAnimatorJob::updateCurrentTime(int time)
if (!m_node)
return;
- QSGSimpleRectNode *geometryNode = static_cast<QSGSimpleRectNode *>(m_node->firstChild());
+ QSGRectangleNode *geometryNode = static_cast<QSGRectangleNode *>(m_node->firstChild());
Q_ASSERT(!geometryNode || geometryNode->type() == QSGNode::GeometryNodeType);
if (!geometryNode)
return;
@@ -286,9 +286,9 @@ QSGNode *QQuickUniversalProgressStrip::updatePaintNode(QSGNode *oldNode, UpdateP
if (!m_indeterminate)
bounds.setWidth(m_progress * bounds.width());
- QSGSimpleRectNode *geometryNode = static_cast<QSGSimpleRectNode *>(oldNode);
+ QSGRectangleNode *geometryNode = static_cast<QSGRectangleNode *>(oldNode);
if (!geometryNode)
- geometryNode = new QSGSimpleRectNode(bounds, Qt::transparent);
+ geometryNode = window()->createRectangleNode();
geometryNode->setRect(bounds);
geometryNode->setColor(m_indeterminate ? Qt::transparent : m_color);
@@ -317,7 +317,7 @@ QSGNode *QQuickUniversalProgressStrip::updatePaintNode(QSGNode *oldNode, UpdateP
QSGOpacityNode *opacityNode = new QSGOpacityNode;
ellipseNode->appendChildNode(opacityNode);
- QSGRectangleNode *rectNode = d->sceneGraphContext()->createRectangleNode();
+ QSGInternalRectangleNode *rectNode = d->sceneGraphContext()->createInternalRectangleNode();
rectNode->setAntialiasing(true);
rectNode->setRadius(EllipseDiameter / 2);
opacityNode->appendChildNode(rectNode);
@@ -330,7 +330,7 @@ QSGNode *QQuickUniversalProgressStrip::updatePaintNode(QSGNode *oldNode, UpdateP
QSGNode *opacityNode = ellipseNode->firstChild();
Q_ASSERT(opacityNode->type() == QSGNode::OpacityNodeType);
- QSGRectangleNode *rectNode = static_cast<QSGRectangleNode *>(opacityNode->firstChild());
+ QSGInternalRectangleNode *rectNode = static_cast<QSGInternalRectangleNode *>(opacityNode->firstChild());
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
rectNode->setRect(QRectF((EllipseCount - i - 1) * (EllipseDiameter + EllipseOffset), (height() - EllipseDiameter) / 2, EllipseDiameter, EllipseDiameter));
diff --git a/src/imports/controls/universal/qquickuniversalstyle.cpp b/src/imports/controls/universal/qquickuniversalstyle.cpp
index 2328f1a5..b33c27e8 100644
--- a/src/imports/controls/universal/qquickuniversalstyle.cpp
+++ b/src/imports/controls/universal/qquickuniversalstyle.cpp
@@ -132,6 +132,15 @@ static QRgb qquickuniversal_accent_color(QQuickUniversalStyle::Color accent)
return colors[accent];
}
+extern bool qt_is_dark_system_theme();
+
+static QQuickUniversalStyle::Theme qquickuniversal_effective_theme(QQuickUniversalStyle::Theme theme)
+{
+ if (theme == QQuickUniversalStyle::System)
+ theme = qt_is_dark_system_theme() ? QQuickUniversalStyle::Dark : QQuickUniversalStyle::Light;
+ return theme;
+}
+
// If no value was inherited from a parent or explicitly set, the "global" values are used.
// The initial, default values of the globals are hard-coded here, but the environment
// variables and .conf file override them if specified.
@@ -164,6 +173,7 @@ QQuickUniversalStyle::Theme QQuickUniversalStyle::theme() const
void QQuickUniversalStyle::setTheme(Theme theme)
{
+ theme = qquickuniversal_effective_theme(theme);
m_explicitTheme = true;
if (m_theme == theme)
return;
@@ -536,7 +546,7 @@ void QQuickUniversalStyle::init()
QByteArray themeValue = resolveSetting("QT_QUICK_CONTROLS_UNIVERSAL_THEME", settings, QStringLiteral("Theme"));
Theme themeEnum = toEnumValue<Theme>(themeValue, &ok);
if (ok)
- GlobalTheme = m_theme = themeEnum;
+ GlobalTheme = m_theme = qquickuniversal_effective_theme(themeEnum);
else if (!themeValue.isEmpty())
qWarning().nospace().noquote() << "Universal: unknown theme value: " << themeValue;
diff --git a/src/imports/controls/universal/qquickuniversalstyle_p.h b/src/imports/controls/universal/qquickuniversalstyle_p.h
index bf0a84d8..0d3a6dab 100644
--- a/src/imports/controls/universal/qquickuniversalstyle_p.h
+++ b/src/imports/controls/universal/qquickuniversalstyle_p.h
@@ -93,7 +93,7 @@ public:
static QQuickUniversalStyle *qmlAttachedProperties(QObject *object);
- enum Theme { Light, Dark };
+ enum Theme { Light, Dark, System };
Q_ENUM(Theme)
Theme theme() const;
diff --git a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp
index ddad6548..394e9162 100644
--- a/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp
+++ b/src/imports/controls/universal/qtquickcontrols2universalstyleplugin.cpp
@@ -77,6 +77,7 @@ QtQuickControls2UniversalStylePlugin::QtQuickControls2UniversalStylePlugin(QObje
void QtQuickControls2UniversalStylePlugin::registerTypes(const char *uri)
{
qmlRegisterUncreatableType<QQuickUniversalStyle>(uri, 2, 0, "Universal", tr("Universal is an attached property"));
+ qmlRegisterRevision<QQuickUniversalStyle, 1>(uri, 2, 1);
}
void QtQuickControls2UniversalStylePlugin::initializeEngine(QQmlEngine *engine, const char *uri)
@@ -87,6 +88,7 @@ void QtQuickControls2UniversalStylePlugin::initializeEngine(QQmlEngine *engine,
QByteArray import = QByteArray(uri) + ".impl";
qmlRegisterType<QQuickUniversalFocusRectangle>(import, 2, 0, "FocusRectangle");
+ qmlRegisterRevision<QQuickUniversalFocusRectangle, 1>(import, 2, 1);
qmlRegisterType<QQuickUniversalProgressRing>(import, 2, 0, "ProgressRing");
qmlRegisterType<QQuickUniversalProgressRingAnimator>(import, 2, 0, "ProgressRingAnimator");
qmlRegisterType<QQuickUniversalProgressStrip>(import, 2, 0, "ProgressStrip");
diff --git a/src/imports/controls/universal/universal.pri b/src/imports/controls/universal/universal.pri
index 61b6912a..3697a2a6 100644
--- a/src/imports/controls/universal/universal.pri
+++ b/src/imports/controls/universal/universal.pri
@@ -7,6 +7,8 @@ QML_FILES += \
$$PWD/CheckIndicator.qml \
$$PWD/ComboBox.qml \
$$PWD/Dial.qml \
+ $$PWD/Dialog.qml \
+ $$PWD/DialogButtonBox.qml \
$$PWD/Drawer.qml \
$$PWD/Frame.qml \
$$PWD/GroupBox.qml \
@@ -14,6 +16,7 @@ QML_FILES += \
$$PWD/Label.qml \
$$PWD/Menu.qml \
$$PWD/MenuItem.qml \
+ $$PWD/MenuSeparator.qml \
$$PWD/Page.qml \
$$PWD/PageIndicator.qml \
$$PWD/Pane.qml \
@@ -23,6 +26,7 @@ QML_FILES += \
$$PWD/RadioDelegate.qml \
$$PWD/RadioIndicator.qml \
$$PWD/RangeSlider.qml \
+ $$PWD/RoundButton.qml \
$$PWD/ScrollBar.qml \
$$PWD/ScrollIndicator.qml \
$$PWD/Slider.qml \
@@ -38,6 +42,7 @@ QML_FILES += \
$$PWD/TextField.qml \
$$PWD/ToolBar.qml \
$$PWD/ToolButton.qml \
+ $$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
$$PWD/Tumbler.qml
diff --git a/src/imports/controls/universal/universal.pro b/src/imports/controls/universal/universal.pro
index f10f21b0..c3835016 100644
--- a/src/imports/controls/universal/universal.pro
+++ b/src/imports/controls/universal/universal.pro
@@ -1,6 +1,6 @@
TARGET = qtquickcontrols2universalstyleplugin
TARGETPATH = QtQuick/Controls.2/Universal
-IMPORT_VERSION = 2.0
+IMPORT_VERSION = 2.1
QT += qml quick
QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private quickcontrols2-private
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 3227cb99..e1da66c9 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -2,6 +2,7 @@ TEMPLATE = subdirs
SUBDIRS += \
controls \
calendar \
+ platform \
templates
SUBDIRS += \
diff --git a/src/imports/platform/doc/images/qtlabsplatform-colordialog-gtk.png b/src/imports/platform/doc/images/qtlabsplatform-colordialog-gtk.png
new file mode 100644
index 00000000..e0785a05
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-colordialog-gtk.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-filedialog-gtk.png b/src/imports/platform/doc/images/qtlabsplatform-filedialog-gtk.png
new file mode 100644
index 00000000..3bc963d0
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-filedialog-gtk.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-folderdialog-gtk.png b/src/imports/platform/doc/images/qtlabsplatform-folderdialog-gtk.png
new file mode 100644
index 00000000..ea4d929d
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-folderdialog-gtk.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-fontdialog-gtk.png b/src/imports/platform/doc/images/qtlabsplatform-fontdialog-gtk.png
new file mode 100644
index 00000000..9f3dc2e7
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-fontdialog-gtk.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-menu.png b/src/imports/platform/doc/images/qtlabsplatform-menu.png
new file mode 100644
index 00000000..120d263b
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-menu.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-menubar.png b/src/imports/platform/doc/images/qtlabsplatform-menubar.png
new file mode 100644
index 00000000..685d03b3
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-menubar.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-messagedialog-android.png b/src/imports/platform/doc/images/qtlabsplatform-messagedialog-android.png
new file mode 100644
index 00000000..a1de1806
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-messagedialog-android.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-messagedialog-informative-android.png b/src/imports/platform/doc/images/qtlabsplatform-messagedialog-informative-android.png
new file mode 100644
index 00000000..7062ed90
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-messagedialog-informative-android.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-menu.png b/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-menu.png
new file mode 100644
index 00000000..0d0ecfab
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-menu.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-message.png b/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-message.png
new file mode 100644
index 00000000..d929ca97
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon-message.png
Binary files differ
diff --git a/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon.png b/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon.png
new file mode 100644
index 00000000..58c40d73
--- /dev/null
+++ b/src/imports/platform/doc/images/qtlabsplatform-systemtrayicon.png
Binary files differ
diff --git a/src/imports/platform/doc/qtlabsplatform.qdocconf b/src/imports/platform/doc/qtlabsplatform.qdocconf
new file mode 100644
index 00000000..e78a9644
--- /dev/null
+++ b/src/imports/platform/doc/qtlabsplatform.qdocconf
@@ -0,0 +1,37 @@
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = QtLabsPlatform
+description = Qt Labs Platform Reference Documentation
+version = $QT_VERSION
+
+qhp.projects = QtLabsPlatform
+
+qhp.QtLabsPlatform.file = qtlabsplatform.qhp
+qhp.QtLabsPlatform.namespace = org.qt-project.qtlabsplatform.$QT_VERSION_TAG
+qhp.QtLabsPlatform.virtualFolder = qtlabsplatform
+qhp.QtLabsPlatform.indexTitle = Qt Labs Platform
+qhp.QtLabsPlatform.indexRoot =
+
+qhp.QtLabsPlatform.filterAttributes = qtlabsplatform $QT_VERSION qtrefdoc
+qhp.QtLabsPlatform.customFilters.Qt.name = QtLabsPlatform $QT_VERSION
+qhp.QtLabsPlatform.customFilters.Qt.filterAttributes = qtlabsplatform $QT_VERSION
+
+qhp.QtLabsPlatform.subprojects = qmltypes
+qhp.QtLabsPlatform.subprojects.qmltypes.title = QML Types
+qhp.QtLabsPlatform.subprojects.qmltypes.indexTitle = Qt Labs Platform QML Types
+qhp.QtLabsPlatform.subprojects.qmltypes.selectors = qmlclass
+qhp.QtLabsPlatform.subprojects.qmltypes.sortPages = true
+
+depends = qtcore qtgui qtdoc qtqml qtquick qtquickcontrols2 qtwidgets
+
+headerdirs += ../
+sourcedirs += ../
+
+imagedirs += images
+
+navigation.landingpage = "Qt Labs Platform"
+navigation.qmltypespage = "Qt Labs Platform QML Types"
+
+tagfile = qtlabsplatform.tags
+
+macro.labs = "\\note \\e{Types in Qt.labs modules are not guaranteed to remain compatible in future versions.}"
diff --git a/src/imports/platform/doc/src/includes/widgets.qdocinc b/src/imports/platform/doc/src/includes/widgets.qdocinc
new file mode 100644
index 00000000..c89c3ca0
--- /dev/null
+++ b/src/imports/platform/doc/src/includes/widgets.qdocinc
@@ -0,0 +1,29 @@
+//! [1]
+The Qt Labs Platform module uses Qt Widgets as a fallback on platforms that
+do not have a native implementation available. Therefore, applications that
+use types from the Qt Labs Platform module should link to QtWidgets and use
+\l QApplication instead of \l QGuiApplication.
+
+To link against the QtWidgets library, add the following to your qmake project
+file:
+
+\code
+QT += widgets
+\endcode
+
+Create an instance of \l QApplication in \c main():
+
+\code
+#include <QApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
+ QApplication app(argc, argv);
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+ return app.exec();
+}
+\endcode
+//! [1]
diff --git a/src/imports/platform/doc/src/qtlabsplatform-index.qdoc b/src/imports/platform/doc/src/qtlabsplatform-index.qdoc
new file mode 100644
index 00000000..aec2a923
--- /dev/null
+++ b/src/imports/platform/doc/src/qtlabsplatform-index.qdoc
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+/*!
+ \page qtlabsplatform-index.html
+ \title Qt Labs Platform
+
+ \brief The experimental Qt Labs Platform module provides QML types for
+ native platform extensions.
+
+ The experimental Qt Labs Platform module provides QML types for native
+ platform extensions. The module was introduced in Qt 5.8.
+
+ \section1 QML Types
+
+ \generatelist {qmltypesbymodule Qt.labs.platform}
+
+ \labs
+
+ \section1 Related Information
+
+ \list
+ \li \l{Qt Quick}
+ \li \l{Qt Quick Controls 2}
+ \endlist
+*/
diff --git a/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc b/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc
new file mode 100644
index 00000000..470b93c4
--- /dev/null
+++ b/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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$
+**
+****************************************************************************/
+
+/*!
+ \qmlmodule Qt.labs.platform 1.0
+ \title Qt Labs Platform QML Types
+ \ingroup qmlmodules
+ \brief Provides QML types for native platform extensions.
+
+ The experimental \l{Qt Labs Platform} module provides QML types for native
+ platform extensions. These QML types work in conjunction with \l{Qt Quick}
+ and \l{Qt Quick Controls 2}.
+
+ The QML types can be imported into your application using the
+ following import statement in your .qml file:
+
+ \badcode
+ import Qt.labs.platform 1.0
+ \endcode
+
+ \section1 QML Types
+
+ \generatelist {qmltypesbymodule Qt.labs.platform}
+
+ \labs
+
+ \section1 Related Information
+
+ \list
+ \li \l {Qt Quick Controls 2 QML Types}
+ \endlist
+
+ \noautolist
+*/
diff --git a/src/imports/platform/platform.pri b/src/imports/platform/platform.pri
new file mode 100644
index 00000000..1e300251
--- /dev/null
+++ b/src/imports/platform/platform.pri
@@ -0,0 +1,31 @@
+HEADERS += \
+ $$PWD/qquickplatformcolordialog_p.h \
+ $$PWD/qquickplatformdialog_p.h \
+ $$PWD/qquickplatformfiledialog_p.h \
+ $$PWD/qquickplatformfolderdialog_p.h \
+ $$PWD/qquickplatformfontdialog_p.h \
+ $$PWD/qquickplatformiconloader_p.h \
+ $$PWD/qquickplatformmenu_p.h \
+ $$PWD/qquickplatformmenubar_p.h \
+ $$PWD/qquickplatformmenuitem_p.h \
+ $$PWD/qquickplatformmenuitemgroup_p.h \
+ $$PWD/qquickplatformmenuseparator_p.h \
+ $$PWD/qquickplatformmessagedialog_p.h \
+ $$PWD/qquickplatformstandardpaths_p.h \
+ $$PWD/qquickplatformsystemtrayicon_p.h
+
+SOURCES += \
+ $$PWD/qquickplatformcolordialog.cpp \
+ $$PWD/qquickplatformdialog.cpp \
+ $$PWD/qquickplatformfiledialog.cpp \
+ $$PWD/qquickplatformfolderdialog.cpp \
+ $$PWD/qquickplatformfontdialog.cpp \
+ $$PWD/qquickplatformiconloader.cpp \
+ $$PWD/qquickplatformmenu.cpp \
+ $$PWD/qquickplatformmenubar.cpp \
+ $$PWD/qquickplatformmenuitem.cpp \
+ $$PWD/qquickplatformmenuitemgroup.cpp \
+ $$PWD/qquickplatformmenuseparator.cpp \
+ $$PWD/qquickplatformmessagedialog.cpp \
+ $$PWD/qquickplatformstandardpaths.cpp \
+ $$PWD/qquickplatformsystemtrayicon.cpp
diff --git a/src/imports/platform/platform.pro b/src/imports/platform/platform.pro
new file mode 100644
index 00000000..043b0172
--- /dev/null
+++ b/src/imports/platform/platform.pro
@@ -0,0 +1,22 @@
+TARGET = qtlabsplatformplugin
+TARGETPATH = Qt/labs/platform
+IMPORT_VERSION = 1.0
+
+QT += qml quick
+QT_PRIVATE += core-private gui-private qml-private quick-private
+
+DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII
+
+QMAKE_DOCS = $$PWD/doc/qtlabsplatform.qdocconf
+
+OTHER_FILES += \
+ qmldir
+
+SOURCES += \
+ $$PWD/qtlabsplatformplugin.cpp
+
+include(platform.pri)
+qtHaveModule(widgets): include(widgets/widgets.pri)
+
+CONFIG += no_cxx_module
+load(qml_plugin)
diff --git a/src/imports/platform/plugins.qmltypes b/src/imports/platform/plugins.qmltypes
new file mode 100644
index 00000000..6913405b
--- /dev/null
+++ b/src/imports/platform/plugins.qmltypes
@@ -0,0 +1,460 @@
+import QtQuick.tooling 1.2
+
+// 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 Qt.labs.platform 1.0'
+
+Module {
+ dependencies: ["QtQuick 2.8"]
+ Component {
+ name: "QPlatformDialogHelper"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/StandardButton 1.0"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ 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,
+ "FirstButton": 1024,
+ "LastButton": 134217728,
+ "LowestBit": 10,
+ "HighestBit": 27
+ }
+ }
+ Enum {
+ name: "ButtonRole"
+ values: {
+ "InvalidRole": -1,
+ "AcceptRole": 0,
+ "RejectRole": 1,
+ "DestructiveRole": 2,
+ "ActionRole": 3,
+ "HelpRole": 4,
+ "YesRole": 5,
+ "NoRole": 6,
+ "ResetRole": 7,
+ "ApplyRole": 8,
+ "NRoles": 9,
+ "RoleMask": 268435455,
+ "AlternateRole": 268435456,
+ "Stretch": 536870912,
+ "Reverse": 1073741824,
+ "EOL": -1
+ }
+ }
+ Signal { name: "accept" }
+ Signal { name: "reject" }
+ }
+ Component {
+ name: "QQuickPlatformColorDialog"
+ defaultProperty: "data"
+ prototype: "QQuickPlatformDialog"
+ exports: ["Qt.labs.platform/ColorDialog 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "color"; type: "QColor" }
+ Property { name: "currentColor"; type: "QColor" }
+ Property { name: "options"; type: "QColorDialogOptions::ColorDialogOptions" }
+ }
+ Component {
+ name: "QQuickPlatformDialog"
+ defaultProperty: "data"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/Dialog 1.0"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "StandardCode"
+ values: {
+ "Rejected": 0,
+ "Accepted": 1
+ }
+ }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "parentWindow"; type: "QWindow"; isPointer: true }
+ Property { name: "title"; type: "string" }
+ Property { name: "flags"; type: "Qt::WindowFlags" }
+ Property { name: "modality"; type: "Qt::WindowModality" }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "result"; type: "int" }
+ Signal { name: "accepted" }
+ Signal { name: "rejected" }
+ Method { name: "open" }
+ Method { name: "close" }
+ Method { name: "accept" }
+ Method { name: "reject" }
+ Method {
+ name: "done"
+ Parameter { name: "result"; type: "int" }
+ }
+ }
+ Component {
+ name: "QQuickPlatformFileDialog"
+ defaultProperty: "data"
+ prototype: "QQuickPlatformDialog"
+ exports: ["Qt.labs.platform/FileDialog 1.0"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "FileMode"
+ values: {
+ "OpenFile": 0,
+ "OpenFiles": 1,
+ "SaveFile": 2
+ }
+ }
+ Property { name: "fileMode"; type: "FileMode" }
+ Property { name: "file"; type: "QUrl" }
+ Property { name: "files"; type: "QList<QUrl>" }
+ Property { name: "currentFile"; type: "QUrl" }
+ Property { name: "currentFiles"; type: "QList<QUrl>" }
+ Property { name: "folder"; type: "QUrl" }
+ Property { name: "options"; type: "QFileDialogOptions::FileDialogOptions" }
+ Property { name: "nameFilters"; type: "QStringList" }
+ Property {
+ name: "selectedNameFilter"
+ type: "QQuickPlatformFileNameFilter"
+ isReadonly: true
+ isPointer: true
+ }
+ Property { name: "defaultSuffix"; type: "string" }
+ Property { name: "acceptLabel"; type: "string" }
+ Property { name: "rejectLabel"; type: "string" }
+ }
+ Component {
+ name: "QQuickPlatformFileNameFilter"
+ prototype: "QObject"
+ Property { name: "index"; type: "int" }
+ Property { name: "name"; type: "string"; isReadonly: true }
+ Property { name: "extensions"; type: "QStringList"; isReadonly: true }
+ Signal {
+ name: "indexChanged"
+ Parameter { name: "index"; type: "int" }
+ }
+ Signal {
+ name: "nameChanged"
+ Parameter { name: "name"; type: "string" }
+ }
+ Signal {
+ name: "extensionsChanged"
+ Parameter { name: "extensions"; type: "QStringList" }
+ }
+ }
+ Component {
+ name: "QQuickPlatformFolderDialog"
+ defaultProperty: "data"
+ prototype: "QQuickPlatformDialog"
+ exports: ["Qt.labs.platform/FolderDialog 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "folder"; type: "QUrl" }
+ Property { name: "currentFolder"; type: "QUrl" }
+ Property { name: "options"; type: "QFileDialogOptions::FileDialogOptions" }
+ Property { name: "acceptLabel"; type: "string" }
+ Property { name: "rejectLabel"; type: "string" }
+ }
+ Component {
+ name: "QQuickPlatformFontDialog"
+ defaultProperty: "data"
+ prototype: "QQuickPlatformDialog"
+ exports: ["Qt.labs.platform/FontDialog 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "font"; type: "QFont" }
+ Property { name: "currentFont"; type: "QFont" }
+ Property { name: "options"; type: "QFontDialogOptions::FontDialogOptions" }
+ }
+ Component {
+ name: "QQuickPlatformMenu"
+ defaultProperty: "data"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/Menu 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "items"; type: "QQuickPlatformMenuItem"; isList: true; isReadonly: true }
+ Property { name: "menuBar"; type: "QQuickPlatformMenuBar"; isReadonly: true; isPointer: true }
+ Property { name: "parentMenu"; type: "QQuickPlatformMenu"; isReadonly: true; isPointer: true }
+ Property {
+ name: "systemTrayIcon"
+ type: "QQuickPlatformSystemTrayIcon"
+ isReadonly: true
+ isPointer: true
+ }
+ Property { name: "menuItem"; type: "QQuickPlatformMenuItem"; isReadonly: true; isPointer: true }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "minimumWidth"; type: "int" }
+ Property { name: "type"; type: "QPlatformMenu::MenuType" }
+ Property { name: "title"; type: "string" }
+ Property { name: "iconSource"; type: "QUrl" }
+ Property { name: "iconName"; type: "string" }
+ Property { name: "font"; type: "QFont" }
+ Signal { name: "aboutToShow" }
+ Signal { name: "aboutToHide" }
+ Method {
+ name: "open"
+ Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true }
+ }
+ Method { name: "close" }
+ Method {
+ name: "addItem"
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Method {
+ name: "insertItem"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Method {
+ name: "removeItem"
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Method {
+ name: "addMenu"
+ Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ }
+ Method {
+ name: "insertMenu"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ }
+ Method {
+ name: "removeMenu"
+ Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ }
+ Method { name: "clear" }
+ }
+ Component {
+ name: "QQuickPlatformMenuBar"
+ defaultProperty: "data"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/MenuBar 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "menus"; type: "QQuickPlatformMenu"; isList: true; isReadonly: true }
+ Property { name: "window"; type: "QWindow"; isPointer: true }
+ Method {
+ name: "addMenu"
+ Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ }
+ Method {
+ name: "insertMenu"
+ Parameter { name: "index"; type: "int" }
+ Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ }
+ Method {
+ name: "removeMenu"
+ Parameter { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ }
+ Method { name: "clear" }
+ }
+ Component {
+ name: "QQuickPlatformMenuItem"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/MenuItem 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "menu"; type: "QQuickPlatformMenu"; isReadonly: true; isPointer: true }
+ Property { name: "subMenu"; type: "QQuickPlatformMenu"; isReadonly: true; isPointer: true }
+ Property { name: "group"; type: "QQuickPlatformMenuItemGroup"; isPointer: true }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "separator"; type: "bool" }
+ Property { name: "checkable"; type: "bool" }
+ Property { name: "checked"; type: "bool" }
+ Property { name: "role"; type: "QPlatformMenuItem::MenuRole" }
+ Property { name: "text"; type: "string" }
+ Property { name: "iconSource"; type: "QUrl" }
+ Property { name: "iconName"; type: "string" }
+ Property { name: "shortcut"; type: "QVariant" }
+ Property { name: "font"; type: "QFont" }
+ Signal { name: "triggered" }
+ Signal { name: "hovered" }
+ Method { name: "toggle" }
+ }
+ Component {
+ name: "QQuickPlatformMenuItemGroup"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/MenuItemGroup 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "exclusive"; type: "bool" }
+ Property { name: "checkedItem"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ Property { name: "items"; type: "QQuickPlatformMenuItem"; isList: true; isReadonly: true }
+ Signal {
+ name: "triggered"
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Signal {
+ name: "hovered"
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Method {
+ name: "addItem"
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Method {
+ name: "removeItem"
+ Parameter { name: "item"; type: "QQuickPlatformMenuItem"; isPointer: true }
+ }
+ Method { name: "clear" }
+ }
+ Component {
+ name: "QQuickPlatformMenuSeparator"
+ prototype: "QQuickPlatformMenuItem"
+ exports: ["Qt.labs.platform/MenuSeparator 1.0"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
+ name: "QQuickPlatformMessageDialog"
+ defaultProperty: "data"
+ prototype: "QQuickPlatformDialog"
+ exports: ["Qt.labs.platform/MessageDialog 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "text"; type: "string" }
+ Property { name: "informativeText"; type: "string" }
+ Property { name: "detailedText"; type: "string" }
+ Property { name: "buttons"; type: "QPlatformDialogHelper::StandardButtons" }
+ Signal {
+ name: "clicked"
+ Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" }
+ }
+ Signal { name: "okClicked" }
+ Signal { name: "saveClicked" }
+ Signal { name: "saveAllClicked" }
+ Signal { name: "openClicked" }
+ Signal { name: "yesClicked" }
+ Signal { name: "yesToAllClicked" }
+ Signal { name: "noClicked" }
+ Signal { name: "noToAllClicked" }
+ Signal { name: "abortClicked" }
+ Signal { name: "retryClicked" }
+ Signal { name: "ignoreClicked" }
+ Signal { name: "closeClicked" }
+ Signal { name: "cancelClicked" }
+ Signal { name: "discardClicked" }
+ Signal { name: "helpClicked" }
+ Signal { name: "applyClicked" }
+ Signal { name: "resetClicked" }
+ Signal { name: "restoreDefaultsClicked" }
+ }
+ Component {
+ name: "QQuickPlatformStandardPaths"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/StandardPaths 1.0"]
+ isCreatable: false
+ isSingleton: true
+ exportMetaObjectRevisions: [0]
+ Method {
+ name: "displayName"
+ type: "string"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ }
+ Method {
+ name: "findExecutable"
+ type: "QUrl"
+ Parameter { name: "executableName"; type: "string" }
+ Parameter { name: "paths"; type: "QStringList" }
+ }
+ Method {
+ name: "findExecutable"
+ type: "QUrl"
+ Parameter { name: "executableName"; type: "string" }
+ }
+ Method {
+ name: "locate"
+ type: "QUrl"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ Parameter { name: "fileName"; type: "string" }
+ Parameter { name: "options"; type: "QStandardPaths::LocateOptions" }
+ }
+ Method {
+ name: "locate"
+ type: "QUrl"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ Parameter { name: "fileName"; type: "string" }
+ }
+ Method {
+ name: "locateAll"
+ type: "QList<QUrl>"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ Parameter { name: "fileName"; type: "string" }
+ Parameter { name: "options"; type: "QStandardPaths::LocateOptions" }
+ }
+ Method {
+ name: "locateAll"
+ type: "QList<QUrl>"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ Parameter { name: "fileName"; type: "string" }
+ }
+ Method {
+ name: "setTestModeEnabled"
+ Parameter { name: "testMode"; type: "bool" }
+ }
+ Method {
+ name: "standardLocations"
+ type: "QList<QUrl>"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ }
+ Method {
+ name: "writableLocation"
+ type: "QUrl"
+ Parameter { name: "type"; type: "QStandardPaths::StandardLocation" }
+ }
+ }
+ Component {
+ name: "QQuickPlatformSystemTrayIcon"
+ prototype: "QObject"
+ exports: ["Qt.labs.platform/SystemTrayIcon 1.0"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "available"; type: "bool"; isReadonly: true }
+ Property { name: "supportsMessages"; type: "bool"; isReadonly: true }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "iconSource"; type: "QUrl" }
+ Property { name: "iconName"; type: "string" }
+ Property { name: "tooltip"; type: "string" }
+ Property { name: "menu"; type: "QQuickPlatformMenu"; isPointer: true }
+ Signal {
+ name: "activated"
+ Parameter { name: "reason"; type: "QPlatformSystemTrayIcon::ActivationReason" }
+ }
+ Signal { name: "messageClicked" }
+ Method { name: "show" }
+ Method { name: "hide" }
+ Method {
+ name: "showMessage"
+ Parameter { name: "title"; type: "string" }
+ Parameter { name: "message"; type: "string" }
+ Parameter { name: "iconType"; type: "QPlatformSystemTrayIcon::MessageIcon" }
+ Parameter { name: "msecs"; type: "int" }
+ }
+ Method {
+ name: "showMessage"
+ Parameter { name: "title"; type: "string" }
+ Parameter { name: "message"; type: "string" }
+ Parameter { name: "iconType"; type: "QPlatformSystemTrayIcon::MessageIcon" }
+ }
+ Method {
+ name: "showMessage"
+ Parameter { name: "title"; type: "string" }
+ Parameter { name: "message"; type: "string" }
+ }
+ }
+}
diff --git a/src/imports/platform/qmldir b/src/imports/platform/qmldir
new file mode 100644
index 00000000..9653b7d3
--- /dev/null
+++ b/src/imports/platform/qmldir
@@ -0,0 +1,3 @@
+module Qt.labs.platform
+plugin qtlabsplatformplugin
+classname QtLabsPlatformPlugin
diff --git a/src/imports/platform/qquickplatformcolordialog.cpp b/src/imports/platform/qquickplatformcolordialog.cpp
new file mode 100644
index 00000000..36bb7d69
--- /dev/null
+++ b/src/imports/platform/qquickplatformcolordialog.cpp
@@ -0,0 +1,205 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformcolordialog_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype ColorDialog
+ \inherits Dialog
+ \instantiates QQuickPlatformColorDialog
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native color dialog.
+
+ The ColorDialog type provides a QML API for native platform color dialogs.
+
+ \image qtlabsplatform-colordialog-gtk.png
+
+ To show a color dialog, construct an instance of ColorDialog, set the
+ desired properties, and call \l {Dialog::}{open()}. The \l currentColor
+ property can be used to determine the currently selected color in the
+ dialog. The \l color property is updated only after the final selection
+ has been made by accepting the dialog.
+
+ \code
+ MenuItem {
+ text: "Color"
+ onTriggered: colorDialog.open()
+ }
+
+ ColorDialog {
+ id: colorDialog
+ currentColor: document.color
+ }
+
+ MyDocument {
+ id: document
+ color: colorDialog.color
+ }
+ \endcode
+
+ \section2 Availability
+
+ A native platform color dialog is currently available on the following platforms:
+
+ \list
+ \li macOS
+ \li Linux (when running with the GTK+ platform theme)
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+*/
+
+QQuickPlatformColorDialog::QQuickPlatformColorDialog(QObject *parent)
+ : QQuickPlatformDialog(QPlatformTheme::ColorDialog, parent),
+ m_options(QColorDialogOptions::create())
+{
+}
+
+/*!
+ \qmlproperty color Qt.labs.platform::ColorDialog::color
+
+ This property holds the final accepted color.
+
+ Unlike the \l currentColor property, the \c color property is not updated
+ while the user is selecting colors in the dialog, but only after the final
+ selection has been made. That is, when the user has clicked \uicontrol OK
+ to accept a color. Alternatively, the \l {Dialog::}{accepted()} signal
+ can be handled to get the final selection.
+
+ \sa currentColor, {Dialog::}{accepted()}
+*/
+QColor QQuickPlatformColorDialog::color() const
+{
+ return m_color;
+}
+
+void QQuickPlatformColorDialog::setColor(const QColor &color)
+{
+ if (m_color == color)
+ return;
+
+ m_color = color;
+ setCurrentColor(color);
+ emit colorChanged();
+}
+
+/*!
+ \qmlproperty color Qt.labs.platform::ColorDialog::currentColor
+
+ This property holds the currently selected color in the dialog.
+
+ Unlike the \l color property, the \c currentColor property is updated
+ while the user is selecting colors in the dialog, even before the final
+ selection has been made.
+
+ \sa color
+*/
+QColor QQuickPlatformColorDialog::currentColor() const
+{
+ if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(handle()))
+ return colorDialog->currentColor();
+ return m_currentColor;
+}
+
+void QQuickPlatformColorDialog::setCurrentColor(const QColor &color)
+{
+ if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(handle()))
+ colorDialog->setCurrentColor(color);
+ m_currentColor = color;
+}
+
+/*!
+ \qmlproperty flags Qt.labs.platform::ColorDialog::options
+
+ This property holds the various options that affect the look and feel of the dialog.
+
+ By default, all options are disabled.
+
+ Options should be set before showing the dialog. Setting them while the dialog is
+ visible is not guaranteed to have an immediate effect on the dialog (depending on
+ the option and on the platform).
+
+ Available options:
+ \value ColorDialog.ShowAlphaChannel Allow the user to select the alpha component of a color.
+ \value ColorDialog.NoButtons Don't display \uicontrol OK and \uicontrol Cancel buttons (useful for "live dialogs").
+*/
+QColorDialogOptions::ColorDialogOptions QQuickPlatformColorDialog::options() const
+{
+ return m_options->options();
+}
+
+void QQuickPlatformColorDialog::setOptions(QColorDialogOptions::ColorDialogOptions options)
+{
+ if (options == m_options->options())
+ return;
+
+ m_options->setOptions(options);
+ emit optionsChanged();
+}
+
+bool QQuickPlatformColorDialog::useNativeDialog() const
+{
+ return QQuickPlatformDialog::useNativeDialog()
+ && !m_options->testOption(QColorDialogOptions::DontUseNativeDialog);
+}
+
+void QQuickPlatformColorDialog::onCreate(QPlatformDialogHelper *dialog)
+{
+ if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(dialog)) {
+ connect(colorDialog, &QPlatformColorDialogHelper::currentColorChanged, this, &QQuickPlatformColorDialog::currentColorChanged);
+ colorDialog->setOptions(m_options);
+ }
+}
+
+void QQuickPlatformColorDialog::onShow(QPlatformDialogHelper *dialog)
+{
+ m_options->setWindowTitle(title());
+ if (QPlatformColorDialogHelper *colorDialog = qobject_cast<QPlatformColorDialogHelper *>(dialog))
+ colorDialog->setOptions(m_options);
+}
+
+void QQuickPlatformColorDialog::accept()
+{
+ setColor(currentColor());
+ QQuickPlatformDialog::accept();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformcolordialog_p.h b/src/imports/platform/qquickplatformcolordialog_p.h
new file mode 100644
index 00000000..33d6f0e8
--- /dev/null
+++ b/src/imports/platform/qquickplatformcolordialog_p.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.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 "qquickplatformdialog_p.h"
+#include <QtGui/qcolor.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformColorDialog : public QQuickPlatformDialog
+{
+ Q_OBJECT
+ Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
+ Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor NOTIFY currentColorChanged FINAL)
+ Q_PROPERTY(QColorDialogOptions::ColorDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
+ Q_FLAGS(QColorDialogOptions::ColorDialogOptions)
+
+public:
+ explicit QQuickPlatformColorDialog(QObject *parent = nullptr);
+
+ QColor color() const;
+ void setColor(const QColor &color);
+
+ QColor currentColor() const;
+ void setCurrentColor(const QColor &color);
+
+ QColorDialogOptions::ColorDialogOptions options() const;
+ void setOptions(QColorDialogOptions::ColorDialogOptions options);
+
+Q_SIGNALS:
+ void colorChanged();
+ void currentColorChanged();
+ void optionsChanged();
+
+protected:
+ bool useNativeDialog() const override;
+ void onCreate(QPlatformDialogHelper *dialog) override;
+ void onShow(QPlatformDialogHelper *dialog) override;
+ void accept() override;
+
+private:
+ QColor m_color;
+ QColor m_currentColor; // TODO: QColorDialogOptions::initialColor
+ QSharedPointer<QColorDialogOptions> m_options;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformColorDialog)
+
+#endif // QQUICKPLATFORMCOLORDIALOG_P_H
diff --git a/src/imports/platform/qquickplatformdialog.cpp b/src/imports/platform/qquickplatformdialog.cpp
new file mode 100644
index 00000000..95bc6426
--- /dev/null
+++ b/src/imports/platform/qquickplatformdialog.cpp
@@ -0,0 +1,409 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformdialog_p.h"
+
+#include <QtCore/qloggingcategory.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtQuick/qquickitem.h>
+#include <QtQuick/qquickwindow.h>
+
+#include "widgets/qwidgetplatform_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype Dialog
+ \inherits QtObject
+ \instantiates QQuickPlatformDialog
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief The base class of native dialogs.
+
+ The Dialog type provides common QML API for native platform dialogs.
+
+ To show a native dialog, construct an instance of one of the concrete
+ Dialog implementations, set the desired properties, and call \l open().
+ Dialog emits \l accepted() or \l rejected() when the user is done with
+ the dialog.
+
+ \labs
+*/
+
+/*!
+ \qmlsignal void Qt.labs.platform::Dialog::accepted()
+
+ This signal is emitted when the dialog has been accepted either
+ interactively or by calling \l accept().
+
+ \note This signal is \e not emitted when closing the dialog with \l close().
+
+ \sa rejected()
+*/
+
+/*!
+ \qmlsignal void Qt.labs.platform::Dialog::rejected()
+
+ This signal is emitted when the dialog has been rejected either
+ interactively or by calling \l reject().
+
+ \note This signal is \e not emitted when closing the dialog with \l close().
+
+ \sa accepted()
+*/
+
+Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformDialogs)
+
+QQuickPlatformDialog::QQuickPlatformDialog(QPlatformTheme::DialogType type, QObject *parent)
+ : QObject(parent),
+ m_visible(false),
+ m_complete(false),
+ m_result(0),
+ m_parentWindow(nullptr),
+ m_flags(Qt::Dialog),
+ m_modality(Qt::WindowModal),
+ m_type(type),
+ m_handle(nullptr)
+{
+}
+
+QQuickPlatformDialog::~QQuickPlatformDialog()
+{
+ destroy();
+}
+
+QPlatformDialogHelper *QQuickPlatformDialog::handle() const
+{
+ return m_handle;
+}
+
+/*!
+ \default
+ \qmlproperty list<Object> Qt.labs.platform::Dialog::data
+
+ This default property holds the list of all objects declared as children of
+ the dialog.
+*/
+QQmlListProperty<QObject> QQuickPlatformDialog::data()
+{
+ return QQmlListProperty<QObject>(this, m_data);
+}
+
+/*!
+ \qmlproperty Window Qt.labs.platform::Dialog::parentWindow
+
+ This property holds the parent window of the dialog.
+
+ Unless explicitly set, the window is automatically resolved by iterating
+ the QML parent objects until a \l Window or an \l Item that has a window
+ is found.
+*/
+QWindow *QQuickPlatformDialog::parentWindow() const
+{
+ return m_parentWindow;
+}
+
+void QQuickPlatformDialog::setParentWindow(QWindow *window)
+{
+ if (m_parentWindow == window)
+ return;
+
+ m_parentWindow = window;
+ emit parentWindowChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::Dialog::title
+
+ This property holds the title of the dialog.
+*/
+QString QQuickPlatformDialog::title() const
+{
+ return m_title;
+}
+
+void QQuickPlatformDialog::setTitle(const QString &title)
+{
+ if (m_title == title)
+ return;
+
+ m_title = title;
+ emit titleChanged();
+}
+
+/*!
+ \qmlproperty Qt::WindowFlags Qt.labs.platform::Dialog::flags
+
+ This property holds the window flags of the dialog. The default value is \c Qt.Dialog.
+*/
+Qt::WindowFlags QQuickPlatformDialog::flags() const
+{
+ return m_flags;
+}
+
+void QQuickPlatformDialog::setFlags(Qt::WindowFlags flags)
+{
+ if (m_flags == flags)
+ return;
+
+ m_flags = flags;
+ emit flagsChanged();
+}
+
+/*!
+ \qmlproperty Qt::WindowModality Qt.labs.platform::Dialog::modality
+
+ This property holds the modality of the dialog. The default value is \c Qt.WindowModal.
+
+ Available values:
+ \value Qt.NonModal The dialog is not modal and does not block input to other windows.
+ \value Qt.WindowModal The dialog is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows.
+ \value Qt.ApplicationModal The dialog is modal to the application and blocks input to all windows.
+*/
+Qt::WindowModality QQuickPlatformDialog::modality() const
+{
+ return m_modality;
+}
+
+void QQuickPlatformDialog::setModality(Qt::WindowModality modality)
+{
+ if (m_modality == modality)
+ return;
+
+ m_modality = modality;
+ emit modalityChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::Dialog::visible
+
+ This property holds the visibility of the dialog. The default value is \c false.
+
+ \sa open(), close()
+*/
+bool QQuickPlatformDialog::isVisible() const
+{
+ return m_handle && m_visible;
+}
+
+void QQuickPlatformDialog::setVisible(bool visible)
+{
+ if (visible)
+ open();
+ else
+ close();
+}
+
+/*!
+ \qmlproperty int Qt.labs.platform::Dialog::result
+
+ This property holds the result code.
+
+ Standard result codes:
+ \value Dialog.Accepted
+ \value Dialog.Rejected
+
+ \note MessageDialog sets the result to the value of the clicked standard
+ button instead of using the standard result codes.
+*/
+int QQuickPlatformDialog::result() const
+{
+ return m_result;
+}
+
+void QQuickPlatformDialog::setResult(int result)
+{
+ if (m_result == result)
+ return;
+
+ m_result = result;
+ emit resultChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Dialog::open()
+
+ Opens the dialog.
+
+ \sa visible, close()
+*/
+void QQuickPlatformDialog::open()
+{
+ if (m_visible || !create())
+ return;
+
+ onShow(m_handle);
+ m_visible = m_handle->show(m_flags, m_modality, m_parentWindow);
+ if (m_visible)
+ emit visibleChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Dialog::close()
+
+ Closes the dialog.
+
+ \sa visible, open()
+*/
+void QQuickPlatformDialog::close()
+{
+ if (!m_handle || !m_visible)
+ return;
+
+ onHide(m_handle);
+ m_handle->hide();
+ m_visible = false;
+ emit visibleChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Dialog::accept()
+
+ Closes the dialog and emits the \l accepted() signal.
+
+ \sa reject()
+*/
+void QQuickPlatformDialog::accept()
+{
+ done(Accepted);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Dialog::reject()
+
+ Closes the dialog and emits the \l rejected() signal.
+
+ \sa accept()
+*/
+void QQuickPlatformDialog::reject()
+{
+ done(Rejected);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Dialog::done(int result)
+
+ Closes the dialog and sets the \a result.
+
+ \sa accept(), reject(), result
+*/
+void QQuickPlatformDialog::done(int result)
+{
+ close();
+ setResult(result);
+
+ if (result == Accepted)
+ emit accepted();
+ else if (result == Rejected)
+ emit rejected();
+}
+
+void QQuickPlatformDialog::classBegin()
+{
+}
+
+void QQuickPlatformDialog::componentComplete()
+{
+ m_complete = true;
+ if (!m_parentWindow)
+ setParentWindow(findParentWindow());
+}
+
+static const char *qmlTypeName(const QObject *object)
+{
+ return object->metaObject()->className() + qstrlen("QQuickPlatform");
+}
+
+bool QQuickPlatformDialog::create()
+{
+ if (!m_handle) {
+ if (useNativeDialog())
+ m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformDialogHelper(m_type);
+ if (!m_handle)
+ m_handle = QWidgetPlatform::createDialog(m_type, this);
+ qCDebug(qtLabsPlatformDialogs) << qmlTypeName(this) << "->" << m_handle;
+ if (m_handle) {
+ onCreate(m_handle);
+ connect(m_handle, &QPlatformDialogHelper::accept, this, &QQuickPlatformDialog::accept);
+ connect(m_handle, &QPlatformDialogHelper::reject, this, &QQuickPlatformDialog::reject);
+ }
+ }
+ return m_handle;
+}
+
+void QQuickPlatformDialog::destroy()
+{
+ delete m_handle;
+ m_handle = nullptr;
+}
+
+bool QQuickPlatformDialog::useNativeDialog() const
+{
+ return !QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
+ && QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(m_type);
+}
+
+void QQuickPlatformDialog::onCreate(QPlatformDialogHelper *dialog)
+{
+ Q_UNUSED(dialog);
+}
+
+void QQuickPlatformDialog::onShow(QPlatformDialogHelper *dialog)
+{
+ Q_UNUSED(dialog);
+}
+
+void QQuickPlatformDialog::onHide(QPlatformDialogHelper *dialog)
+{
+ Q_UNUSED(dialog);
+}
+
+QWindow *QQuickPlatformDialog::findParentWindow() const
+{
+ QObject *obj = parent();
+ while (obj) {
+ QWindow *window = qobject_cast<QWindow *>(obj);
+ if (window)
+ return window;
+ QQuickItem *item = qobject_cast<QQuickItem *>(obj);
+ if (item && item->window())
+ return item->window();
+ obj = obj->parent();
+ }
+ return nullptr;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformdialog_p.h b/src/imports/platform/qquickplatformdialog_p.h
new file mode 100644
index 00000000..a9797c1d
--- /dev/null
+++ b/src/imports/platform/qquickplatformdialog_p.h
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMDIALOG_P_H
+#define QQUICKPLATFORMDIALOG_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 <QtCore/qobject.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/qpa/qplatformdialoghelper.h>
+#include <QtQml/qqmlparserstatus.h>
+#include <QtQml/qqmllist.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+class QPlatformDialogHelper;
+
+class QQuickPlatformDialog : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlParserStatus)
+ Q_PROPERTY(QQmlListProperty<QObject> data READ data FINAL)
+ Q_PROPERTY(QWindow *parentWindow READ parentWindow WRITE setParentWindow NOTIFY parentWindowChanged FINAL)
+ Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
+ Q_PROPERTY(Qt::WindowFlags flags READ flags WRITE setFlags NOTIFY flagsChanged FINAL)
+ Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged FINAL)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
+ Q_PROPERTY(int result READ result WRITE setResult NOTIFY resultChanged FINAL)
+ Q_CLASSINFO("DefaultProperty", "data")
+ Q_ENUMS(StandardCode)
+
+public:
+ explicit QQuickPlatformDialog(QPlatformTheme::DialogType type, QObject *parent = nullptr);
+ ~QQuickPlatformDialog();
+
+ QPlatformDialogHelper *handle() const;
+
+ QQmlListProperty<QObject> data();
+
+ QWindow *parentWindow() const;
+ void setParentWindow(QWindow *window);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+ Qt::WindowFlags flags() const;
+ void setFlags(Qt::WindowFlags flags);
+
+ Qt::WindowModality modality() const;
+ void setModality(Qt::WindowModality modality);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ enum StandardCode { Rejected, Accepted };
+
+ int result() const;
+ void setResult(int result);
+
+public Q_SLOTS:
+ void open();
+ void close();
+ virtual void accept();
+ virtual void reject();
+ virtual void done(int result);
+
+Q_SIGNALS:
+ void accepted();
+ void rejected();
+ void parentWindowChanged();
+ void titleChanged();
+ void flagsChanged();
+ void modalityChanged();
+ void visibleChanged();
+ void resultChanged();
+
+protected:
+ void classBegin() override;
+ void componentComplete() override;
+
+ bool create();
+ void destroy();
+
+ virtual bool useNativeDialog() const;
+ virtual void onCreate(QPlatformDialogHelper *dialog);
+ virtual void onShow(QPlatformDialogHelper *dialog);
+ virtual void onHide(QPlatformDialogHelper *dialog);
+
+ QWindow *findParentWindow() const;
+
+private:
+ bool m_visible;
+ bool m_complete;
+ int m_result;
+ QWindow *m_parentWindow;
+ QString m_title;
+ Qt::WindowFlags m_flags;
+ Qt::WindowModality m_modality;
+ QPlatformTheme::DialogType m_type;
+ QList<QObject *> m_data;
+ QPlatformDialogHelper *m_handle;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformDialog)
+
+#endif // QQUICKPLATFORMDIALOG_P_H
diff --git a/src/imports/platform/qquickplatformfiledialog.cpp b/src/imports/platform/qquickplatformfiledialog.cpp
new file mode 100644
index 00000000..6a0f4e13
--- /dev/null
+++ b/src/imports/platform/qquickplatformfiledialog.cpp
@@ -0,0 +1,660 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformfiledialog_p.h"
+
+#include <QtCore/qvector.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype FileDialog
+ \inherits Dialog
+ \instantiates QQuickPlatformFileDialog
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native file dialog.
+
+ The FileDialog type provides a QML API for native platform file dialogs.
+
+ \image qtlabsplatform-filedialog-gtk.png
+
+ To show a file dialog, construct an instance of FileDialog, set the
+ desired properties, and call \l {Dialog::}{open()}. The \l currentFile
+ or \l currentFiles properties can be used to determine the currently
+ selected file(s) in the dialog. The \l file and \l files properties
+ are updated only after the final selection has been made by accepting
+ the dialog.
+
+ \code
+ MenuItem {
+ text: "Open..."
+ onTriggered: fileDialog.open()
+ }
+
+ FileDialog {
+ id: fileDialog
+ currentFile: document.source
+ folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
+ }
+
+ MyDocument {
+ id: document
+ source: fileDialog.file
+ }
+ \endcode
+
+ \section2 Availability
+
+ A native platform file dialog is currently available on the following platforms:
+
+ \list
+ \li iOS
+ \li Linux (when running with the GTK+ platform theme)
+ \li macOS
+ \li Windows
+ \li WinRT
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+
+ \sa FolderDialog, StandardPaths
+*/
+
+QQuickPlatformFileDialog::QQuickPlatformFileDialog(QObject *parent)
+ : QQuickPlatformDialog(QPlatformTheme::FileDialog, parent),
+ m_fileMode(OpenFile),
+ m_options(QFileDialogOptions::create()),
+ m_selectedNameFilter(nullptr)
+{
+ m_options->setFileMode(QFileDialogOptions::ExistingFile);
+ m_options->setAcceptMode(QFileDialogOptions::AcceptOpen);
+}
+
+/*!
+ \qmlproperty enumeration Qt.labs.platform::FileDialog::fileMode
+
+ This property holds the mode of the dialog.
+
+ Available values:
+ \value FileDialog.OpenFile The dialog is used to select an existing file (default).
+ \value FileDialog.OpenFiles The dialog is used to select multiple existing files.
+ \value FileDialog.SaveFile The dialog is used to select any file. The file does not have to exist.
+*/
+QQuickPlatformFileDialog::FileMode QQuickPlatformFileDialog::fileMode() const
+{
+ return m_fileMode;
+}
+
+void QQuickPlatformFileDialog::setFileMode(FileMode mode)
+{
+ if (mode == m_fileMode)
+ return;
+
+ switch (mode) {
+ case OpenFile:
+ m_options->setFileMode(QFileDialogOptions::ExistingFile);
+ m_options->setAcceptMode(QFileDialogOptions::AcceptOpen);
+ break;
+ case OpenFiles:
+ m_options->setFileMode(QFileDialogOptions::ExistingFiles);
+ m_options->setAcceptMode(QFileDialogOptions::AcceptOpen);
+ break;
+ case SaveFile:
+ m_options->setFileMode(QFileDialogOptions::AnyFile);
+ m_options->setAcceptMode(QFileDialogOptions::AcceptSave);
+ break;
+ default:
+ break;
+ }
+
+ m_fileMode = mode;
+ emit fileModeChanged();
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::FileDialog::file
+
+ This property holds the final accepted file.
+
+ Unlike the \l currentFile property, the \c file property is not updated
+ while the user is selecting files in the dialog, but only after the final
+ selection has been made. That is, when the user has clicked \uicontrol OK
+ to accept a file. Alternatively, the \l {Dialog::}{accepted()} signal
+ can be handled to get the final selection.
+
+ \sa currentFile, {Dialog::}{accepted()}
+*/
+QUrl QQuickPlatformFileDialog::file() const
+{
+ return addDefaultSuffix(m_files.value(0));
+}
+
+void QQuickPlatformFileDialog::setFile(const QUrl &file)
+{
+ setFiles(QList<QUrl>() << file);
+}
+
+/*!
+ \qmlproperty list<url> Qt.labs.platform::FileDialog::files
+
+ This property holds the final accepted files.
+
+ Unlike the \l currentFiles property, the \c files property is not updated
+ while the user is selecting files in the dialog, but only after the final
+ selection has been made. That is, when the user has clicked \uicontrol OK
+ to accept files. Alternatively, the \l {Dialog::}{accepted()} signal
+ can be handled to get the final selection.
+
+ \sa currentFiles, {Dialog::}{accepted()}
+*/
+QList<QUrl> QQuickPlatformFileDialog::files() const
+{
+ return addDefaultSuffixes(m_files);
+}
+
+void QQuickPlatformFileDialog::setFiles(const QList<QUrl> &files)
+{
+ if (m_files == files)
+ return;
+
+ bool firstChanged = m_files.value(0) != files.value(0);
+ m_files = files;
+ if (firstChanged)
+ emit fileChanged();
+ emit filesChanged();
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::FileDialog::currentFile
+
+ This property holds the currently selected file in the dialog.
+
+ Unlike the \l file property, the \c currentFile property is updated
+ while the user is selecting files in the dialog, even before the final
+ selection has been made.
+
+ \sa file, currentFiles
+*/
+QUrl QQuickPlatformFileDialog::currentFile() const
+{
+ return currentFiles().value(0);
+}
+
+void QQuickPlatformFileDialog::setCurrentFile(const QUrl &file)
+{
+ setCurrentFiles(QList<QUrl>() << file);
+}
+
+/*!
+ \qmlproperty list<url> Qt.labs.platform::FileDialog::currentFiles
+
+ This property holds the currently selected files in the dialog.
+
+ Unlike the \l files property, the \c currentFiles property is updated
+ while the user is selecting files in the dialog, even before the final
+ selection has been made.
+
+ \sa files, currentFile
+*/
+QList<QUrl> QQuickPlatformFileDialog::currentFiles() const
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle()))
+ return fileDialog->selectedFiles();
+ return m_options->initiallySelectedFiles();
+}
+
+void QQuickPlatformFileDialog::setCurrentFiles(const QList<QUrl> &files)
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle())) {
+ for (const QUrl &file : files)
+ fileDialog->selectFile(file);
+ }
+ m_options->setInitiallySelectedFiles(files);
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::FileDialog::folder
+
+ This property holds the folder where files are selected.
+ For selecting a folder, use FolderDialog instead.
+
+ \sa FolderDialog
+*/
+QUrl QQuickPlatformFileDialog::folder() const
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle()))
+ return fileDialog->directory();
+ return m_options->initialDirectory();
+}
+
+void QQuickPlatformFileDialog::setFolder(const QUrl &folder)
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle()))
+ fileDialog->setDirectory(folder);
+ m_options->setInitialDirectory(folder);
+}
+
+/*!
+ \qmlproperty flags Qt.labs.platform::FileDialog::options
+
+ This property holds the various options that affect the look and feel of the dialog.
+
+ By default, all options are disabled.
+
+ Options should be set before showing the dialog. Setting them while the dialog is
+ visible is not guaranteed to have an immediate effect on the dialog (depending on
+ the option and on the platform).
+
+ Available options:
+ \value FileDialog.DontResolveSymlinks Don't resolve symlinks in the file dialog. By default symlinks are resolved.
+ \value FileDialog.DontConfirmOverwrite Don't ask for confirmation if an existing file is selected. By default confirmation is requested.
+ \value FileDialog.ReadOnly Indicates that the dialog doesn't allow creating directories.
+ \value FileDialog.HideNameFilterDetails Indicates if the file name filter details are hidden or not.
+*/
+QFileDialogOptions::FileDialogOptions QQuickPlatformFileDialog::options() const
+{
+ return m_options->options();
+}
+
+void QQuickPlatformFileDialog::setOptions(QFileDialogOptions::FileDialogOptions options)
+{
+ if (options == m_options->options())
+ return;
+
+ m_options->setOptions(options);
+ emit optionsChanged();
+}
+
+void QQuickPlatformFileDialog::resetOptions()
+{
+ setOptions(0);
+}
+
+/*!
+ \qmlproperty list<string> Qt.labs.platform::FileDialog::nameFilters
+
+ This property holds the filters that restrict the types of files that
+ can be selected.
+
+ \code
+ FileDialog {
+ nameFilters: ["Text files (*.txt)", "HTML files (*.html *.htm)"]
+ }
+ \endcode
+
+ \note \b{*.*} is not a portable filter, because the historical assumption
+ that the file extension determines the file type is not consistent on every
+ operating system. It is possible to have a file with no dot in its name (for
+ example, \c Makefile). In a native Windows file dialog, \b{*.*} will match
+ such files, while in other types of file dialogs it may not. So it is better
+ to use \b{*} if you mean to select any file.
+
+ \sa selectedNameFilter
+*/
+QStringList QQuickPlatformFileDialog::nameFilters() const
+{
+ return m_options->nameFilters();
+}
+
+void QQuickPlatformFileDialog::setNameFilters(const QStringList &filters)
+{
+ if (filters == m_options->nameFilters())
+ return;
+
+ m_options->setNameFilters(filters);
+ if (m_selectedNameFilter) {
+ int index = m_selectedNameFilter->index();
+ if (index < 0 || index >= filters.count())
+ index = 0;
+ m_selectedNameFilter->update(filters.value(index));
+ }
+ emit nameFiltersChanged();
+}
+
+void QQuickPlatformFileDialog::resetNameFilters()
+{
+ setNameFilters(QStringList());
+}
+
+/*!
+ \qmlpropertygroup Qt.labs.platform::FileDialog::selectedNameFilter
+ \qmlproperty int Qt.labs.platform::FileDialog::selectedNameFilter.index
+ \qmlproperty string Qt.labs.platform::FileDialog::selectedNameFilter.name
+ \qmlproperty list<string> Qt.labs.platform::FileDialog::selectedNameFilter.extensions
+
+ These properties hold the currently selected name filter.
+
+ \table
+ \header
+ \li Name
+ \li Description
+ \row
+ \li \b index : int
+ \li This property determines which \l {nameFilters}{name filter} is selected.
+ The specified filter is selected when the dialog is opened. The value is
+ updated when the user selects another filter.
+ \row
+ \li [read-only] \b name : string
+ \li This property holds the name of the selected filter. In the
+ example below, the name of the first filter is \c {"Text files"}
+ and the second is \c {"HTML files"}.
+ \row
+ \li [read-only] \b extensions : list<string>
+ \li This property holds the list of extensions of the selected filter.
+ In the example below, the list of extensions of the first filter is
+ \c {["txt"]} and the second is \c {["html", "htm"]}.
+ \endtable
+
+ \code
+ FileDialog {
+ id: fileDialog
+ selectedNameFilter.index: 1
+ nameFilters: ["Text files (*.txt)", "HTML files (*.html *.htm)"]
+ }
+
+ MyDocument {
+ id: document
+ fileType: fileDialog.selectedNameFilter.extensions[0]
+ }
+ \endcode
+
+ \sa nameFilters
+*/
+QQuickPlatformFileNameFilter *QQuickPlatformFileDialog::selectedNameFilter() const
+{
+ if (!m_selectedNameFilter) {
+ QQuickPlatformFileDialog *that = const_cast<QQuickPlatformFileDialog *>(this);
+ m_selectedNameFilter = new QQuickPlatformFileNameFilter(that);
+ m_selectedNameFilter->setOptions(m_options);
+ }
+ return m_selectedNameFilter;
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::FileDialog::defaultSuffix
+
+ This property holds a suffix that is added to selected files that have
+ no suffix specified. The suffix is typically used to indicate the file
+ type (e.g. "txt" indicates a text file).
+
+ If the first character is a dot ('.'), it is removed.
+*/
+QString QQuickPlatformFileDialog::defaultSuffix() const
+{
+ return m_options->defaultSuffix();
+}
+
+void QQuickPlatformFileDialog::setDefaultSuffix(const QString &suffix)
+{
+ if (suffix == m_options->defaultSuffix())
+ return;
+
+ m_options->setDefaultSuffix(suffix);
+ emit defaultSuffixChanged();
+}
+
+void QQuickPlatformFileDialog::resetDefaultSuffix()
+{
+ setDefaultSuffix(QString());
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::FileDialog::acceptLabel
+
+ This property holds the label text shown on the button that accepts the dialog.
+
+ When set to an empty string, the default label of the underlying platform is used.
+ The default label is typically \uicontrol Open or \uicontrol Save depending on which
+ \l fileMode the dialog is used in.
+
+ The default value is an empty string.
+
+ \sa rejectLabel
+*/
+QString QQuickPlatformFileDialog::acceptLabel() const
+{
+ return m_options->labelText(QFileDialogOptions::Accept);
+}
+
+void QQuickPlatformFileDialog::setAcceptLabel(const QString &label)
+{
+ if (label == m_options->labelText(QFileDialogOptions::Accept))
+ return;
+
+ m_options->setLabelText(QFileDialogOptions::Accept, label);
+ emit acceptLabelChanged();
+}
+
+void QQuickPlatformFileDialog::resetAcceptLabel()
+{
+ setAcceptLabel(QString());
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::FileDialog::rejectLabel
+
+ This property holds the label text shown on the button that rejects the dialog.
+
+ When set to an empty string, the default label of the underlying platform is used.
+ The default label is typically \uicontrol Cancel.
+
+ The default value is an empty string.
+
+ \sa acceptLabel
+*/
+QString QQuickPlatformFileDialog::rejectLabel() const
+{
+ return m_options->labelText(QFileDialogOptions::Reject);
+}
+
+void QQuickPlatformFileDialog::setRejectLabel(const QString &label)
+{
+ if (label == m_options->labelText(QFileDialogOptions::Reject))
+ return;
+
+ m_options->setLabelText(QFileDialogOptions::Reject, label);
+ emit rejectLabelChanged();
+}
+
+void QQuickPlatformFileDialog::resetRejectLabel()
+{
+ setRejectLabel(QString());
+}
+
+bool QQuickPlatformFileDialog::useNativeDialog() const
+{
+ return QQuickPlatformDialog::useNativeDialog()
+ && !m_options->testOption(QFileDialogOptions::DontUseNativeDialog);
+}
+
+void QQuickPlatformFileDialog::onCreate(QPlatformDialogHelper *dialog)
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(dialog)) {
+ // TODO: emit currentFileChanged only when the first entry in currentFiles changes
+ connect(fileDialog, &QPlatformFileDialogHelper::currentChanged, this, &QQuickPlatformFileDialog::currentFileChanged);
+ connect(fileDialog, &QPlatformFileDialogHelper::currentChanged, this, &QQuickPlatformFileDialog::currentFilesChanged);
+ connect(fileDialog, &QPlatformFileDialogHelper::directoryEntered, this, &QQuickPlatformFileDialog::folderChanged);
+ fileDialog->setOptions(m_options);
+ }
+}
+
+void QQuickPlatformFileDialog::onShow(QPlatformDialogHelper *dialog)
+{
+ m_options->setWindowTitle(title());
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(dialog)) {
+ fileDialog->setOptions(m_options);
+ if (m_selectedNameFilter) {
+ const int index = m_selectedNameFilter->index();
+ const QString filter = m_options->nameFilters().value(index);
+ m_options->setInitiallySelectedNameFilter(filter);
+ fileDialog->selectNameFilter(filter);
+ connect(fileDialog, &QPlatformFileDialogHelper::filterSelected, m_selectedNameFilter, &QQuickPlatformFileNameFilter::update);
+ }
+ }
+}
+
+void QQuickPlatformFileDialog::onHide(QPlatformDialogHelper *dialog)
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(dialog)) {
+ if (m_selectedNameFilter)
+ disconnect(fileDialog, &QPlatformFileDialogHelper::filterSelected, m_selectedNameFilter, &QQuickPlatformFileNameFilter::update);
+ }
+}
+
+void QQuickPlatformFileDialog::accept()
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle()))
+ setFiles(fileDialog->selectedFiles());
+ QQuickPlatformDialog::accept();
+}
+
+QUrl QQuickPlatformFileDialog::addDefaultSuffix(const QUrl &file) const
+{
+ QUrl url = file;
+ const QString path = url.path();
+ const QString suffix = m_options->defaultSuffix();
+ if (!suffix.isEmpty() && !path.endsWith(QLatin1Char('/')) && path.lastIndexOf(QLatin1Char('.')) == -1)
+ url.setPath(path + QLatin1Char('.') + suffix);
+ return url;
+}
+
+QList<QUrl> QQuickPlatformFileDialog::addDefaultSuffixes(const QList<QUrl> &files) const
+{
+ QList<QUrl> urls;
+ urls.reserve(files.size());
+ for (const QUrl &file : files)
+ urls += addDefaultSuffix(file);
+ return urls;
+}
+
+QQuickPlatformFileNameFilter::QQuickPlatformFileNameFilter(QObject *parent)
+ : QObject(parent), m_index(-1)
+{
+}
+
+int QQuickPlatformFileNameFilter::index() const
+{
+ return m_index;
+}
+
+void QQuickPlatformFileNameFilter::setIndex(int index)
+{
+ if (m_index == index)
+ return;
+
+ m_index = index;
+ emit indexChanged(index);
+}
+
+QString QQuickPlatformFileNameFilter::name() const
+{
+ return m_name;
+}
+
+QStringList QQuickPlatformFileNameFilter::extensions() const
+{
+ return m_extensions;
+}
+
+QSharedPointer<QFileDialogOptions> QQuickPlatformFileNameFilter::options() const
+{
+ return m_options;
+}
+
+void QQuickPlatformFileNameFilter::setOptions(const QSharedPointer<QFileDialogOptions> &options)
+{
+ m_options = options;
+}
+
+static QString extractName(const QString &filter)
+{
+ return filter.left(filter.indexOf(QLatin1Char('(')) - 1);
+}
+
+static QString extractExtension(const QString &filter)
+{
+ return filter.mid(filter.indexOf(QLatin1Char('.')) + 1);
+}
+
+static QStringList extractExtensions(const QString &filter)
+{
+ QStringList extensions;
+ const int from = filter.indexOf(QLatin1Char('('));
+ const int to = filter.lastIndexOf(QLatin1Char(')')) - 1;
+ if (from >= 0 && from < to) {
+ const QStringRef ref = filter.midRef(from + 1, to - from);
+ const QVector<QStringRef> exts = ref.split(QLatin1Char(' '), QString::SkipEmptyParts);
+ for (const QStringRef &ref : exts)
+ extensions += extractExtension(ref.toString());
+ }
+
+ return extensions;
+}
+
+void QQuickPlatformFileNameFilter::update(const QString &filter)
+{
+ const QStringList filters = nameFilters();
+
+ const int oldIndex = m_index;
+ const QString oldName = m_name;
+ const QStringList oldExtensions = m_extensions;
+
+ m_index = filters.indexOf(filter);
+ m_name = extractName(filter);
+ m_extensions = extractExtensions(filter);
+
+ if (oldIndex != m_index)
+ emit indexChanged(m_index);
+ if (oldName != m_name)
+ emit nameChanged(m_name);
+ if (oldExtensions != m_extensions)
+ emit extensionsChanged(m_extensions);
+}
+
+QStringList QQuickPlatformFileNameFilter::nameFilters() const
+{
+ return m_options ? m_options->nameFilters() : QStringList();
+}
+
+QString QQuickPlatformFileNameFilter::nameFilter(int index) const
+{
+ return m_options ? m_options->nameFilters().value(index) : QString();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformfiledialog_p.h b/src/imports/platform/qquickplatformfiledialog_p.h
new file mode 100644
index 00000000..51f88d46
--- /dev/null
+++ b/src/imports/platform/qquickplatformfiledialog_p.h
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMFILEDIALOG_P_H
+#define QQUICKPLATFORMFILEDIALOG_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 "qquickplatformdialog_p.h"
+#include <QtCore/qurl.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformFileNameFilter;
+
+class QQuickPlatformFileDialog : public QQuickPlatformDialog
+{
+ Q_OBJECT
+ Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode NOTIFY fileModeChanged FINAL)
+ Q_PROPERTY(QUrl file READ file WRITE setFile NOTIFY fileChanged FINAL)
+ Q_PROPERTY(QList<QUrl> files READ files WRITE setFiles NOTIFY filesChanged FINAL)
+ Q_PROPERTY(QUrl currentFile READ currentFile WRITE setCurrentFile NOTIFY currentFileChanged FINAL)
+ Q_PROPERTY(QList<QUrl> currentFiles READ currentFiles WRITE setCurrentFiles NOTIFY currentFilesChanged FINAL)
+ Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged FINAL)
+ Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
+ Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters RESET resetNameFilters NOTIFY nameFiltersChanged FINAL)
+ Q_PROPERTY(QQuickPlatformFileNameFilter *selectedNameFilter READ selectedNameFilter CONSTANT)
+ Q_PROPERTY(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix RESET resetDefaultSuffix NOTIFY defaultSuffixChanged FINAL)
+ Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
+ Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
+ Q_FLAGS(QFileDialogOptions::FileDialogOptions)
+
+public:
+ explicit QQuickPlatformFileDialog(QObject *parent = nullptr);
+
+ enum FileMode {
+ OpenFile,
+ OpenFiles,
+ SaveFile
+ };
+ Q_ENUM(FileMode)
+
+ FileMode fileMode() const;
+ void setFileMode(FileMode fileMode);
+
+ QUrl file() const;
+ void setFile(const QUrl &file);
+
+ QList<QUrl> files() const;
+ void setFiles(const QList<QUrl> &files);
+
+ QUrl currentFile() const;
+ void setCurrentFile(const QUrl &file);
+
+ QList<QUrl> currentFiles() const;
+ void setCurrentFiles(const QList<QUrl> &files);
+
+ QUrl folder() const;
+ void setFolder(const QUrl &folder);
+
+ QFileDialogOptions::FileDialogOptions options() const;
+ void setOptions(QFileDialogOptions::FileDialogOptions options);
+ void resetOptions();
+
+ QStringList nameFilters() const;
+ void setNameFilters(const QStringList &filters);
+ void resetNameFilters();
+
+ QQuickPlatformFileNameFilter *selectedNameFilter() const;
+
+ QString defaultSuffix() const;
+ void setDefaultSuffix(const QString &suffix);
+ void resetDefaultSuffix();
+
+ QString acceptLabel() const;
+ void setAcceptLabel(const QString &label);
+ void resetAcceptLabel();
+
+ QString rejectLabel() const;
+ void setRejectLabel(const QString &label);
+ void resetRejectLabel();
+
+Q_SIGNALS:
+ void fileModeChanged();
+ void fileChanged();
+ void filesChanged();
+ void currentFileChanged();
+ void currentFilesChanged();
+ void folderChanged();
+ void optionsChanged();
+ void nameFiltersChanged();
+ void defaultSuffixChanged();
+ void acceptLabelChanged();
+ void rejectLabelChanged();
+
+protected:
+ bool useNativeDialog() const override;
+ void onCreate(QPlatformDialogHelper *dialog) override;
+ void onShow(QPlatformDialogHelper *dialog) override;
+ void onHide(QPlatformDialogHelper *dialog) override;
+ void accept() override;
+
+private:
+ QUrl addDefaultSuffix(const QUrl &file) const;
+ QList<QUrl> addDefaultSuffixes(const QList<QUrl> &files) const;
+
+ FileMode m_fileMode;
+ QList<QUrl> m_files;
+ QSharedPointer<QFileDialogOptions> m_options;
+ mutable QQuickPlatformFileNameFilter *m_selectedNameFilter;
+};
+
+class QQuickPlatformFileNameFilter : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int index READ index WRITE setIndex NOTIFY indexChanged FINAL)
+ Q_PROPERTY(QString name READ name NOTIFY nameChanged FINAL)
+ Q_PROPERTY(QStringList extensions READ extensions NOTIFY extensionsChanged FINAL)
+
+public:
+ explicit QQuickPlatformFileNameFilter(QObject *parent = nullptr);
+
+ int index() const;
+ void setIndex(int index);
+
+ QString name() const;
+ QStringList extensions() const;
+
+ QSharedPointer<QFileDialogOptions> options() const;
+ void setOptions(const QSharedPointer<QFileDialogOptions> &options);
+
+ void update(const QString &filter);
+
+Q_SIGNALS:
+ void indexChanged(int index);
+ void nameChanged(const QString &name);
+ void extensionsChanged(const QStringList &extensions);
+
+private:
+ QStringList nameFilters() const;
+ QString nameFilter(int index) const;
+
+ int m_index;
+ QString m_name;
+ QStringList m_extensions;
+ QSharedPointer<QFileDialogOptions> m_options;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformFileDialog)
+
+#endif // QQUICKPLATFORMFILEDIALOG_P_H
diff --git a/src/imports/platform/qquickplatformfolderdialog.cpp b/src/imports/platform/qquickplatformfolderdialog.cpp
new file mode 100644
index 00000000..c56658c4
--- /dev/null
+++ b/src/imports/platform/qquickplatformfolderdialog.cpp
@@ -0,0 +1,281 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformfolderdialog_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype FolderDialog
+ \inherits Dialog
+ \instantiates QQuickPlatformFolderDialog
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native folder dialog.
+
+ The FolderDialog type provides a QML API for native platform folder dialogs.
+
+ \image qtlabsplatform-folderdialog-gtk.png
+
+ To show a folder dialog, construct an instance of FolderDialog, set the
+ desired properties, and call \l {Dialog::}{open()}. The \l currentFolder
+ property can be used to determine the currently selected folder in the
+ dialog. The \l folder property is updated only after the final selection
+ has been made by accepting the dialog.
+
+ \code
+ MenuItem {
+ text: "Open..."
+ onTriggered: folderDialog.open()
+ }
+
+ FolderDialog {
+ id: folderDialog
+ currentFolder: viewer.folder
+ folder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0]
+ }
+
+ MyViewer {
+ id: viewer
+ folder: folderDialog.folder
+ }
+ \endcode
+
+ \section2 Availability
+
+ A native platform folder dialog is currently available on the following platforms:
+
+ \list
+ \li iOS
+ \li Linux (when running with the GTK+ platform theme)
+ \li macOS
+ \li Windows
+ \li WinRT
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+
+ \sa FileDialog, StandardPaths
+*/
+
+QQuickPlatformFolderDialog::QQuickPlatformFolderDialog(QObject *parent)
+ : QQuickPlatformDialog(QPlatformTheme::FileDialog, parent),
+ m_options(QFileDialogOptions::create())
+{
+ m_options->setFileMode(QFileDialogOptions::Directory);
+ m_options->setAcceptMode(QFileDialogOptions::AcceptOpen);
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::FolderDialog::folder
+
+ This property holds the final accepted folder.
+
+ Unlike the \l currentFolder property, the \c folder property is not updated
+ while the user is selecting folders in the dialog, but only after the final
+ selection has been made. That is, when the user has clicked \uicontrol OK
+ to accept a folder. Alternatively, the \l {Dialog::}{accepted()} signal
+ can be handled to get the final selection.
+
+ \sa currentFolder, {Dialog::}{accepted()}
+*/
+QUrl QQuickPlatformFolderDialog::folder() const
+{
+ return m_folder;
+}
+
+void QQuickPlatformFolderDialog::setFolder(const QUrl &folder)
+{
+ if (m_folder == folder)
+ return;
+
+ m_folder = folder;
+ setCurrentFolder(folder);
+ emit folderChanged();
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::FolderDialog::currentFolder
+
+ This property holds the currently selected folder in the dialog.
+
+ Unlike the \l folder property, the \c currentFolder property is updated
+ while the user is selecting folders in the dialog, even before the final
+ selection has been made.
+
+ \sa folder
+*/
+QUrl QQuickPlatformFolderDialog::currentFolder() const
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle()))
+ return fileDialog->directory();
+ return m_options->initialDirectory();
+}
+
+void QQuickPlatformFolderDialog::setCurrentFolder(const QUrl &folder)
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(handle()))
+ fileDialog->setDirectory(folder);
+ m_options->setInitialDirectory(folder);
+}
+
+/*!
+ \qmlproperty flags Qt.labs.platform::FolderDialog::options
+
+ This property holds the various options that affect the look and feel of the dialog.
+
+ By default, all options are disabled.
+
+ Options should be set before showing the dialog. Setting them while the dialog is
+ visible is not guaranteed to have an immediate effect on the dialog (depending on
+ the option and on the platform).
+
+ Available options:
+ \value FolderDialog.ShowDirsOnly Only show directories in the folder dialog. By default both folders and directories are shown.
+ \value FolderDialog.DontResolveSymlinks Don't resolve symlinks in the folder dialog. By default symlinks are resolved.
+ \value FolderDialog.ReadOnly Indicates that the dialog doesn't allow creating directories.
+*/
+QFileDialogOptions::FileDialogOptions QQuickPlatformFolderDialog::options() const
+{
+ return m_options->options();
+}
+
+void QQuickPlatformFolderDialog::setOptions(QFileDialogOptions::FileDialogOptions options)
+{
+ if (options == m_options->options())
+ return;
+
+ m_options->setOptions(options);
+ emit optionsChanged();
+}
+
+void QQuickPlatformFolderDialog::resetOptions()
+{
+ setOptions(0);
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::FolderDialog::acceptLabel
+
+ This property holds the label text shown on the button that accepts the dialog.
+
+ When set to an empty string, the default label of the underlying platform is used.
+ The default label is typically \uicontrol Open.
+
+ The default value is an empty string.
+
+ \sa rejectLabel
+*/
+QString QQuickPlatformFolderDialog::acceptLabel() const
+{
+ return m_options->labelText(QFileDialogOptions::Accept);
+}
+
+void QQuickPlatformFolderDialog::setAcceptLabel(const QString &label)
+{
+ if (label == m_options->labelText(QFileDialogOptions::Accept))
+ return;
+
+ m_options->setLabelText(QFileDialogOptions::Accept, label);
+ emit acceptLabelChanged();
+}
+
+void QQuickPlatformFolderDialog::resetAcceptLabel()
+{
+ setAcceptLabel(QString());
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::FolderDialog::rejectLabel
+
+ This property holds the label text shown on the button that rejects the dialog.
+
+ When set to an empty string, the default label of the underlying platform is used.
+ The default label is typically \uicontrol Cancel.
+
+ The default value is an empty string.
+
+ \sa acceptLabel
+*/
+QString QQuickPlatformFolderDialog::rejectLabel() const
+{
+ return m_options->labelText(QFileDialogOptions::Reject);
+}
+
+void QQuickPlatformFolderDialog::setRejectLabel(const QString &label)
+{
+ if (label == m_options->labelText(QFileDialogOptions::Reject))
+ return;
+
+ m_options->setLabelText(QFileDialogOptions::Reject, label);
+ emit rejectLabelChanged();
+}
+
+void QQuickPlatformFolderDialog::resetRejectLabel()
+{
+ setRejectLabel(QString());
+}
+
+bool QQuickPlatformFolderDialog::useNativeDialog() const
+{
+ return QQuickPlatformDialog::useNativeDialog()
+ && !m_options->testOption(QFileDialogOptions::DontUseNativeDialog);
+}
+
+void QQuickPlatformFolderDialog::onCreate(QPlatformDialogHelper *dialog)
+{
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(dialog)) {
+ connect(fileDialog, &QPlatformFileDialogHelper::directoryEntered, this, &QQuickPlatformFolderDialog::currentFolderChanged);
+ fileDialog->setOptions(m_options);
+ }
+}
+
+void QQuickPlatformFolderDialog::onShow(QPlatformDialogHelper *dialog)
+{
+ m_options->setWindowTitle(title());
+ if (QPlatformFileDialogHelper *fileDialog = qobject_cast<QPlatformFileDialogHelper *>(dialog))
+ fileDialog->setOptions(m_options);
+}
+
+void QQuickPlatformFolderDialog::accept()
+{
+ setFolder(currentFolder());
+ QQuickPlatformDialog::accept();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformfolderdialog_p.h b/src/imports/platform/qquickplatformfolderdialog_p.h
new file mode 100644
index 00000000..d9ecd1fb
--- /dev/null
+++ b/src/imports/platform/qquickplatformfolderdialog_p.h
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMFOLDERDIALOG_P_H
+#define QQUICKPLATFORMFOLDERDIALOG_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This folder is not part of the Qt API. It exists purely as an
+// implementation detail. This header folder may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include "qquickplatformdialog_p.h"
+#include <QtCore/qurl.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformFolderDialog : public QQuickPlatformDialog
+{
+ Q_OBJECT
+ Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged FINAL)
+ Q_PROPERTY(QUrl currentFolder READ currentFolder WRITE setCurrentFolder NOTIFY currentFolderChanged FINAL)
+ Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
+ Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
+ Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
+ Q_FLAGS(QFileDialogOptions::FileDialogOptions)
+
+public:
+ explicit QQuickPlatformFolderDialog(QObject *parent = nullptr);
+
+ QUrl folder() const;
+ void setFolder(const QUrl &folder);
+
+ QUrl currentFolder() const;
+ void setCurrentFolder(const QUrl &folder);
+
+ QFileDialogOptions::FileDialogOptions options() const;
+ void setOptions(QFileDialogOptions::FileDialogOptions options);
+ void resetOptions();
+
+ QString acceptLabel() const;
+ void setAcceptLabel(const QString &label);
+ void resetAcceptLabel();
+
+ QString rejectLabel() const;
+ void setRejectLabel(const QString &label);
+ void resetRejectLabel();
+
+Q_SIGNALS:
+ void folderChanged();
+ void currentFolderChanged();
+ void optionsChanged();
+ void acceptLabelChanged();
+ void rejectLabelChanged();
+
+protected:
+ bool useNativeDialog() const override;
+ void onCreate(QPlatformDialogHelper *dialog) override;
+ void onShow(QPlatformDialogHelper *dialog) override;
+ void accept() override;
+
+private:
+ QUrl m_folder;
+ QSharedPointer<QFileDialogOptions> m_options;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformFolderDialog)
+
+#endif // QQUICKPLATFORMFOLDERDIALOG_P_H
diff --git a/src/imports/platform/qquickplatformfontdialog.cpp b/src/imports/platform/qquickplatformfontdialog.cpp
new file mode 100644
index 00000000..edefe645
--- /dev/null
+++ b/src/imports/platform/qquickplatformfontdialog.cpp
@@ -0,0 +1,208 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformfontdialog_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype FontDialog
+ \inherits Dialog
+ \instantiates QQuickPlatformFontDialog
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native font dialog.
+
+ The FontDialog type provides a QML API for native platform font dialogs.
+
+ \image qtlabsplatform-fontdialog-gtk.png
+
+ To show a font dialog, construct an instance of FontDialog, set the
+ desired properties, and call \l {Dialog::}{open()}. The \l currentFont
+ property can be used to determine the currently selected font in the
+ dialog. The \l font property is updated only after the final selection
+ has been made by accepting the dialog.
+
+ \code
+ MenuItem {
+ text: "Font"
+ onTriggered: fontDialog.open()
+ }
+
+ FontDialog {
+ id: fontDialog
+ currentFont.family: document.font
+ }
+
+ MyDocument {
+ id: document
+ font: fontDialog.font
+ }
+ \endcode
+
+ \section2 Availability
+
+ A native platform font dialog is currently available on the following platforms:
+
+ \list
+ \li macOS
+ \li Linux (when running with the GTK+ platform theme)
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+*/
+
+QQuickPlatformFontDialog::QQuickPlatformFontDialog(QObject *parent)
+ : QQuickPlatformDialog(QPlatformTheme::FontDialog, parent),
+ m_options(QFontDialogOptions::create())
+{
+}
+
+/*!
+ \qmlproperty font Qt.labs.platform::FontDialog::font
+
+ This property holds the final accepted font.
+
+ Unlike the \l currentFont property, the \c font property is not updated
+ while the user is selecting fonts in the dialog, but only after the final
+ selection has been made. That is, when the user has clicked \uicontrol OK
+ to accept a font. Alternatively, the \l {Dialog::}{accepted()} signal
+ can be handled to get the final selection.
+
+ \sa currentFont, {Dialog::}{accepted()}
+*/
+QFont QQuickPlatformFontDialog::font() const
+{
+ return m_font;
+}
+
+void QQuickPlatformFontDialog::setFont(const QFont &font)
+{
+ if (m_font == font)
+ return;
+
+ m_font = font;
+ setCurrentFont(font);
+ emit fontChanged();
+}
+
+/*!
+ \qmlproperty font Qt.labs.platform::FontDialog::currentFont
+
+ This property holds the currently selected font in the dialog.
+
+ Unlike the \l font property, the \c currentFont property is updated
+ while the user is selecting fonts in the dialog, even before the final
+ selection has been made.
+
+ \sa font
+*/
+QFont QQuickPlatformFontDialog::currentFont() const
+{
+ if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(handle()))
+ return fontDialog->currentFont();
+ return m_currentFont;
+}
+
+void QQuickPlatformFontDialog::setCurrentFont(const QFont &font)
+{
+ if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(handle()))
+ fontDialog->setCurrentFont(font);
+ m_currentFont = font;
+}
+
+/*!
+ \qmlproperty flags Qt.labs.platform::FontDialog::options
+
+ This property holds the various options that affect the look and feel of the dialog.
+
+ By default, all options are disabled.
+
+ Options should be set before showing the dialog. Setting them while the dialog is
+ visible is not guaranteed to have an immediate effect on the dialog (depending on
+ the option and on the platform).
+
+ Available options:
+ \value FontDialog.ScalableFonts Show scalable fonts.
+ \value FontDialog.NonScalableFonts Show non-scalable fonts.
+ \value FontDialog.MonospacedFonts Show monospaced fonts.
+ \value FontDialog.ProportionalFonts Show proportional fonts.
+ \value FontDialog.NoButtons Don't display \uicontrol OK and \uicontrol Cancel buttons (useful for "live dialogs").
+*/
+QFontDialogOptions::FontDialogOptions QQuickPlatformFontDialog::options() const
+{
+ return m_options->options();
+}
+
+void QQuickPlatformFontDialog::setOptions(QFontDialogOptions::FontDialogOptions options)
+{
+ if (options == m_options->options())
+ return;
+
+ m_options->setOptions(options);
+ emit optionsChanged();
+}
+
+bool QQuickPlatformFontDialog::useNativeDialog() const
+{
+ return QQuickPlatformDialog::useNativeDialog()
+ && !m_options->testOption(QFontDialogOptions::DontUseNativeDialog);
+}
+
+void QQuickPlatformFontDialog::onCreate(QPlatformDialogHelper *dialog)
+{
+ if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(dialog)) {
+ connect(fontDialog, &QPlatformFontDialogHelper::currentFontChanged, this, &QQuickPlatformFontDialog::currentFontChanged);
+ fontDialog->setOptions(m_options);
+ }
+}
+
+void QQuickPlatformFontDialog::onShow(QPlatformDialogHelper *dialog)
+{
+ m_options->setWindowTitle(title());
+ if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(dialog))
+ fontDialog->setOptions(m_options);
+}
+
+void QQuickPlatformFontDialog::accept()
+{
+ setFont(currentFont());
+ QQuickPlatformDialog::accept();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformfontdialog_p.h b/src/imports/platform/qquickplatformfontdialog_p.h
new file mode 100644
index 00000000..c0704610
--- /dev/null
+++ b/src/imports/platform/qquickplatformfontdialog_p.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.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 "qquickplatformdialog_p.h"
+#include <QtGui/qfont.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformFontDialog : public QQuickPlatformDialog
+{
+ Q_OBJECT
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
+ Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged FINAL)
+ Q_PROPERTY(QFontDialogOptions::FontDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
+ Q_FLAGS(QFontDialogOptions::FontDialogOptions)
+
+public:
+ explicit QQuickPlatformFontDialog(QObject *parent = nullptr);
+
+ QFont font() const;
+ void setFont(const QFont &font);
+
+ QFont currentFont() const;
+ void setCurrentFont(const QFont &font);
+
+ QFontDialogOptions::FontDialogOptions options() const;
+ void setOptions(QFontDialogOptions::FontDialogOptions options);
+
+Q_SIGNALS:
+ void fontChanged();
+ void currentFontChanged();
+ void optionsChanged();
+
+protected:
+ bool useNativeDialog() const override;
+ void onCreate(QPlatformDialogHelper *dialog) override;
+ void onShow(QPlatformDialogHelper *dialog) override;
+ void accept() override;
+
+private:
+ QFont m_font;
+ QFont m_currentFont; // TODO: QFontDialogOptions::initialFont
+ QSharedPointer<QFontDialogOptions> m_options;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformFontDialog)
+
+#endif // QQUICKPLATFORMFONTDIALOG_P_H
diff --git a/src/imports/platform/qquickplatformiconloader.cpp b/src/imports/platform/qquickplatformiconloader.cpp
new file mode 100644
index 00000000..08df44d9
--- /dev/null
+++ b/src/imports/platform/qquickplatformiconloader.cpp
@@ -0,0 +1,111 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformiconloader_p.h"
+
+#include <QtCore/qobject.h>
+#include <QtCore/qmetaobject.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+QQuickPlatformIconLoader::QQuickPlatformIconLoader(int slot, QObject *parent)
+ : m_parent(parent),
+ m_slot(slot),
+ m_enabled(false)
+{
+ Q_ASSERT(slot != -1 && parent);
+}
+
+bool QQuickPlatformIconLoader::isEnabled() const
+{
+ return m_enabled;
+}
+
+void QQuickPlatformIconLoader::setEnabled(bool enabled)
+{
+ m_enabled = enabled;
+ if (m_enabled)
+ loadIcon();
+}
+
+QIcon QQuickPlatformIconLoader::icon() const
+{
+ QIcon fallback = QPixmap::fromImage(image());
+ return QIcon::fromTheme(m_iconName, fallback);
+}
+
+QUrl QQuickPlatformIconLoader::iconSource() const
+{
+ return m_iconSource;
+}
+
+void QQuickPlatformIconLoader::setIconSource(const QUrl& source)
+{
+ m_iconSource = source;
+ if (m_enabled)
+ loadIcon();
+}
+
+QString QQuickPlatformIconLoader::iconName() const
+{
+ return m_iconName;
+}
+
+void QQuickPlatformIconLoader::setIconName(const QString& name)
+{
+ m_iconName = name;
+ if (m_enabled)
+ loadIcon();
+}
+
+void QQuickPlatformIconLoader::loadIcon()
+{
+ if (m_iconSource.isEmpty()) {
+ clear(m_parent);
+ } else {
+ load(qmlEngine(m_parent), m_iconSource);
+ if (m_slot != -1 && isLoading()) {
+ connectFinished(m_parent, m_slot);
+ m_slot = -1;
+ }
+ }
+
+ if (!isLoading())
+ m_parent->metaObject()->method(m_slot).invoke(m_parent);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformiconloader_p.h b/src/imports/platform/qquickplatformiconloader_p.h
new file mode 100644
index 00000000..5ddb625f
--- /dev/null
+++ b/src/imports/platform/qquickplatformiconloader_p.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMICONLOADER_P_H
+#define QQUICKPLATFORMICONLOADER_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 <QtCore/qurl.h>
+#include <QtCore/qstring.h>
+#include <QtGui/qicon.h>
+#include <QtQuick/private/qquickpixmapcache_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QObject;
+
+class QQuickPlatformIconLoader : public QQuickPixmap
+{
+public:
+ QQuickPlatformIconLoader(int slot, QObject *parent);
+
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
+ QIcon icon() const;
+
+ QUrl iconSource() const;
+ void setIconSource(const QUrl &source);
+
+ QString iconName() const;
+ void setIconName(const QString &name);
+
+private:
+ void loadIcon();
+
+ QObject *m_parent;
+ int m_slot;
+ bool m_enabled;
+ QIcon m_icon;
+ QUrl m_iconSource;
+ QString m_iconName;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKPLATFORMICONLOADER_P_H
diff --git a/src/imports/platform/qquickplatformmenu.cpp b/src/imports/platform/qquickplatformmenu.cpp
new file mode 100644
index 00000000..17d3b2ce
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenu.cpp
@@ -0,0 +1,835 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformmenu_p.h"
+#include "qquickplatformmenubar_p.h"
+#include "qquickplatformmenuitem_p.h"
+#include "qquickplatformiconloader_p.h"
+#include "qquickplatformsystemtrayicon_p.h"
+
+#include <QtCore/qloggingcategory.h>
+#include <QtGui/qicon.h>
+#include <QtGui/qcursor.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtQml/private/qqmlengine_p.h>
+#include <QtQml/private/qv4scopedvalue_p.h>
+#include <QtQml/private/qv4qobjectwrapper_p.h>
+#include <QtQuick/qquickrendercontrol.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qquickitem.h>
+
+#include "widgets/qwidgetplatform_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype Menu
+ \inherits QtObject
+ \instantiates QQuickPlatformMenu
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native menu.
+
+ The Menu type provides a QML API for native platform menu popups.
+
+ \image qtlabsplatform-menu.png
+
+ Menu can be used in a \l MenuBar, or as a stand-alone context menu.
+ The following example shows how to open a context menu on right mouse
+ click:
+
+ \code
+ MouseArea {
+ anchors.fill: parent
+ acceptedButtons: Qt.RightButton
+ onClicked: zoomMenu.open()
+ }
+
+ Menu {
+ id: zoomMenu
+
+ MenuItem {
+ text: qsTr("Zoom In")
+ shortcut: StandardKey.ZoomIn
+ onTriggered: zoomIn()
+ }
+
+ MenuItem {
+ text: qsTr("Zoom Out")
+ shortcut: StandardKey.ZoomOut
+ onTriggered: zoomOut()
+ }
+ }
+ \endcode
+
+ \section2 Availability
+
+ A native platform menu is currently available on the following platforms:
+
+ \list
+ \li macOS
+ \li iOS
+ \li Android
+ \li Linux (only available as a stand-alone context menu when running with the GTK+ platform theme)
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+
+ \sa MenuItem, MenuSeparator, MenuBar
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::Menu::aboutToShow()
+
+ This signal is emitted when the menu is about to be shown to the user.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::Menu::aboutToHide()
+
+ This signal is emitted when the menu is about to be hidden from the user.
+*/
+
+Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformMenus)
+
+QQuickPlatformMenu::QQuickPlatformMenu(QObject *parent)
+ : QObject(parent),
+ m_complete(false),
+ m_enabled(true),
+ m_visible(true),
+ m_minimumWidth(-1),
+ m_type(QPlatformMenu::DefaultMenu),
+ m_menuBar(nullptr),
+ m_parentMenu(nullptr),
+ m_systemTrayIcon(nullptr),
+ m_menuItem(nullptr),
+ m_iconLoader(nullptr),
+ m_handle(nullptr)
+{
+}
+
+QQuickPlatformMenu::~QQuickPlatformMenu()
+{
+ if (m_menuBar)
+ m_menuBar->removeMenu(this);
+ if (m_parentMenu)
+ m_parentMenu->removeMenu(this);
+ for (QQuickPlatformMenuItem *item : m_items) {
+ if (QQuickPlatformMenu *subMenu = item->subMenu())
+ subMenu->setParentMenu(nullptr);
+ item->setMenu(nullptr);
+ }
+ delete m_iconLoader;
+ m_iconLoader = nullptr;
+ delete m_handle;
+ m_handle = nullptr;
+}
+
+QPlatformMenu *QQuickPlatformMenu::handle() const
+{
+ return m_handle;
+}
+
+QPlatformMenu * QQuickPlatformMenu::create()
+{
+ if (!m_handle) {
+ if (m_menuBar && m_menuBar->handle())
+ m_handle = m_menuBar->handle()->createMenu();
+ else if (m_parentMenu && m_parentMenu->handle())
+ m_handle = m_parentMenu->handle()->createSubMenu();
+ else if (m_systemTrayIcon && m_systemTrayIcon->handle())
+ m_handle = m_systemTrayIcon->handle()->createMenu();
+
+ // TODO: implement ^
+ // - QCocoaMenuBar::createMenu()
+ // - QCocoaMenu::createSubMenu()
+ // - QCocoaSystemTrayIcon::createMenu()
+ if (!m_handle)
+ m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformMenu();
+
+ if (!m_handle)
+ m_handle = QWidgetPlatform::createMenu();
+
+ qCDebug(qtLabsPlatformMenus) << "Menu ->" << m_handle;
+
+ if (m_handle) {
+ connect(m_handle, &QPlatformMenu::aboutToShow, this, &QQuickPlatformMenu::aboutToShow);
+ connect(m_handle, &QPlatformMenu::aboutToHide, this, &QQuickPlatformMenu::aboutToHide);
+
+ for (QQuickPlatformMenuItem *item : m_items)
+ m_handle->insertMenuItem(item->create(), nullptr);
+
+ if (m_menuItem) {
+ if (QPlatformMenuItem *handle = m_menuItem->create())
+ handle->setMenu(m_handle);
+ }
+ }
+ }
+ return m_handle;
+}
+
+void QQuickPlatformMenu::destroy()
+{
+ if (!m_handle)
+ return;
+
+ delete m_handle;
+ m_handle = nullptr;
+}
+
+void QQuickPlatformMenu::sync()
+{
+ if (!m_complete || !create())
+ return;
+
+ m_handle->setText(m_title);
+ m_handle->setEnabled(m_enabled);
+ m_handle->setVisible(m_visible);
+ m_handle->setMinimumWidth(m_minimumWidth);
+ m_handle->setMenuType(m_type);
+ m_handle->setFont(m_font);
+
+ if (m_menuBar && m_menuBar->handle())
+ m_menuBar->handle()->syncMenu(m_handle);
+ else if (m_systemTrayIcon && m_systemTrayIcon->handle())
+ m_systemTrayIcon->handle()->updateMenu(m_handle);
+
+ for (QQuickPlatformMenuItem *item : m_items)
+ item->sync();
+}
+
+/*!
+ \default
+ \qmlproperty list<Object> Qt.labs.platform::Menu::data
+
+ This default property holds the list of all objects declared as children of
+ the menu. The data property includes objects that are not \l MenuItem instances,
+ such as \l Timer and \l QtObject.
+
+ \sa items
+*/
+QQmlListProperty<QObject> QQuickPlatformMenu::data()
+{
+ return QQmlListProperty<QObject>(this, nullptr, data_append, data_count, data_at, data_clear);
+}
+
+/*!
+ \qmlproperty list<MenuItem> Qt.labs.platform::Menu::items
+
+ This property holds the list of items in the menu.
+*/
+QQmlListProperty<QQuickPlatformMenuItem> QQuickPlatformMenu::items()
+{
+ return QQmlListProperty<QQuickPlatformMenuItem>(this, nullptr, items_append, items_count, items_at, items_clear);
+}
+
+/*!
+ \readonly
+ \qmlproperty MenuBar Qt.labs.platform::Menu::menuBar
+
+ This property holds the menubar that the menu belongs to, or \c null if the
+ menu is not in a menubar.
+*/
+QQuickPlatformMenuBar *QQuickPlatformMenu::menuBar() const
+{
+ return m_menuBar;
+}
+
+void QQuickPlatformMenu::setMenuBar(QQuickPlatformMenuBar *menuBar)
+{
+ if (m_menuBar == menuBar)
+ return;
+
+ m_menuBar = menuBar;
+ destroy();
+ emit menuBarChanged();
+}
+
+/*!
+ \readonly
+ \qmlproperty Menu Qt.labs.platform::Menu::parentMenu
+
+ This property holds the parent menu that the menu belongs to, or \c null if the
+ menu is not a sub-menu.
+*/
+QQuickPlatformMenu *QQuickPlatformMenu::parentMenu() const
+{
+ return m_parentMenu;
+}
+
+void QQuickPlatformMenu::setParentMenu(QQuickPlatformMenu *menu)
+{
+ if (m_parentMenu == menu)
+ return;
+
+ m_parentMenu = menu;
+ destroy();
+ emit parentMenuChanged();
+}
+
+/*!
+ \readonly
+ \qmlproperty SystemTrayIcon Qt.labs.platform::Menu::systemTrayIcon
+
+ This property holds the system tray icon that the menu belongs to, or \c null
+ if the menu is not in a system tray icon.
+*/
+QQuickPlatformSystemTrayIcon *QQuickPlatformMenu::systemTrayIcon() const
+{
+ return m_systemTrayIcon;
+}
+
+void QQuickPlatformMenu::setSystemTrayIcon(QQuickPlatformSystemTrayIcon *icon)
+{
+ if (m_systemTrayIcon == icon)
+ return;
+
+ m_systemTrayIcon = icon;
+ destroy();
+ emit systemTrayIconChanged();
+}
+
+/*!
+ \readonly
+ \qmlproperty MenuItem Qt.labs.platform::Menu::menuItem
+
+ This property holds the item that presents the menu (in a parent menu).
+*/
+QQuickPlatformMenuItem *QQuickPlatformMenu::menuItem() const
+{
+ if (!m_menuItem) {
+ QQuickPlatformMenu *that = const_cast<QQuickPlatformMenu *>(this);
+ m_menuItem = new QQuickPlatformMenuItem(that);
+ m_menuItem->setSubMenu(that);
+ m_menuItem->setText(m_title);
+ m_menuItem->setIconName(iconName());
+ m_menuItem->setIconSource(iconSource());
+ m_menuItem->setVisible(m_visible);
+ m_menuItem->setEnabled(m_enabled);
+ m_menuItem->componentComplete();
+ }
+ return m_menuItem;
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::Menu::enabled
+
+ This property holds whether the menu is enabled. The default value is \c true.
+*/
+bool QQuickPlatformMenu::isEnabled() const
+{
+ return m_enabled;
+}
+
+void QQuickPlatformMenu::setEnabled(bool enabled)
+{
+ if (m_enabled == enabled)
+ return;
+
+ if (m_menuItem)
+ m_menuItem->setEnabled(enabled);
+
+ m_enabled = enabled;
+ sync();
+ emit enabledChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::Menu::visible
+
+ This property holds whether the menu is visible. The default value is \c true.
+*/
+bool QQuickPlatformMenu::isVisible() const
+{
+ return m_visible;
+}
+
+void QQuickPlatformMenu::setVisible(bool visible)
+{
+ if (m_visible == visible)
+ return;
+
+ if (m_menuItem)
+ m_menuItem->setVisible(visible);
+
+ m_visible = visible;
+ sync();
+ emit visibleChanged();
+}
+
+/*!
+ \qmlproperty int Qt.labs.platform::Menu::minimumWidth
+
+ This property holds the minimum width of the menu. The default value is \c -1 (no minimum width).
+*/
+int QQuickPlatformMenu::minimumWidth() const
+{
+ return m_minimumWidth;
+}
+
+void QQuickPlatformMenu::setMinimumWidth(int width)
+{
+ if (m_minimumWidth == width)
+ return;
+
+ m_minimumWidth = width;
+ sync();
+ emit minimumWidthChanged();
+}
+
+/*!
+ \qmlproperty enumeration Qt.labs.platform::Menu::type
+
+ This property holds the type of the menu.
+
+ Available values:
+ \value Menu.DefaultMenu A normal menu (default).
+ \value Menu.EditMenu An edit menu with pre-populated cut, copy and paste items.
+*/
+QPlatformMenu::MenuType QQuickPlatformMenu::type() const
+{
+ return m_type;
+}
+
+void QQuickPlatformMenu::setType(QPlatformMenu::MenuType type)
+{
+ if (m_type == type)
+ return;
+
+ m_type = type;
+ sync();
+ emit typeChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::Menu::title
+
+ This property holds the menu's title.
+*/
+QString QQuickPlatformMenu::title() const
+{
+ return m_title;
+}
+
+void QQuickPlatformMenu::setTitle(const QString &title)
+{
+ if (m_title == title)
+ return;
+
+ m_title = title;
+ sync();
+ emit titleChanged();
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::Menu::iconSource
+
+ This property holds the url of the menu's icon.
+
+ \sa iconName
+*/
+QUrl QQuickPlatformMenu::iconSource() const
+{
+ if (!m_iconLoader)
+ return QUrl();
+
+ return m_iconLoader->iconSource();
+}
+
+void QQuickPlatformMenu::setIconSource(const QUrl& source)
+{
+ if (source == iconSource())
+ return;
+
+ if (m_menuItem)
+ m_menuItem->setIconSource(source);
+
+ iconLoader()->setIconSource(source);
+ emit iconSourceChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::Menu::iconName
+
+ This property holds the theme name of the menu's icon.
+
+ \sa iconSource, QIcon::fromTheme()
+*/
+QString QQuickPlatformMenu::iconName() const
+{
+ if (!m_iconLoader)
+ return QString();
+
+ return m_iconLoader->iconName();
+}
+
+void QQuickPlatformMenu::setIconName(const QString& name)
+{
+ if (name == iconName())
+ return;
+
+ if (m_menuItem)
+ m_menuItem->setIconName(name);
+
+ iconLoader()->setIconName(name);
+ emit iconNameChanged();
+}
+
+/*!
+ \qmlproperty font Qt.labs.platform::Menu::font
+
+ This property holds the menu's font.
+
+ \sa text
+*/
+QFont QQuickPlatformMenu::font() const
+{
+ return m_font;
+}
+
+void QQuickPlatformMenu::setFont(const QFont& font)
+{
+ if (m_font == font)
+ return;
+
+ m_font = font;
+ sync();
+ emit fontChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::addItem(MenuItem item)
+
+ Adds an \a item to the end of the menu.
+*/
+void QQuickPlatformMenu::addItem(QQuickPlatformMenuItem *item)
+{
+ insertItem(m_items.count(), item);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::insertItem(int index, MenuItem item)
+
+ Inserts an \a item at the specified \a index in the menu.
+*/
+void QQuickPlatformMenu::insertItem(int index, QQuickPlatformMenuItem *item)
+{
+ if (!item || m_items.contains(item))
+ return;
+
+ m_items.insert(index, item);
+ m_data.append(item);
+ item->setMenu(this);
+ if (m_handle && item->create()) {
+ QQuickPlatformMenuItem *before = m_items.value(index + 1);
+ m_handle->insertMenuItem(item->handle(), before ? before->create() : nullptr);
+ }
+ sync();
+ emit itemsChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::removeItem(MenuItem item)
+
+ Removes an \a item from the menu.
+*/
+void QQuickPlatformMenu::removeItem(QQuickPlatformMenuItem *item)
+{
+ if (!item || !m_items.removeOne(item))
+ return;
+
+ m_data.removeOne(item);
+ if (m_handle)
+ m_handle->removeMenuItem(item->handle());
+ item->setMenu(nullptr);
+ sync();
+ emit itemsChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::addMenu(Menu submenu)
+
+ Adds a \a submenu to the end of the menu.
+*/
+void QQuickPlatformMenu::addMenu(QQuickPlatformMenu *menu)
+{
+ insertMenu(m_items.count(), menu);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::insertMenu(int index, Menu submenu)
+
+ Inserts a \a submenu at the specified \a index in the menu.
+*/
+void QQuickPlatformMenu::insertMenu(int index, QQuickPlatformMenu *menu)
+{
+ if (!menu)
+ return;
+
+ menu->setParentMenu(this);
+ insertItem(index, menu->menuItem());
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::removeMenu(Menu submenu)
+
+ Removes a \a submenu from the menu.
+*/
+void QQuickPlatformMenu::removeMenu(QQuickPlatformMenu *menu)
+{
+ if (!menu)
+ return;
+
+ menu->setParentMenu(nullptr);
+ removeItem(menu->menuItem());
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::clear()
+
+ Removes all items from the menu.
+*/
+void QQuickPlatformMenu::clear()
+{
+ if (m_items.isEmpty())
+ return;
+
+ for (QQuickPlatformMenuItem *item : m_items) {
+ m_data.removeOne(item);
+ if (m_handle)
+ m_handle->removeMenuItem(item->handle());
+ item->setMenu(nullptr);
+ delete item;
+ }
+
+ m_items.clear();
+ sync();
+ emit itemsChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::open(MenuItem item)
+
+ Opens the menu at the current mouse position, optionally aligned to a menu \a item.
+*/
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::open(Item target, MenuItem item)
+
+ Opens the menu at the specified \a target item, optionally aligned to a menu \a item.
+*/
+void QQuickPlatformMenu::open(QQmlV4Function *args)
+{
+ if (!m_handle)
+ return;
+
+ if (args->length() > 2) {
+ args->v4engine()->throwTypeError();
+ return;
+ }
+
+ QV4::ExecutionEngine *v4 = args->v4engine();
+ QV4::Scope scope(v4);
+
+ QQuickItem *targetItem = nullptr;
+ if (args->length() > 0) {
+ QV4::ScopedValue value(scope, (*args)[0]);
+ QV4::Scoped<QV4::QObjectWrapper> object(scope, value->as<QV4::QObjectWrapper>());
+ if (object)
+ targetItem = qobject_cast<QQuickItem *>(object->object());
+ }
+
+ QQuickPlatformMenuItem *menuItem = nullptr;
+ if (args->length() > 1) {
+ QV4::ScopedValue value(scope, (*args)[1]);
+ QV4::Scoped<QV4::QObjectWrapper> object(scope, value->as<QV4::QObjectWrapper>());
+ if (object)
+ menuItem = qobject_cast<QQuickPlatformMenuItem *>(object->object());
+ }
+
+ QPoint offset;
+ QWindow *window = findWindow(targetItem, &offset);
+
+ QRect targetRect;
+ if (targetItem) {
+ QRectF sceneBounds = targetItem->mapRectToScene(targetItem->boundingRect());
+ targetRect = sceneBounds.toAlignedRect().translated(offset);
+ } else {
+#ifndef QT_NO_CURSOR
+ QPoint pos = QCursor::pos();
+ if (window)
+ pos = window->mapFromGlobal(pos);
+ targetRect.moveTo(pos);
+#endif
+ }
+
+ m_handle->showPopup(window, targetRect, menuItem ? menuItem->handle() : nullptr);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::Menu::close()
+
+ Closes the menu.
+*/
+void QQuickPlatformMenu::close()
+{
+ if (m_handle)
+ m_handle->dismiss();
+}
+
+void QQuickPlatformMenu::classBegin()
+{
+}
+
+void QQuickPlatformMenu::componentComplete()
+{
+ m_complete = true;
+ if (m_handle && m_iconLoader)
+ m_iconLoader->setEnabled(true);
+ sync();
+}
+
+QQuickPlatformIconLoader *QQuickPlatformMenu::iconLoader() const
+{
+ if (!m_iconLoader) {
+ QQuickPlatformMenu *that = const_cast<QQuickPlatformMenu *>(this);
+ static int slot = staticMetaObject.indexOfSlot("updateIcon()");
+ m_iconLoader = new QQuickPlatformIconLoader(slot, that);
+ m_iconLoader->setEnabled(m_complete);
+ }
+ return m_iconLoader;
+}
+
+static QWindow *effectiveWindow(QWindow *window, QPoint *offset)
+{
+ QQuickWindow *quickWindow = qobject_cast<QQuickWindow *>(window);
+ if (quickWindow) {
+ QWindow *renderWindow = QQuickRenderControl::renderWindowFor(quickWindow, offset);
+ if (renderWindow)
+ return renderWindow;
+ }
+ return window;
+}
+
+QWindow *QQuickPlatformMenu::findWindow(QQuickItem *target, QPoint *offset) const
+{
+ if (target)
+ return effectiveWindow(target->window(), offset);
+
+ if (m_menuBar && m_menuBar->window())
+ return effectiveWindow(m_menuBar->window(), offset);
+
+ QObject *obj = parent();
+ while (obj) {
+ QWindow *window = qobject_cast<QWindow *>(obj);
+ if (window)
+ return effectiveWindow(window, offset);
+
+ QQuickItem *item = qobject_cast<QQuickItem *>(obj);
+ if (item && item->window())
+ return effectiveWindow(item->window(), offset);
+
+ obj = obj->parent();
+ }
+ return nullptr;
+}
+
+void QQuickPlatformMenu::data_append(QQmlListProperty<QObject> *property, QObject *object)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ if (QQuickPlatformMenuItem *item = qobject_cast<QQuickPlatformMenuItem *>(object))
+ menu->addItem(item);
+ else if (QQuickPlatformMenu *subMenu = qobject_cast<QQuickPlatformMenu *>(object))
+ menu->addMenu(subMenu);
+ else
+ menu->m_data.append(object);
+}
+
+int QQuickPlatformMenu::data_count(QQmlListProperty<QObject> *property)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ return menu->m_data.count();
+}
+
+QObject *QQuickPlatformMenu::data_at(QQmlListProperty<QObject> *property, int index)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ return menu->m_data.value(index);
+}
+
+void QQuickPlatformMenu::data_clear(QQmlListProperty<QObject> *property)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ menu->m_data.clear();
+}
+
+void QQuickPlatformMenu::items_append(QQmlListProperty<QQuickPlatformMenuItem> *property, QQuickPlatformMenuItem *item)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ menu->addItem(item);
+}
+
+int QQuickPlatformMenu::items_count(QQmlListProperty<QQuickPlatformMenuItem> *property)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ return menu->m_items.count();
+}
+
+QQuickPlatformMenuItem *QQuickPlatformMenu::items_at(QQmlListProperty<QQuickPlatformMenuItem> *property, int index)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ return menu->m_items.value(index);
+}
+
+void QQuickPlatformMenu::items_clear(QQmlListProperty<QQuickPlatformMenuItem> *property)
+{
+ QQuickPlatformMenu *menu = static_cast<QQuickPlatformMenu *>(property->object);
+ menu->clear();
+}
+
+void QQuickPlatformMenu::updateIcon()
+{
+ if (!m_handle || !m_iconLoader)
+ return;
+
+ m_handle->setIcon(m_iconLoader->icon());
+ sync();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmenu_p.h b/src/imports/platform/qquickplatformmenu_p.h
new file mode 100644
index 00000000..587fae99
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenu_p.h
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMMENU_P_H
+#define QQUICKPLATFORMMENU_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 <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtGui/qfont.h>
+#include <QtGui/qpa/qplatformmenu.h>
+#include <QtQml/qqmlparserstatus.h>
+#include <QtQml/qqmllist.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QIcon;
+class QWindow;
+class QQuickItem;
+class QPlatformMenu;
+class QQmlV4Function;
+class QQuickPlatformMenuBar;
+class QQuickPlatformMenuItem;
+class QQuickPlatformIconLoader;
+class QQuickPlatformSystemTrayIcon;
+
+class QQuickPlatformMenu : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlParserStatus)
+ Q_PROPERTY(QQmlListProperty<QObject> data READ data FINAL)
+ Q_PROPERTY(QQmlListProperty<QQuickPlatformMenuItem> items READ items NOTIFY itemsChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenu *parentMenu READ parentMenu NOTIFY parentMenuChanged FINAL)
+ Q_PROPERTY(QQuickPlatformSystemTrayIcon *systemTrayIcon READ systemTrayIcon NOTIFY systemTrayIconChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenuItem *menuItem READ menuItem CONSTANT FINAL)
+ Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
+ Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged FINAL)
+ Q_PROPERTY(QPlatformMenu::MenuType type READ type WRITE setType NOTIFY typeChanged FINAL)
+ Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
+ Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL)
+ Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL)
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
+ Q_ENUMS(QPlatformMenu::MenuType)
+ Q_CLASSINFO("DefaultProperty", "data")
+
+public:
+ explicit QQuickPlatformMenu(QObject *parent = nullptr);
+ ~QQuickPlatformMenu();
+
+ QPlatformMenu *handle() const;
+ QPlatformMenu *create();
+ void destroy();
+ void sync();
+
+ QQmlListProperty<QObject> data();
+ QQmlListProperty<QQuickPlatformMenuItem> items();
+
+ QQuickPlatformMenuBar *menuBar() const;
+ void setMenuBar(QQuickPlatformMenuBar *menuBar);
+
+ QQuickPlatformMenu *parentMenu() const;
+ void setParentMenu(QQuickPlatformMenu *menu);
+
+ QQuickPlatformSystemTrayIcon *systemTrayIcon() const;
+ void setSystemTrayIcon(QQuickPlatformSystemTrayIcon *icon);
+
+ QQuickPlatformMenuItem *menuItem() const;
+
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ int minimumWidth() const;
+ void setMinimumWidth(int width);
+
+ QPlatformMenu::MenuType type() const;
+ void setType(QPlatformMenu::MenuType type);
+
+ QString title() const;
+ void setTitle(const QString &title);
+
+ QUrl iconSource() const;
+ void setIconSource(const QUrl &source);
+
+ QString iconName() const;
+ void setIconName(const QString &name);
+
+ QFont font() const;
+ void setFont(const QFont &font);
+
+ Q_INVOKABLE void addItem(QQuickPlatformMenuItem *item);
+ Q_INVOKABLE void insertItem(int index, QQuickPlatformMenuItem *item);
+ Q_INVOKABLE void removeItem(QQuickPlatformMenuItem *item);
+
+ Q_INVOKABLE void addMenu(QQuickPlatformMenu *menu);
+ Q_INVOKABLE void insertMenu(int index, QQuickPlatformMenu *menu);
+ Q_INVOKABLE void removeMenu(QQuickPlatformMenu *menu);
+
+ Q_INVOKABLE void clear();
+
+public Q_SLOTS:
+ void open(QQmlV4Function *args);
+ void close();
+
+Q_SIGNALS:
+ void aboutToShow();
+ void aboutToHide();
+
+ void itemsChanged();
+ void menuBarChanged();
+ void parentMenuChanged();
+ void systemTrayIconChanged();
+ void titleChanged();
+ void iconSourceChanged();
+ void iconNameChanged();
+ void enabledChanged();
+ void visibleChanged();
+ void minimumWidthChanged();
+ void fontChanged();
+ void typeChanged();
+
+protected:
+ void classBegin() override;
+ void componentComplete() override;
+
+ QQuickPlatformIconLoader *iconLoader() const;
+
+ QWindow *findWindow(QQuickItem *target, QPoint *offset) const;
+
+ static void data_append(QQmlListProperty<QObject> *property, QObject *object);
+ static int data_count(QQmlListProperty<QObject> *property);
+ static QObject *data_at(QQmlListProperty<QObject> *property, int index);
+ static void data_clear(QQmlListProperty<QObject> *property);
+
+ static void items_append(QQmlListProperty<QQuickPlatformMenuItem> *property, QQuickPlatformMenuItem *item);
+ static int items_count(QQmlListProperty<QQuickPlatformMenuItem> *property);
+ static QQuickPlatformMenuItem *items_at(QQmlListProperty<QQuickPlatformMenuItem> *property, int index);
+ static void items_clear(QQmlListProperty<QQuickPlatformMenuItem> *property);
+
+private Q_SLOTS:
+ void updateIcon();
+
+private:
+ bool m_complete;
+ bool m_enabled;
+ bool m_visible;
+ int m_minimumWidth;
+ QPlatformMenu::MenuType m_type;
+ QString m_title;
+ QFont m_font;
+ QList<QObject *> m_data;
+ QList<QQuickPlatformMenuItem *> m_items;
+ QQuickPlatformMenuBar *m_menuBar;
+ QQuickPlatformMenu *m_parentMenu;
+ QQuickPlatformSystemTrayIcon *m_systemTrayIcon;
+ mutable QQuickPlatformMenuItem *m_menuItem;
+ mutable QQuickPlatformIconLoader *m_iconLoader;
+ QPlatformMenu *m_handle;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformMenu)
+
+#endif // QQUICKPLATFORMMENU_P_H
diff --git a/src/imports/platform/qquickplatformmenubar.cpp b/src/imports/platform/qquickplatformmenubar.cpp
new file mode 100644
index 00000000..00630a84
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenubar.cpp
@@ -0,0 +1,330 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformmenubar_p.h"
+#include "qquickplatformmenu_p.h"
+
+#include <QtCore/qloggingcategory.h>
+#include <QtGui/qpa/qplatformmenu.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtQuick/qquickwindow.h>
+#include <QtQuick/qquickitem.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype MenuBar
+ \inherits QtObject
+ \instantiates QQuickPlatformMenuBar
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native menubar.
+
+ The MenuBar type provides a QML API for native platform menubars.
+
+ \image qtlabsplatform-menubar.png
+
+ A menubar consists of a list of drop-down menus.
+
+ \code
+ MenuBar {
+ id: menuBar
+
+ Menu {
+ id: fileMenu
+ title: qsTr("File")
+ // ...
+ }
+
+ Menu {
+ id: editMenu
+ title: qsTr("&Edit")
+ // ...
+ }
+
+ Menu {
+ id: viewMenu
+ title: qsTr("&View")
+ // ...
+ }
+
+ Menu {
+ id: helpMenu
+ title: qsTr("&Help")
+ // ...
+ }
+ }
+ \endcode
+
+ MenuBar is currently available on the following platforms:
+
+ \list
+ \li macOS
+ \li Android
+ \li Linux (only available on desktop environments that provide a global D-Bus menu bar)
+ \endlist
+
+ \labs
+
+ \sa Menu
+*/
+
+Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformMenus)
+
+QQuickPlatformMenuBar::QQuickPlatformMenuBar(QObject *parent)
+ : QObject(parent),
+ m_complete(false),
+ m_window(nullptr),
+ m_handle(nullptr)
+{
+ m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformMenuBar();
+ qCDebug(qtLabsPlatformMenus) << "MenuBar ->" << m_handle;
+}
+
+QQuickPlatformMenuBar::~QQuickPlatformMenuBar()
+{
+ for (QQuickPlatformMenu *menu : m_menus)
+ menu->setMenuBar(nullptr);
+ delete m_handle;
+ m_handle = nullptr;
+}
+
+QPlatformMenuBar *QQuickPlatformMenuBar::handle() const
+{
+ return m_handle;
+}
+
+/*!
+ \default
+ \qmlproperty list<Object> Qt.labs.platform::MenuBar::data
+
+ This default property holds the list of all objects declared as children of
+ the menubar. The data property includes objects that are not \l Menu instances,
+ such as \l Timer and \l QtObject.
+
+ \sa menus
+*/
+QQmlListProperty<QObject> QQuickPlatformMenuBar::data()
+{
+ return QQmlListProperty<QObject>(this, nullptr, data_append, data_count, data_at, data_clear);
+}
+
+/*!
+ \qmlproperty list<Menu> Qt.labs.platform::MenuBar::menus
+
+ This property holds the list of menus in the menubar.
+*/
+QQmlListProperty<QQuickPlatformMenu> QQuickPlatformMenuBar::menus()
+{
+ return QQmlListProperty<QQuickPlatformMenu>(this, nullptr, menus_append, menus_count, menus_at, menus_clear);
+}
+
+/*!
+ \qmlproperty Window Qt.labs.platform::MenuBar::window
+
+ This property holds the menubar's window.
+
+ Unless explicitly set, the window is automatically resolved by iterating
+ the QML parent objects until a \l Window or an \l Item that has a window
+ is found.
+*/
+QWindow *QQuickPlatformMenuBar::window() const
+{
+ return m_window;
+}
+
+void QQuickPlatformMenuBar::setWindow(QWindow *window)
+{
+ if (m_window == window)
+ return;
+
+ if (m_handle)
+ m_handle->handleReparent(window);
+
+ m_window = window;
+ emit windowChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuBar::addMenu(Menu menu)
+
+ Adds a \a menu to end of the menubar.
+*/
+void QQuickPlatformMenuBar::addMenu(QQuickPlatformMenu *menu)
+{
+ insertMenu(m_menus.count(), menu);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuBar::insertMenu(int index, Menu menu)
+
+ Inserts a \a menu at the specified \a index in the menubar.
+*/
+void QQuickPlatformMenuBar::insertMenu(int index, QQuickPlatformMenu *menu)
+{
+ if (!menu || m_menus.contains(menu))
+ return;
+
+ QQuickPlatformMenu *before = m_menus.value(index);
+ m_menus.insert(index, menu);
+ m_data.append(menu);
+ menu->setMenuBar(this);
+ if (m_handle)
+ m_handle->insertMenu(menu->create(), before ? before->handle() : nullptr);
+ emit menusChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuBar::removeMenu(Menu menu)
+
+ Removes a \a menu from the menubar.
+*/
+void QQuickPlatformMenuBar::removeMenu(QQuickPlatformMenu *menu)
+{
+ if (!menu || !m_menus.removeOne(menu))
+ return;
+
+ m_data.removeOne(menu);
+ if (m_handle)
+ m_handle->removeMenu(menu->handle());
+ menu->setMenuBar(nullptr);
+ emit menusChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuBar::clear()
+
+ Removes all menus from the menubar.
+*/
+void QQuickPlatformMenuBar::clear()
+{
+ if (m_menus.isEmpty())
+ return;
+
+ for (QQuickPlatformMenu *menu : m_menus) {
+ m_data.removeOne(menu);
+ if (m_handle)
+ m_handle->removeMenu(menu->handle());
+ menu->setMenuBar(nullptr);
+ delete menu;
+ }
+
+ m_menus.clear();
+ emit menusChanged();
+}
+
+void QQuickPlatformMenuBar::classBegin()
+{
+}
+
+void QQuickPlatformMenuBar::componentComplete()
+{
+ m_complete = true;
+ for (QQuickPlatformMenu *menu : m_menus)
+ menu->sync();
+ if (!m_window)
+ setWindow(findWindow());
+}
+
+QWindow *QQuickPlatformMenuBar::findWindow() const
+{
+ QObject *obj = parent();
+ while (obj) {
+ QWindow *window = qobject_cast<QWindow *>(obj);
+ if (window)
+ return window;
+ QQuickItem *item = qobject_cast<QQuickItem *>(obj);
+ if (item && item->window())
+ return item->window();
+ obj = obj->parent();
+ }
+ return nullptr;
+}
+
+void QQuickPlatformMenuBar::data_append(QQmlListProperty<QObject> *property, QObject *object)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ QQuickPlatformMenu *menu = qobject_cast<QQuickPlatformMenu *>(object);
+ if (menu)
+ menuBar->addMenu(menu);
+ else
+ menuBar->m_data.append(object);
+}
+
+int QQuickPlatformMenuBar::data_count(QQmlListProperty<QObject> *property)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ return menuBar->m_data.count();
+}
+
+QObject *QQuickPlatformMenuBar::data_at(QQmlListProperty<QObject> *property, int index)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ return menuBar->m_data.value(index);
+}
+
+void QQuickPlatformMenuBar::data_clear(QQmlListProperty<QObject> *property)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ menuBar->m_data.clear();
+}
+
+void QQuickPlatformMenuBar::menus_append(QQmlListProperty<QQuickPlatformMenu> *property, QQuickPlatformMenu *menu)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ menuBar->addMenu(menu);
+}
+
+int QQuickPlatformMenuBar::menus_count(QQmlListProperty<QQuickPlatformMenu> *property)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ return menuBar->m_menus.count();
+}
+
+QQuickPlatformMenu *QQuickPlatformMenuBar::menus_at(QQmlListProperty<QQuickPlatformMenu> *property, int index)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ return menuBar->m_menus.value(index);
+}
+
+void QQuickPlatformMenuBar::menus_clear(QQmlListProperty<QQuickPlatformMenu> *property)
+{
+ QQuickPlatformMenuBar *menuBar = static_cast<QQuickPlatformMenuBar *>(property->object);
+ menuBar->clear();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmenubar_p.h b/src/imports/platform/qquickplatformmenubar_p.h
new file mode 100644
index 00000000..059acfe6
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenubar_p.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMMENUBAR_P_H
+#define QQUICKPLATFORMMENUBAR_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 <QtCore/qobject.h>
+#include <QtQml/qqmlparserstatus.h>
+#include <QtQml/qqmllist.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+class QPlatformMenuBar;
+class QQuickPlatformMenu;
+
+class QQuickPlatformMenuBar : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlParserStatus)
+ Q_PROPERTY(QQmlListProperty<QObject> data READ data FINAL)
+ Q_PROPERTY(QQmlListProperty<QQuickPlatformMenu> menus READ menus NOTIFY menusChanged FINAL)
+ Q_PROPERTY(QWindow *window READ window WRITE setWindow NOTIFY windowChanged FINAL)
+ Q_CLASSINFO("DefaultProperty", "data")
+
+public:
+ explicit QQuickPlatformMenuBar(QObject *parent = nullptr);
+ ~QQuickPlatformMenuBar();
+
+ QPlatformMenuBar *handle() const;
+
+ QQmlListProperty<QObject> data();
+ QQmlListProperty<QQuickPlatformMenu> menus();
+
+ QWindow *window() const;
+ void setWindow(QWindow *window);
+
+ Q_INVOKABLE void addMenu(QQuickPlatformMenu *menu);
+ Q_INVOKABLE void insertMenu(int index, QQuickPlatformMenu *menu);
+ Q_INVOKABLE void removeMenu(QQuickPlatformMenu *menu);
+ Q_INVOKABLE void clear();
+
+Q_SIGNALS:
+ void menusChanged();
+ void windowChanged();
+
+protected:
+ void classBegin() override;
+ void componentComplete() override;
+
+ QWindow *findWindow() const;
+
+ static void data_append(QQmlListProperty<QObject> *property, QObject *object);
+ static int data_count(QQmlListProperty<QObject> *property);
+ static QObject *data_at(QQmlListProperty<QObject> *property, int index);
+ static void data_clear(QQmlListProperty<QObject> *property);
+
+ static void menus_append(QQmlListProperty<QQuickPlatformMenu> *property, QQuickPlatformMenu *menu);
+ static int menus_count(QQmlListProperty<QQuickPlatformMenu> *property);
+ static QQuickPlatformMenu *menus_at(QQmlListProperty<QQuickPlatformMenu> *property, int index);
+ static void menus_clear(QQmlListProperty<QQuickPlatformMenu> *property);
+
+private:
+ bool m_complete;
+ QWindow *m_window;
+ QList<QObject *> m_data;
+ QList<QQuickPlatformMenu *> m_menus;
+ QPlatformMenuBar *m_handle;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformMenuBar)
+
+#endif // QQUICKPLATFORMMENUBAR_P_H
diff --git a/src/imports/platform/qquickplatformmenuitem.cpp b/src/imports/platform/qquickplatformmenuitem.cpp
new file mode 100644
index 00000000..9f261d24
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenuitem.cpp
@@ -0,0 +1,612 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformmenuitem_p.h"
+#include "qquickplatformmenu_p.h"
+#include "qquickplatformmenuitemgroup_p.h"
+#include "qquickplatformiconloader_p.h"
+
+#include <QtGui/qicon.h>
+#include <QtGui/qkeysequence.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/private/qguiapplication_p.h>
+
+#include "widgets/qwidgetplatform_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype MenuItem
+ \inherits QtObject
+ \instantiates QQuickPlatformMenuItem
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native menu item.
+
+ The MenuItem type provides a QML API for native platform menu items.
+
+ \image qtlabsplatform-menu.png
+
+ A menu item consists of an \l {iconSource}{icon}, \l text, and \l shortcut.
+
+ \code
+ Menu {
+ id: zoomMenu
+
+ MenuItem {
+ text: qsTr("Zoom In")
+ shortcut: StandardKey.ZoomIn
+ onTriggered: zoomIn()
+ }
+
+ MenuItem {
+ text: qsTr("Zoom Out")
+ shortcut: StandardKey.ZoomOut
+ onTriggered: zoomOut()
+ }
+ }
+ \endcode
+
+ \labs
+
+ \sa Menu, MenuItemGroup
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MenuItem::triggered()
+
+ This signal is emitted when the menu item is triggered by the user.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MenuItem::hovered()
+
+ This signal is emitted when the menu item is hovered by the user.
+*/
+
+QQuickPlatformMenuItem::QQuickPlatformMenuItem(QObject *parent)
+ : QObject(parent),
+ m_complete(false),
+ m_enabled(true),
+ m_visible(true),
+ m_separator(false),
+ m_checkable(false),
+ m_checked(false),
+ m_role(QPlatformMenuItem::TextHeuristicRole),
+ m_menu(nullptr),
+ m_subMenu(nullptr),
+ m_group(nullptr),
+ m_iconLoader(nullptr),
+ m_handle(nullptr)
+{
+}
+
+QQuickPlatformMenuItem::~QQuickPlatformMenuItem()
+{
+ if (m_menu)
+ m_menu->removeItem(this);
+ if (m_group)
+ m_group->removeItem(this);
+ delete m_iconLoader;
+ m_iconLoader = nullptr;
+ delete m_handle;
+ m_handle = nullptr;
+}
+
+QPlatformMenuItem *QQuickPlatformMenuItem::handle() const
+{
+ return m_handle;
+}
+
+QPlatformMenuItem *QQuickPlatformMenuItem::create()
+{
+ if (!m_handle && m_menu && m_menu->handle()) {
+ m_handle = m_menu->handle()->createMenuItem();
+
+ // TODO: implement QCocoaMenu::createMenuItem()
+ if (!m_handle)
+ m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformMenuItem();
+
+ if (!m_handle)
+ m_handle = QWidgetPlatform::createMenuItem();
+
+ if (m_handle) {
+ connect(m_handle, &QPlatformMenuItem::activated, this, &QQuickPlatformMenuItem::triggered);
+ connect(m_handle, &QPlatformMenuItem::hovered, this, &QQuickPlatformMenuItem::hovered);
+ if (m_checkable)
+ connect(m_handle, &QPlatformMenuItem::activated, this, &QQuickPlatformMenuItem::toggle);
+ }
+ }
+ return m_handle;
+}
+
+void QQuickPlatformMenuItem::sync()
+{
+ if (!m_complete || !create())
+ return;
+
+ m_handle->setEnabled(isEnabled());
+ m_handle->setVisible(isVisible());
+ m_handle->setIsSeparator(m_separator);
+ m_handle->setCheckable(m_checkable);
+ m_handle->setChecked(m_checked);
+ m_handle->setRole(m_role);
+ m_handle->setText(m_text);
+ m_handle->setFont(m_font);
+ m_handle->setHasExclusiveGroup(m_group && m_group->isExclusive());
+ if (m_subMenu && m_subMenu->handle())
+ m_handle->setMenu(m_subMenu->handle());
+
+ QKeySequence sequence;
+ if (m_shortcut.type() == QVariant::Int)
+ sequence = QKeySequence(static_cast<QKeySequence::StandardKey>(m_shortcut.toInt()));
+ else
+ sequence = QKeySequence::fromString(m_shortcut.toString());
+ m_handle->setShortcut(sequence.toString());
+
+ if (m_menu && m_menu->handle())
+ m_menu->handle()->syncMenuItem(m_handle);
+}
+
+/*!
+ \readonly
+ \qmlproperty Menu Qt.labs.platform::MenuItem::menu
+
+ This property holds the menu that the item belongs to, or \c null if the
+ item is not in a menu.
+*/
+QQuickPlatformMenu *QQuickPlatformMenuItem::menu() const
+{
+ return m_menu;
+}
+
+void QQuickPlatformMenuItem::setMenu(QQuickPlatformMenu *menu)
+{
+ if (m_menu == menu)
+ return;
+
+ m_menu = menu;
+ emit menuChanged();
+}
+
+/*!
+ \readonly
+ \qmlproperty Menu Qt.labs.platform::MenuItem::subMenu
+
+ This property holds the sub-menu that the item contains, or \c null if
+ the item is not a sub-menu item.
+*/
+QQuickPlatformMenu *QQuickPlatformMenuItem::subMenu() const
+{
+ return m_subMenu;
+}
+
+void QQuickPlatformMenuItem::setSubMenu(QQuickPlatformMenu *menu)
+{
+ if (m_subMenu == menu)
+ return;
+
+ m_subMenu = menu;
+ sync();
+ emit subMenuChanged();
+}
+
+/*!
+ \qmlproperty MenuItemGroup Qt.labs.platform::MenuItem::group
+
+ This property holds the group that the item belongs to, or \c null if the
+ item is not in a group.
+*/
+QQuickPlatformMenuItemGroup *QQuickPlatformMenuItem::group() const
+{
+ return m_group;
+}
+
+void QQuickPlatformMenuItem::setGroup(QQuickPlatformMenuItemGroup *group)
+{
+ if (m_group == group)
+ return;
+
+ bool wasEnabled = isEnabled();
+ bool wasVisible = isVisible();
+
+ if (group)
+ group->addItem(this);
+
+ m_group = group;
+ sync();
+ emit groupChanged();
+
+ if (isEnabled() != wasEnabled)
+ emit enabledChanged();
+ if (isVisible() != wasVisible)
+ emit visibleChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItem::enabled
+
+ This property holds whether the item is enabled. The default value is \c true.
+
+ Disabled items cannot be triggered by the user. They do not disappear from menus,
+ but they are displayed in a way which indicates that they are unavailable. For
+ example, they might be displayed using only shades of gray.
+
+ When an item is disabled, it is not possible to trigger it through its \l shortcut.
+*/
+bool QQuickPlatformMenuItem::isEnabled() const
+{
+ return m_enabled && (!m_group || m_group->isEnabled());
+}
+
+void QQuickPlatformMenuItem::setEnabled(bool enabled)
+{
+ if (m_enabled == enabled)
+ return;
+
+ bool wasEnabled = isEnabled();
+ m_enabled = enabled;
+ sync();
+ if (isEnabled() != wasEnabled)
+ emit enabledChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItem::visible
+
+ This property holds whether the item is visible. The default value is \c true.
+*/
+bool QQuickPlatformMenuItem::isVisible() const
+{
+ return m_visible && (!m_group || m_group->isVisible());
+}
+
+void QQuickPlatformMenuItem::setVisible(bool visible)
+{
+ if (m_visible == visible)
+ return;
+
+ bool wasVisible = isVisible();
+ m_visible = visible;
+ sync();
+ if (isVisible() != wasVisible)
+ emit visibleChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItem::separator
+
+ This property holds whether the item is a separator line. The default value
+ is \c false.
+
+ \sa MenuSeparator
+*/
+bool QQuickPlatformMenuItem::isSeparator() const
+{
+ return m_separator;
+}
+
+void QQuickPlatformMenuItem::setSeparator(bool separator)
+{
+ if (m_separator == separator)
+ return;
+
+ m_separator = separator;
+ sync();
+ emit separatorChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItem::checkable
+
+ This property holds whether the item is checkable.
+
+ A checkable menu item has an on/off state. For example, in a word processor,
+ a "Bold" menu item may be either on or off. A menu item that is not checkable
+ is a command item that is simply executed, e.g. file save.
+
+ The default value is \c false.
+
+ \sa checked, MenuItemGroup
+*/
+bool QQuickPlatformMenuItem::isCheckable() const
+{
+ return m_checkable;
+}
+
+void QQuickPlatformMenuItem::setCheckable(bool checkable)
+{
+ if (m_checkable == checkable)
+ return;
+
+ if (m_handle) {
+ if (checkable)
+ connect(m_handle, &QPlatformMenuItem::activated, this, &QQuickPlatformMenuItem::toggle);
+ else
+ disconnect(m_handle, &QPlatformMenuItem::activated, this, &QQuickPlatformMenuItem::toggle);
+ }
+
+ m_checkable = checkable;
+ sync();
+ emit checkableChanged();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItem::checked
+
+ This property holds whether the item is checked (on) or unchecked (off).
+ The default value is \c false.
+
+ \sa checkable, MenuItemGroup
+*/
+bool QQuickPlatformMenuItem::isChecked() const
+{
+ return m_checked;
+}
+
+void QQuickPlatformMenuItem::setChecked(bool checked)
+{
+ if (m_checked == checked)
+ return;
+
+ if (checked && !m_checkable)
+ setCheckable(true);
+
+ m_checked = checked;
+ sync();
+ emit checkedChanged();
+}
+
+/*!
+ \qmlproperty enumeration Qt.labs.platform::MenuItem::role
+
+ This property holds the role of the item. The role determines whether
+ the item should be placed into the application menu on macOS.
+
+ Available values:
+ \value MenuItem.NoRole The item should not be put into the application menu
+ \value MenuItem.TextHeuristicRole The item should be put in the application menu based on the action's text (default)
+ \value MenuItem.ApplicationSpecificRole The item should be put in the application menu with an application-specific role
+ \value MenuItem.AboutQtRole The item handles the "About Qt" menu item.
+ \value MenuItem.AboutRole The item should be placed where the "About" menu item is in the application menu. The text of
+ the menu item will be set to "About <application name>". The application name is fetched from the
+ \c{Info.plist} file in the application's bundle (See \l{Qt for OS X - Deployment}).
+ \value MenuItem.PreferencesRole The item should be placed where the "Preferences..." menu item is in the application menu.
+ \value MenuItem.QuitRole The item should be placed where the Quit menu item is in the application menu.
+
+ Specifying the role only has effect on items that are in the immediate
+ menus of a menubar, not in the submenus of those menus. For example, if
+ you have a "File" menu in your menubar and the "File" menu has a submenu,
+ specifying a role for the items in that submenu has no effect. They will
+ never be moved to the application menu.
+*/
+QPlatformMenuItem::MenuRole QQuickPlatformMenuItem::role() const
+{
+ return m_role;
+}
+
+void QQuickPlatformMenuItem::setRole(QPlatformMenuItem::MenuRole role)
+{
+ if (m_role == role)
+ return;
+
+ m_role = role;
+ sync();
+ emit roleChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::MenuItem::text
+
+ This property holds the menu item's text.
+*/
+QString QQuickPlatformMenuItem::text() const
+{
+ return m_text;
+}
+
+void QQuickPlatformMenuItem::setText(const QString &text)
+{
+ if (m_text == text)
+ return;
+
+ m_text = text;
+ sync();
+ emit textChanged();
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::MenuItem::iconSource
+
+ This property holds the url of the menu item's icon.
+
+ \code
+ MenuItem {
+ iconName: "edit-undo"
+ iconSource: "qrc:/images/undo.png"
+ }
+ \endcode
+
+ \sa iconName
+*/
+QUrl QQuickPlatformMenuItem::iconSource() const
+{
+ if (!m_iconLoader)
+ return QUrl();
+
+ return m_iconLoader->iconSource();
+}
+
+void QQuickPlatformMenuItem::setIconSource(const QUrl& source)
+{
+ if (source == iconSource())
+ return;
+
+ iconLoader()->setIconSource(source);
+ emit iconSourceChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::MenuItem::iconName
+
+ This property holds the theme name of the menu item's icon.
+
+ \code
+ MenuItem {
+ iconName: "edit-undo"
+ iconSource: "qrc:/images/undo.png"
+ }
+ \endcode
+
+ \sa iconSource, QIcon::fromTheme()
+*/
+QString QQuickPlatformMenuItem::iconName() const
+{
+ if (!m_iconLoader)
+ return QString();
+
+ return m_iconLoader->iconName();
+}
+
+void QQuickPlatformMenuItem::setIconName(const QString& name)
+{
+ if (name == iconName())
+ return;
+
+ iconLoader()->setIconName(name);
+ emit iconNameChanged();
+}
+
+/*!
+ \qmlproperty keysequence Qt.labs.platform::MenuItem::shortcut
+
+ This property holds the menu item's shortcut.
+
+ The shortcut key sequence can be set to one of the
+ \l{QKeySequence::StandardKey}{standard keyboard shortcuts}, or it can be
+ specified by a string containing a sequence of up to four key presses
+ that are needed to \l{triggered}{trigger} the shortcut.
+
+ The default value is an empty key sequence.
+
+ \code
+ MenuItem {
+ shortcut: "Ctrl+E,Ctrl+W"
+ onTriggered: edit.wrapMode = TextEdit.Wrap
+ }
+ \endcode
+*/
+QVariant QQuickPlatformMenuItem::shortcut() const
+{
+ return m_shortcut;
+}
+
+void QQuickPlatformMenuItem::setShortcut(const QVariant& shortcut)
+{
+ if (m_shortcut == shortcut)
+ return;
+
+ m_shortcut = shortcut;
+ sync();
+ emit shortcutChanged();
+}
+
+/*!
+ \qmlproperty font Qt.labs.platform::MenuItem::font
+
+ This property holds the menu item's font.
+
+ \sa text
+*/
+QFont QQuickPlatformMenuItem::font() const
+{
+ return m_font;
+}
+
+void QQuickPlatformMenuItem::setFont(const QFont& font)
+{
+ if (m_font == font)
+ return;
+
+ m_font = font;
+ sync();
+ emit fontChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuItem::toggle()
+
+ Toggles the \l checked state to its opposite state.
+*/
+void QQuickPlatformMenuItem::toggle()
+{
+ if (m_checkable)
+ setChecked(!m_checked);
+}
+
+void QQuickPlatformMenuItem::classBegin()
+{
+}
+
+void QQuickPlatformMenuItem::componentComplete()
+{
+ if (m_handle && m_iconLoader)
+ m_iconLoader->setEnabled(true);
+ m_complete = true;
+ sync();
+}
+
+QQuickPlatformIconLoader *QQuickPlatformMenuItem::iconLoader() const
+{
+ if (!m_iconLoader) {
+ QQuickPlatformMenuItem *that = const_cast<QQuickPlatformMenuItem *>(this);
+ static int slot = staticMetaObject.indexOfSlot("updateIcon()");
+ m_iconLoader = new QQuickPlatformIconLoader(slot, that);
+ m_iconLoader->setEnabled(m_complete);
+ }
+ return m_iconLoader;
+}
+
+void QQuickPlatformMenuItem::updateIcon()
+{
+ if (!m_handle || !m_iconLoader)
+ return;
+
+ m_handle->setIcon(m_iconLoader->icon());
+ sync();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmenuitem_p.h b/src/imports/platform/qquickplatformmenuitem_p.h
new file mode 100644
index 00000000..48a5603e
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenuitem_p.h
@@ -0,0 +1,191 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMMENUITEM_P_H
+#define QQUICKPLATFORMMENUITEM_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 <QtCore/qobject.h>
+#include <QtCore/qurl.h>
+#include <QtGui/qfont.h>
+#include <QtGui/qpa/qplatformmenu.h>
+#include <QtQml/qqmlparserstatus.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QPlatformMenuItem;
+class QQuickPlatformMenu;
+class QQuickPlatformIconLoader;
+class QQuickPlatformMenuItemGroup;
+
+class QQuickPlatformMenuItem : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlParserStatus)
+ Q_PROPERTY(QQuickPlatformMenu *menu READ menu NOTIFY menuChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenu *subMenu READ subMenu NOTIFY subMenuChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenuItemGroup *group READ group WRITE setGroup NOTIFY groupChanged FINAL)
+ Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
+ Q_PROPERTY(bool separator READ isSeparator WRITE setSeparator NOTIFY separatorChanged FINAL)
+ Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged FINAL)
+ Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged FINAL)
+ Q_PROPERTY(QPlatformMenuItem::MenuRole role READ role WRITE setRole NOTIFY roleChanged FINAL)
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
+ Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL)
+ Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL)
+ Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged FINAL)
+ Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
+ Q_ENUMS(QPlatformMenuItem::MenuRole)
+
+public:
+ explicit QQuickPlatformMenuItem(QObject *parent = nullptr);
+ ~QQuickPlatformMenuItem();
+
+ QPlatformMenuItem *handle() const;
+ QPlatformMenuItem *create();
+ void sync();
+
+ QQuickPlatformMenu *menu() const;
+ void setMenu(QQuickPlatformMenu* menu);
+
+ QQuickPlatformMenu *subMenu() const;
+ void setSubMenu(QQuickPlatformMenu *menu);
+
+ QQuickPlatformMenuItemGroup *group() const;
+ void setGroup(QQuickPlatformMenuItemGroup *group);
+
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ bool isSeparator() const;
+ void setSeparator(bool separator);
+
+ bool isCheckable() const;
+ void setCheckable(bool checkable);
+
+ bool isChecked() const;
+ void setChecked(bool checked);
+
+ QPlatformMenuItem::MenuRole role() const;
+ void setRole(QPlatformMenuItem::MenuRole role);
+
+ QString text() const;
+ void setText(const QString &text);
+
+ QUrl iconSource() const;
+ void setIconSource(const QUrl &source);
+
+ QString iconName() const;
+ void setIconName(const QString &name);
+
+ QVariant shortcut() const;
+ void setShortcut(const QVariant& shortcut);
+
+ QFont font() const;
+ void setFont(const QFont &font);
+
+public Q_SLOTS:
+ void toggle();
+
+Q_SIGNALS:
+ void triggered();
+ void hovered();
+
+ void menuChanged();
+ void subMenuChanged();
+ void groupChanged();
+ void enabledChanged();
+ void visibleChanged();
+ void separatorChanged();
+ void checkableChanged();
+ void checkedChanged();
+ void roleChanged();
+ void textChanged();
+ void iconSourceChanged();
+ void iconNameChanged();
+ void shortcutChanged();
+ void fontChanged();
+
+protected:
+ void classBegin() override;
+ void componentComplete() override;
+
+ QQuickPlatformIconLoader *iconLoader() const;
+
+private Q_SLOTS:
+ void updateIcon();
+
+private:
+ bool m_complete;
+ bool m_enabled;
+ bool m_visible;
+ bool m_separator;
+ bool m_checkable;
+ bool m_checked;
+ QPlatformMenuItem::MenuRole m_role;
+ QString m_text;
+ QVariant m_shortcut;
+ QFont m_font;
+ QQuickPlatformMenu *m_menu;
+ QQuickPlatformMenu *m_subMenu;
+ QQuickPlatformMenuItemGroup *m_group;
+ mutable QQuickPlatformIconLoader *m_iconLoader;
+ QPlatformMenuItem *m_handle;
+
+ friend class QQuickPlatformMenu;
+ friend class QQuickPlatformMenuItemGroup;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformMenuItem)
+
+#endif // QQUICKPLATFORMMENUITEM_P_H
diff --git a/src/imports/platform/qquickplatformmenuitemgroup.cpp b/src/imports/platform/qquickplatformmenuitemgroup.cpp
new file mode 100644
index 00000000..1f4dda3c
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenuitemgroup.cpp
@@ -0,0 +1,390 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Templates module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformmenuitemgroup_p.h"
+#include "qquickplatformmenuitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype MenuItemGroup
+ \inherits QtObject
+ \instantiates QQuickPlatformMenuItemGroup
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A group for managing native menu items.
+
+ The MenuItemGroup groups native menu items together.
+
+ MenuItemGroup is exclusive by default. In an exclusive menu item
+ group, only one item can be checked at any time; checking another
+ item automatically unchecks the previously checked one. MenuItemGroup
+ can be configured as non-exclusive, which is particularly useful for
+ showing, hiding, enabling and disabling items together as a group.
+
+ The most straight-forward way to use MenuItemGroup is to assign
+ a list of items.
+
+ \code
+ Menu {
+ id: verticalMenu
+ title: qsTr("Vertical")
+
+ MenuItemGroup {
+ id: verticalGroup
+ items: verticalMenu.items
+ }
+
+ MenuItem { text: qsTr("Top"); checkable: true }
+ MenuItem { text: qsTr("Center"); checked: true }
+ MenuItem { text: qsTr("Bottom"); checkable: true }
+ }
+ \endcode
+
+ The same menu may sometimes contain items that should not be included
+ in the same exclusive group. Such cases are best handled using the
+ \l {MenuItem::group}{group} property.
+
+ \code
+ Menu {
+ id: horizontalMenu
+ title: qsTr("Horizontal")
+
+ MenuItemGroup {
+ id: horizontalGroup
+ }
+
+ MenuItem {
+ checked: true
+ text: qsTr("Left")
+ group: horizontalGroup
+ }
+ MenuItem {
+ checkable: true
+ text: qsTr("Center")
+ group: horizontalGroup
+ }
+ MenuItem {
+ text: qsTr("Right")
+ checkable: true
+ group: horizontalGroup
+ }
+
+ MenuItem { separator: true }
+ MenuItem { text: qsTr("Justify"); checkable: true }
+ MenuItem { text: qsTr("Absolute"); checkable: true }
+ }
+ \endcode
+
+ More advanced use cases can be handled using the addItem() and
+ removeItem() methods.
+
+ \labs
+
+ \sa MenuItem
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MenuItemGroup::triggered(MenuItem item)
+
+ This signal is emitted when an \a item in the group is triggered by the user.
+
+ \sa MenuItem::triggered()
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MenuItemGroup::hovered(MenuItem item)
+
+ This signal is emitted when an \a item in the group is hovered by the user.
+
+ \sa MenuItem::hovered()
+*/
+
+QQuickPlatformMenuItemGroup::QQuickPlatformMenuItemGroup(QObject *parent)
+ : QObject(parent), m_enabled(true), m_visible(true), m_exclusive(true), m_checkedItem(nullptr)
+{
+}
+
+QQuickPlatformMenuItemGroup::~QQuickPlatformMenuItemGroup()
+{
+ clear();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItemGroup::enabled
+
+ This property holds whether the group is enabled. The default value is \c true.
+
+ The enabled state of the group affects the enabled state of each item in the group,
+ except that explicitly disabled items are not enabled even if the group is enabled.
+*/
+bool QQuickPlatformMenuItemGroup::isEnabled() const
+{
+ return m_enabled;
+}
+
+void QQuickPlatformMenuItemGroup::setEnabled(bool enabled)
+{
+ if (m_enabled == enabled)
+ return;
+
+ m_enabled = enabled;
+ emit enabledChanged();
+
+ for (QQuickPlatformMenuItem *item : m_items) {
+ if (item->m_enabled) {
+ item->sync();
+ emit item->enabledChanged();
+ }
+ }
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItemGroup::visible
+
+ This property holds whether the group is visible. The default value is \c true.
+
+ The visibility of the group affects the visibility of each item in the group,
+ except that explicitly hidden items are not visible even if the group is visible.
+*/
+bool QQuickPlatformMenuItemGroup::isVisible() const
+{
+ return m_visible;
+}
+
+void QQuickPlatformMenuItemGroup::setVisible(bool visible)
+{
+ if (m_visible == visible)
+ return;
+
+ m_visible = visible;
+ emit visibleChanged();
+
+ for (QQuickPlatformMenuItem *item : m_items) {
+ if (item->m_visible) {
+ item->sync();
+ emit item->visibleChanged();
+ }
+ }
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::MenuItemGroup::exclusive
+
+ This property holds whether the group is exclusive. The default value is \c true.
+
+ In an exclusive menu item group, only one item can be checked at any time;
+ checking another item automatically unchecks the previously checked one.
+*/
+bool QQuickPlatformMenuItemGroup::isExclusive() const
+{
+ return m_exclusive;
+}
+
+void QQuickPlatformMenuItemGroup::setExclusive(bool exclusive)
+{
+ if (m_exclusive == exclusive)
+ return;
+
+ m_exclusive = exclusive;
+ emit exclusiveChanged();
+
+ for (QQuickPlatformMenuItem *item : m_items)
+ item->sync();
+}
+
+/*!
+ \qmlproperty MenuItem Qt.labs.platform::MenuItemGroup::checkedItem
+
+ This property holds the currently checked item in the group, or \c null if no item is checked.
+*/
+QQuickPlatformMenuItem *QQuickPlatformMenuItemGroup::checkedItem() const
+{
+ return m_checkedItem;
+}
+
+void QQuickPlatformMenuItemGroup::setCheckedItem(QQuickPlatformMenuItem *item)
+{
+ if (m_checkedItem == item)
+ return;
+
+ if (m_checkedItem)
+ m_checkedItem->setChecked(false);
+
+ m_checkedItem = item;
+ emit checkedItemChanged();
+
+ if (item)
+ item->setChecked(true);
+}
+
+/*!
+ \qmlproperty list<MenuItem> Qt.labs.platform::MenuItemGroup::items
+
+ This property holds the list of items in the group.
+*/
+QQmlListProperty<QQuickPlatformMenuItem> QQuickPlatformMenuItemGroup::items()
+{
+ return QQmlListProperty<QQuickPlatformMenuItem>(this, nullptr, items_append, items_count, items_at, items_clear);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuItemGroup::addItem(MenuItem item)
+
+ Adds an \a item to the group.
+*/
+void QQuickPlatformMenuItemGroup::addItem(QQuickPlatformMenuItem *item)
+{
+ if (!item || m_items.contains(item))
+ return;
+
+ m_items.append(item);
+ item->setGroup(this);
+
+ connect(item, &QQuickPlatformMenuItem::checkedChanged, this, &QQuickPlatformMenuItemGroup::updateCurrent);
+ connect(item, &QQuickPlatformMenuItem::triggered, this, &QQuickPlatformMenuItemGroup::activateItem);
+ connect(item, &QQuickPlatformMenuItem::hovered, this, &QQuickPlatformMenuItemGroup::hoverItem);
+
+ if (m_exclusive && item->isChecked())
+ setCheckedItem(item);
+
+ emit itemsChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuItemGroup::removeItem(MenuItem item)
+
+ Removes an \a item from the group.
+*/
+void QQuickPlatformMenuItemGroup::removeItem(QQuickPlatformMenuItem *item)
+{
+ if (!item || !m_items.contains(item))
+ return;
+
+ m_items.removeOne(item);
+ item->setGroup(nullptr);
+
+ disconnect(item, &QQuickPlatformMenuItem::checkedChanged, this, &QQuickPlatformMenuItemGroup::updateCurrent);
+ disconnect(item, &QQuickPlatformMenuItem::triggered, this, &QQuickPlatformMenuItemGroup::activateItem);
+ disconnect(item, &QQuickPlatformMenuItem::hovered, this, &QQuickPlatformMenuItemGroup::hoverItem);
+
+ if (m_checkedItem == item)
+ setCheckedItem(nullptr);
+
+ emit itemsChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::MenuItemGroup::clear()
+
+ Removes all items from the group.
+*/
+void QQuickPlatformMenuItemGroup::clear()
+{
+ if (m_items.isEmpty())
+ return;
+
+ for (QQuickPlatformMenuItem *item : m_items) {
+ item->setGroup(nullptr);
+ disconnect(item, &QQuickPlatformMenuItem::checkedChanged, this, &QQuickPlatformMenuItemGroup::updateCurrent);
+ disconnect(item, &QQuickPlatformMenuItem::triggered, this, &QQuickPlatformMenuItemGroup::activateItem);
+ disconnect(item, &QQuickPlatformMenuItem::hovered, this, &QQuickPlatformMenuItemGroup::hoverItem);
+ }
+
+ setCheckedItem(nullptr);
+
+ m_items.clear();
+ emit itemsChanged();
+}
+
+QQuickPlatformMenuItem *QQuickPlatformMenuItemGroup::findCurrent() const
+{
+ for (QQuickPlatformMenuItem *item : m_items) {
+ if (item->isChecked())
+ return item;
+ }
+ return nullptr;
+}
+
+void QQuickPlatformMenuItemGroup::updateCurrent()
+{
+ if (!m_exclusive)
+ return;
+
+ QQuickPlatformMenuItem *item = qobject_cast<QQuickPlatformMenuItem*>(sender());
+ if (item && item->isChecked())
+ setCheckedItem(item);
+}
+
+void QQuickPlatformMenuItemGroup::activateItem()
+{
+ QQuickPlatformMenuItem *item = qobject_cast<QQuickPlatformMenuItem*>(sender());
+ if (item)
+ emit triggered(item);
+}
+
+void QQuickPlatformMenuItemGroup::hoverItem()
+{
+ QQuickPlatformMenuItem *item = qobject_cast<QQuickPlatformMenuItem*>(sender());
+ if (item)
+ emit hovered(item);
+}
+
+void QQuickPlatformMenuItemGroup::items_append(QQmlListProperty<QQuickPlatformMenuItem> *prop, QQuickPlatformMenuItem *item)
+{
+ QQuickPlatformMenuItemGroup *group = static_cast<QQuickPlatformMenuItemGroup *>(prop->object);
+ group->addItem(item);
+}
+
+int QQuickPlatformMenuItemGroup::items_count(QQmlListProperty<QQuickPlatformMenuItem> *prop)
+{
+ QQuickPlatformMenuItemGroup *group = static_cast<QQuickPlatformMenuItemGroup *>(prop->object);
+ return group->m_items.count();
+}
+
+QQuickPlatformMenuItem *QQuickPlatformMenuItemGroup::items_at(QQmlListProperty<QQuickPlatformMenuItem> *prop, int index)
+{
+ QQuickPlatformMenuItemGroup *group = static_cast<QQuickPlatformMenuItemGroup *>(prop->object);
+ return group->m_items.value(index);
+}
+
+void QQuickPlatformMenuItemGroup::items_clear(QQmlListProperty<QQuickPlatformMenuItem> *prop)
+{
+ QQuickPlatformMenuItemGroup *group = static_cast<QQuickPlatformMenuItemGroup *>(prop->object);
+ group->clear();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmenuitemgroup_p.h b/src/imports/platform/qquickplatformmenuitemgroup_p.h
new file mode 100644
index 00000000..f5797eff
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenuitemgroup_p.h
@@ -0,0 +1,123 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Templates module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMMENUITEMGROUP_P_H
+#define QQUICKPLATFORMMENUITEMGROUP_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 <QtCore/qobject.h>
+#include <QtCore/qvector.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformMenuItem;
+class QQuickPlatformMenuItemGroupPrivate;
+
+class QQuickPlatformMenuItemGroup : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
+ Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive NOTIFY exclusiveChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenuItem *checkedItem READ checkedItem WRITE setCheckedItem NOTIFY checkedItemChanged FINAL)
+ Q_PROPERTY(QQmlListProperty<QQuickPlatformMenuItem> items READ items NOTIFY itemsChanged FINAL)
+
+public:
+ explicit QQuickPlatformMenuItemGroup(QObject *parent = nullptr);
+ ~QQuickPlatformMenuItemGroup();
+
+ bool isEnabled() const;
+ void setEnabled(bool enabled);
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ bool isExclusive() const;
+ void setExclusive(bool exclusive);
+
+ QQuickPlatformMenuItem *checkedItem() const;
+ void setCheckedItem(QQuickPlatformMenuItem *item);
+
+ QQmlListProperty<QQuickPlatformMenuItem> items();
+
+ Q_INVOKABLE void addItem(QQuickPlatformMenuItem *item);
+ Q_INVOKABLE void removeItem(QQuickPlatformMenuItem *item);
+ Q_INVOKABLE void clear();
+
+Q_SIGNALS:
+ void triggered(QQuickPlatformMenuItem *item);
+ void hovered(QQuickPlatformMenuItem *item);
+
+ void enabledChanged();
+ void visibleChanged();
+ void exclusiveChanged();
+ void checkedItemChanged();
+ void itemsChanged();
+
+private:
+ QQuickPlatformMenuItem *findCurrent() const;
+ void updateCurrent();
+ void activateItem();
+ void hoverItem();
+
+ static void items_append(QQmlListProperty<QQuickPlatformMenuItem> *prop, QQuickPlatformMenuItem *obj);
+ static int items_count(QQmlListProperty<QQuickPlatformMenuItem> *prop);
+ static QQuickPlatformMenuItem *items_at(QQmlListProperty<QQuickPlatformMenuItem> *prop, int index);
+ static void items_clear(QQmlListProperty<QQuickPlatformMenuItem> *prop);
+
+ bool m_enabled;
+ bool m_visible;
+ bool m_exclusive;
+ QQuickPlatformMenuItem *m_checkedItem;
+ QVector<QQuickPlatformMenuItem*> m_items;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformMenuItemGroup)
+
+#endif // QQUICKPLATFORMMENUITEMGROUP_P_H
diff --git a/src/imports/platform/qquickplatformmenuseparator.cpp b/src/imports/platform/qquickplatformmenuseparator.cpp
new file mode 100644
index 00000000..908ea075
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenuseparator.cpp
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformmenuseparator_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype MenuSeparator
+ \inherits MenuItem
+ \instantiates QQuickPlatformMenuSeparator
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native menu separator.
+
+ The MenuSeparator type is provided for convenience. It is a MenuItem
+ that has the \l {MenuItem::}{separator} property set to \c true by default.
+
+ \image qtlabsplatform-menubar.png
+
+ \labs
+
+ \sa Menu, MenuItem
+*/
+
+QQuickPlatformMenuSeparator::QQuickPlatformMenuSeparator(QObject *parent)
+ : QQuickPlatformMenuItem(parent)
+{
+ setSeparator(true);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmenuseparator_p.h b/src/imports/platform/qquickplatformmenuseparator_p.h
new file mode 100644
index 00000000..ce5ed391
--- /dev/null
+++ b/src/imports/platform/qquickplatformmenuseparator_p.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMMENUSEPARATOR_P_H
+#define QQUICKPLATFORMMENUSEPARATOR_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 "qquickplatformmenuitem_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformMenuSeparator : public QQuickPlatformMenuItem
+{
+ Q_OBJECT
+
+public:
+ explicit QQuickPlatformMenuSeparator(QObject *parent = nullptr);
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformMenuSeparator)
+
+#endif // QQUICKPLATFORMMENUSEPARATOR_P_H
diff --git a/src/imports/platform/qquickplatformmessagedialog.cpp b/src/imports/platform/qquickplatformmessagedialog.cpp
new file mode 100644
index 00000000..20216e9b
--- /dev/null
+++ b/src/imports/platform/qquickplatformmessagedialog.cpp
@@ -0,0 +1,383 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformmessagedialog_p.h"
+
+#include <QtQml/qqmlinfo.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype MessageDialog
+ \inherits Dialog
+ \instantiates QQuickPlatformMessageDialog
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A native message dialog.
+
+ The MessageDialog type provides a QML API for native platform message dialogs.
+
+ \image qtlabsplatform-messagedialog-android.png
+
+ A message dialog is used to inform the user, or ask the user a question.
+ A message dialog displays a primary \l text to alert the user to a situation,
+ an \l {informativeText}{informative text} to further explain the alert or to
+ ask the user a question, and an optional \l {detailedText}{detailed text} to
+ provide even more data if the user requests it. A message box can also display
+ a configurable set of \l buttons for accepting a user response.
+
+ To show a message dialog, construct an instance of MessageDialog, set the
+ desired properties, and call \l {Dialog::}{open()}.
+
+ \code
+ MessageDialog {
+ buttons: MessageDialog.Ok
+ text: "The document has been modified."
+ }
+ \endcode
+
+ The user must click the \uicontrol OK button to dismiss the message dialog.
+ A modal message dialog blocks the rest of the GUI until the message is
+ dismissed.
+
+ A more elaborate approach than just alerting the user to an event is to
+ also ask the user what to do about it. Store the question in the
+ \l {informativeText}{informative text} property, and specify the \l buttons
+ property to the set of buttons you want as the set of user responses. The
+ buttons are specified by combining values using the bitwise OR operator. The
+ display order for the buttons is platform dependent.
+
+ \code
+ MessageDialog {
+ text: "The document has been modified."
+ informativeText: "Do you want to save your changes?"
+ buttons: MessageDialog.Ok | MessageDialog.Cancel
+
+ onAccepted: document.save()
+ }
+ \endcode
+
+ \image qtlabsplatform-messagedialog-informative-android.png
+
+ The \l clicked() signal passes the information of which button was clicked.
+
+ A native platform message dialog is currently available on the following platforms:
+
+ \list
+ \li iOS
+ \li Android
+ \li WinRT
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::clicked(button)
+
+ This signal is emitted when a dialog \a button is clicked.
+
+ \sa buttons
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::okClicked()
+
+ This signal is emitted when \uicontrol Ok is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::saveClicked()
+
+ This signal is emitted when \uicontrol Save is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::saveAllClicked()
+
+ This signal is emitted when \uicontrol {Save All} is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::openClicked()
+
+ This signal is emitted when \uicontrol Open is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::yesClicked()
+
+ This signal is emitted when \uicontrol Yes is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::yesToAllClicked()
+
+ This signal is emitted when \uicontrol {Yes To All} is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::noClicked()
+
+ This signal is emitted when \uicontrol No is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::noToAllClicked()
+
+ This signal is emitted when \uicontrol {No To All} is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::abortClicked()
+
+ This signal is emitted when \uicontrol Abort is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::retryClicked()
+
+ This signal is emitted when \uicontrol Retry is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::ignoreClicked()
+
+ This signal is emitted when \uicontrol Ignore is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::closeClicked()
+
+ This signal is emitted when \uicontrol Close is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::cancelClicked()
+
+ This signal is emitted when \uicontrol Cancel is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::discardClicked()
+
+ This signal is emitted when \uicontrol Discard is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::helpClicked()
+
+ This signal is emitted when \uicontrol Help is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::applyClicked()
+
+ This signal is emitted when \uicontrol Apply is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::resetClicked()
+
+ This signal is emitted when \uicontrol Reset is clicked.
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::MessageDialog::restoreDefaultsClicked()
+
+ This signal is emitted when \uicontrol {Restore Defaults} is clicked.
+*/
+
+QQuickPlatformMessageDialog::QQuickPlatformMessageDialog(QObject *parent)
+ : QQuickPlatformDialog(QPlatformTheme::MessageDialog, parent),
+ m_options(QMessageDialogOptions::create())
+{
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::MessageDialog::text
+
+ This property holds the text to be displayed on the message dialog.
+
+ \sa informativeText, detailedText
+*/
+QString QQuickPlatformMessageDialog::text() const
+{
+ return m_options->text();
+}
+
+void QQuickPlatformMessageDialog::setText(const QString &text)
+{
+ if (m_options->text() == text)
+ return;
+
+ m_options->setText(text);
+ emit textChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::MessageDialog::informativeText
+
+ This property holds the informative text that provides a fuller description for the message.
+
+ Informative text can be used to expand upon the \l text to give more information to the user.
+
+ \sa text, detailedText
+*/
+QString QQuickPlatformMessageDialog::informativeText() const
+{
+ return m_options->informativeText();
+}
+
+void QQuickPlatformMessageDialog::setInformativeText(const QString &text)
+{
+ if (m_options->informativeText() == text)
+ return;
+
+ m_options->setInformativeText(text);
+ emit informativeTextChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::MessageDialog::detailedText
+
+ This property holds the text to be displayed in the details area.
+
+ \sa text, informativeText
+*/
+QString QQuickPlatformMessageDialog::detailedText() const
+{
+ return m_options->detailedText();
+}
+
+void QQuickPlatformMessageDialog::setDetailedText(const QString &text)
+{
+ if (m_options->detailedText() == text)
+ return;
+
+ m_options->setDetailedText(text);
+ emit detailedTextChanged();
+}
+
+/*!
+ \qmlproperty flags Qt.labs.platform::MessageDialog::buttons
+
+ This property holds a combination of buttons that are used by the message dialog.
+ The default value is \c MessageDialog.NoButton.
+
+ Possible flags:
+ \value MessageDialog.Ok An "OK" button defined with the \c AcceptRole.
+ \value MessageDialog.Open An "Open" button defined with the \c AcceptRole.
+ \value MessageDialog.Save A "Save" button defined with the \c AcceptRole.
+ \value MessageDialog.Cancel A "Cancel" button defined with the \c RejectRole.
+ \value MessageDialog.Close A "Close" button defined with the \c RejectRole.
+ \value MessageDialog.Discard A "Discard" or "Don't Save" button, depending on the platform, defined with the \c DestructiveRole.
+ \value MessageDialog.Apply An "Apply" button defined with the \c ApplyRole.
+ \value MessageDialog.Reset A "Reset" button defined with the \c ResetRole.
+ \value MessageDialog.RestoreDefaults A "Restore Defaults" button defined with the \c ResetRole.
+ \value MessageDialog.Help A "Help" button defined with the \c HelpRole.
+ \value MessageDialog.SaveAll A "Save All" button defined with the \c AcceptRole.
+ \value MessageDialog.Yes A "Yes" button defined with the \c YesRole.
+ \value MessageDialog.YesToAll A "Yes to All" button defined with the \c YesRole.
+ \value MessageDialog.No A "No" button defined with the \c NoRole.
+ \value MessageDialog.NoToAll A "No to All" button defined with the \c NoRole.
+ \value MessageDialog.Abort An "Abort" button defined with the \c RejectRole.
+ \value MessageDialog.Retry A "Retry" button defined with the \c AcceptRole.
+ \value MessageDialog.Ignore An "Ignore" button defined with the \c AcceptRole.
+ \value MessageDialog.NoButton The dialog has no buttons.
+
+ \sa clicked()
+*/
+QPlatformDialogHelper::StandardButtons QQuickPlatformMessageDialog::buttons() const
+{
+ return m_options->standardButtons();
+}
+
+void QQuickPlatformMessageDialog::setButtons(QPlatformDialogHelper::StandardButtons buttons)
+{
+ if (m_options->standardButtons() == buttons)
+ return;
+
+ m_options->setStandardButtons(buttons);
+ emit buttonsChanged();
+}
+
+void QQuickPlatformMessageDialog::onCreate(QPlatformDialogHelper *dialog)
+{
+ if (QPlatformMessageDialogHelper *messageDialog = qobject_cast<QPlatformMessageDialogHelper *>(dialog)) {
+ connect(messageDialog, &QPlatformMessageDialogHelper::clicked, this, &QQuickPlatformMessageDialog::handleClick);
+ messageDialog->setOptions(m_options);
+ }
+}
+
+void QQuickPlatformMessageDialog::onShow(QPlatformDialogHelper *dialog)
+{
+ m_options->setWindowTitle(title());
+ if (QPlatformMessageDialogHelper *messageDialog = qobject_cast<QPlatformMessageDialogHelper *>(dialog))
+ messageDialog->setOptions(m_options);
+}
+
+void QQuickPlatformMessageDialog::handleClick(QPlatformDialogHelper::StandardButton button)
+{
+ done(button);
+ emit clicked(button);
+
+ switch (button) {
+ case QPlatformDialogHelper::Ok: emit okClicked(); break;
+ case QPlatformDialogHelper::Save: emit saveClicked(); break;
+ case QPlatformDialogHelper::SaveAll: emit saveAllClicked(); break;
+ case QPlatformDialogHelper::Open: emit openClicked(); break;
+ case QPlatformDialogHelper::Yes: emit yesClicked(); break;
+ case QPlatformDialogHelper::YesToAll: emit yesToAllClicked(); break;
+ case QPlatformDialogHelper::No: emit noClicked(); break;
+ case QPlatformDialogHelper::NoToAll: emit noToAllClicked(); break;
+ case QPlatformDialogHelper::Abort: emit abortClicked(); break;
+ case QPlatformDialogHelper::Retry: emit retryClicked(); break;
+ case QPlatformDialogHelper::Ignore: emit ignoreClicked(); break;
+ case QPlatformDialogHelper::Close: emit closeClicked(); break;
+ case QPlatformDialogHelper::Cancel: emit cancelClicked(); break;
+ case QPlatformDialogHelper::Discard: emit discardClicked(); break;
+ case QPlatformDialogHelper::Help: emit helpClicked(); break;
+ case QPlatformDialogHelper::Apply: emit applyClicked(); break;
+ case QPlatformDialogHelper::Reset: emit resetClicked(); break;
+ case QPlatformDialogHelper::RestoreDefaults: emit restoreDefaultsClicked(); break;
+ default: qmlInfo(this) << "unknown button" << button; break;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmessagedialog_p.h b/src/imports/platform/qquickplatformmessagedialog_p.h
new file mode 100644
index 00000000..e8355932
--- /dev/null
+++ b/src/imports/platform/qquickplatformmessagedialog_p.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.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 "qquickplatformdialog_p.h"
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformMessageDialog : public QQuickPlatformDialog
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
+ Q_PROPERTY(QString informativeText READ informativeText WRITE setInformativeText NOTIFY informativeTextChanged FINAL)
+ Q_PROPERTY(QString detailedText READ detailedText WRITE setDetailedText NOTIFY detailedTextChanged FINAL)
+ Q_PROPERTY(QPlatformDialogHelper::StandardButtons buttons READ buttons WRITE setButtons NOTIFY buttonsChanged FINAL)
+ Q_FLAGS(QPlatformDialogHelper::StandardButtons)
+
+public:
+ explicit QQuickPlatformMessageDialog(QObject *parent = nullptr);
+
+ QString text() const;
+ void setText(const QString &text);
+
+ QString informativeText() const;
+ void setInformativeText(const QString &text);
+
+ QString detailedText() const;
+ void setDetailedText(const QString &text);
+
+ QPlatformDialogHelper::StandardButtons buttons() const;
+ void setButtons(QPlatformDialogHelper::StandardButtons buttons);
+
+Q_SIGNALS:
+ void textChanged();
+ void informativeTextChanged();
+ void detailedTextChanged();
+ void buttonsChanged();
+ void clicked(QPlatformDialogHelper::StandardButton button);
+
+ void okClicked();
+ void saveClicked();
+ void saveAllClicked();
+ void openClicked();
+ void yesClicked();
+ void yesToAllClicked();
+ void noClicked();
+ void noToAllClicked();
+ void abortClicked();
+ void retryClicked();
+ void ignoreClicked();
+ void closeClicked();
+ void cancelClicked();
+ void discardClicked();
+ void helpClicked();
+ void applyClicked();
+ void resetClicked();
+ void restoreDefaultsClicked();
+
+protected:
+ void onCreate(QPlatformDialogHelper *dialog) override;
+ void onShow(QPlatformDialogHelper *dialog) override;
+
+private Q_SLOTS:
+ void handleClick(QPlatformDialogHelper::StandardButton button);
+
+private:
+ QSharedPointer<QMessageDialogOptions> m_options;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformMessageDialog)
+
+#endif // QQUICKPLATFORMMESSAGEDIALOG_P_H
diff --git a/src/imports/platform/qquickplatformstandardpaths.cpp b/src/imports/platform/qquickplatformstandardpaths.cpp
new file mode 100644
index 00000000..004d3c86
--- /dev/null
+++ b/src/imports/platform/qquickplatformstandardpaths.cpp
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformstandardpaths_p.h"
+
+#include <QtQml/qqmlengine.h>
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype StandardPaths
+ \inherits QtObject
+ \instantiates QQuickPlatformStandardPaths
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief Provides access to the standard system paths.
+
+ The StandardPaths singleton type provides methods for querying the standard
+ system paths. The standard paths are mostly useful in conjunction with the
+ FileDialog and FolderDialog types.
+
+ \qml
+ FileDialog {
+ folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
+ }
+ \endqml
+
+ \labs
+
+ \sa FileDialog, FolderDialog, QStandardPaths
+*/
+
+static QList<QUrl> toUrlList(const QStringList &paths)
+{
+ QList<QUrl> urls;
+ urls.reserve(paths.size());
+ for (const QString &path : paths)
+ urls += QUrl::fromLocalFile(path);
+ return urls;
+}
+
+QQuickPlatformStandardPaths::QQuickPlatformStandardPaths(QObject *parent)
+ : QObject(parent)
+{
+}
+
+QObject *QQuickPlatformStandardPaths::create(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(scriptEngine);
+ return new QQuickPlatformStandardPaths(engine);
+}
+
+/*!
+ \qmlmethod string Qt.labs.platform::StandardPaths::displayName(StandardLocation type)
+
+ \sa QStandardPaths::displayName()
+*/
+QString QQuickPlatformStandardPaths::displayName(QStandardPaths::StandardLocation type)
+{
+ return QStandardPaths::displayName(type);
+}
+
+/*!
+ \qmlmethod url Qt.labs.platform::StandardPaths::findExecutable(string executableName, list<string> paths)
+
+ \sa QStandardPaths::findExecutable()
+*/
+QUrl QQuickPlatformStandardPaths::findExecutable(const QString &executableName, const QStringList &paths)
+{
+ return QUrl::fromLocalFile(QStandardPaths::findExecutable(executableName, paths));
+}
+
+/*!
+ \qmlmethod url Qt.labs.platform::StandardPaths::locate(StandardLocation type, string fileName, LocateOptions options = LocateFile)
+
+ \sa QStandardPaths::locate()
+*/
+QUrl QQuickPlatformStandardPaths::locate(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options)
+{
+ return QUrl::fromLocalFile(QStandardPaths::locate(type, fileName, options));
+}
+
+/*!
+ \qmlmethod list<url> Qt.labs.platform::StandardPaths::locateAll(StandardLocation type, string fileName, LocateOptions options = LocateFile)
+
+ \sa QStandardPaths::locateAll()
+*/
+QList<QUrl> QQuickPlatformStandardPaths::locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options)
+{
+ return toUrlList(QStandardPaths::locateAll(type, fileName, options));
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::StandardPaths::setTestModeEnabled(bool testMode)
+
+ \sa QStandardPaths::setTestModeEnabled()
+*/
+void QQuickPlatformStandardPaths::setTestModeEnabled(bool testMode)
+{
+ QStandardPaths::setTestModeEnabled(testMode);
+}
+
+/*!
+ \qmlmethod list<url> Qt.labs.platform::StandardPaths::standardLocations(StandardLocation type)
+
+ \sa QStandardPaths::standardLocations()
+*/
+QList<QUrl> QQuickPlatformStandardPaths::standardLocations(QStandardPaths::StandardLocation type)
+{
+ return toUrlList(QStandardPaths::standardLocations(type));
+}
+
+/*!
+ \qmlmethod url Qt.labs.platform::StandardPaths::writableLocation(StandardLocation type)
+
+ \sa QStandardPaths::writableLocation()
+*/
+QUrl QQuickPlatformStandardPaths::writableLocation(QStandardPaths::StandardLocation type)
+{
+ return QUrl::fromLocalFile(QStandardPaths::writableLocation(type));
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformstandardpaths_p.h b/src/imports/platform/qquickplatformstandardpaths_p.h
new file mode 100644
index 00000000..b6504e70
--- /dev/null
+++ b/src/imports/platform/qquickplatformstandardpaths_p.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMSTANDARDPATHS_P_H
+#define QQUICKPLATFORMSTANDARDPATHS_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 <QtCore/qobject.h>
+#include <QtCore/qstandardpaths.h>
+#include <QtCore/qurl.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQmlEngine;
+class QJSEngine;
+
+class QQuickPlatformStandardPaths : public QObject
+{
+ Q_OBJECT
+ Q_ENUMS(QStandardPaths::StandardLocation QStandardPaths::LocateOptions)
+
+public:
+ explicit QQuickPlatformStandardPaths(QObject *parent = nullptr);
+
+ static QObject *create(QQmlEngine *engine, QJSEngine *scriptEngine);
+
+ Q_INVOKABLE static QString displayName(QStandardPaths::StandardLocation type);
+ Q_INVOKABLE static QUrl findExecutable(const QString &executableName, const QStringList &paths = QStringList());
+ Q_INVOKABLE static QUrl locate(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
+ Q_INVOKABLE static QList<QUrl> locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
+ Q_INVOKABLE static void setTestModeEnabled(bool testMode);
+ Q_INVOKABLE static QList<QUrl> standardLocations(QStandardPaths::StandardLocation type);
+ Q_INVOKABLE static QUrl writableLocation(QStandardPaths::StandardLocation type);
+
+private:
+ Q_DISABLE_COPY(QQuickPlatformStandardPaths)
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformStandardPaths)
+
+#endif // QQUICKPLATFORMSTANDARDPATHS_P_H
diff --git a/src/imports/platform/qquickplatformsystemtrayicon.cpp b/src/imports/platform/qquickplatformsystemtrayicon.cpp
new file mode 100644
index 00000000..70393c41
--- /dev/null
+++ b/src/imports/platform/qquickplatformsystemtrayicon.cpp
@@ -0,0 +1,441 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qquickplatformsystemtrayicon_p.h"
+#include "qquickplatformmenu_p.h"
+#include "qquickplatformiconloader_p.h"
+
+#include <QtCore/qloggingcategory.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/private/qguiapplication_p.h>
+
+#include "widgets/qwidgetplatform_p.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \qmltype SystemTrayIcon
+ \inherits QtObject
+ \instantiates QQuickPlatformSystemTrayIcon
+ \inqmlmodule Qt.labs.platform
+ \since 5.8
+ \brief A system tray icon.
+
+ The SystemTrayIcon type provides an icon for an application in the system tray.
+
+ Many desktop platforms provide a special system tray or notification area,
+ where applications can display icons and notification messages.
+
+ \image qtlabsplatform-systemtrayicon.png
+
+ The following example shows how to create a system tray icon, and how to make
+ use of the \l activated() signal:
+
+ \code
+ SystemTrayIcon {
+ visible: true
+ iconSource: "qrc:/images/tray-icon.png"
+
+ onActivated: {
+ window.show()
+ window.raise()
+ window.requestActivate()
+ }
+ }
+ \endcode
+
+ \section2 Tray menu
+
+ SystemTrayIcon can have a menu that opens when the icon is activated.
+
+ \image qtlabsplatform-systemtrayicon-menu.png
+
+ The following example illustrates how to assign a \l Menu to a system tray icon:
+
+ \code
+ SystemTrayIcon {
+ visible: true
+ iconSource: "qrc:/images/tray-icon.png"
+
+ menu: Menu {
+ MenuItem {
+ text: qsTr("Quit")
+ onActivated: Qt.quit()
+ }
+ }
+ }
+ \endcode
+
+ \section2 Notification messages
+
+ SystemTrayIcon can display notification messages.
+
+ \image qtlabsplatform-systemtrayicon-message.png
+
+ The following example presents how to show a notification message using
+ \l showMessage(), and how to make use of the \l messageClicked() signal:
+
+ \code
+ SystemTrayIcon {
+ visible: true
+ iconSource: "qrc:/images/tray-icon.png"
+
+ onMessageClicked: console.log("Message clicked")
+ Component.onCompleted: showMessage("Message title", "Something important came up. Click this to know more.")
+ }
+ \endcode
+
+ \section2 Availability
+
+ A native system tray icon is currently \l available on the following platforms:
+
+ \list
+ \li All window managers and independent tray implementations for X11 that implement the
+ \l{http://standards.freedesktop.org/systemtray-spec/systemtray-spec-0.2.html}
+ {freedesktop.org XEmbed system tray specification}.
+ \li All desktop environments that implement the
+ \l{http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/StatusNotifierItem}
+ {freedesktop.org D-Bus StatusNotifierItem specification}, including recent versions of KDE and Unity.
+ \li All supported versions of macOS. Note that the Growl notification system must be installed
+ for showMessage() to display messages on OS X prior to 10.8 (Mountain Lion).
+ \endlist
+
+ \input includes/widgets.qdocinc 1
+
+ \labs
+
+ \sa Menu
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::SystemTrayIcon::activated(ActivationReason reason)
+
+ This signal is emitted when the system tray icon is activated by the user. The
+ \a reason argument specifies how the system tray icon was activated.
+
+ Available reasons:
+
+ \value SystemTrayIcon.Unknown Unknown reason
+ \value SystemTrayIcon.Context The context menu for the system tray icon was requested
+ \value SystemTrayIcon.DoubleClick The system tray icon was double clicked
+ \value SystemTrayIcon.Trigger The system tray icon was clicked
+ \value SystemTrayIcon.MiddleClick The system tray icon was clicked with the middle mouse button
+*/
+
+/*!
+ \qmlsignal Qt.labs.platform::SystemTrayIcon::messageClicked()
+
+ This signal is emitted when a notification message is clicked by the user.
+
+ \sa showMessage()
+*/
+
+Q_DECLARE_LOGGING_CATEGORY(qtLabsPlatformTray)
+
+QQuickPlatformSystemTrayIcon::QQuickPlatformSystemTrayIcon(QObject *parent)
+ : QObject(parent),
+ m_complete(false),
+ m_visible(false),
+ m_menu(nullptr),
+ m_iconLoader(nullptr),
+ m_handle(nullptr)
+{
+ m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon();
+ if (!m_handle)
+ m_handle = QWidgetPlatform::createSystemTrayIcon(this);
+ qCDebug(qtLabsPlatformTray) << "SystemTrayIcon ->" << m_handle;
+
+ if (m_handle) {
+ connect(m_handle, &QPlatformSystemTrayIcon::activated, this, &QQuickPlatformSystemTrayIcon::activated);
+ connect(m_handle, &QPlatformSystemTrayIcon::messageClicked, this, &QQuickPlatformSystemTrayIcon::messageClicked);
+ }
+}
+
+QQuickPlatformSystemTrayIcon::~QQuickPlatformSystemTrayIcon()
+{
+ if (m_menu)
+ m_menu->setSystemTrayIcon(nullptr);
+ cleanup();
+ delete m_iconLoader;
+ m_iconLoader = nullptr;
+ delete m_handle;
+ m_handle = nullptr;
+}
+
+QPlatformSystemTrayIcon *QQuickPlatformSystemTrayIcon::handle() const
+{
+ return m_handle;
+}
+
+/*!
+ \readonly
+ \qmlproperty bool Qt.labs.platform::SystemTrayIcon::available
+
+ This property holds whether the system tray is available.
+*/
+bool QQuickPlatformSystemTrayIcon::isAvailable() const
+{
+ return m_handle && m_handle->isSystemTrayAvailable();
+}
+
+/*!
+ \readonly
+ \qmlproperty bool Qt.labs.platform::SystemTrayIcon::supportsMessages
+
+ This property holds whether the system tray icon supports notification messages.
+
+ \sa showMessage()
+*/
+bool QQuickPlatformSystemTrayIcon::supportsMessages() const
+{
+ return m_handle && m_handle->supportsMessages();
+}
+
+/*!
+ \qmlproperty bool Qt.labs.platform::SystemTrayIcon::visible
+
+ This property holds whether the system tray icon is visible.
+
+ The default value is \c false.
+*/
+bool QQuickPlatformSystemTrayIcon::isVisible() const
+{
+ return m_visible;
+}
+
+void QQuickPlatformSystemTrayIcon::setVisible(bool visible)
+{
+ if (m_visible == visible)
+ return;
+
+ if (m_handle && m_complete) {
+ if (visible)
+ init();
+ else
+ cleanup();
+ }
+
+ m_visible = visible;
+ emit visibleChanged();
+}
+
+/*!
+ \qmlproperty url Qt.labs.platform::SystemTrayIcon::iconSource
+
+ This property holds the url of the system tray icon.
+
+ \sa iconName
+*/
+QUrl QQuickPlatformSystemTrayIcon::iconSource() const
+{
+ if (!m_iconLoader)
+ return QUrl();
+
+ return m_iconLoader->iconSource();
+}
+
+void QQuickPlatformSystemTrayIcon::setIconSource(const QUrl& source)
+{
+ if (source == iconSource())
+ return;
+
+ iconLoader()->setIconSource(source);
+ emit iconSourceChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::SystemTrayIcon::iconName
+
+ This property holds the theme name of the system tray icon.
+
+ \sa iconSource, QIcon::fromTheme()
+*/
+QString QQuickPlatformSystemTrayIcon::iconName() const
+{
+ if (!m_iconLoader)
+ return QString();
+
+ return m_iconLoader->iconName();
+}
+
+void QQuickPlatformSystemTrayIcon::setIconName(const QString& name)
+{
+ if (name == iconName())
+ return;
+
+ iconLoader()->setIconName(name);
+ emit iconNameChanged();
+}
+
+/*!
+ \qmlproperty string Qt.labs.platform::SystemTrayIcon::tooltip
+
+ This property holds the tooltip of the system tray icon.
+*/
+QString QQuickPlatformSystemTrayIcon::tooltip() const
+{
+ return m_tooltip;
+}
+
+void QQuickPlatformSystemTrayIcon::setTooltip(const QString &tooltip)
+{
+ if (m_tooltip == tooltip)
+ return;
+
+ if (m_handle && m_complete)
+ m_handle->updateToolTip(tooltip);
+
+ m_tooltip = tooltip;
+ emit tooltipChanged();
+}
+
+/*!
+ \qmlproperty Menu Qt.labs.platform::SystemTrayIcon::menu
+
+ This property holds a menu for the system tray icon.
+*/
+QQuickPlatformMenu *QQuickPlatformSystemTrayIcon::menu() const
+{
+ return m_menu;
+}
+
+void QQuickPlatformSystemTrayIcon::setMenu(QQuickPlatformMenu *menu)
+{
+ if (m_menu == menu)
+ return;
+
+ if (m_menu)
+ m_menu->setSystemTrayIcon(nullptr);
+ if (menu) {
+ menu->setSystemTrayIcon(this);
+ if (m_handle && m_complete && menu->create())
+ m_handle->updateMenu(menu->handle());
+ }
+
+ m_menu = menu;
+ emit menuChanged();
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::SystemTrayIcon::show()
+
+ Shows the system tray icon.
+*/
+void QQuickPlatformSystemTrayIcon::show()
+{
+ setVisible(true);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::SystemTrayIcon::hide()
+
+ Hides the system tray icon.
+*/
+void QQuickPlatformSystemTrayIcon::hide()
+{
+ setVisible(false);
+}
+
+/*!
+ \qmlmethod void Qt.labs.platform::SystemTrayIcon::showMessage(string title, string message, MessageIcon icon, int msecs)
+
+ Shows a system tray message with the given \a title, \a message and \a icon
+ for the time specified in \a msecs.
+
+ \note System tray messages are dependent on the system configuration and user preferences,
+ and may not appear at all. Therefore, it should not be relied upon as the sole means for providing
+ critical information.
+
+ \sa supportsMessages, messageClicked()
+*/
+void QQuickPlatformSystemTrayIcon::showMessage(const QString &title, const QString &msg, QPlatformSystemTrayIcon::MessageIcon icon, int msecs)
+{
+ if (m_handle)
+ m_handle->showMessage(title, msg, QIcon(), icon, msecs);
+}
+
+void QQuickPlatformSystemTrayIcon::init()
+{
+ if (!m_handle)
+ return;
+
+ m_handle->init();
+ if (m_menu && m_menu->create())
+ m_handle->updateMenu(m_menu->handle());
+ m_handle->updateToolTip(m_tooltip);
+ if (m_iconLoader)
+ m_iconLoader->setEnabled(true);
+}
+
+void QQuickPlatformSystemTrayIcon::cleanup()
+{
+ if (m_handle)
+ m_handle->cleanup();
+ if (m_iconLoader)
+ m_iconLoader->setEnabled(false);
+}
+
+void QQuickPlatformSystemTrayIcon::classBegin()
+{
+}
+
+void QQuickPlatformSystemTrayIcon::componentComplete()
+{
+ m_complete = true;
+ if (m_visible)
+ init();
+}
+
+QQuickPlatformIconLoader *QQuickPlatformSystemTrayIcon::iconLoader() const
+{
+ if (!m_iconLoader) {
+ QQuickPlatformSystemTrayIcon *that = const_cast<QQuickPlatformSystemTrayIcon *>(this);
+ static int slot = staticMetaObject.indexOfSlot("updateIcon()");
+ m_iconLoader = new QQuickPlatformIconLoader(slot, that);
+ m_iconLoader->setEnabled(m_complete);
+ }
+ return m_iconLoader;
+}
+
+void QQuickPlatformSystemTrayIcon::updateIcon()
+{
+ if (!m_handle || !m_iconLoader)
+ return;
+
+ m_handle->updateIcon(m_iconLoader->icon());
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformsystemtrayicon_p.h b/src/imports/platform/qquickplatformsystemtrayicon_p.h
new file mode 100644
index 00000000..12597c72
--- /dev/null
+++ b/src/imports/platform/qquickplatformsystemtrayicon_p.h
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QQUICKPLATFORMSYSTEMTRAYICON_P_H
+#define QQUICKPLATFORMSYSTEMTRAYICON_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 <QtCore/qurl.h>
+#include <QtGui/qpa/qplatformsystemtrayicon.h>
+#include <QtQml/qqmlparserstatus.h>
+#include <QtQml/qqml.h>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickPlatformMenu;
+class QQuickPlatformIconLoader;
+
+class QQuickPlatformSystemTrayIcon : public QObject, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlParserStatus)
+ Q_PROPERTY(bool available READ isAvailable CONSTANT FINAL)
+ Q_PROPERTY(bool supportsMessages READ supportsMessages CONSTANT FINAL)
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
+ Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL)
+ Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL)
+ Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip NOTIFY tooltipChanged FINAL)
+ Q_PROPERTY(QQuickPlatformMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL)
+ Q_ENUMS(QPlatformSystemTrayIcon::ActivationReason QPlatformSystemTrayIcon::MessageIcon)
+
+public:
+ explicit QQuickPlatformSystemTrayIcon(QObject *parent = nullptr);
+ ~QQuickPlatformSystemTrayIcon();
+
+ QPlatformSystemTrayIcon *handle() const;
+
+ bool isAvailable() const;
+ bool supportsMessages() const;
+
+ bool isVisible() const;
+ void setVisible(bool visible);
+
+ QUrl iconSource() const;
+ void setIconSource(const QUrl &source);
+
+ QString iconName() const;
+ void setIconName(const QString &name);
+
+ QString tooltip() const;
+ void setTooltip(const QString &tooltip);
+
+ QQuickPlatformMenu *menu() const;
+ void setMenu(QQuickPlatformMenu *menu);
+
+public Q_SLOTS:
+ void show();
+ void hide();
+
+ void showMessage(const QString &title, const QString &message,
+ QPlatformSystemTrayIcon::MessageIcon iconType = QPlatformSystemTrayIcon::Information, int msecs = 10000);
+
+Q_SIGNALS:
+ void activated(QPlatformSystemTrayIcon::ActivationReason reason);
+ void messageClicked();
+ void visibleChanged();
+ void iconSourceChanged();
+ void iconNameChanged();
+ void tooltipChanged();
+ void menuChanged();
+
+protected:
+ void init();
+ void cleanup();
+
+ void classBegin() override;
+ void componentComplete() override;
+
+ QQuickPlatformIconLoader *iconLoader() const;
+
+private Q_SLOTS:
+ void updateIcon();
+
+private:
+ bool m_complete;
+ bool m_visible;
+ QString m_tooltip;
+ QQuickPlatformMenu *m_menu;
+ mutable QQuickPlatformIconLoader *m_iconLoader;
+ QPlatformSystemTrayIcon *m_handle;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QQuickPlatformSystemTrayIcon)
+
+#endif // QQUICKPLATFORMSYSTEMTRAYICON_P_H
diff --git a/src/imports/platform/qtlabsplatformplugin.cpp b/src/imports/platform/qtlabsplatformplugin.cpp
new file mode 100644
index 00000000..f73b04e8
--- /dev/null
+++ b/src/imports/platform/qtlabsplatformplugin.cpp
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Templates module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtQml/qqmlextensionplugin.h>
+#include <QtQml/qqml.h>
+#include <QtCore/qloggingcategory.h>
+
+#include "qquickplatformdialog_p.h"
+#include "qquickplatformcolordialog_p.h"
+#include "qquickplatformfiledialog_p.h"
+#include "qquickplatformfolderdialog_p.h"
+#include "qquickplatformfontdialog_p.h"
+#include "qquickplatformmessagedialog_p.h"
+
+#include "qquickplatformmenu_p.h"
+#include "qquickplatformmenubar_p.h"
+#include "qquickplatformmenuitem_p.h"
+#include "qquickplatformmenuitemgroup_p.h"
+#include "qquickplatformmenuseparator_p.h"
+
+#include "qquickplatformstandardpaths_p.h"
+
+#include "qquickplatformsystemtrayicon_p.h"
+
+Q_DECLARE_METATYPE(QStandardPaths::StandardLocation)
+Q_DECLARE_METATYPE(QStandardPaths::LocateOptions)
+
+static inline void initResources()
+{
+#ifdef QT_STATIC
+ Q_INIT_RESOURCE(qmake_Qt_labs_platform);
+#endif
+}
+
+QT_BEGIN_NAMESPACE
+
+Q_LOGGING_CATEGORY(qtLabsPlatformDialogs, "qt.labs.platform.dialogs")
+Q_LOGGING_CATEGORY(qtLabsPlatformMenus, "qt.labs.platform.menus")
+Q_LOGGING_CATEGORY(qtLabsPlatformTray, "qt.labs.platform.tray")
+
+class QtLabsPlatformPlugin: public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
+
+public:
+ QtLabsPlatformPlugin(QObject *parent = nullptr);
+ void registerTypes(const char *uri) override;
+};
+
+QtLabsPlatformPlugin::QtLabsPlatformPlugin(QObject *parent) : QQmlExtensionPlugin(parent)
+{
+ initResources();
+}
+
+void QtLabsPlatformPlugin::registerTypes(const char *uri)
+{
+ qmlRegisterUncreatableType<QQuickPlatformDialog>(uri, 1, 0, "Dialog", QQuickPlatformDialog::tr("Dialog is an abstract base class"));
+ qmlRegisterType<QQuickPlatformColorDialog>(uri, 1, 0, "ColorDialog");
+ qmlRegisterType<QQuickPlatformFileDialog>(uri, 1, 0, "FileDialog");
+ qmlRegisterType<QQuickPlatformFileNameFilter>();
+ qmlRegisterType<QQuickPlatformFolderDialog>(uri, 1, 0, "FolderDialog");
+ qmlRegisterType<QQuickPlatformFontDialog>(uri, 1, 0, "FontDialog");
+ qmlRegisterType<QQuickPlatformMessageDialog>(uri, 1, 0, "MessageDialog");
+
+ qmlRegisterType<QQuickPlatformMenu>(uri, 1, 0, "Menu");
+ qmlRegisterType<QQuickPlatformMenuBar>(uri, 1, 0, "MenuBar");
+ qmlRegisterType<QQuickPlatformMenuItem>(uri, 1, 0, "MenuItem");
+ qmlRegisterType<QQuickPlatformMenuItemGroup>(uri, 1, 0, "MenuItemGroup");
+ qmlRegisterType<QQuickPlatformMenuSeparator>(uri, 1, 0, "MenuSeparator");
+
+ qmlRegisterUncreatableType<QPlatformDialogHelper>(uri, 1, 0, "StandardButton", QQuickPlatformDialog::tr("Cannot create an instance of StandardButton"));
+ qmlRegisterSingletonType<QQuickPlatformStandardPaths>(uri, 1, 0, "StandardPaths", QQuickPlatformStandardPaths::create);
+ qRegisterMetaType<QStandardPaths::StandardLocation>();
+ qRegisterMetaType<QStandardPaths::LocateOptions>();
+
+ qmlRegisterType<QQuickPlatformSystemTrayIcon>(uri, 1, 0, "SystemTrayIcon");
+}
+
+QT_END_NAMESPACE
+
+#include "qtlabsplatformplugin.moc"
diff --git a/src/imports/platform/widgets/qwidgetplatform_p.h b/src/imports/platform/widgets/qwidgetplatform_p.h
new file mode 100644
index 00000000..06dcc9d3
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatform_p.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORM_P_H
+#define QWIDGETPLATFORM_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 <QtCore/qdebug.h>
+#include <QtCore/qcoreapplication.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtGui/qpa/qplatformdialoghelper.h>
+#include <QtGui/qpa/qplatformsystemtrayicon.h>
+#include <QtGui/qpa/qplatformmenu.h>
+
+#ifdef QT_WIDGETS_LIB
+#include "qwidgetplatformcolordialog_p.h"
+#include "qwidgetplatformfiledialog_p.h"
+#include "qwidgetplatformfontdialog_p.h"
+#include "qwidgetplatformmessagedialog_p.h"
+#include "qwidgetplatformmenu_p.h"
+#include "qwidgetplatformmenuitem_p.h"
+#include "qwidgetplatformsystemtrayicon_p.h"
+#endif
+
+QT_BEGIN_NAMESPACE
+
+#ifndef QT_WIDGETS_LIB
+typedef QPlatformMenu QWidgetPlatformMenu;
+typedef QPlatformMenuItem QWidgetPlatformMenuItem;
+typedef QPlatformColorDialogHelper QWidgetPlatformColorDialog;
+typedef QPlatformFileDialogHelper QWidgetPlatformFileDialog;
+typedef QPlatformFontDialogHelper QWidgetPlatformFontDialog;
+typedef QPlatformMessageDialogHelper QWidgetPlatformMessageDialog;
+typedef QPlatformSystemTrayIcon QWidgetPlatformSystemTrayIcon;
+#endif
+
+namespace QWidgetPlatform
+{
+ static inline bool isAvailable(const char *type)
+ {
+ if (!qApp->inherits("QApplication")) {
+ qCritical("\nERROR: No native %s implementation available."
+ "\nQt Labs Platform requires Qt Widgets on this setup."
+ "\nAdd 'QT += widgets' to .pro and create QApplication in main().\n", type);
+ return false;
+ }
+ return true;
+ }
+
+ template<typename T>
+ static inline T *createWidget(const char *name, QObject *parent)
+ {
+ static bool available = isAvailable(name);
+#ifdef QT_WIDGETS_LIB
+ if (available)
+ return new T(parent);
+#else
+ Q_UNUSED(parent)
+ Q_UNUSED(available)
+#endif
+ return nullptr;
+ }
+
+ static inline QPlatformMenu *createMenu(QObject *parent = nullptr) { return createWidget<QWidgetPlatformMenu>("Menu", parent); }
+ static inline QPlatformMenuItem *createMenuItem(QObject *parent = nullptr) { return createWidget<QWidgetPlatformMenuItem>("MenuItem", parent); }
+ static inline QPlatformSystemTrayIcon *createSystemTrayIcon(QObject *parent = nullptr) { return createWidget<QWidgetPlatformSystemTrayIcon>("SystemTrayIcon", parent); }
+ static inline QPlatformDialogHelper *createDialog(QPlatformTheme::DialogType type, QObject *parent = nullptr)
+ {
+ switch (type) {
+ case QPlatformTheme::ColorDialog: return createWidget<QWidgetPlatformColorDialog>("ColorDialog", parent);
+ case QPlatformTheme::FileDialog: return createWidget<QWidgetPlatformFileDialog>("FileDialog", parent);
+ case QPlatformTheme::FontDialog: return createWidget<QWidgetPlatformFontDialog>("FontDialog", parent);
+ case QPlatformTheme::MessageDialog: return createWidget<QWidgetPlatformMessageDialog>("MessageDialog", parent);
+ default: Q_UNREACHABLE(); break;
+ return nullptr;
+ }
+ }
+}
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORM_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformcolordialog.cpp b/src/imports/platform/widgets/qwidgetplatformcolordialog.cpp
new file mode 100644
index 00000000..69a76eb2
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformcolordialog.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformcolordialog_p.h"
+#include "qwidgetplatformdialog_p.h"
+
+#include <QtWidgets/qcolordialog.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformColorDialog::QWidgetPlatformColorDialog(QObject *parent)
+ : m_dialog(new QColorDialog)
+{
+ setParent(parent);
+
+ connect(m_dialog.data(), &QColorDialog::accepted, this, &QPlatformDialogHelper::accept);
+ connect(m_dialog.data(), &QColorDialog::rejected, this, &QPlatformDialogHelper::reject);
+ connect(m_dialog.data(), &QColorDialog::currentColorChanged, this, &QPlatformColorDialogHelper::currentColorChanged);
+}
+
+QWidgetPlatformColorDialog::~QWidgetPlatformColorDialog()
+{
+}
+
+QColor QWidgetPlatformColorDialog::currentColor() const
+{
+ return m_dialog->currentColor();
+}
+
+void QWidgetPlatformColorDialog::setCurrentColor(const QColor &color)
+{
+ m_dialog->setCurrentColor(color);
+}
+
+void QWidgetPlatformColorDialog::exec()
+{
+ m_dialog->exec();
+}
+
+bool QWidgetPlatformColorDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
+{
+ QSharedPointer<QColorDialogOptions> options = QPlatformColorDialogHelper::options();
+ m_dialog->setWindowTitle(options->windowTitle());
+ m_dialog->setOptions(static_cast<QColorDialog::ColorDialogOptions>(int(options->options())) | QColorDialog::DontUseNativeDialog);
+
+ return QWidgetPlatformDialog::show(m_dialog.data(), flags, modality, parent);
+}
+
+void QWidgetPlatformColorDialog::hide()
+{
+ m_dialog->hide();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformcolordialog_p.h b/src/imports/platform/widgets/qwidgetplatformcolordialog_p.h
new file mode 100644
index 00000000..14bbcd1f
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformcolordialog_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMCOLORDIALOG_P_H
+#define QWIDGETPLATFORMCOLORDIALOG_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 <QtGui/qpa/qplatformdialoghelper.h>
+
+QT_BEGIN_NAMESPACE
+
+class QColorDialog;
+
+class QWidgetPlatformColorDialog : public QPlatformColorDialogHelper
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformColorDialog(QObject *parent = nullptr);
+ ~QWidgetPlatformColorDialog();
+
+ QColor currentColor() const override;
+ void setCurrentColor(const QColor &color) override;
+
+ void exec() override;
+ bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) override;
+ void hide() override;
+
+private:
+ QScopedPointer<QColorDialog> m_dialog;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMCOLORDIALOG_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformdialog.cpp b/src/imports/platform/widgets/qwidgetplatformdialog.cpp
new file mode 100644
index 00000000..ebca7ea8
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformdialog.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformdialog_p.h"
+
+#include <QtGui/qwindow.h>
+#include <QtWidgets/qdialog.h>
+
+QT_BEGIN_NAMESPACE
+
+bool QWidgetPlatformDialog::show(QDialog *dialog, Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
+{
+ dialog->setWindowFlags(flags);
+ dialog->setWindowModality(modality);
+
+ dialog->createWinId();
+ QWindow *handle = dialog->windowHandle();
+ Q_ASSERT(handle);
+ handle->setTransientParent(const_cast<QWindow *>(parent));
+
+ dialog->show();
+ return true;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformdialog_p.h b/src/imports/platform/widgets/qwidgetplatformdialog_p.h
new file mode 100644
index 00000000..efc99b85
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformdialog_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMDIALOG_P_H
+#define QWIDGETPLATFORMDIALOG_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 <QtCore/qnamespace.h>
+
+QT_BEGIN_NAMESPACE
+
+class QDialog;
+class QWindow;
+
+class QWidgetPlatformDialog
+{
+public:
+ static bool show(QDialog *dialog, Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent);
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMDIALOG_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformfiledialog.cpp b/src/imports/platform/widgets/qwidgetplatformfiledialog.cpp
new file mode 100644
index 00000000..772443a5
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformfiledialog.cpp
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformfiledialog_p.h"
+#include "qwidgetplatformdialog_p.h"
+
+#include <QtWidgets/qfiledialog.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformFileDialog::QWidgetPlatformFileDialog(QObject *parent)
+ : m_dialog(new QFileDialog)
+{
+ setParent(parent);
+
+ connect(m_dialog.data(), &QDialog::accepted, this, &QPlatformDialogHelper::accept);
+ connect(m_dialog.data(), &QDialog::rejected, this, &QPlatformDialogHelper::reject);
+
+ connect(m_dialog.data(), &QFileDialog::fileSelected, [this](const QString &file) {
+ emit fileSelected(QUrl::fromLocalFile(file));
+ });
+ connect(m_dialog.data(), &QFileDialog::filesSelected, [this](const QList<QString> &files) {
+ QList<QUrl> urls;
+ urls.reserve(files.count());
+ for (const QString &file : files)
+ urls += QUrl::fromLocalFile(file);
+ emit filesSelected(urls);
+ });
+ connect(m_dialog.data(), &QFileDialog::currentChanged, [this](const QString &path) {
+ emit currentChanged(QUrl::fromLocalFile(path));
+ });
+ connect(m_dialog.data(), &QFileDialog::directoryEntered, this, &QWidgetPlatformFileDialog::directoryEntered);
+ connect(m_dialog.data(), &QFileDialog::filterSelected, this, &QWidgetPlatformFileDialog::filterSelected);
+}
+
+QWidgetPlatformFileDialog::~QWidgetPlatformFileDialog()
+{
+}
+
+bool QWidgetPlatformFileDialog::defaultNameFilterDisables() const
+{
+ return false; // TODO: ?
+}
+
+void QWidgetPlatformFileDialog::setDirectory(const QUrl &directory)
+{
+ m_dialog->setDirectory(directory.toLocalFile());
+}
+
+QUrl QWidgetPlatformFileDialog::directory() const
+{
+ return m_dialog->directoryUrl();
+}
+
+void QWidgetPlatformFileDialog::selectFile(const QUrl &filename)
+{
+ m_dialog->selectUrl(filename);
+}
+
+QList<QUrl> QWidgetPlatformFileDialog::selectedFiles() const
+{
+ return m_dialog->selectedUrls();
+}
+
+void QWidgetPlatformFileDialog::setFilter()
+{
+ // TODO: ?
+}
+
+void QWidgetPlatformFileDialog::selectNameFilter(const QString &filter)
+{
+ m_dialog->selectNameFilter(filter);
+}
+
+QString QWidgetPlatformFileDialog::selectedNameFilter() const
+{
+ return m_dialog->selectedNameFilter();
+}
+
+void QWidgetPlatformFileDialog::exec()
+{
+ m_dialog->exec();
+}
+
+bool QWidgetPlatformFileDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
+{
+ QSharedPointer<QFileDialogOptions> options = QPlatformFileDialogHelper::options();
+ m_dialog->setWindowTitle(options->windowTitle());
+ m_dialog->setAcceptMode(static_cast<QFileDialog::AcceptMode>(options->acceptMode()));
+ m_dialog->setFileMode(static_cast<QFileDialog::FileMode>(options->fileMode()));
+ m_dialog->setOptions(static_cast<QFileDialog::Options>(int(options->options())) | QFileDialog::DontUseNativeDialog);
+ m_dialog->setNameFilters(options->nameFilters());
+ m_dialog->setDefaultSuffix(options->defaultSuffix());
+ if (options->isLabelExplicitlySet(QFileDialogOptions::Accept))
+ m_dialog->setLabelText(QFileDialog::Accept, options->labelText(QFileDialogOptions::Accept));
+ if (options->isLabelExplicitlySet(QFileDialogOptions::Reject))
+ m_dialog->setLabelText(QFileDialog::Reject, options->labelText(QFileDialogOptions::Reject));
+
+ return QWidgetPlatformDialog::show(m_dialog.data(), flags, modality, parent);
+}
+
+void QWidgetPlatformFileDialog::hide()
+{
+ m_dialog->hide();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformfiledialog_p.h b/src/imports/platform/widgets/qwidgetplatformfiledialog_p.h
new file mode 100644
index 00000000..743bc571
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformfiledialog_p.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMFILEDIALOG_P_H
+#define QWIDGETPLATFORMFILEDIALOG_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 <QtGui/qpa/qplatformdialoghelper.h>
+
+QT_BEGIN_NAMESPACE
+
+class QFileDialog;
+
+class QWidgetPlatformFileDialog : public QPlatformFileDialogHelper
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformFileDialog(QObject *parent = nullptr);
+ ~QWidgetPlatformFileDialog();
+
+ bool defaultNameFilterDisables() const override;
+ void setDirectory(const QUrl &directory) override;
+ QUrl directory() const override;
+ void selectFile(const QUrl &filename) override;
+ QList<QUrl> selectedFiles() const override;
+ void setFilter() override;
+ void selectNameFilter(const QString &filter) override;
+ QString selectedNameFilter() const override;
+
+ void exec() override;
+ bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) override;
+ void hide() override;
+
+private:
+ QScopedPointer<QFileDialog> m_dialog;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMFILEDIALOG_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformfontdialog.cpp b/src/imports/platform/widgets/qwidgetplatformfontdialog.cpp
new file mode 100644
index 00000000..d2b6c539
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformfontdialog.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformfontdialog_p.h"
+#include "qwidgetplatformdialog_p.h"
+
+#include <QtWidgets/qfontdialog.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformFontDialog::QWidgetPlatformFontDialog(QObject *parent)
+ : m_dialog(new QFontDialog)
+{
+ setParent(parent);
+
+ connect(m_dialog.data(), &QFontDialog::accepted, this, &QPlatformDialogHelper::accept);
+ connect(m_dialog.data(), &QFontDialog::rejected, this, &QPlatformDialogHelper::reject);
+ connect(m_dialog.data(), &QFontDialog::currentFontChanged, this, &QPlatformFontDialogHelper::currentFontChanged);
+}
+
+QWidgetPlatformFontDialog::~QWidgetPlatformFontDialog()
+{
+}
+
+QFont QWidgetPlatformFontDialog::currentFont() const
+{
+ return m_dialog->currentFont();
+}
+
+void QWidgetPlatformFontDialog::setCurrentFont(const QFont &font)
+{
+ m_dialog->setCurrentFont(font);
+}
+
+void QWidgetPlatformFontDialog::exec()
+{
+ m_dialog->exec();
+}
+
+bool QWidgetPlatformFontDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
+{
+ QSharedPointer<QFontDialogOptions> options = QPlatformFontDialogHelper::options();
+ m_dialog->setWindowTitle(options->windowTitle());
+ m_dialog->setOptions(static_cast<QFontDialog::FontDialogOptions>(int(options->options())) | QFontDialog::DontUseNativeDialog);
+
+ return QWidgetPlatformDialog::show(m_dialog.data(), flags, modality, parent);
+}
+
+void QWidgetPlatformFontDialog::hide()
+{
+ m_dialog->hide();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformfontdialog_p.h b/src/imports/platform/widgets/qwidgetplatformfontdialog_p.h
new file mode 100644
index 00000000..97d5463d
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformfontdialog_p.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMFONTDIALOG_P_H
+#define QWIDGETPLATFORMFONTDIALOG_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 <QtGui/qpa/qplatformdialoghelper.h>
+
+QT_BEGIN_NAMESPACE
+
+class QFontDialog;
+
+class QWidgetPlatformFontDialog : public QPlatformFontDialogHelper
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformFontDialog(QObject *parent = nullptr);
+ ~QWidgetPlatformFontDialog();
+
+ QFont currentFont() const override;
+ void setCurrentFont(const QFont &font) override;
+
+ void exec() override;
+ bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
+ void hide() override;
+
+private:
+ QScopedPointer<QFontDialog> m_dialog;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMFONTDIALOG_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformmenu.cpp b/src/imports/platform/widgets/qwidgetplatformmenu.cpp
new file mode 100644
index 00000000..d9ecb16f
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformmenu.cpp
@@ -0,0 +1,186 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformmenu_p.h"
+#include "qwidgetplatformmenuitem_p.h"
+
+#include <QtGui/qwindow.h>
+#include <QtWidgets/qmenu.h>
+#include <QtWidgets/qaction.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformMenu::QWidgetPlatformMenu(QObject *parent)
+ : m_menu(new QMenu)
+{
+ setParent(parent);
+
+ connect(m_menu.data(), &QMenu::aboutToShow, this, &QPlatformMenu::aboutToShow);
+ connect(m_menu.data(), &QMenu::aboutToHide, this, &QPlatformMenu::aboutToHide);
+}
+
+QWidgetPlatformMenu::~QWidgetPlatformMenu()
+{
+}
+
+QMenu *QWidgetPlatformMenu::menu() const
+{
+ return m_menu.data();
+}
+
+void QWidgetPlatformMenu::insertMenuItem(QPlatformMenuItem *item, QPlatformMenuItem *before)
+{
+ QWidgetPlatformMenuItem *widgetItem = qobject_cast<QWidgetPlatformMenuItem *>(item);
+ if (!widgetItem)
+ return;
+
+ QWidgetPlatformMenuItem *widgetBefore = qobject_cast<QWidgetPlatformMenuItem *>(before);
+ m_menu->insertAction(widgetBefore ? widgetBefore->action() : nullptr, widgetItem->action());
+}
+
+void QWidgetPlatformMenu::removeMenuItem(QPlatformMenuItem *item)
+{
+ QWidgetPlatformMenuItem *widgetItem = qobject_cast<QWidgetPlatformMenuItem *>(item);
+ if (!widgetItem)
+ return;
+
+ m_menu->removeAction(widgetItem->action());
+}
+
+void QWidgetPlatformMenu::syncMenuItem(QPlatformMenuItem *item)
+{
+ Q_UNUSED(item);
+}
+
+void QWidgetPlatformMenu::syncSeparatorsCollapsible(bool enable)
+{
+ Q_UNUSED(enable);
+}
+
+quintptr QWidgetPlatformMenu::tag() const
+{
+ return 0;
+}
+
+void QWidgetPlatformMenu::setTag(quintptr tag)
+{
+ Q_UNUSED(tag);
+}
+
+void QWidgetPlatformMenu::setText(const QString &text)
+{
+ m_menu->setTitle(text);
+}
+
+void QWidgetPlatformMenu::setIcon(const QIcon &icon)
+{
+ m_menu->setIcon(icon);
+}
+
+void QWidgetPlatformMenu::setEnabled(bool enabled)
+{
+ m_menu->menuAction()->setEnabled(enabled);
+}
+
+bool QWidgetPlatformMenu::isEnabled() const
+{
+ return m_menu->menuAction()->isEnabled();
+}
+
+void QWidgetPlatformMenu::setVisible(bool visible)
+{
+ m_menu->menuAction()->setVisible(visible);
+}
+
+void QWidgetPlatformMenu::setMinimumWidth(int width)
+{
+ if (width > 0)
+ m_menu->setMinimumWidth(width);
+}
+
+void QWidgetPlatformMenu::setFont(const QFont &font)
+{
+ m_menu->setFont(font);
+}
+
+void QWidgetPlatformMenu::setMenuType(MenuType type)
+{
+ Q_UNUSED(type);
+}
+
+void QWidgetPlatformMenu::showPopup(const QWindow *window, const QRect &targetRect, const QPlatformMenuItem *item)
+{
+ m_menu->createWinId();
+ QWindow *handle = m_menu->windowHandle();
+ Q_ASSERT(handle);
+ handle->setTransientParent(const_cast<QWindow *>(window));
+
+ QPoint targetPos = targetRect.bottomLeft();
+ if (window)
+ targetPos = window->mapToGlobal(targetPos);
+
+ const QWidgetPlatformMenuItem *widgetItem = qobject_cast<const QWidgetPlatformMenuItem *>(item);
+ m_menu->popup(targetPos, widgetItem ? widgetItem->action() : nullptr);
+}
+
+void QWidgetPlatformMenu::dismiss()
+{
+ m_menu->close();
+}
+
+QPlatformMenuItem *QWidgetPlatformMenu::menuItemAt(int position) const
+{
+ Q_UNUSED(position);
+ return nullptr;
+}
+
+QPlatformMenuItem *QWidgetPlatformMenu::menuItemForTag(quintptr tag) const
+{
+ Q_UNUSED(tag);
+ return nullptr;
+}
+
+QPlatformMenuItem *QWidgetPlatformMenu::createMenuItem() const
+{
+ return nullptr;
+}
+
+QPlatformMenu *QWidgetPlatformMenu::createSubMenu() const
+{
+ return nullptr;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformmenu_p.h b/src/imports/platform/widgets/qwidgetplatformmenu_p.h
new file mode 100644
index 00000000..56ea7a45
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformmenu_p.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMMENU_P_H
+#define QWIDGETPLATFORMMENU_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 <QtGui/qpa/qplatformmenu.h>
+
+QT_BEGIN_NAMESPACE
+
+class QMenu;
+
+class QWidgetPlatformMenu : public QPlatformMenu
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformMenu(QObject *parent = nullptr);
+ ~QWidgetPlatformMenu();
+
+ QMenu *menu() const;
+
+ void insertMenuItem(QPlatformMenuItem *item, QPlatformMenuItem *before) override;
+ void removeMenuItem(QPlatformMenuItem *item) override;
+ void syncMenuItem(QPlatformMenuItem *item) override;
+ void syncSeparatorsCollapsible(bool enable) override;
+
+ quintptr tag()const override;
+ void setTag(quintptr tag) override;
+
+ void setText(const QString &text) override;
+ void setIcon(const QIcon &icon) override;
+ void setEnabled(bool enabled) override;
+ bool isEnabled() const override;
+ void setVisible(bool visible) override;
+ void setMinimumWidth(int width) override;
+ void setFont(const QFont &font) override;
+ void setMenuType(MenuType type) override;
+
+ void showPopup(const QWindow *window, const QRect &targetRect, const QPlatformMenuItem *item) override;
+ void dismiss() override;
+
+ QPlatformMenuItem *menuItemAt(int position) const override;
+ QPlatformMenuItem *menuItemForTag(quintptr tag) const override;
+
+ QPlatformMenuItem *createMenuItem() const override;
+ QPlatformMenu *createSubMenu() const override;
+
+private:
+ QScopedPointer<QMenu> m_menu;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMMENU_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformmenuitem.cpp b/src/imports/platform/widgets/qwidgetplatformmenuitem.cpp
new file mode 100644
index 00000000..4d168f7a
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformmenuitem.cpp
@@ -0,0 +1,131 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformmenuitem_p.h"
+
+#include <QtWidgets/qmenu.h>
+#include <QtWidgets/qaction.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformMenuItem::QWidgetPlatformMenuItem(QObject *parent)
+ : m_action(new QAction)
+{
+ setParent(parent);
+ connect(m_action.data(), &QAction::hovered, this, &QPlatformMenuItem::hovered);
+ connect(m_action.data(), &QAction::triggered, this, &QPlatformMenuItem::activated);
+}
+
+QWidgetPlatformMenuItem::~QWidgetPlatformMenuItem()
+{
+}
+
+QAction *QWidgetPlatformMenuItem::action() const
+{
+ return m_action.data();
+}
+
+quintptr QWidgetPlatformMenuItem::tag() const
+{
+ return 0;
+}
+
+void QWidgetPlatformMenuItem::setTag(quintptr tag)
+{
+ Q_UNUSED(tag);
+}
+
+void QWidgetPlatformMenuItem::setText(const QString &text)
+{
+ m_action->setText(text);
+}
+
+void QWidgetPlatformMenuItem::setIcon(const QIcon &icon)
+{
+ m_action->setIcon(icon);
+}
+
+void QWidgetPlatformMenuItem::setMenu(QPlatformMenu *menu)
+{
+ m_action->setMenu(qobject_cast<QMenu *>(menu));
+}
+
+void QWidgetPlatformMenuItem::setVisible(bool visible)
+{
+ m_action->setVisible(visible);
+}
+
+void QWidgetPlatformMenuItem::setIsSeparator(bool separator)
+{
+ m_action->setSeparator(separator);
+}
+
+void QWidgetPlatformMenuItem::setFont(const QFont &font)
+{
+ m_action->setFont(font);
+}
+
+void QWidgetPlatformMenuItem::setRole(MenuRole role)
+{
+ m_action->setMenuRole(static_cast<QAction::MenuRole>(role));
+}
+
+void QWidgetPlatformMenuItem::setCheckable(bool checkable)
+{
+ m_action->setCheckable(checkable);
+}
+
+void QWidgetPlatformMenuItem::setChecked(bool checked)
+{
+ m_action->setChecked(checked);
+}
+
+void QWidgetPlatformMenuItem::setShortcut(const QKeySequence &shortcut)
+{
+ m_action->setShortcut(shortcut);
+}
+
+void QWidgetPlatformMenuItem::setEnabled(bool enabled)
+{
+ m_action->setEnabled(enabled);
+}
+
+void QWidgetPlatformMenuItem::setIconSize(int size)
+{
+ Q_UNUSED(size);
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformmenuitem_p.h b/src/imports/platform/widgets/qwidgetplatformmenuitem_p.h
new file mode 100644
index 00000000..d1a08187
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformmenuitem_p.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMMENUITEM_P_H
+#define QWIDGETPLATFORMMENUITEM_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 <QtGui/qpa/qplatformmenu.h>
+
+QT_BEGIN_NAMESPACE
+
+class QAction;
+
+class QWidgetPlatformMenuItem : public QPlatformMenuItem
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformMenuItem(QObject *parent = nullptr);
+ ~QWidgetPlatformMenuItem();
+
+ QAction *action() const;
+
+ quintptr tag()const override;
+ void setTag(quintptr tag) override;
+
+ void setText(const QString &text) override;
+ void setIcon(const QIcon &icon) override;
+ void setMenu(QPlatformMenu *menu) override;
+ void setVisible(bool visible) override;
+ void setIsSeparator(bool separator) override;
+ void setFont(const QFont &font) override;
+ void setRole(MenuRole role) override;
+ void setCheckable(bool checkable) override;
+ void setChecked(bool checked) override;
+ void setShortcut(const QKeySequence& shortcut) override;
+ void setEnabled(bool enabled) override;
+ void setIconSize(int size) override;
+
+private:
+ QScopedPointer<QAction> m_action;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMMENUITEM_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformmessagedialog.cpp b/src/imports/platform/widgets/qwidgetplatformmessagedialog.cpp
new file mode 100644
index 00000000..b546e534
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformmessagedialog.cpp
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformmessagedialog_p.h"
+#include "qwidgetplatformdialog_p.h"
+
+#include <QtWidgets/qmessagebox.h>
+#include <QtWidgets/qabstractbutton.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformMessageDialog::QWidgetPlatformMessageDialog(QObject *parent)
+ : m_dialog(new QMessageBox)
+{
+ setParent(parent);
+
+ connect(m_dialog.data(), &QMessageBox::accepted, this, &QPlatformDialogHelper::accept);
+ connect(m_dialog.data(), &QMessageBox::rejected, this, &QPlatformDialogHelper::reject);
+ connect(m_dialog.data(), &QMessageBox::buttonClicked, [this](QAbstractButton *button) {
+ QMessageBox::ButtonRole role = m_dialog->buttonRole(button);
+ QMessageBox::StandardButton standardButton = m_dialog->standardButton(button);
+ emit clicked(static_cast<StandardButton>(standardButton), static_cast<ButtonRole>(role));
+ });
+}
+
+QWidgetPlatformMessageDialog::~QWidgetPlatformMessageDialog()
+{
+}
+void QWidgetPlatformMessageDialog::exec()
+{
+ m_dialog->exec();
+}
+
+bool QWidgetPlatformMessageDialog::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
+{
+ QSharedPointer<QMessageDialogOptions> options = QPlatformMessageDialogHelper::options();
+ m_dialog->setWindowTitle(options->windowTitle());
+ m_dialog->setIcon(static_cast<QMessageBox::Icon>(options->icon()));
+ m_dialog->setText(options->text());
+ m_dialog->setInformativeText(options->informativeText());
+ m_dialog->setDetailedText(options->detailedText());
+ m_dialog->setStandardButtons(static_cast<QMessageBox::StandardButtons>(int(options->standardButtons())));
+
+ return QWidgetPlatformDialog::show(m_dialog.data(), flags, modality, parent);
+}
+
+void QWidgetPlatformMessageDialog::hide()
+{
+ m_dialog->hide();
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformmessagedialog_p.h b/src/imports/platform/widgets/qwidgetplatformmessagedialog_p.h
new file mode 100644
index 00000000..319bb34d
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformmessagedialog_p.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMMESSAGEDIALOG_P_H
+#define QWIDGETPLATFORMMESSAGEDIALOG_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 <QtGui/qpa/qplatformdialoghelper.h>
+
+QT_BEGIN_NAMESPACE
+
+class QMessageBox;
+
+class QWidgetPlatformMessageDialog : public QPlatformMessageDialogHelper
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformMessageDialog(QObject *parent = nullptr);
+ ~QWidgetPlatformMessageDialog();
+
+ void exec() override;
+ bool show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent) override;
+ void hide() override;
+
+private:
+ QScopedPointer<QMessageBox> m_dialog;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMMESSAGEDIALOG_P_H
diff --git a/src/imports/platform/widgets/qwidgetplatformsystemtrayicon.cpp b/src/imports/platform/widgets/qwidgetplatformsystemtrayicon.cpp
new file mode 100644
index 00000000..cfee02aa
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformsystemtrayicon.cpp
@@ -0,0 +1,114 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwidgetplatformsystemtrayicon_p.h"
+#include "qwidgetplatformmenu_p.h"
+
+#include <QtWidgets/qsystemtrayicon.h>
+
+QT_BEGIN_NAMESPACE
+
+QWidgetPlatformSystemTrayIcon::QWidgetPlatformSystemTrayIcon(QObject *parent)
+ : m_systray(new QSystemTrayIcon)
+{
+ setParent(parent);
+
+ connect(m_systray.data(), &QSystemTrayIcon::messageClicked, this, &QPlatformSystemTrayIcon::messageClicked);
+ connect(m_systray.data(), &QSystemTrayIcon::activated, [this](QSystemTrayIcon::ActivationReason reason) {
+ emit activated(static_cast<ActivationReason>(reason));
+ });
+}
+
+QWidgetPlatformSystemTrayIcon::~QWidgetPlatformSystemTrayIcon()
+{
+}
+
+void QWidgetPlatformSystemTrayIcon::init()
+{
+ m_systray->show();
+}
+
+void QWidgetPlatformSystemTrayIcon::cleanup()
+{
+ m_systray->hide();
+}
+
+void QWidgetPlatformSystemTrayIcon::updateIcon(const QIcon &icon)
+{
+ m_systray->setIcon(icon);
+}
+
+void QWidgetPlatformSystemTrayIcon::updateToolTip(const QString &tooltip)
+{
+ m_systray->setToolTip(tooltip);
+}
+
+void QWidgetPlatformSystemTrayIcon::updateMenu(QPlatformMenu *menu)
+{
+ QWidgetPlatformMenu *widgetMenu = qobject_cast<QWidgetPlatformMenu *>(menu);
+ if (!widgetMenu)
+ return;
+
+ m_systray->setContextMenu(widgetMenu->menu());
+}
+
+QRect QWidgetPlatformSystemTrayIcon::geometry() const
+{
+ return m_systray->geometry();
+}
+
+void QWidgetPlatformSystemTrayIcon::showMessage(const QString &title, const QString &msg, const QIcon &icon, MessageIcon iconType, int msecs)
+{
+ Q_UNUSED(icon);
+ m_systray->showMessage(title, msg, static_cast<QSystemTrayIcon::MessageIcon>(iconType), msecs);
+}
+
+bool QWidgetPlatformSystemTrayIcon::isSystemTrayAvailable() const
+{
+ return QSystemTrayIcon::isSystemTrayAvailable();
+}
+
+bool QWidgetPlatformSystemTrayIcon::supportsMessages() const
+{
+ return QSystemTrayIcon::supportsMessages();
+}
+
+QPlatformMenu *QWidgetPlatformSystemTrayIcon::createMenu() const
+{
+ return new QWidgetPlatformMenu;
+}
+
+QT_END_NAMESPACE
diff --git a/src/imports/platform/widgets/qwidgetplatformsystemtrayicon_p.h b/src/imports/platform/widgets/qwidgetplatformsystemtrayicon_p.h
new file mode 100644
index 00000000..f48430a4
--- /dev/null
+++ b/src/imports/platform/widgets/qwidgetplatformsystemtrayicon_p.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Labs Platform module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later 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 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWIDGETPLATFORMSYSTEMTRAYICON_P_H
+#define QWIDGETPLATFORMSYSTEMTRAYICON_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 <QtGui/qpa/qplatformsystemtrayicon.h>
+
+QT_BEGIN_NAMESPACE
+
+class QSystemTrayIcon;
+
+class QWidgetPlatformSystemTrayIcon : public QPlatformSystemTrayIcon
+{
+ Q_OBJECT
+
+public:
+ explicit QWidgetPlatformSystemTrayIcon(QObject *parent = nullptr);
+ ~QWidgetPlatformSystemTrayIcon();
+
+ void init() override;
+ void cleanup() override;
+ void updateIcon(const QIcon &icon) override;
+ void updateToolTip(const QString &tooltip) override;
+ void updateMenu(QPlatformMenu *menu) override;
+ QRect geometry() const override;
+ void showMessage(const QString &title, const QString &msg,
+ const QIcon &icon, MessageIcon iconType, int msecs) override;
+
+ bool isSystemTrayAvailable() const override;
+ bool supportsMessages() const override;
+
+ QPlatformMenu *createMenu() const override;
+
+private:
+ QScopedPointer<QSystemTrayIcon> m_systray;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWIDGETPLATFORMSYSTEMTRAYICON_P_H
diff --git a/src/imports/platform/widgets/widgets.pri b/src/imports/platform/widgets/widgets.pri
new file mode 100644
index 00000000..c904e924
--- /dev/null
+++ b/src/imports/platform/widgets/widgets.pri
@@ -0,0 +1,23 @@
+QT += widgets
+DEPENDPATH += $$PWD
+
+HEADERS += \
+ $$PWD/qwidgetplatform_p.h \
+ $$PWD/qwidgetplatformcolordialog_p.h \
+ $$PWD/qwidgetplatformdialog_p.h \
+ $$PWD/qwidgetplatformfiledialog_p.h \
+ $$PWD/qwidgetplatformfontdialog_p.h \
+ $$PWD/qwidgetplatformmenu_p.h \
+ $$PWD/qwidgetplatformmenuitem_p.h \
+ $$PWD/qwidgetplatformmessagedialog_p.h \
+ $$PWD/qwidgetplatformsystemtrayicon_p.h
+
+SOURCES += \
+ $$PWD/qwidgetplatformcolordialog.cpp \
+ $$PWD/qwidgetplatformdialog.cpp \
+ $$PWD/qwidgetplatformfiledialog.cpp \
+ $$PWD/qwidgetplatformfontdialog.cpp \
+ $$PWD/qwidgetplatformmenu.cpp \
+ $$PWD/qwidgetplatformmenuitem.cpp \
+ $$PWD/qwidgetplatformmessagedialog.cpp \
+ $$PWD/qwidgetplatformsystemtrayicon.cpp
diff --git a/src/imports/templates/dependencies.json b/src/imports/templates/dependencies.json
new file mode 100644
index 00000000..26ce7c00
--- /dev/null
+++ b/src/imports/templates/dependencies.json
@@ -0,0 +1,12 @@
+[
+ {
+ "name": "QtQuick",
+ "type": "module",
+ "version": "2.8"
+ },
+ {
+ "name": "QtQuick.Window",
+ "type": "module",
+ "version": "2.2"
+ }
+]
diff --git a/src/imports/controls/doc/src/templates/qtquicktemplates2-index.qdoc b/src/imports/templates/doc/src/qtquicktemplates2-index.qdoc
index 2e22196b..2e22196b 100644
--- a/src/imports/controls/doc/src/templates/qtquicktemplates2-index.qdoc
+++ b/src/imports/templates/doc/src/qtquicktemplates2-index.qdoc
diff --git a/src/imports/controls/doc/src/templates/qtquicktemplates2.qdoc b/src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc
index 1ddfe763..977616bd 100644
--- a/src/imports/controls/doc/src/templates/qtquicktemplates2.qdoc
+++ b/src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc
@@ -38,7 +38,7 @@
\c .qml file:
\badcode
- import QtQuick.Templates 2.0 as T
+ import QtQuick.Templates 2.1 as T
\endcode
For the sake of clarity, there is a one-to-one mapping between the types
diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes
index 75a11a6e..002ea9b7 100644
--- a/src/imports/templates/plugins.qmltypes
+++ b/src/imports/templates/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Templates 2.0'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Templates 2.1'
Module {
- dependencies: ["QtQuick.Window 2.2"]
+ dependencies: ["QtQuick 2.8", "QtQuick.Window 2.2"]
Component {
name: "QQuickAbstractButton"
defaultProperty: "data"
@@ -75,6 +75,36 @@ Module {
Property { name: "flat"; type: "bool" }
}
Component {
+ name: "QQuickButtonGroup"
+ prototype: "QObject"
+ exports: [
+ "QtQuick.Templates/ButtonGroup 2.0",
+ "QtQuick.Templates/ButtonGroup 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
+ attachedType: "QQuickButtonGroupAttached"
+ Property { name: "checkedButton"; type: "QQuickAbstractButton"; isPointer: true }
+ Property { name: "buttons"; type: "QQuickAbstractButton"; isList: true; isReadonly: true }
+ Signal {
+ name: "clicked"
+ revision: 1
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ Method {
+ name: "addButton"
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ Method {
+ name: "removeButton"
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ }
+ Component {
+ name: "QQuickButtonGroupAttached"
+ prototype: "QObject"
+ Property { name: "group"; type: "QQuickButtonGroup"; isPointer: true }
+ }
+ Component {
name: "QQuickCheckBox"
defaultProperty: "data"
prototype: "QQuickAbstractButton"
@@ -96,11 +126,15 @@ Module {
name: "QQuickComboBox"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/ComboBox 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/ComboBox 2.0",
+ "QtQuick.Templates/ComboBox 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "count"; type: "int"; isReadonly: true }
Property { name: "model"; type: "QVariant" }
Property { name: "delegateModel"; type: "QQmlInstanceModel"; isReadonly: true; isPointer: true }
+ Property { name: "flat"; revision: 1; type: "bool" }
Property { name: "pressed"; type: "bool" }
Property { name: "highlightedIndex"; type: "int"; isReadonly: true }
Property { name: "currentIndex"; type: "int" }
@@ -110,6 +144,7 @@ Module {
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "indicator"; type: "QQuickItem"; isPointer: true }
Property { name: "popup"; type: "QQuickPopup"; isPointer: true }
+ Signal { name: "flatChanged"; revision: 1 }
Signal {
name: "activated"
Parameter { name: "index"; type: "int" }
@@ -141,8 +176,11 @@ Module {
name: "QQuickContainer"
defaultProperty: "contentData"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/Container 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/Container 2.0",
+ "QtQuick.Templates/Container 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "count"; type: "int"; isReadonly: true }
Property { name: "contentModel"; type: "QVariant"; isReadonly: true }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
@@ -153,6 +191,8 @@ Module {
name: "setCurrentIndex"
Parameter { name: "index"; type: "int" }
}
+ Method { name: "incrementCurrentIndex"; revision: 1 }
+ Method { name: "decrementCurrentIndex"; revision: 1 }
Method {
name: "itemAt"
type: "QQuickItem*"
@@ -231,6 +271,58 @@ Module {
Method { name: "decrease" }
}
Component {
+ name: "QQuickDialog"
+ defaultProperty: "contentData"
+ prototype: "QQuickPopup"
+ exports: ["QtQuick.Templates/Dialog 2.1"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "header"; type: "QQuickItem"; isPointer: true }
+ Property { name: "footer"; type: "QQuickItem"; isPointer: true }
+ Property { name: "buttonBox"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" }
+ Signal { name: "accepted" }
+ Signal { name: "rejected" }
+ Method { name: "accept" }
+ Method { name: "reject" }
+ }
+ Component {
+ name: "QQuickDialogButtonBox"
+ defaultProperty: "contentData"
+ prototype: "QQuickContainer"
+ exports: ["QtQuick.Templates/DialogButtonBox 2.1"]
+ exportMetaObjectRevisions: [0]
+ attachedType: "QQuickDialogButtonBoxAttached"
+ Enum {
+ name: "Position"
+ values: {
+ "Header": 0,
+ "Footer": 1
+ }
+ }
+ Property { name: "position"; type: "Position" }
+ Property { name: "alignment"; type: "Qt::Alignment" }
+ Property { name: "standardButtons"; type: "QPlatformDialogHelper::StandardButtons" }
+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
+ Signal { name: "accepted" }
+ Signal { name: "rejected" }
+ Signal { name: "helpRequested" }
+ Signal {
+ name: "clicked"
+ Parameter { name: "button"; type: "QQuickAbstractButton"; isPointer: true }
+ }
+ Method {
+ name: "standardButton"
+ type: "QQuickAbstractButton*"
+ Parameter { name: "button"; type: "QPlatformDialogHelper::StandardButton" }
+ }
+ }
+ Component {
+ name: "QQuickDialogButtonBoxAttached"
+ prototype: "QObject"
+ Property { name: "buttonBox"; type: "QQuickDialogButtonBox"; isReadonly: true; isPointer: true }
+ Property { name: "buttonRole"; type: "QPlatformDialogHelper::ButtonRole" }
+ }
+ Component {
name: "QQuickDrawer"
defaultProperty: "contentData"
prototype: "QQuickPopup"
@@ -257,181 +349,6 @@ Module {
Property { name: "label"; type: "QQuickItem"; isPointer: true }
}
Component {
- name: "QQuickImplicitSizeItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- Property { name: "implicitWidth"; type: "double"; isReadonly: true }
- Property { name: "implicitHeight"; type: "double"; isReadonly: true }
- Signal { name: "implicitWidthChanged2"; revision: 1 }
- Signal { name: "implicitHeightChanged2"; revision: 1 }
- }
- Component {
- name: "QQuickItem"
- defaultProperty: "data"
- prototype: "QObject"
- Enum {
- name: "TransformOrigin"
- values: {
- "TopLeft": 0,
- "Top": 1,
- "TopRight": 2,
- "Left": 3,
- "Center": 4,
- "Right": 5,
- "BottomLeft": 6,
- "Bottom": 7,
- "BottomRight": 8
- }
- }
- Property { name: "parent"; type: "QQuickItem"; isPointer: true }
- Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
- Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true }
- Property { name: "x"; type: "double" }
- Property { name: "y"; type: "double" }
- Property { name: "z"; type: "double" }
- Property { name: "width"; type: "double" }
- Property { name: "height"; type: "double" }
- Property { name: "opacity"; type: "double" }
- Property { name: "enabled"; type: "bool" }
- Property { name: "visible"; type: "bool" }
- Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true }
- Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true }
- Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true }
- Property { name: "state"; type: "string" }
- Property { name: "childrenRect"; type: "QRectF"; isReadonly: true }
- Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true }
- Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true }
- Property { name: "baselineOffset"; type: "double" }
- Property { name: "clip"; type: "bool" }
- Property { name: "focus"; type: "bool" }
- Property { name: "activeFocus"; type: "bool"; isReadonly: true }
- Property { name: "activeFocusOnTab"; revision: 1; type: "bool" }
- Property { name: "rotation"; type: "double" }
- Property { name: "scale"; type: "double" }
- Property { name: "transformOrigin"; type: "TransformOrigin" }
- Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true }
- Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true }
- Property { name: "smooth"; type: "bool" }
- Property { name: "antialiasing"; type: "bool" }
- Property { name: "implicitWidth"; type: "double" }
- Property { name: "implicitHeight"; type: "double" }
- Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true }
- Signal {
- name: "childrenRectChanged"
- Parameter { type: "QRectF" }
- }
- Signal {
- name: "baselineOffsetChanged"
- Parameter { type: "double" }
- }
- Signal {
- name: "stateChanged"
- Parameter { type: "string" }
- }
- Signal {
- name: "focusChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "activeFocusChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "activeFocusOnTabChanged"
- revision: 1
- Parameter { type: "bool" }
- }
- Signal {
- name: "parentChanged"
- Parameter { type: "QQuickItem"; isPointer: true }
- }
- Signal {
- name: "transformOriginChanged"
- Parameter { type: "TransformOrigin" }
- }
- Signal {
- name: "smoothChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "antialiasingChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "clipChanged"
- Parameter { type: "bool" }
- }
- Signal {
- name: "windowChanged"
- revision: 1
- Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
- }
- Method { name: "update" }
- Method {
- name: "grabToImage"
- revision: 2
- type: "bool"
- Parameter { name: "callback"; type: "QJSValue" }
- Parameter { name: "targetSize"; type: "QSize" }
- }
- Method {
- name: "grabToImage"
- revision: 2
- type: "bool"
- Parameter { name: "callback"; type: "QJSValue" }
- }
- Method {
- name: "contains"
- type: "bool"
- Parameter { name: "point"; type: "QPointF" }
- }
- Method {
- name: "mapToGlobal"
- revision: 7
- type: "QPointF"
- Parameter { name: "point"; type: "QPointF" }
- }
- Method {
- name: "mapFromGlobal"
- revision: 7
- type: "QPointF"
- Parameter { name: "point"; type: "QPointF" }
- }
- Method {
- name: "mapFromItem"
- Parameter { type: "QQmlV4Function"; isPointer: true }
- }
- Method {
- name: "mapToItem"
- Parameter { type: "QQmlV4Function"; isPointer: true }
- }
- Method { name: "forceActiveFocus" }
- Method {
- name: "forceActiveFocus"
- Parameter { name: "reason"; type: "Qt::FocusReason" }
- }
- Method {
- name: "nextItemInFocusChain"
- revision: 1
- type: "QQuickItem*"
- Parameter { name: "forward"; type: "bool" }
- }
- Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" }
- Method {
- name: "childAt"
- type: "QQuickItem*"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- }
- }
- Component {
name: "QQuickItemDelegate"
defaultProperty: "data"
prototype: "QQuickAbstractButton"
@@ -492,11 +409,18 @@ Module {
Signal { name: "triggered" }
}
Component {
+ name: "QQuickMenuSeparator"
+ defaultProperty: "data"
+ prototype: "QQuickControl"
+ exports: ["QtQuick.Templates/MenuSeparator 2.1"]
+ exportMetaObjectRevisions: [0]
+ }
+ Component {
name: "QQuickOverlay"
defaultProperty: "data"
prototype: "QQuickItem"
- Property { name: "modal"; type: "QQuickItem"; isPointer: true }
- Property { name: "modeless"; type: "QQuickItem"; isPointer: true }
+ Property { name: "modal"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "modeless"; type: "QQmlComponent"; isPointer: true }
Signal { name: "pressed" }
Signal { name: "released" }
}
@@ -615,6 +539,11 @@ Module {
Signal { name: "closed" }
Method { name: "open" }
Method { name: "close" }
+ Method {
+ name: "forceActiveFocus"
+ Parameter { name: "reason"; type: "Qt::FocusReason" }
+ }
+ Method { name: "forceActiveFocus" }
}
Component {
name: "QQuickProgressBar"
@@ -647,8 +576,11 @@ Module {
name: "QQuickRangeSlider"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/RangeSlider 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/RangeSlider 2.0",
+ "QtQuick.Templates/RangeSlider 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "SnapMode"
values: {
@@ -678,21 +610,18 @@ Module {
Property { name: "visualPosition"; type: "double"; isReadonly: true }
Property { name: "handle"; type: "QQuickItem"; isPointer: true }
Property { name: "pressed"; type: "bool" }
+ Property { name: "hovered"; revision: 1; type: "bool" }
+ Signal { name: "hoveredChanged"; revision: 1 }
Method { name: "increase" }
Method { name: "decrease" }
}
Component {
- name: "QQuickRootItem"
+ name: "QQuickRoundButton"
defaultProperty: "data"
- prototype: "QQuickItem"
- Method {
- name: "setWidth"
- Parameter { name: "w"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "h"; type: "int" }
- }
+ prototype: "QQuickButton"
+ exports: ["QtQuick.Templates/RoundButton 2.1"]
+ exportMetaObjectRevisions: [1]
+ Property { name: "radius"; type: "double" }
}
Component {
name: "QQuickScrollBar"
@@ -754,8 +683,11 @@ Module {
name: "QQuickSlider"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/Slider 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/Slider 2.0",
+ "QtQuick.Templates/Slider 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "SnapMode"
values: {
@@ -776,13 +708,22 @@ Module {
Property { name: "handle"; type: "QQuickItem"; isPointer: true }
Method { name: "increase" }
Method { name: "decrease" }
+ Method {
+ name: "valueAt"
+ revision: 1
+ type: "double"
+ Parameter { name: "position"; type: "double" }
+ }
}
Component {
name: "QQuickSpinBox"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/SpinBox 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/SpinBox 2.0",
+ "QtQuick.Templates/SpinBox 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "from"; type: "int" }
Property { name: "to"; type: "int" }
Property { name: "value"; type: "int" }
@@ -800,7 +741,9 @@ Module {
name: "QQuickSpinButton"
prototype: "QObject"
Property { name: "pressed"; type: "bool" }
+ Property { name: "hovered"; revision: 1; type: "bool" }
Property { name: "indicator"; type: "QQuickItem"; isPointer: true }
+ Signal { name: "hoveredChanged"; revision: 1 }
}
Component {
name: "QQuickStackAttached"
@@ -808,13 +751,21 @@ Module {
Property { name: "index"; type: "int"; isReadonly: true }
Property { name: "view"; type: "QQuickStackView"; isReadonly: true; isPointer: true }
Property { name: "status"; type: "QQuickStackView::Status"; isReadonly: true }
+ Signal { name: "activated" }
+ Signal { name: "activating" }
+ Signal { name: "deactivated" }
+ Signal { name: "deactivating" }
+ Signal { name: "removed" }
}
Component {
name: "QQuickStackView"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/StackView 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/StackView 2.0",
+ "QtQuick.Templates/StackView 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickStackAttached"
Enum {
name: "Status"
@@ -835,8 +786,11 @@ Module {
Enum {
name: "Operation"
values: {
- "Transition": 0,
- "Immediate": 1
+ "Transition": -1,
+ "Immediate": 0,
+ "PushTransition": 1,
+ "ReplaceTransition": 2,
+ "PopTransition": 3
}
}
Property { name: "busy"; type: "bool"; isReadonly: true }
@@ -896,28 +850,47 @@ Module {
Property { name: "leftItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "behindItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "rightItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
+ Signal { name: "completed"; revision: 1 }
+ Method { name: "close"; revision: 1 }
}
Component {
name: "QQuickSwipeDelegate"
defaultProperty: "data"
prototype: "QQuickItemDelegate"
- exports: ["QtQuick.Templates/SwipeDelegate 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/SwipeDelegate 2.0",
+ "QtQuick.Templates/SwipeDelegate 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
+ attachedType: "QQuickSwipeDelegateAttached"
Property { name: "swipe"; type: "QQuickSwipe"; isReadonly: true; isPointer: true }
}
Component {
+ name: "QQuickSwipeDelegateAttached"
+ prototype: "QObject"
+ Property { name: "pressed"; type: "bool"; isReadonly: true }
+ Signal { name: "clicked" }
+ }
+ Component {
name: "QQuickSwipeView"
defaultProperty: "contentData"
prototype: "QQuickContainer"
- exports: ["QtQuick.Templates/SwipeView 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/SwipeView 2.0",
+ "QtQuick.Templates/SwipeView 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickSwipeViewAttached"
+ Property { name: "interactive"; revision: 1; type: "bool" }
+ Signal { name: "interactiveChanged"; revision: 1 }
}
Component {
name: "QQuickSwipeViewAttached"
prototype: "QObject"
Property { name: "index"; type: "int"; isReadonly: true }
Property { name: "isCurrentItem"; type: "bool"; isReadonly: true }
+ Property { name: "isNextItem"; revision: 1; type: "bool"; isReadonly: true }
+ Property { name: "isPreviousItem"; revision: 1; type: "bool"; isReadonly: true }
Property { name: "view"; type: "QQuickSwipeView"; isReadonly: true; isPointer: true }
}
Component {
@@ -961,188 +934,14 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
- name: "QQuickText"
- defaultProperty: "data"
- prototype: "QQuickImplicitSizeItem"
- Enum {
- name: "HAlignment"
- values: {
- "AlignLeft": 1,
- "AlignRight": 2,
- "AlignHCenter": 4,
- "AlignJustify": 8
- }
- }
- Enum {
- name: "VAlignment"
- values: {
- "AlignTop": 32,
- "AlignBottom": 64,
- "AlignVCenter": 128
- }
- }
- Enum {
- name: "TextStyle"
- values: {
- "Normal": 0,
- "Outline": 1,
- "Raised": 2,
- "Sunken": 3
- }
- }
- Enum {
- name: "TextFormat"
- values: {
- "PlainText": 0,
- "RichText": 1,
- "AutoText": 2,
- "StyledText": 4
- }
- }
- Enum {
- name: "TextElideMode"
- values: {
- "ElideLeft": 0,
- "ElideRight": 1,
- "ElideMiddle": 2,
- "ElideNone": 3
- }
- }
- Enum {
- name: "WrapMode"
- values: {
- "NoWrap": 0,
- "WordWrap": 1,
- "WrapAnywhere": 3,
- "WrapAtWordBoundaryOrAnywhere": 4,
- "Wrap": 4
- }
- }
- Enum {
- name: "RenderType"
- values: {
- "QtRendering": 0,
- "NativeRendering": 1
- }
- }
- Enum {
- name: "LineHeightMode"
- values: {
- "ProportionalHeight": 0,
- "FixedHeight": 1
- }
- }
- Enum {
- name: "FontSizeMode"
- values: {
- "FixedSize": 0,
- "HorizontalFit": 1,
- "VerticalFit": 2,
- "Fit": 3
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "font"; type: "QFont" }
- Property { name: "color"; type: "QColor" }
- Property { name: "linkColor"; type: "QColor" }
- Property { name: "style"; type: "TextStyle" }
- Property { name: "styleColor"; type: "QColor" }
- Property { name: "horizontalAlignment"; type: "HAlignment" }
- Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true }
- Property { name: "verticalAlignment"; type: "VAlignment" }
- Property { name: "wrapMode"; type: "WrapMode" }
- Property { name: "lineCount"; type: "int"; isReadonly: true }
- Property { name: "truncated"; type: "bool"; isReadonly: true }
- Property { name: "maximumLineCount"; type: "int" }
- Property { name: "textFormat"; type: "TextFormat" }
- Property { name: "elide"; type: "TextElideMode" }
- Property { name: "contentWidth"; type: "double"; isReadonly: true }
- Property { name: "contentHeight"; type: "double"; isReadonly: true }
- Property { name: "paintedWidth"; type: "double"; isReadonly: true }
- Property { name: "paintedHeight"; type: "double"; isReadonly: true }
- Property { name: "lineHeight"; type: "double" }
- Property { name: "lineHeightMode"; type: "LineHeightMode" }
- Property { name: "baseUrl"; type: "QUrl" }
- Property { name: "minimumPixelSize"; type: "int" }
- Property { name: "minimumPointSize"; type: "int" }
- Property { name: "fontSizeMode"; type: "FontSizeMode" }
- Property { name: "renderType"; type: "RenderType" }
- Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true }
- Property { name: "padding"; revision: 6; type: "double" }
- Property { name: "topPadding"; revision: 6; type: "double" }
- Property { name: "leftPadding"; revision: 6; type: "double" }
- Property { name: "rightPadding"; revision: 6; type: "double" }
- Property { name: "bottomPadding"; revision: 6; type: "double" }
- Signal {
- name: "textChanged"
- Parameter { name: "text"; type: "string" }
- }
- Signal {
- name: "linkActivated"
- Parameter { name: "link"; type: "string" }
- }
- Signal {
- name: "linkHovered"
- revision: 2
- Parameter { name: "link"; type: "string" }
- }
- Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "styleChanged"
- Parameter { name: "style"; type: "QQuickText::TextStyle" }
- }
- Signal {
- name: "horizontalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickText::HAlignment" }
- }
- Signal {
- name: "verticalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickText::VAlignment" }
- }
- Signal {
- name: "textFormatChanged"
- Parameter { name: "textFormat"; type: "QQuickText::TextFormat" }
- }
- Signal {
- name: "elideModeChanged"
- Parameter { name: "mode"; type: "QQuickText::TextElideMode" }
- }
- Signal { name: "contentSizeChanged" }
- Signal {
- name: "lineHeightChanged"
- Parameter { name: "lineHeight"; type: "double" }
- }
- Signal {
- name: "lineHeightModeChanged"
- Parameter { name: "mode"; type: "LineHeightMode" }
- }
- Signal {
- name: "lineLaidOut"
- Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true }
- }
- Signal { name: "paddingChanged"; revision: 6 }
- Signal { name: "topPaddingChanged"; revision: 6 }
- Signal { name: "leftPaddingChanged"; revision: 6 }
- Signal { name: "rightPaddingChanged"; revision: 6 }
- Signal { name: "bottomPaddingChanged"; revision: 6 }
- Method { name: "doLayout" }
- Method {
- name: "linkAt"
- revision: 3
- type: "string"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- }
- }
- Component {
name: "QQuickTextArea"
defaultProperty: "data"
prototype: "QQuickTextEdit"
- exports: ["QtQuick.Templates/TextArea 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/TextArea 2.0",
+ "QtQuick.Templates/TextArea 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickTextAreaAttached"
Property { name: "font"; type: "QFont" }
Property { name: "implicitWidth"; type: "double" }
@@ -1150,539 +949,72 @@ Module {
Property { name: "background"; type: "QQuickItem"; isPointer: true }
Property { name: "placeholderText"; type: "string" }
Property { name: "focusReason"; type: "Qt::FocusReason" }
+ Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true }
+ Property { name: "hoverEnabled"; revision: 1; type: "bool" }
Signal { name: "implicitWidthChanged3" }
Signal { name: "implicitHeightChanged3" }
+ Signal { name: "hoveredChanged"; revision: 1 }
+ Signal { name: "hoverEnabledChanged"; revision: 1 }
Signal {
name: "pressAndHold"
Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
- }
- Component {
- name: "QQuickTextAreaAttached"
- prototype: "QObject"
- Property { name: "flickable"; type: "QQuickTextArea"; isPointer: true }
- }
- Component {
- name: "QQuickTextEdit"
- defaultProperty: "data"
- prototype: "QQuickImplicitSizeItem"
- Enum {
- name: "HAlignment"
- values: {
- "AlignLeft": 1,
- "AlignRight": 2,
- "AlignHCenter": 4,
- "AlignJustify": 8
- }
- }
- Enum {
- name: "VAlignment"
- values: {
- "AlignTop": 32,
- "AlignBottom": 64,
- "AlignVCenter": 128
- }
- }
- Enum {
- name: "TextFormat"
- values: {
- "PlainText": 0,
- "RichText": 1,
- "AutoText": 2
- }
- }
- Enum {
- name: "WrapMode"
- values: {
- "NoWrap": 0,
- "WordWrap": 1,
- "WrapAnywhere": 3,
- "WrapAtWordBoundaryOrAnywhere": 4,
- "Wrap": 4
- }
- }
- Enum {
- name: "SelectionMode"
- values: {
- "SelectCharacters": 0,
- "SelectWords": 1
- }
- }
- Enum {
- name: "RenderType"
- values: {
- "QtRendering": 0,
- "NativeRendering": 1
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "color"; type: "QColor" }
- Property { name: "selectionColor"; type: "QColor" }
- Property { name: "selectedTextColor"; type: "QColor" }
- Property { name: "font"; type: "QFont" }
- Property { name: "horizontalAlignment"; type: "HAlignment" }
- Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true }
- Property { name: "verticalAlignment"; type: "VAlignment" }
- Property { name: "wrapMode"; type: "WrapMode" }
- Property { name: "lineCount"; type: "int"; isReadonly: true }
- Property { name: "length"; type: "int"; isReadonly: true }
- Property { name: "contentWidth"; type: "double"; isReadonly: true }
- Property { name: "contentHeight"; type: "double"; isReadonly: true }
- Property { name: "paintedWidth"; type: "double"; isReadonly: true }
- Property { name: "paintedHeight"; type: "double"; isReadonly: true }
- Property { name: "textFormat"; type: "TextFormat" }
- Property { name: "readOnly"; type: "bool" }
- Property { name: "cursorVisible"; type: "bool" }
- Property { name: "cursorPosition"; type: "int" }
- Property { name: "cursorRectangle"; type: "QRectF"; isReadonly: true }
- Property { name: "cursorDelegate"; type: "QQmlComponent"; isPointer: true }
- Property { name: "selectionStart"; type: "int"; isReadonly: true }
- Property { name: "selectionEnd"; type: "int"; isReadonly: true }
- Property { name: "selectedText"; type: "string"; isReadonly: true }
- Property { name: "activeFocusOnPress"; type: "bool" }
- Property { name: "persistentSelection"; type: "bool" }
- Property { name: "textMargin"; type: "double" }
- Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" }
- Property { name: "selectByKeyboard"; revision: 1; type: "bool" }
- Property { name: "selectByMouse"; type: "bool" }
- Property { name: "mouseSelectionMode"; type: "SelectionMode" }
- Property { name: "canPaste"; type: "bool"; isReadonly: true }
- Property { name: "canUndo"; type: "bool"; isReadonly: true }
- Property { name: "canRedo"; type: "bool"; isReadonly: true }
- Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true }
- Property { name: "baseUrl"; type: "QUrl" }
- Property { name: "renderType"; type: "RenderType" }
- Property {
- name: "textDocument"
- revision: 1
- type: "QQuickTextDocument"
- isReadonly: true
- isPointer: true
- }
- Property { name: "hoveredLink"; revision: 2; type: "string"; isReadonly: true }
- Property { name: "padding"; revision: 6; type: "double" }
- Property { name: "topPadding"; revision: 6; type: "double" }
- Property { name: "leftPadding"; revision: 6; type: "double" }
- Property { name: "rightPadding"; revision: 6; type: "double" }
- Property { name: "bottomPadding"; revision: 6; type: "double" }
- Property { name: "preeditText"; revision: 7; type: "string"; isReadonly: true }
- Signal { name: "preeditTextChanged"; revision: 7 }
- Signal { name: "contentSizeChanged" }
Signal {
- name: "colorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Signal {
- name: "selectionColorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Signal {
- name: "selectedTextColorChanged"
- Parameter { name: "color"; type: "QColor" }
- }
- Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "horizontalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextEdit::HAlignment" }
- }
- Signal {
- name: "verticalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextEdit::VAlignment" }
- }
- Signal {
- name: "textFormatChanged"
- Parameter { name: "textFormat"; type: "QQuickTextEdit::TextFormat" }
- }
- Signal {
- name: "readOnlyChanged"
- Parameter { name: "isReadOnly"; type: "bool" }
- }
- Signal {
- name: "cursorVisibleChanged"
- Parameter { name: "isCursorVisible"; type: "bool" }
- }
- Signal {
- name: "activeFocusOnPressChanged"
- Parameter { name: "activeFocusOnPressed"; type: "bool" }
- }
- Signal {
- name: "persistentSelectionChanged"
- Parameter { name: "isPersistentSelection"; type: "bool" }
- }
- Signal {
- name: "textMarginChanged"
- Parameter { name: "textMargin"; type: "double" }
- }
- Signal {
- name: "selectByKeyboardChanged"
+ name: "pressed"
revision: 1
- Parameter { name: "selectByKeyboard"; type: "bool" }
- }
- Signal {
- name: "selectByMouseChanged"
- Parameter { name: "selectByMouse"; type: "bool" }
- }
- Signal {
- name: "mouseSelectionModeChanged"
- Parameter { name: "mode"; type: "QQuickTextEdit::SelectionMode" }
- }
- Signal {
- name: "linkActivated"
- Parameter { name: "link"; type: "string" }
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
Signal {
- name: "linkHovered"
- revision: 2
- Parameter { name: "link"; type: "string" }
- }
- Signal { name: "editingFinished"; revision: 6 }
- Signal { name: "paddingChanged"; revision: 6 }
- Signal { name: "topPaddingChanged"; revision: 6 }
- Signal { name: "leftPaddingChanged"; revision: 6 }
- Signal { name: "rightPaddingChanged"; revision: 6 }
- Signal { name: "bottomPaddingChanged"; revision: 6 }
- Method { name: "selectAll" }
- Method { name: "selectWord" }
- Method {
- name: "select"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "deselect" }
- Method {
- name: "isRightToLeft"
- type: "bool"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "cut" }
- Method { name: "copy" }
- Method { name: "paste" }
- Method { name: "undo" }
- Method { name: "redo" }
- Method {
- name: "insert"
- Parameter { name: "position"; type: "int" }
- Parameter { name: "text"; type: "string" }
- }
- Method {
- name: "remove"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "append"
- revision: 2
- Parameter { name: "text"; type: "string" }
- }
- Method { name: "clear"; revision: 7 }
- Method {
- name: "inputMethodQuery"
- revision: 4
- type: "QVariant"
- Parameter { name: "query"; type: "Qt::InputMethodQuery" }
- Parameter { name: "argument"; type: "QVariant" }
- }
- Method {
- name: "positionToRectangle"
- type: "QRectF"
- Parameter { type: "int" }
- }
- Method {
- name: "positionAt"
- type: "int"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- Parameter { name: "mode"; type: "SelectionMode" }
- }
- Method {
- name: "getText"
- type: "string"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "getFormattedText"
- type: "string"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "linkAt"
- revision: 3
- type: "string"
- Parameter { name: "x"; type: "double" }
- Parameter { name: "y"; type: "double" }
+ name: "released"
+ revision: 1
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
}
Component {
+ name: "QQuickTextAreaAttached"
+ prototype: "QObject"
+ Property { name: "flickable"; type: "QQuickTextArea"; isPointer: true }
+ }
+ Component {
name: "QQuickTextField"
defaultProperty: "data"
prototype: "QQuickTextInput"
- exports: ["QtQuick.Templates/TextField 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/TextField 2.0",
+ "QtQuick.Templates/TextField 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "font"; type: "QFont" }
Property { name: "implicitWidth"; type: "double" }
Property { name: "implicitHeight"; type: "double" }
Property { name: "background"; type: "QQuickItem"; isPointer: true }
Property { name: "placeholderText"; type: "string" }
Property { name: "focusReason"; type: "Qt::FocusReason" }
+ Property { name: "hovered"; revision: 1; type: "bool"; isReadonly: true }
+ Property { name: "hoverEnabled"; revision: 1; type: "bool" }
Signal { name: "implicitWidthChanged3" }
Signal { name: "implicitHeightChanged3" }
+ Signal { name: "hoveredChanged"; revision: 1 }
+ Signal { name: "hoverEnabledChanged"; revision: 1 }
Signal {
name: "pressAndHold"
- Parameter { name: "mouse"; type: "QQuickMouseEvent"; isPointer: true }
- }
- }
- Component {
- name: "QQuickTextInput"
- defaultProperty: "data"
- prototype: "QQuickImplicitSizeItem"
- Enum {
- name: "EchoMode"
- values: {
- "Normal": 0,
- "NoEcho": 1,
- "Password": 2,
- "PasswordEchoOnEdit": 3
- }
- }
- Enum {
- name: "HAlignment"
- values: {
- "AlignLeft": 1,
- "AlignRight": 2,
- "AlignHCenter": 4
- }
- }
- Enum {
- name: "VAlignment"
- values: {
- "AlignTop": 32,
- "AlignBottom": 64,
- "AlignVCenter": 128
- }
- }
- Enum {
- name: "WrapMode"
- values: {
- "NoWrap": 0,
- "WordWrap": 1,
- "WrapAnywhere": 3,
- "WrapAtWordBoundaryOrAnywhere": 4,
- "Wrap": 4
- }
- }
- Enum {
- name: "SelectionMode"
- values: {
- "SelectCharacters": 0,
- "SelectWords": 1
- }
- }
- Enum {
- name: "CursorPosition"
- values: {
- "CursorBetweenCharacters": 0,
- "CursorOnCharacter": 1
- }
- }
- Enum {
- name: "RenderType"
- values: {
- "QtRendering": 0,
- "NativeRendering": 1
- }
- }
- Property { name: "text"; type: "string" }
- Property { name: "length"; type: "int"; isReadonly: true }
- Property { name: "color"; type: "QColor" }
- Property { name: "selectionColor"; type: "QColor" }
- Property { name: "selectedTextColor"; type: "QColor" }
- Property { name: "font"; type: "QFont" }
- Property { name: "horizontalAlignment"; type: "HAlignment" }
- Property { name: "effectiveHorizontalAlignment"; type: "HAlignment"; isReadonly: true }
- Property { name: "verticalAlignment"; type: "VAlignment" }
- Property { name: "wrapMode"; type: "WrapMode" }
- Property { name: "readOnly"; type: "bool" }
- Property { name: "cursorVisible"; type: "bool" }
- Property { name: "cursorPosition"; type: "int" }
- Property { name: "cursorRectangle"; type: "QRectF"; isReadonly: true }
- Property { name: "cursorDelegate"; type: "QQmlComponent"; isPointer: true }
- Property { name: "selectionStart"; type: "int"; isReadonly: true }
- Property { name: "selectionEnd"; type: "int"; isReadonly: true }
- Property { name: "selectedText"; type: "string"; isReadonly: true }
- Property { name: "maximumLength"; type: "int" }
- Property { name: "validator"; type: "QValidator"; isPointer: true }
- Property { name: "inputMask"; type: "string" }
- Property { name: "inputMethodHints"; type: "Qt::InputMethodHints" }
- Property { name: "acceptableInput"; type: "bool"; isReadonly: true }
- Property { name: "echoMode"; type: "EchoMode" }
- Property { name: "activeFocusOnPress"; type: "bool" }
- Property { name: "passwordCharacter"; type: "string" }
- Property { name: "passwordMaskDelay"; revision: 3; type: "int" }
- Property { name: "displayText"; type: "string"; isReadonly: true }
- Property { name: "preeditText"; revision: 7; type: "string"; isReadonly: true }
- Property { name: "autoScroll"; type: "bool" }
- Property { name: "selectByMouse"; type: "bool" }
- Property { name: "mouseSelectionMode"; type: "SelectionMode" }
- Property { name: "persistentSelection"; type: "bool" }
- Property { name: "canPaste"; type: "bool"; isReadonly: true }
- Property { name: "canUndo"; type: "bool"; isReadonly: true }
- Property { name: "canRedo"; type: "bool"; isReadonly: true }
- Property { name: "inputMethodComposing"; type: "bool"; isReadonly: true }
- Property { name: "contentWidth"; type: "double"; isReadonly: true }
- Property { name: "contentHeight"; type: "double"; isReadonly: true }
- Property { name: "renderType"; type: "RenderType" }
- Property { name: "padding"; revision: 6; type: "double" }
- Property { name: "topPadding"; revision: 6; type: "double" }
- Property { name: "leftPadding"; revision: 6; type: "double" }
- Property { name: "rightPadding"; revision: 6; type: "double" }
- Property { name: "bottomPadding"; revision: 6; type: "double" }
- Signal { name: "accepted" }
- Signal { name: "editingFinished"; revision: 2 }
- Signal {
- name: "fontChanged"
- Parameter { name: "font"; type: "QFont" }
- }
- Signal {
- name: "horizontalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextInput::HAlignment" }
- }
- Signal {
- name: "verticalAlignmentChanged"
- Parameter { name: "alignment"; type: "QQuickTextInput::VAlignment" }
- }
- Signal {
- name: "readOnlyChanged"
- Parameter { name: "isReadOnly"; type: "bool" }
- }
- Signal {
- name: "cursorVisibleChanged"
- Parameter { name: "isCursorVisible"; type: "bool" }
- }
- Signal {
- name: "maximumLengthChanged"
- Parameter { name: "maximumLength"; type: "int" }
- }
- Signal {
- name: "inputMaskChanged"
- Parameter { name: "inputMask"; type: "string" }
- }
- Signal {
- name: "echoModeChanged"
- Parameter { name: "echoMode"; type: "QQuickTextInput::EchoMode" }
- }
- Signal {
- name: "passwordMaskDelayChanged"
- revision: 3
- Parameter { name: "delay"; type: "int" }
- }
- Signal { name: "preeditTextChanged"; revision: 7 }
- Signal {
- name: "activeFocusOnPressChanged"
- Parameter { name: "activeFocusOnPress"; type: "bool" }
- }
- Signal {
- name: "autoScrollChanged"
- Parameter { name: "autoScroll"; type: "bool" }
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
Signal {
- name: "selectByMouseChanged"
- Parameter { name: "selectByMouse"; type: "bool" }
+ name: "pressed"
+ revision: 1
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
Signal {
- name: "mouseSelectionModeChanged"
- Parameter { name: "mode"; type: "QQuickTextInput::SelectionMode" }
- }
- Signal { name: "contentSizeChanged" }
- Signal { name: "paddingChanged"; revision: 6 }
- Signal { name: "topPaddingChanged"; revision: 6 }
- Signal { name: "leftPaddingChanged"; revision: 6 }
- Signal { name: "rightPaddingChanged"; revision: 6 }
- Signal { name: "bottomPaddingChanged"; revision: 6 }
- Method { name: "selectAll" }
- Method { name: "selectWord" }
- Method {
- name: "select"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "deselect" }
- Method {
- name: "isRightToLeft"
- type: "bool"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method { name: "cut" }
- Method { name: "copy" }
- Method { name: "paste" }
- Method { name: "undo" }
- Method { name: "redo" }
- Method {
- name: "insert"
- Parameter { name: "position"; type: "int" }
- Parameter { name: "text"; type: "string" }
- }
- Method {
- name: "remove"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
- }
- Method {
- name: "ensureVisible"
- revision: 3
- Parameter { name: "position"; type: "int" }
- }
- Method { name: "clear"; revision: 7 }
- Method {
- name: "positionAt"
- Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true }
- }
- Method {
- name: "positionToRectangle"
- type: "QRectF"
- Parameter { name: "pos"; type: "int" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- }
- Method {
- name: "moveCursorSelection"
- Parameter { name: "pos"; type: "int" }
- Parameter { name: "mode"; type: "SelectionMode" }
- }
- Method {
- name: "inputMethodQuery"
- revision: 3
- type: "QVariant"
- Parameter { name: "query"; type: "Qt::InputMethodQuery" }
- Parameter { name: "argument"; type: "QVariant" }
- }
- Method {
- name: "getText"
- type: "string"
- Parameter { name: "start"; type: "int" }
- Parameter { name: "end"; type: "int" }
+ name: "released"
+ revision: 1
+ Parameter { name: "event"; type: "QQuickMouseEvent"; isPointer: true }
}
}
Component {
name: "QQuickToolBar"
defaultProperty: "contentData"
- prototype: "QQuickFrame"
+ prototype: "QQuickPane"
exports: ["QtQuick.Templates/ToolBar 2.0"]
exportMetaObjectRevisions: [0]
Enum {
@@ -1702,6 +1034,16 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
+ name: "QQuickToolSeparator"
+ defaultProperty: "data"
+ prototype: "QQuickControl"
+ exports: ["QtQuick.Templates/ToolSeparator 2.1"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "orientation"; type: "Qt::Orientation" }
+ Property { name: "horizontal"; type: "bool"; isReadonly: true }
+ Property { name: "vertical"; type: "bool"; isReadonly: true }
+ }
+ Component {
name: "QQuickToolTip"
defaultProperty: "contentData"
prototype: "QQuickPopup"
@@ -1711,8 +1053,6 @@ Module {
Property { name: "delay"; type: "int" }
Property { name: "timeout"; type: "int" }
Property { name: "text"; type: "string" }
- Method { name: "open" }
- Method { name: "close" }
}
Component {
name: "QQuickToolTipAttached"
@@ -1737,8 +1077,11 @@ Module {
name: "QQuickTumbler"
defaultProperty: "data"
prototype: "QQuickControl"
- exports: ["QtQuick.Templates/Tumbler 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: [
+ "QtQuick.Templates/Tumbler 2.0",
+ "QtQuick.Templates/Tumbler 2.1"
+ ]
+ exportMetaObjectRevisions: [0, 1]
attachedType: "QQuickTumblerAttached"
Property { name: "model"; type: "QVariant" }
Property { name: "count"; type: "int"; isReadonly: true }
@@ -1746,6 +1089,8 @@ Module {
Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "visibleItemCount"; type: "int" }
+ Property { name: "wrap"; revision: 1; type: "bool" }
+ Signal { name: "wrapChanged"; revision: 1 }
}
Component {
name: "QQuickTumblerAttached"
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp
index b0ec18d3..cc344a80 100644
--- a/src/imports/templates/qtquicktemplates2plugin.cpp
+++ b/src/imports/templates/qtquicktemplates2plugin.cpp
@@ -47,6 +47,8 @@
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
#include <QtQuickTemplates2/private/qquickcontainer_p.h>
#include <QtQuickTemplates2/private/qquickdial_p.h>
+#include <QtQuickTemplates2/private/qquickdialog_p.h>
+#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
#include <QtQuickTemplates2/private/qquickdrawer_p.h>
#include <QtQuickTemplates2/private/qquickframe_p.h>
#include <QtQuickTemplates2/private/qquickgroupbox_p.h>
@@ -54,6 +56,7 @@
#include <QtQuickTemplates2/private/qquicklabel_p.h>
#include <QtQuickTemplates2/private/qquickmenu_p.h>
#include <QtQuickTemplates2/private/qquickmenuitem_p.h>
+#include <QtQuickTemplates2/private/qquickmenuseparator_p.h>
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
#include <QtQuickTemplates2/private/qquickpage_p.h>
#include <QtQuickTemplates2/private/qquickpageindicator_p.h>
@@ -63,6 +66,7 @@
#include <QtQuickTemplates2/private/qquickradiobutton_p.h>
#include <QtQuickTemplates2/private/qquickradiodelegate_p.h>
#include <QtQuickTemplates2/private/qquickrangeslider_p.h>
+#include <QtQuickTemplates2/private/qquickroundbutton_p.h>
#include <QtQuickTemplates2/private/qquickscrollbar_p.h>
#include <QtQuickTemplates2/private/qquickscrollindicator_p.h>
#include <QtQuickTemplates2/private/qquickslider_p.h>
@@ -78,6 +82,7 @@
#include <QtQuickTemplates2/private/qquicktextfield_p.h>
#include <QtQuickTemplates2/private/qquicktoolbar_p.h>
#include <QtQuickTemplates2/private/qquicktoolbutton_p.h>
+#include <QtQuickTemplates2/private/qquicktoolseparator_p.h>
#include <QtQuickTemplates2/private/qquicktooltip_p.h>
#include <QtQuickTemplates2/private/qquicktumbler_p.h>
@@ -107,6 +112,7 @@ QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent) : QQmlExtensio
void QtQuickTemplates2Plugin::registerTypes(const char *uri)
{
+ // QtQuick.Templates 2.0 (Qt 5.7)
qmlRegisterType<QQuickAbstractButton>(uri, 2, 0, "AbstractButton");
qmlRegisterType<QQuickApplicationWindow>(uri, 2, 0, "ApplicationWindow");
qmlRegisterType<QQuickApplicationWindowAttached>();
@@ -171,6 +177,26 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterRevision<QQuickText, 6>(uri, 2, 0);
qmlRegisterRevision<QQuickTextInput, 7>(uri, 2, 0);
qmlRegisterRevision<QQuickTextEdit, 7>(uri, 2, 0);
+
+ // QtQuick.Templates 2.1 (Qt 5.8)
+ qmlRegisterType<QQuickButtonGroup, 1>(uri, 2, 1, "ButtonGroup");
+ qmlRegisterType<QQuickComboBox, 1>(uri, 2, 1, "ComboBox");
+ qmlRegisterType<QQuickContainer, 1>(uri, 2, 1, "Container");
+ qmlRegisterType<QQuickDialog>(uri, 2, 1, "Dialog");
+ qmlRegisterType<QQuickDialogButtonBox>(uri, 2, 1, "DialogButtonBox");
+ qmlRegisterType<QQuickDialogButtonBoxAttached>();
+ qmlRegisterType<QQuickMenuSeparator>(uri, 2, 1, "MenuSeparator");
+ qmlRegisterType<QQuickRangeSlider, 1>(uri, 2, 1, "RangeSlider");
+ qmlRegisterType<QQuickRoundButton, 1>(uri, 2, 1, "RoundButton");
+ qmlRegisterType<QQuickSlider, 1>(uri, 2, 1, "Slider");
+ qmlRegisterType<QQuickSpinBox, 1>(uri, 2, 1, "SpinBox");
+ qmlRegisterType<QQuickStackView, 1>(uri, 2, 1, "StackView");
+ qmlRegisterType<QQuickSwipeDelegate, 1>(uri, 2, 1, "SwipeDelegate");
+ qmlRegisterType<QQuickSwipeView, 1>(uri, 2, 1, "SwipeView");
+ qmlRegisterType<QQuickTextArea, 1>(uri, 2, 1, "TextArea");
+ qmlRegisterType<QQuickTextField, 1>(uri, 2, 1, "TextField");
+ qmlRegisterType<QQuickToolSeparator>(uri, 2, 1, "ToolSeparator");
+ qmlRegisterType<QQuickTumbler, 1>(uri, 2, 1, "Tumbler");
}
QT_END_NAMESPACE
diff --git a/src/imports/templates/templates.pro b/src/imports/templates/templates.pro
index 8785734a..3640f6d1 100644
--- a/src/imports/templates/templates.pro
+++ b/src/imports/templates/templates.pro
@@ -1,6 +1,6 @@
TARGET = qtquicktemplates2plugin
TARGETPATH = QtQuick/Templates.2
-IMPORT_VERSION = 2.0
+IMPORT_VERSION = 2.1
QT += qml quick
QT_PRIVATE += core-private gui-private qml-private quick-private quicktemplates2-private