diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2017-09-13 11:32:27 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-09-14 09:05:26 +0000 |
commit | 7cbf3685565d7f62c9a01b090a4c1600b4abe220 (patch) | |
tree | 20baffc826c01b9695d2d104c07b78f5196cf9c0 | |
parent | c829b2a8b4e80cf9b829b3ead0a69722c1b04a1a (diff) |
Imagine: fix QRC paths
Using ApplicationWindow as an example, its NinePatchImage url is
assigned like so:
source: Imagine.path + "applicationwindow-background"
If Imagine.path is set to ":/images" by the user, then the final URL
would be:
QUrl("file:///home/user/qt/qtbase/qml/QtQuick/Controls.2/Imagine/:/images/applicationwindow-background")
We could use a QUrl for QQuickImagineStyle::path, but we don't
want to support anything other than local paths. Instead, we add
a private "url" property that returns a URL that we construct
correctly in C++ ourselves, and then the Imagine QML controls files
use that property.
Change-Id: Ic4d1910bbc7f7b6f80f257496ae6131777a19401
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
53 files changed, 272 insertions, 93 deletions
diff --git a/src/imports/controls/imagine/ApplicationWindow.qml b/src/imports/controls/imagine/ApplicationWindow.qml index d0e7870a..d0219da0 100644 --- a/src/imports/controls/imagine/ApplicationWindow.qml +++ b/src/imports/controls/imagine/ApplicationWindow.qml @@ -45,7 +45,7 @@ T.ApplicationWindow { // ### remove? overlay.modal: NinePatchImage { - source: Imagine.path + "applicationwindow-overlay" + source: Imagine.url + "applicationwindow-overlay" NinePatchImageSelector on source { states: [ {"modal": true} @@ -55,7 +55,7 @@ T.ApplicationWindow { // ### remove? overlay.modeless: NinePatchImage { - source: Imagine.path + "applicationwindow-overlay" + source: Imagine.url + "applicationwindow-overlay" NinePatchImageSelector on source { states: [ {"modal": false} @@ -67,7 +67,7 @@ T.ApplicationWindow { width: window.width height: window.height - source: Imagine.path + "applicationwindow-background" + source: Imagine.url + "applicationwindow-background" NinePatchImageSelector on source { states: [ {"active": window.active} diff --git a/src/imports/controls/imagine/BusyIndicator.qml b/src/imports/controls/imagine/BusyIndicator.qml index c8ee92bd..a1ce3f7b 100644 --- a/src/imports/controls/imagine/BusyIndicator.qml +++ b/src/imports/controls/imagine/BusyIndicator.qml @@ -58,7 +58,7 @@ T.BusyIndicator { visible: control.running || animator.running Behavior on opacity { OpacityAnimator { id: animator; duration: 250 } } - source: Imagine.path + "busyindicator-animation" + source: Imagine.url + "busyindicator-animation" AnimatedImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -74,7 +74,7 @@ T.BusyIndicator { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "busyindicator-background" + source: Imagine.url + "busyindicator-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Button.qml b/src/imports/controls/imagine/Button.qml index 910491fa..8ccedbf8 100644 --- a/src/imports/controls/imagine/Button.qml +++ b/src/imports/controls/imagine/Button.qml @@ -81,7 +81,7 @@ T.Button { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "button-background" + source: Imagine.url + "button-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/CheckBox.qml b/src/imports/controls/imagine/CheckBox.qml index 0d37626a..01426054 100644 --- a/src/imports/controls/imagine/CheckBox.qml +++ b/src/imports/controls/imagine/CheckBox.qml @@ -60,7 +60,7 @@ T.CheckBox { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 - source: Imagine.path + "checkbox-indicator" + source: Imagine.url + "checkbox-indicator" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -92,7 +92,7 @@ T.CheckBox { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "checkbox-background" + source: Imagine.url + "checkbox-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/CheckDelegate.qml b/src/imports/controls/imagine/CheckDelegate.qml index 3660186d..e98a612c 100644 --- a/src/imports/controls/imagine/CheckDelegate.qml +++ b/src/imports/controls/imagine/CheckDelegate.qml @@ -66,7 +66,7 @@ T.CheckDelegate { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding y: control.topPadding + (control.availableHeight - height) / 2 - source: Imagine.path + "checkdelegate-indicator" + source: Imagine.url + "checkdelegate-indicator" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -101,7 +101,7 @@ T.CheckDelegate { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "checkdelegate-background" + source: Imagine.url + "checkdelegate-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml index 663b288c..1a85b675 100644 --- a/src/imports/controls/imagine/ComboBox.qml +++ b/src/imports/controls/imagine/ComboBox.qml @@ -65,7 +65,7 @@ T.ComboBox { x: control.mirrored ? control.padding : control.width - width - control.padding y: control.topPadding + (control.availableHeight - height) / 2 - source: Imagine.path + "combobox-indicator" + source: Imagine.url + "combobox-indicator" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -107,7 +107,7 @@ T.ComboBox { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "combobox-background" + source: Imagine.url + "combobox-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -155,7 +155,7 @@ T.ComboBox { width: control.popup.width + leftInset + rightInset height: control.popup.height + topInset + bottomInset - source: Imagine.path + "combobox-popup" + source: Imagine.url + "combobox-popup" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/DelayButton.qml b/src/imports/controls/imagine/DelayButton.qml index 05f38a10..3b2eb8bb 100644 --- a/src/imports/controls/imagine/DelayButton.qml +++ b/src/imports/controls/imagine/DelayButton.qml @@ -74,7 +74,7 @@ T.DelayButton { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "delaybutton-background" + source: Imagine.url + "delaybutton-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -92,7 +92,7 @@ T.DelayButton { height: parent.height visible: false - source: Imagine.path + "delaybutton-progress" + source: Imagine.url + "delaybutton-progress" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -111,7 +111,7 @@ T.DelayButton { height: parent.height visible: false - source: Imagine.path + "delaybutton-mask" + source: Imagine.url + "delaybutton-mask" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Dial.qml b/src/imports/controls/imagine/Dial.qml index 22dd44b6..04f8e1b8 100644 --- a/src/imports/controls/imagine/Dial.qml +++ b/src/imports/controls/imagine/Dial.qml @@ -56,7 +56,7 @@ T.Dial { x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 - source: Imagine.path + "dial-handle" + source: Imagine.url + "dial-handle" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -85,7 +85,7 @@ T.Dial { width: Math.max(64, Math.min(control.width, control.height)) height: width - source: Imagine.path + "dial-background" + source: Imagine.url + "dial-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Dialog.qml b/src/imports/controls/imagine/Dialog.qml index 80dd0896..e7a8cce5 100644 --- a/src/imports/controls/imagine/Dialog.qml +++ b/src/imports/controls/imagine/Dialog.qml @@ -65,7 +65,7 @@ T.Dialog { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "dialog-background" + source: Imagine.url + "dialog-background" NinePatchImageSelector on source { states: [ {"modal": control.modal}, @@ -85,7 +85,7 @@ T.Dialog { width: parent.width height: parent.height - source: Imagine.path + "dialog-title" + source: Imagine.url + "dialog-title" NinePatchImageSelector on source { states: [ {"modal": control.modal}, @@ -100,7 +100,7 @@ T.Dialog { } T.Overlay.modal: NinePatchImage { - source: Imagine.path + "dialog-overlay" + source: Imagine.url + "dialog-overlay" NinePatchImageSelector on source { states: [ {"modal": true} @@ -109,7 +109,7 @@ T.Dialog { } T.Overlay.modeless: NinePatchImage { - source: Imagine.path + "dialog-overlay" + source: Imagine.url + "dialog-overlay" NinePatchImageSelector on source { states: [ {"modal": false} diff --git a/src/imports/controls/imagine/DialogButtonBox.qml b/src/imports/controls/imagine/DialogButtonBox.qml index ea23d7b2..ae0e64de 100644 --- a/src/imports/controls/imagine/DialogButtonBox.qml +++ b/src/imports/controls/imagine/DialogButtonBox.qml @@ -75,7 +75,7 @@ T.DialogButtonBox { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "dialogbuttonbox-background" + source: Imagine.url + "dialogbuttonbox-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Drawer.qml b/src/imports/controls/imagine/Drawer.qml index 0bf4e9df..f52f9554 100644 --- a/src/imports/controls/imagine/Drawer.qml +++ b/src/imports/controls/imagine/Drawer.qml @@ -63,7 +63,7 @@ T.Drawer { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "drawer-background" + source: Imagine.url + "drawer-background" NinePatchImageSelector on source { states: [ {"modal": control.modal}, @@ -77,7 +77,7 @@ T.Drawer { } T.Overlay.modal: NinePatchImage { - source: Imagine.path + "drawer-overlay" + source: Imagine.url + "drawer-overlay" NinePatchImageSelector on source { states: [ {"modal": true} @@ -86,7 +86,7 @@ T.Drawer { } T.Overlay.modeless: NinePatchImage { - source: Imagine.path + "drawer-overlay" + source: Imagine.url + "drawer-overlay" NinePatchImageSelector on source { states: [ {"modal": false} diff --git a/src/imports/controls/imagine/Frame.qml b/src/imports/controls/imagine/Frame.qml index f506e97d..43c852f1 100644 --- a/src/imports/controls/imagine/Frame.qml +++ b/src/imports/controls/imagine/Frame.qml @@ -58,7 +58,7 @@ T.Frame { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "frame-background" + source: Imagine.url + "frame-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/GroupBox.qml b/src/imports/controls/imagine/GroupBox.qml index 6d12d378..8ff48c42 100644 --- a/src/imports/controls/imagine/GroupBox.qml +++ b/src/imports/controls/imagine/GroupBox.qml @@ -78,7 +78,7 @@ T.GroupBox { width: parent.width height: parent.height - source: Imagine.path + "groupbox-title" + source: Imagine.url + "groupbox-title" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -94,7 +94,7 @@ T.GroupBox { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - control.topPadding + control.padding - source: Imagine.path + "groupbox-background" + source: Imagine.url + "groupbox-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/ItemDelegate.qml b/src/imports/controls/imagine/ItemDelegate.qml index b8600631..1d16faf4 100644 --- a/src/imports/controls/imagine/ItemDelegate.qml +++ b/src/imports/controls/imagine/ItemDelegate.qml @@ -79,7 +79,7 @@ T.ItemDelegate { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "itemdelegate-background" + source: Imagine.url + "itemdelegate-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Label.qml b/src/imports/controls/imagine/Label.qml index 87d9f708..0db416e1 100644 --- a/src/imports/controls/imagine/Label.qml +++ b/src/imports/controls/imagine/Label.qml @@ -50,7 +50,7 @@ T.Label { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "label-background" + source: Imagine.url + "label-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Menu.qml b/src/imports/controls/imagine/Menu.qml index c666dfbb..80bda5ec 100644 --- a/src/imports/controls/imagine/Menu.qml +++ b/src/imports/controls/imagine/Menu.qml @@ -76,7 +76,7 @@ T.Menu { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "menu-background" + source: Imagine.url + "menu-background" NinePatchImageSelector on source { states: [ {"modal": control.modal}, @@ -86,7 +86,7 @@ T.Menu { } T.Overlay.modal: NinePatchImage { - source: Imagine.path + "menu-overlay" + source: Imagine.url + "menu-overlay" NinePatchImageSelector on source { states: [ {"modal": true} @@ -95,7 +95,7 @@ T.Menu { } T.Overlay.modeless: NinePatchImage { - source: Imagine.path + "menu-overlay" + source: Imagine.url + "menu-overlay" NinePatchImageSelector on source { states: [ {"modal": false} diff --git a/src/imports/controls/imagine/MenuItem.qml b/src/imports/controls/imagine/MenuItem.qml index 52b39f7b..8b576444 100644 --- a/src/imports/controls/imagine/MenuItem.qml +++ b/src/imports/controls/imagine/MenuItem.qml @@ -84,7 +84,7 @@ T.MenuItem { y: control.topPadding + (control.availableHeight - height) / 2 visible: control.subMenu - source: Imagine.path + "menuitem-arrow" + source: Imagine.url + "menuitem-arrow" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -103,7 +103,7 @@ T.MenuItem { y: control.topPadding + (control.availableHeight - height) / 2 visible: control.checkable - source: Imagine.path + "menuitem-indicator" + source: Imagine.url + "menuitem-indicator" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -122,7 +122,7 @@ T.MenuItem { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "menuitem-background" + source: Imagine.url + "menuitem-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/MenuSeparator.qml b/src/imports/controls/imagine/MenuSeparator.qml index 2dbb0a45..d445a9e1 100644 --- a/src/imports/controls/imagine/MenuSeparator.qml +++ b/src/imports/controls/imagine/MenuSeparator.qml @@ -53,7 +53,7 @@ T.MenuSeparator { bottomPadding: background ? background.bottomPadding : 0 contentItem: NinePatchImage { - source: Imagine.path + "menuseparator-separator" + source: Imagine.url + "menuseparator-separator" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -67,7 +67,7 @@ T.MenuSeparator { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "menuseparator-background" + source: Imagine.url + "menuseparator-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Page.qml b/src/imports/controls/imagine/Page.qml index 9a50b8a0..f3bdba51 100644 --- a/src/imports/controls/imagine/Page.qml +++ b/src/imports/controls/imagine/Page.qml @@ -64,7 +64,7 @@ T.Page { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "page-background" + source: Imagine.url + "page-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/PageIndicator.qml b/src/imports/controls/imagine/PageIndicator.qml index dcaf36c6..fafd73d3 100644 --- a/src/imports/controls/imagine/PageIndicator.qml +++ b/src/imports/controls/imagine/PageIndicator.qml @@ -53,7 +53,7 @@ T.PageIndicator { bottomPadding: background ? background.bottomPadding : 0 delegate: Image { - source: Imagine.path + "pageindicator-delegate" + source: Imagine.url + "pageindicator-delegate" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -79,7 +79,7 @@ T.PageIndicator { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "pageindicator-background" + source: Imagine.url + "pageindicator-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Pane.qml b/src/imports/controls/imagine/Pane.qml index c72653c1..b0029d49 100644 --- a/src/imports/controls/imagine/Pane.qml +++ b/src/imports/controls/imagine/Pane.qml @@ -58,7 +58,7 @@ T.Pane { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "pane-background" + source: Imagine.url + "pane-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/Popup.qml b/src/imports/controls/imagine/Popup.qml index f4591866..08fcfc69 100644 --- a/src/imports/controls/imagine/Popup.qml +++ b/src/imports/controls/imagine/Popup.qml @@ -60,7 +60,7 @@ T.Popup { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "popup-background" + source: Imagine.url + "popup-background" NinePatchImageSelector on source { states: [ {"modal": control.modal}, @@ -70,7 +70,7 @@ T.Popup { } T.Overlay.modal: NinePatchImage { - source: Imagine.path + "popup-overlay" + source: Imagine.url + "popup-overlay" NinePatchImageSelector on source { states: [ {"modal": true} @@ -79,7 +79,7 @@ T.Popup { } T.Overlay.modeless: NinePatchImage { - source: Imagine.path + "popup-overlay" + source: Imagine.url + "popup-overlay" NinePatchImageSelector on source { states: [ {"modal": false} diff --git a/src/imports/controls/imagine/ProgressBar.qml b/src/imports/controls/imagine/ProgressBar.qml index 17d5ed90..89645d3c 100644 --- a/src/imports/controls/imagine/ProgressBar.qml +++ b/src/imports/controls/imagine/ProgressBar.qml @@ -64,7 +64,7 @@ T.ProgressBar { height: parent.height visible: !control.indeterminate && mask.status === Image.Null - source: Imagine.path + "progressbar-progress" + source: Imagine.url + "progressbar-progress" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -82,7 +82,7 @@ T.ProgressBar { playing: control.indeterminate visible: control.indeterminate && mask.status === Image.Null - source: Imagine.path + "progressbar-animation" + source: Imagine.url + "progressbar-animation" AnimatedImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -98,7 +98,7 @@ T.ProgressBar { height: parent.height visible: false - source: Imagine.path + "progressbar-mask" + source: Imagine.url + "progressbar-mask" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -127,7 +127,7 @@ T.ProgressBar { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "progressbar-background" + source: Imagine.url + "progressbar-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/RadioButton.qml b/src/imports/controls/imagine/RadioButton.qml index 942d66e2..8df27fcc 100644 --- a/src/imports/controls/imagine/RadioButton.qml +++ b/src/imports/controls/imagine/RadioButton.qml @@ -60,7 +60,7 @@ T.RadioButton { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 - source: Imagine.path + "radiobutton-indicator" + source: Imagine.url + "radiobutton-indicator" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -91,7 +91,7 @@ T.RadioButton { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "radiobutton-background" + source: Imagine.url + "radiobutton-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/RadioDelegate.qml b/src/imports/controls/imagine/RadioDelegate.qml index a5f84dc1..25d7dd2d 100644 --- a/src/imports/controls/imagine/RadioDelegate.qml +++ b/src/imports/controls/imagine/RadioDelegate.qml @@ -66,7 +66,7 @@ T.RadioDelegate { x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding y: control.topPadding + (control.availableHeight - height) / 2 - source: Imagine.path + "radiodelegate-indicator" + source: Imagine.url + "radiodelegate-indicator" ImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -100,7 +100,7 @@ T.RadioDelegate { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "radiodelegate-background" + source: Imagine.url + "radiodelegate-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/RangeSlider.qml b/src/imports/controls/imagine/RangeSlider.qml index 7a43da0e..b902806a 100644 --- a/src/imports/controls/imagine/RangeSlider.qml +++ b/src/imports/controls/imagine/RangeSlider.qml @@ -58,7 +58,7 @@ T.RangeSlider { x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height)) - source: Imagine.path + "rangeslider-handle" + source: Imagine.url + "rangeslider-handle" ImageSelector on source { states: [ {"first": true}, @@ -77,7 +77,7 @@ T.RangeSlider { x: control.leftPadding + (control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height)) - source: Imagine.path + "rangeslider-handle" + source: Imagine.url + "rangeslider-handle" ImageSelector on source { states: [ {"second": true}, @@ -98,7 +98,7 @@ T.RangeSlider { height: control.height + topInset + bottomInset scale: control.horizontal && control.mirrored ? -1 : 1 - source: Imagine.path + "rangeslider-background" + source: Imagine.url + "rangeslider-background" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, @@ -116,7 +116,7 @@ T.RangeSlider { width: control.horizontal ? control.second.position * (parent.width - control.first.handle.width) - control.first.position * (parent.width - control.first.handle.width) : parent.width height: control.vertical ? control.second.position * (parent.height - control.first.handle.height) - control.first.position * (parent.height - control.first.handle.height): parent.height - source: Imagine.path + "rangeslider-progress" + source: Imagine.url + "rangeslider-progress" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, diff --git a/src/imports/controls/imagine/RoundButton.qml b/src/imports/controls/imagine/RoundButton.qml index bac86b5c..e3ee269b 100644 --- a/src/imports/controls/imagine/RoundButton.qml +++ b/src/imports/controls/imagine/RoundButton.qml @@ -72,7 +72,7 @@ T.RoundButton { height: control.height + topInset + bottomInset // ### TODO: radius? - source: Imagine.path + "roundbutton-background" + source: Imagine.url + "roundbutton-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/ScrollBar.qml b/src/imports/controls/imagine/ScrollBar.qml index e0cdda0c..ad764242 100644 --- a/src/imports/controls/imagine/ScrollBar.qml +++ b/src/imports/controls/imagine/ScrollBar.qml @@ -58,7 +58,7 @@ T.ScrollBar { width: control.availableWidth height: control.availableHeight - source: Imagine.path + "scrollbar-handle" + source: Imagine.url + "scrollbar-handle" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, @@ -78,7 +78,7 @@ T.ScrollBar { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "scrollbar-background" + source: Imagine.url + "scrollbar-background" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, diff --git a/src/imports/controls/imagine/ScrollIndicator.qml b/src/imports/controls/imagine/ScrollIndicator.qml index 377ba4f7..a0ab8783 100644 --- a/src/imports/controls/imagine/ScrollIndicator.qml +++ b/src/imports/controls/imagine/ScrollIndicator.qml @@ -56,7 +56,7 @@ T.ScrollIndicator { width: control.availableWidth height: control.availableHeight - source: Imagine.path + "scrollindicator-handle" + source: Imagine.url + "scrollindicator-handle" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, @@ -74,7 +74,7 @@ T.ScrollIndicator { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "scrollindicator-background" + source: Imagine.url + "scrollindicator-background" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, diff --git a/src/imports/controls/imagine/Slider.qml b/src/imports/controls/imagine/Slider.qml index 3d369865..af927806 100644 --- a/src/imports/controls/imagine/Slider.qml +++ b/src/imports/controls/imagine/Slider.qml @@ -56,7 +56,7 @@ T.Slider { x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) - source: Imagine.path + "slider-handle" + source: Imagine.url + "slider-handle" ImageSelector on source { states: [ {"vertical": control.vertical}, @@ -76,7 +76,7 @@ T.Slider { height: control.height + topInset + bottomInset scale: control.horizontal && control.mirrored ? -1 : 1 - source: Imagine.path + "slider-background" + source: Imagine.url + "slider-background" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, @@ -101,7 +101,7 @@ T.Slider { ? control.handle.height / 2 + control.position * (parent.height - control.handle.height) : parent.height - source: Imagine.path + "slider-progress" + source: Imagine.url + "slider-progress" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, diff --git a/src/imports/controls/imagine/SpinBox.qml b/src/imports/controls/imagine/SpinBox.qml index ab5567b5..ebadb860 100644 --- a/src/imports/controls/imagine/SpinBox.qml +++ b/src/imports/controls/imagine/SpinBox.qml @@ -85,7 +85,7 @@ T.SpinBox { height: control.height visible: control.editable - source: Imagine.path + "spinbox-editor" + source: Imagine.url + "spinbox-editor" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -102,7 +102,7 @@ T.SpinBox { x: control.mirrored ? 0 : parent.width - width height: parent.height - source: Imagine.path + "spinbox-indicator" + source: Imagine.url + "spinbox-indicator" NinePatchImageSelector on source { states: [ {"up": true}, @@ -121,7 +121,7 @@ T.SpinBox { x: control.mirrored ? parent.width - width : 0 height: parent.height - source: Imagine.path + "spinbox-indicator" + source: Imagine.url + "spinbox-indicator" NinePatchImageSelector on source { states: [ {"down": true}, @@ -140,7 +140,7 @@ T.SpinBox { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "spinbox-background" + source: Imagine.url + "spinbox-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/StackView.qml b/src/imports/controls/imagine/StackView.qml index 5b15b2c1..d462239a 100644 --- a/src/imports/controls/imagine/StackView.qml +++ b/src/imports/controls/imagine/StackView.qml @@ -79,7 +79,7 @@ T.StackView { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "stackview-background" + source: Imagine.url + "stackview-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/SwipeDelegate.qml b/src/imports/controls/imagine/SwipeDelegate.qml index f6e475c4..be88fb7d 100644 --- a/src/imports/controls/imagine/SwipeDelegate.qml +++ b/src/imports/controls/imagine/SwipeDelegate.qml @@ -81,7 +81,7 @@ T.SwipeDelegate { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "swipedelegate-background" + source: Imagine.url + "swipedelegate-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/SwipeView.qml b/src/imports/controls/imagine/SwipeView.qml index e84ff6b0..8410d0bd 100644 --- a/src/imports/controls/imagine/SwipeView.qml +++ b/src/imports/controls/imagine/SwipeView.qml @@ -73,7 +73,7 @@ T.SwipeView { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "swipeview-background" + source: Imagine.url + "swipeview-background" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, diff --git a/src/imports/controls/imagine/Switch.qml b/src/imports/controls/imagine/Switch.qml index f6d1348e..a4a33e29 100644 --- a/src/imports/controls/imagine/Switch.qml +++ b/src/imports/controls/imagine/Switch.qml @@ -62,7 +62,7 @@ T.Switch { width: Math.max(implicitWidth, handle.leftPadding && handle.rightPadding ? handle.implicitWidth : 2 * handle.implicitWidth) height: Math.max(implicitHeight, handle.implicitHeight) - source: Imagine.path + "switch-indicator" + source: Imagine.url + "switch-indicator" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -83,7 +83,7 @@ T.Switch { x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 - source: Imagine.path + "switch-handle" + source: Imagine.url + "switch-handle" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -120,7 +120,7 @@ T.Switch { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "switch-background" + source: Imagine.url + "switch-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/SwitchDelegate.qml b/src/imports/controls/imagine/SwitchDelegate.qml index 97bb03b9..0c9bfb15 100644 --- a/src/imports/controls/imagine/SwitchDelegate.qml +++ b/src/imports/controls/imagine/SwitchDelegate.qml @@ -68,7 +68,7 @@ T.SwitchDelegate { width: Math.max(implicitWidth, handle.leftPadding && handle.rightPadding ? handle.implicitWidth : 2 * handle.implicitWidth) height: Math.max(implicitHeight, handle.implicitHeight) - source: Imagine.path + "switchdelegate-indicator" + source: Imagine.url + "switchdelegate-indicator" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -90,7 +90,7 @@ T.SwitchDelegate { x: Math.max(minPos, Math.min(maxPos, control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 - source: Imagine.path + "switchdelegate-handle" + source: Imagine.url + "switchdelegate-handle" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, @@ -130,7 +130,7 @@ T.SwitchDelegate { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "switchdelegate-background" + source: Imagine.url + "switchdelegate-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/TabBar.qml b/src/imports/controls/imagine/TabBar.qml index 1ce009a0..49e7b425 100644 --- a/src/imports/controls/imagine/TabBar.qml +++ b/src/imports/controls/imagine/TabBar.qml @@ -73,7 +73,7 @@ T.TabBar { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "tabbar-background" + source: Imagine.url + "tabbar-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/TabButton.qml b/src/imports/controls/imagine/TabButton.qml index 6ed6ea7f..aa87f472 100644 --- a/src/imports/controls/imagine/TabButton.qml +++ b/src/imports/controls/imagine/TabButton.qml @@ -77,7 +77,7 @@ T.TabButton { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "tabbutton-background" + source: Imagine.url + "tabbutton-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/TextArea.qml b/src/imports/controls/imagine/TextArea.qml index 18fe0c81..ac212b95 100644 --- a/src/imports/controls/imagine/TextArea.qml +++ b/src/imports/controls/imagine/TextArea.qml @@ -82,7 +82,7 @@ T.TextArea { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "textarea-background" + source: Imagine.url + "textarea-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/TextField.qml b/src/imports/controls/imagine/TextField.qml index 93f43d14..a6449884 100644 --- a/src/imports/controls/imagine/TextField.qml +++ b/src/imports/controls/imagine/TextField.qml @@ -82,7 +82,7 @@ T.TextField { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "textfield-background" + source: Imagine.url + "textfield-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/ToolBar.qml b/src/imports/controls/imagine/ToolBar.qml index 6da2d171..a4bf9c1f 100644 --- a/src/imports/controls/imagine/ToolBar.qml +++ b/src/imports/controls/imagine/ToolBar.qml @@ -58,7 +58,7 @@ T.ToolBar { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "toolbar-background" + source: Imagine.url + "toolbar-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/ToolButton.qml b/src/imports/controls/imagine/ToolButton.qml index 815e48eb..b82b59fd 100644 --- a/src/imports/controls/imagine/ToolButton.qml +++ b/src/imports/controls/imagine/ToolButton.qml @@ -77,7 +77,7 @@ T.ToolButton { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "toolbutton-background" + source: Imagine.url + "toolbutton-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/ToolSeparator.qml b/src/imports/controls/imagine/ToolSeparator.qml index 68839f64..99a45938 100644 --- a/src/imports/controls/imagine/ToolSeparator.qml +++ b/src/imports/controls/imagine/ToolSeparator.qml @@ -53,7 +53,7 @@ T.ToolSeparator { bottomPadding: background ? background.bottomPadding : 0 contentItem: NinePatchImage { - source: Imagine.path + "toolseparator-separator" + source: Imagine.url + "toolseparator-separator" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, @@ -69,7 +69,7 @@ T.ToolSeparator { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "toolseparator-background" + source: Imagine.url + "toolseparator-background" NinePatchImageSelector on source { states: [ {"vertical": control.vertical}, diff --git a/src/imports/controls/imagine/ToolTip.qml b/src/imports/controls/imagine/ToolTip.qml index d509b3d5..cc89a728 100644 --- a/src/imports/controls/imagine/ToolTip.qml +++ b/src/imports/controls/imagine/ToolTip.qml @@ -74,7 +74,7 @@ T.ToolTip { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "tooltip-background" + source: Imagine.url + "tooltip-background" NinePatchImageSelector on source { states: [ // ### diff --git a/src/imports/controls/imagine/Tumbler.qml b/src/imports/controls/imagine/Tumbler.qml index dbcd3146..5e1c913c 100644 --- a/src/imports/controls/imagine/Tumbler.qml +++ b/src/imports/controls/imagine/Tumbler.qml @@ -76,7 +76,7 @@ T.Tumbler { width: control.width + leftInset + rightInset height: control.height + topInset + bottomInset - source: Imagine.path + "tumbler-background" + source: Imagine.url + "tumbler-background" NinePatchImageSelector on source { states: [ {"disabled": !control.enabled}, diff --git a/src/imports/controls/imagine/qquickimaginestyle.cpp b/src/imports/controls/imagine/qquickimaginestyle.cpp index e103421e..7617fbf5 100644 --- a/src/imports/controls/imagine/qquickimaginestyle.cpp +++ b/src/imports/controls/imagine/qquickimaginestyle.cpp @@ -64,17 +64,16 @@ QQuickImagineStyle *QQuickImagineStyle::qmlAttachedProperties(QObject *object) QString QQuickImagineStyle::path() const { - return m_path; // ### TODO: url? + return m_path; } void QQuickImagineStyle::setPath(const QString &path) { - QString p = ensureSlash(path); m_explicitPath = true; - if (m_path == p) + if (m_path == path) return; - m_path = p; + m_path = path; propagatePath(); emit pathChanged(); @@ -110,6 +109,29 @@ void QQuickImagineStyle::resetPath() inheritPath(imagine ? imagine->path() : *GlobalPath()); } +QUrl QQuickImagineStyle::url() const +{ + // Using ApplicationWindow as an example, its NinePatchImage url + // was previously assigned like this: + // + // soruce: Imagine.path + "applicationwindow-background" + // + // If Imagine.path is set to ":/images" by the user, then the final URL would be: + // + // QUrl("file:///home/user/qt/qtbase/qml/QtQuick/Controls.2/Imagine/:/images/applicationwindow-background") + // + // To ensure that the correct URL is constructed, we do it ourselves here, + // and then the control QML files use the "url" property instead. + const QString path = ensureSlash(m_path); + if (path.startsWith(QLatin1String("qrc"))) + return QUrl(path); + + if (path.startsWith(QLatin1String(":/"))) + return QUrl(QLatin1String("qrc") + path); + + return QUrl::fromLocalFile(path); +} + void QQuickImagineStyle::attachedParentChange(QQuickAttachedObject *newParent, QQuickAttachedObject *oldParent) { Q_UNUSED(oldParent); diff --git a/src/imports/controls/imagine/qquickimaginestyle_p.h b/src/imports/controls/imagine/qquickimaginestyle_p.h index fc4b21b8..88b92c00 100644 --- a/src/imports/controls/imagine/qquickimaginestyle_p.h +++ b/src/imports/controls/imagine/qquickimaginestyle_p.h @@ -58,6 +58,7 @@ class QQuickImagineStyle : public QQuickAttachedObject { Q_OBJECT Q_PROPERTY(QString path READ path WRITE setPath RESET resetPath NOTIFY pathChanged FINAL) + Q_PROPERTY(QUrl url READ url NOTIFY pathChanged FINAL) public: explicit QQuickImagineStyle(QObject *parent = nullptr); @@ -70,6 +71,8 @@ public: void propagatePath(); void resetPath(); + QUrl url() const; + Q_SIGNALS: void pathChanged(); diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 2f6dc9af..df6f764e 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -16,6 +16,7 @@ SUBDIRS += \ qquickcolor \ qquickiconimage \ qquickiconlabel \ + qquickimaginestyle \ qquickmaterialstyle \ qquickmaterialstyleconf \ qquickmenubar \ diff --git a/tests/auto/qquickimaginestyle/control-assets/button-background.9.png b/tests/auto/qquickimaginestyle/control-assets/button-background.9.png Binary files differnew file mode 100644 index 00000000..29bd8d7c --- /dev/null +++ b/tests/auto/qquickimaginestyle/control-assets/button-background.9.png diff --git a/tests/auto/qquickimaginestyle/data/tst_imagine.qml b/tests/auto/qquickimaginestyle/data/tst_imagine.qml new file mode 100644 index 00000000..7a711dcd --- /dev/null +++ b/tests/auto/qquickimaginestyle/data/tst_imagine.qml @@ -0,0 +1,97 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** 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. +** +** BSD License Usage +** Alternatively, 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$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Window 2.2 +import QtTest 1.1 +import QtQuick.Templates 2.3 as T +import QtQuick.Controls 2.3 +import QtQuick.Controls.Imagine 2.3 + +TestCase { + id: testCase + width: 200 + height: 200 + visible: true + when: windowShown + name: "Imagine" + + Component { + id: implicitQrcButtonComponent + Button { + Imagine.path: ":/control-assets" + } + } + + Component { + id: explicitQrcButtonComponent + Button { + Imagine.path: "qrc:/control-assets" + } + } + + function test_qrcPaths_data() { + return [ + { tag: ":/control-assets", component: implicitQrcButtonComponent }, + { tag: "qrc:/control-assets", component: explicitQrcButtonComponent } + ] + } + + function test_qrcPaths(data) { + if (Qt.platform.pluginName === "offscreen") + skip("grabImage() is not functional on the offscreen platform (QTBUG-63185)") + + var control = createTemporaryObject(data.component, testCase) + verify(control) + compare(control.Imagine.path, data.tag) + var image = grabImage(control) + compare(image.pixel(control.width / 2, control.height / 2), "#ff0000") + } +} diff --git a/tests/auto/qquickimaginestyle/qquickimaginestyle.pro b/tests/auto/qquickimaginestyle/qquickimaginestyle.pro new file mode 100644 index 00000000..c421f2dc --- /dev/null +++ b/tests/auto/qquickimaginestyle/qquickimaginestyle.pro @@ -0,0 +1,16 @@ +TEMPLATE = app +TARGET = tst_qquickimaginestyle +CONFIG += qmltestcase + +SOURCES += \ + $$PWD/tst_qquickimaginestyle.cpp + +RESOURCES += \ + $$PWD/qtquickcontrols2.conf \ + $$PWD/control-assets/button-background.9.png + +OTHER_FILES += \ + $$PWD/data/*.qml + +TESTDATA += \ + $$PWD/data/tst_* diff --git a/tests/auto/qquickimaginestyle/qtquickcontrols2.conf b/tests/auto/qquickimaginestyle/qtquickcontrols2.conf new file mode 100644 index 00000000..add378d4 --- /dev/null +++ b/tests/auto/qquickimaginestyle/qtquickcontrols2.conf @@ -0,0 +1,2 @@ +[Controls] +Style=Imagine diff --git a/tests/auto/qquickimaginestyle/tst_qquickimaginestyle.cpp b/tests/auto/qquickimaginestyle/tst_qquickimaginestyle.cpp new file mode 100644 index 00000000..cd08923a --- /dev/null +++ b/tests/auto/qquickimaginestyle/tst_qquickimaginestyle.cpp @@ -0,0 +1,38 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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: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 <QtQuickTest/quicktest.h> +QUICK_TEST_MAIN(tst_qquickmaterialstyle) |