1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5 \page qtquickcontrols-imagine.html
8 The Imagine Style is based on configurable image assets. \l{detailed-desc-imagine}{More...}
10 \styleimport {QtQuick.Controls.Imagine 2.12} {Qt 5.10}
12 \section1 Attached Properties
15 \li \l {imagine-path-attached-prop}{\b path} : string
18 \section1 Detailed Description
19 \target detailed-desc-imagine
21 The Imagine style is based on image assets. The style comes with a default
22 set of images, but the images can be easily changed by providing a directory
23 with images using a predefined naming convention.
25 \image qtquickcontrols-imagine.png
26 \caption The Imagine style with the default images
28 To run an application with the Imagine style, see
29 \l {Using Styles in Qt Quick Controls}.
33 The image files are named using the following convention:
35 \c <control>-<element>-<states>
37 The \c <control> and \c <element> sections are mandatory, but the
38 \c <states> section is optional. For example, if a single file named
39 \c "button-background.9.png" is provided for \l {Button}, it will be used
40 for every state that \c Button supports. It is up to the developer to
41 decide the set of states that they will provide images for. However, it
42 is recommended to provide images for the most common control states where
43 possible, such as \c disabled, \c pressed, etc. This will ensure that
44 interactive controls visually behave as the end user would expect them to.
46 \section2 Element Reference
48 The following table lists which elements are supported for each control,
49 along with the possible states for that element, and the file extension
50 that it expects. An element is an image that represents a certain visual
51 part of the control. For example, \c {Button}'s \c "background" element
52 represents its \l {Control::}{background}.
61 \li \l ApplicationWindow
68 \li disabled, running, mirrored, hovered
78 \li disabled, pressed, checked, checkable, focused, highlighted, flat, mirrored, hovered
83 \li disabled, pressed, checked, partially-checked, focused, mirrored, hovered
93 \li disabled, pressed, checked, partially-checked, focused, highlighted, mirrored, hovered
103 \li disabled, pressed, editable, open, focused, mirrored, hovered, flat
118 \li disabled, pressed, checked, checkable, focused, mirrored, hovered
132 \li background\sup{1}
133 \li disabled, pressed, focused, mirrored, hovered
156 \li \l DialogButtonBox
158 \li disabled, mirrored
163 \li modal, dim, top, left, right, bottom
173 \li disabled, mirrored
178 \li disabled, mirrored
188 \li disabled, pressed, focused, highlighted, mirrored, hovered
193 \li disabled, mirrored, hovered
208 \li disabled, pressed, checked, focused, highlighted, mirrored, hovered
223 \li disabled, mirrored
233 \li disabled, mirrored
238 \li disabled, mirrored, hovered
243 \li disabled, pressed, current, mirrored, hovered
248 \li disabled, mirrored
263 \li disabled, mirrored, hovered
268 \li disabled, indeterminate, mirrored, hovered
283 \li disabled, pressed, checked, focused, mirrored, hovered
293 \li disabled, pressed, checked, focused, highlighted, mirrored, hovered
303 \li vertical, horizontal, disabled, focused, mirrored, hovered
313 \li first, second, vertical, horizontal, disabled, pressed, focused, mirrored, hovered
318 \li disabled, pressed, checked, checkable, focused, highlighted, flat, mirrored, hovered
323 \li vertical, horizontal, disabled, interactive, pressed, mirrored, hovered
331 \li \l ScrollIndicator
333 \li vertical, horizontal, disabled, mirrored, hovered
343 \li disabled, mirrored
348 \li vertical, horizontal, disabled, pressed, focused, mirrored, hovered
363 \li disabled, editable, focused, mirrored, hovered
368 \li disabled, focused, mirrored, hovered
373 \li up, down, disabled, editable, pressed, focused, mirrored, hovered
378 \li disabled, mirrored
383 \li disabled, pressed, focused, highlighted, mirrored, hovered
388 \li vertical, horizontal, disabled, interactive, focused, mirrored
393 \li disabled, pressed, checked, focused, mirrored, hovered
406 \li \l SwitchDelegate
408 \li disabled, pressed, checked, focused, highlighted, mirrored, hovered
423 \li disabled, header, footer, mirrored
428 \li disabled, pressed, checked, focused, mirrored, hovered
433 \li disabled, focused, mirrored, hovered
438 \li disabled, focused, mirrored, hovered
443 \li disabled, header, footer, mirrored
448 \li disabled, pressed, checked, checkable, focused, highlighted, flat, mirrored, hovered
453 \li vertical, horizontal, disabled, mirrored
468 \li disabled, focused, mirrored, hovered
472 \note \sup{1}) The Imagine style Dial does not yet support the
473 \l {Dial::}{startAngle} and \l {Dial::}{endAngle} properties that were
474 introduced in Qt 6.6, and instead uses a fixed background image.
476 \section2 Asset Examples
478 The following table lists examples of assets (taken from the
479 \l {https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quickcontrols/imagine/images}
480 {default Imagine style assets}) for all controls. The list is not
481 exhaustive, as not all elements need assets, but it can be used as a guide
482 when creating your own assets.
484 The template that these assets were \l {Exporting 9-Patch Images}
485 {exported from} is available as a
486 \l {https://code.qt.io/cgit/qt/qtdeclarative.git/plain/src/quickcontrols/imagine/design/imagine.sketch}
497 \li \l ApplicationWindow
500 \li \image imagine/images/applicationwindow-background.png
501 \li \l {sup1}{See footnote} \sup 1
506 \li \image imagine/images/applicationwindow-overlay.png
507 \li \l {sup1}{See footnote} \sup 1
512 \li \image imagine/images/applicationwindow-overlay-modal.png
513 \li \l {sup1}{See footnote} \sup 1
518 \li \image imagine/images/button-background.9.png
524 \li \image imagine/images/button-background-disabled.9.png
530 \li \image imagine/images/button-background-focused.9.png
536 \li \image imagine/images/button-background-pressed.9.png
542 \li \image imagine/images/button-background-checked.9.png
547 \li checked, disabled
548 \li \image imagine/images/button-background-checked-disabled.9.png
554 \li \image imagine/images/button-background-checked-focused.9.png
560 \li \image imagine/images/button-background-checked-hovered.9.png
566 \li \image imagine/images/button-background-highlighted.9.png
571 \li highlighted, disabled
572 \li \image imagine/images/button-background-highlighted-disabled.9.png
577 \li highlighted, focused
578 \li \image imagine/images/button-background-highlighted-focused.9.png
583 \li highlighted, hovered
584 \li \image imagine/images/button-background-highlighted-hovered.9.png
589 \li highlighted, pressed
590 \li \image imagine/images/button-background-highlighted-pressed.9.png
595 \li highlighted, checked
596 \li \image imagine/images/button-background-highlighted-checked.9.png
602 \li \image imagine/images/button-background-hovered.9.png
608 \li \image imagine/images/button-background-flat.9.png
614 \li \image imagine/images/button-background-flat-disabled.9.png
620 \li \image imagine/images/button-background-flat-hovered.9.png
626 \li \image imagine/images/button-background-flat-pressed.9.png
632 \li \image imagine/images/button-background-flat-checked.9.png
638 \li \image imagine/images/checkbox-indicator.png
644 \li \image imagine/images/checkbox-indicator-disabled.png
650 \li \image imagine/images/checkbox-indicator-pressed.png
656 \li \image imagine/images/checkbox-indicator-checked.png
662 \li \image imagine/images/checkbox-indicator-checked-pressed.png
668 \li \image imagine/images/checkbox-indicator-checked-hovered.png
674 \li \image imagine/images/checkbox-indicator-checked-focused.png
679 \li partially, checked
680 \li \image imagine/images/checkbox-indicator-partially-checked.png
685 \li partially, checked, pressed
686 \li \image imagine/images/checkbox-indicator-partially-checked-pressed.png
691 \li partially, checked, focused
692 \li \image imagine/images/checkbox-indicator-partially-checked-focused.png
697 \li partially, checked, hovered
698 \li \image imagine/images/checkbox-indicator-partially-checked-hovered.png
704 \li \image imagine/images/checkbox-indicator-focused.png
710 \li \image imagine/images/checkbox-indicator-hovered.png
716 \li \image imagine/images/checkdelegate-background.9.png
722 \li \image imagine/images/checkdelegate-background-disabled.9.png
728 \li \image imagine/images/checkdelegate-background-pressed.9.png
734 \li \image imagine/images/checkdelegate-background-focused.9.png
740 \li \image imagine/images/checkdelegate-background-hovered.9.png
746 \li \image imagine/images/checkdelegate-indicator.png
752 \li \image imagine/images/checkdelegate-indicator-disabled.png
758 \li \image imagine/images/checkdelegate-indicator-pressed.png
764 \li \image imagine/images/checkdelegate-indicator-checked.png
770 \li \image imagine/images/checkdelegate-indicator-checked-pressed.png
776 \li \image imagine/images/checkdelegate-indicator-checked-focused.png
782 \li \image imagine/images/checkdelegate-indicator-checked-hovered.png
788 \li \image imagine/images/checkdelegate-indicator-focused.png
794 \li \image imagine/images/checkdelegate-indicator-hovered.png
799 \li partially, checked
800 \li \image imagine/images/checkdelegate-indicator-partially-checked.png
805 \li partially, checked, pressed
806 \li \image imagine/images/checkdelegate-indicator-partially-checked-pressed.png
811 \li partially, checked, focused
812 \li \image imagine/images/checkdelegate-indicator-partially-checked-focused.png
817 \li partially, checked, hovered
818 \li \image imagine/images/checkdelegate-indicator-partially-checked-hovered.png
824 \li \image imagine/images/checkdelegate-indicator-hovered.png
830 \li \image imagine/images/combobox-background.9.png
836 \li \image imagine/images/combobox-background-disabled.9.png
842 \li \image imagine/images/combobox-background-focused.9.png
848 \li \image imagine/images/combobox-background-hovered.9.png
854 \li \image imagine/images/combobox-background-pressed.9.png
860 \li \image imagine/images/combobox-background-open.9.png
866 \li \image imagine/images/combobox-background-editable.9.png
871 \li editable, focused
872 \li \image imagine/images/combobox-background-editable-focused.9.png
877 \li editable, disabled
878 \li \image imagine/images/combobox-background-editable-disabled.9.png
884 \li \image imagine/images/combobox-indicator.png
890 \li \image imagine/images/combobox-indicator-disabled.png
896 \li \image imagine/images/combobox-indicator-editable.png
901 \li editable, disabled
902 \li \image imagine/images/combobox-indicator-editable-disabled.png
907 \li editable, mirrored
908 \li \image imagine/images/combobox-indicator-editable-mirrored.png
913 \li editable, mirrored, disabled
914 \li \image imagine/images/combobox-indicator-editable-mirrored-disabled.png
920 \li \image imagine/images/combobox-popup.9.png
926 \li \image imagine/images/delaybutton-background.9.png
932 \li \image imagine/images/delaybutton-background-disabled.9.png
937 \li disabled, checked
938 \li \image imagine/images/delaybutton-background-disabled-checked.9.png
944 \li \image imagine/images/delaybutton-background-focused.9.png
950 \li \image imagine/images/delaybutton-background-pressed.9.png
956 \li \image imagine/images/delaybutton-background-checked.9.png
962 \li \image imagine/images/delaybutton-background-checked-focused.9.png
968 \li \image imagine/images/delaybutton-background-checked-hovered.9.png
974 \li \image imagine/images/delaybutton-background-hovered.9.png
980 \li \image imagine/images/delaybutton-progress.9.png
986 \li \image imagine/images/delaybutton-progress-disabled.9.png
992 \li \image imagine/images/delaybutton-mask.9.png
998 \li \image imagine/images/dial-background.png
1004 \li \image imagine/images/dial-background-disabled.png
1010 \li \image imagine/images/dial-background-focused.png
1016 \li \image imagine/images/dial-handle.png
1022 \li \image imagine/images/dial-handle-disabled.png
1028 \li \image imagine/images/dial-handle-focused.png
1033 \li focused, pressed
1034 \li \image imagine/images/dial-handle-focused-pressed.png
1039 \li focused, hovered
1040 \li \image imagine/images/dial-handle-focused-hovered.png
1046 \li \image imagine/images/dial-handle-pressed.png
1052 \li \image imagine/images/dial-handle-hovered.png
1058 \li \image imagine/images/dialog-background.9.png
1064 \li \image imagine/images/dialog-overlay.png
1065 \li \l {sup1}{See footnote} \sup 1
1070 \li \image imagine/images/dialog-overlay-modal.png
1071 \li \l {sup1}{See footnote} \sup 1
1073 \li \l DialogButtonBox
1076 \li \image imagine/images/dialogbuttonbox-background.9.png
1082 \li \image imagine/images/drawer-background-left.9.png
1088 \li \image imagine/images/drawer-background-right.9.png
1094 \li \image imagine/images/drawer-background-top.9.png
1100 \li \image imagine/images/drawer-background-bottom.9.png
1106 \li \image imagine/images/drawer-overlay.png
1107 \li \l {sup1}{See footnote} \sup 1
1112 \li \image imagine/images/drawer-overlay-modal.png
1113 \li \l {sup1}{See footnote} \sup 1
1118 \li \image imagine/images/frame-background.9.png
1124 \li \image imagine/images/groupbox-background.9.png
1130 \li \image imagine/images/groupbox-title.9.png
1136 \li \image imagine/images/itemdelegate-background.9.png
1142 \li \image imagine/images/itemdelegate-background-disabled.9.png
1148 \li \image imagine/images/itemdelegate-background-pressed.9.png
1154 \li \image imagine/images/itemdelegate-background-focused.9.png
1160 \li \image imagine/images/itemdelegate-background-hovered.9.png
1166 \li \image imagine/images/itemdelegate-background-highlighted.9.png
1172 \li \image imagine/images/menu-background.9.png
1178 \li \image imagine/images/menuitem-background.9.png
1184 \li \image imagine/images/menuitem-background-highlighted.9.png
1190 \li \image imagine/images/menuitem-arrow.png
1196 \li \image imagine/images/menuitem-arrow-mirrored.png
1202 \li \image imagine/images/menuitem-arrow-disabled.png
1207 \li mirrored, disabled
1208 \li \image imagine/images/menuitem-arrow-mirrored-disabled.png
1214 \li \image imagine/images/menuitem-indicator.png
1220 \li \image imagine/images/menuitem-indicator-disabled.png
1226 \li \image imagine/images/menuitem-indicator-pressed.png
1232 \li \image imagine/images/menuitem-indicator-checked.png
1237 \li checked, pressed
1238 \li \image imagine/images/menuitem-indicator-checked-pressed.png
1243 \li checked, focused
1244 \li \image imagine/images/menuitem-indicator-checked-focused.png
1249 \li checked, hovered
1250 \li \image imagine/images/menuitem-indicator-checked-hovered.png
1256 \li \image imagine/images/menuitem-indicator-focused.png
1262 \li \image imagine/images/menuitem-indicator-hovered.png
1265 \li \l MenuSeparator
1268 \li \image imagine/images/menuseparator-separator.9.png
1274 \li \image imagine/images/page-background.png
1275 \li \l {sup1}{See footnote} \sup 1
1277 \li \l PageIndicator
1280 \li \image imagine/images/pageindicator-delegate.png
1286 \li \image imagine/images/pageindicator-delegate-disabled.png
1291 \li disabled, current
1292 \li \image imagine/images/pageindicator-delegate-disabled-current.png
1298 \li \image imagine/images/pageindicator-delegate-pressed.png
1304 \li \image imagine/images/pageindicator-delegate-current.png
1310 \li \image imagine/images/pane-background.9.png
1316 \li \image imagine/images/popup-background.9.png
1317 \li \l {sup1}{See footnote} \sup 1
1322 \li \image imagine/images/popup-overlay.png
1323 \li \l {sup1}{See footnote} \sup 1
1328 \li \image imagine/images/popup-overlay-modal.png
1334 \li \image imagine/images/progressbar-background.9.png
1340 \li \image imagine/images/progressbar-progress.png
1346 \li \image imagine/images/progressbar-mask.9.png
1352 \li \image imagine/images/radiobutton-indicator.png
1358 \li \image imagine/images/radiobutton-indicator-disabled.png
1364 \li \image imagine/images/radiobutton-indicator-pressed.png
1370 \li \image imagine/images/radiobutton-indicator-checked.png
1375 \li checked, focused
1376 \li \image imagine/images/radiobutton-indicator-checked-focused.png
1381 \li checked, hovered
1382 \li \image imagine/images/radiobutton-indicator-checked-hovered.png
1387 \li checked, pressed
1388 \li \image imagine/images/radiobutton-indicator-checked-pressed.png
1394 \li \image imagine/images/radiobutton-indicator-focused.png
1400 \li \image imagine/images/radiobutton-indicator-hovered.png
1403 \li \l RadioDelegate
1406 \li \image imagine/images/radiodelegate-background.9.png
1412 \li \image imagine/images/radiodelegate-background-disabled.9.png
1418 \li \image imagine/images/radiodelegate-background-pressed.9.png
1424 \li \image imagine/images/radiodelegate-background-focused.9.png
1430 \li \image imagine/images/radiodelegate-background-hovered.9.png
1436 \li \image imagine/images/radiodelegate-indicator.png
1442 \li \image imagine/images/radiodelegate-indicator-disabled.png
1448 \li \image imagine/images/radiodelegate-indicator-pressed.png
1454 \li \image imagine/images/radiodelegate-indicator-checked.png
1459 \li checked, focused
1460 \li \image imagine/images/radiodelegate-indicator-checked-focused.png
1465 \li checked, hovered
1466 \li \image imagine/images/radiodelegate-indicator-checked-hovered.png
1471 \li checked, pressed
1472 \li \image imagine/images/radiodelegate-indicator-checked-pressed.png
1478 \li \image imagine/images/radiodelegate-indicator-focused.png
1484 \li \image imagine/images/radiodelegate-indicator-hovered.png
1490 \li \image imagine/images/rangeslider-background-vertical.9.png
1496 \li \image imagine/images/rangeslider-background-horizontal.9.png
1502 \li \image imagine/images/rangeslider-progress-vertical.9.png
1507 \li vertical, disabled
1508 \li \image imagine/images/rangeslider-progress-vertical-disabled.9.png
1514 \li \image imagine/images/rangeslider-progress-horizontal.9.png
1519 \li horizontal, disabled
1520 \li \image imagine/images/rangeslider-progress-horizontal-disabled.9.png
1526 \li \image imagine/images/rangeslider-handle.png
1532 \li \image imagine/images/rangeslider-handle-disabled.png
1538 \li \image imagine/images/rangeslider-handle-focused.png
1543 \li focused, hovered
1544 \li \image imagine/images/rangeslider-handle-focused-hovered.png
1549 \li focused, pressed
1550 \li \image imagine/images/rangeslider-handle-focused-pressed.png
1556 \li \image imagine/images/rangeslider-handle-hovered.png
1562 \li \image imagine/images/rangeslider-handle-pressed.png
1568 \li \image imagine/images/roundbutton-background.png
1574 \li \image imagine/images/roundbutton-background-disabled.png
1579 \li disabled, checked
1580 \li \image imagine/images/roundbutton-background-disabled-checked.png
1586 \li \image imagine/images/roundbutton-background-focused.png
1592 \li \image imagine/images/roundbutton-background-pressed.png
1598 \li \image imagine/images/roundbutton-background-checked.png
1603 \li checked, focused
1604 \li \image imagine/images/roundbutton-background-checked-focused.png
1609 \li checked, hovered
1610 \li \image imagine/images/roundbutton-background-checked-hovered.png
1616 \li \image imagine/images/roundbutton-background-highlighted.png
1621 \li highlighted, pressed
1622 \li \image imagine/images/roundbutton-background-highlighted-pressed.png
1627 \li highlighted, focused
1628 \li \image imagine/images/roundbutton-background-highlighted-focused.png
1633 \li highlighted, hovered
1634 \li \image imagine/images/roundbutton-background-highlighted-hovered.png
1640 \li \image imagine/images/roundbutton-background-hovered.png
1646 \li \image imagine/images/scrollbar-handle.png
1652 \li \image imagine/images/scrollbar-handle-disabled.png
1658 \li \image imagine/images/scrollbar-handle-interactive.png
1663 \li interactive, disabled
1664 \li \image imagine/images/scrollbar-handle-interactive-disabled.png
1669 \li interactive, pressed
1670 \li \image imagine/images/scrollbar-handle-interactive-pressed.png
1675 \li interactive, hovered
1676 \li \image imagine/images/scrollbar-handle-interactive-hovered.png
1679 \li \l ScrollIndicator
1682 \li \image imagine/images/scrollindicator-handle.png
1688 \li \image imagine/images/slider-background-vertical.9.png
1694 \li \image imagine/images/slider-background-horizontal.9.png
1700 \li \image imagine/images/slider-progress-vertical.9.png
1705 \li vertical, disabled
1706 \li \image imagine/images/slider-progress-vertical-disabled.9.png
1712 \li \image imagine/images/slider-progress-horizontal.9.png
1717 \li horizontal, disabled
1718 \li \image imagine/images/slider-progress-horizontal-disabled.9.png
1724 \li \image imagine/images/slider-handle.png
1730 \li \image imagine/images/slider-handle-disabled.png
1736 \li \image imagine/images/slider-handle-focused.png
1741 \li focused, hovered
1742 \li \image imagine/images/slider-handle-focused-hovered.png
1747 \li focused, pressed
1748 \li \image imagine/images/slider-handle-focused-pressed.png
1754 \li \image imagine/images/slider-handle-hovered.png
1760 \li \image imagine/images/slider-handle-pressed.png
1766 \li \image imagine/images/spinbox-background.9.png
1772 \li \image imagine/images/spinbox-background-disabled.9.png
1778 \li \image imagine/images/spinbox-background-focused.9.png
1784 \li \image imagine/images/spinbox-background-editable.9.png
1790 \li \image imagine/images/spinbox-indicator-up.9.png
1796 \li \image imagine/images/spinbox-indicator-up-disabled.9.png
1802 \li \image imagine/images/spinbox-indicator-up-pressed.9.png
1808 \li \image imagine/images/spinbox-indicator-up-focused.9.png
1814 \li \image imagine/images/spinbox-indicator-up-mirrored.9.png
1820 \li \image imagine/images/spinbox-indicator-up-hovered.9.png
1826 \li \image imagine/images/spinbox-indicator-up-editable.9.png
1831 \li up, editable, pressed
1832 \li \image imagine/images/spinbox-indicator-up-editable-pressed.9.png
1837 \li up, editable, focused
1838 \li \image imagine/images/spinbox-indicator-up-editable-focused.9.png
1843 \li up, editable, mirrored
1844 \li \image imagine/images/spinbox-indicator-up-editable-mirrored.9.png
1849 \li up, editable, hovered
1850 \li \image imagine/images/spinbox-indicator-up-editable-hovered.9.png
1856 \li \image imagine/images/spinbox-indicator-down.9.png
1862 \li \image imagine/images/spinbox-indicator-down-disabled.9.png
1868 \li \image imagine/images/spinbox-indicator-down-pressed.9.png
1874 \li \image imagine/images/spinbox-indicator-down-focused.9.png
1880 \li \image imagine/images/spinbox-indicator-down-mirrored.9.png
1886 \li \image imagine/images/spinbox-indicator-down-hovered.9.png
1892 \li \image imagine/images/spinbox-indicator-down-editable.9.png
1897 \li down, editable, pressed
1898 \li \image imagine/images/spinbox-indicator-down-editable-pressed.9.png
1903 \li down, editable, focused
1904 \li \image imagine/images/spinbox-indicator-down-editable-focused.9.png
1909 \li down, editable, mirrored
1910 \li \image imagine/images/spinbox-indicator-down-editable-mirrored.9.png
1915 \li down, editable, hovered
1916 \li \image imagine/images/spinbox-indicator-down-editable-hovered.9.png
1919 \li \l SwipeDelegate
1922 \li \image imagine/images/swipedelegate-background.9.png
1928 \li \image imagine/images/swipedelegate-background-disabled.9.png
1934 \li \image imagine/images/swipedelegate-background-pressed.9.png
1940 \li \image imagine/images/swipedelegate-background-focused.9.png
1946 \li \image imagine/images/swipedelegate-background-hovered.9.png
1952 \li \image imagine/images/switch-indicator.png
1958 \li \image imagine/images/switch-indicator-disabled.png
1964 \li \image imagine/images/switch-indicator-pressed.png
1970 \li \image imagine/images/switch-indicator-checked.png
1975 \li checked, focused
1976 \li \image imagine/images/switch-indicator-checked-focused.png
1981 \li checked, hovered
1982 \li \image imagine/images/switch-indicator-checked-hovered.png
1987 \li checked, pressed
1988 \li \image imagine/images/switch-indicator-checked-pressed.png
1994 \li \image imagine/images/switch-indicator-focused.png
2000 \li \image imagine/images/switch-indicator-hovered.png
2006 \li \image imagine/images/switch-handle.png
2012 \li \image imagine/images/switch-handle-disabled.png
2018 \li \image imagine/images/switch-handle-pressed.png
2021 \li \l SwitchDelegate
2024 \li \image imagine/images/switchdelegate-background.9.png
2030 \li \image imagine/images/switchdelegate-background-disabled.9.png
2036 \li \image imagine/images/switchdelegate-background-pressed.9.png
2042 \li \image imagine/images/switchdelegate-background-focused.9.png
2048 \li \image imagine/images/switchdelegate-background-hovered.9.png
2054 \li \image imagine/images/switchdelegate-indicator.png
2060 \li \image imagine/images/switchdelegate-indicator-disabled.png
2066 \li \image imagine/images/switchdelegate-indicator-pressed.png
2072 \li \image imagine/images/switchdelegate-indicator-checked.png
2077 \li checked, focused
2078 \li \image imagine/images/switchdelegate-indicator-checked-focused.png
2083 \li checked, hovered
2084 \li \image imagine/images/switchdelegate-indicator-checked-hovered.png
2089 \li checked, pressed
2090 \li \image imagine/images/switchdelegate-indicator-checked-pressed.png
2096 \li \image imagine/images/switchdelegate-indicator-focused.png
2102 \li \image imagine/images/switchdelegate-indicator-hovered.png
2108 \li \image imagine/images/switchdelegate-handle.png
2114 \li \image imagine/images/switchdelegate-handle-disabled.png
2120 \li \image imagine/images/tabbar-background.png
2126 \li \image imagine/images/tabbutton-background.9.png
2132 \li \image imagine/images/tabbutton-background-disabled.9.png
2138 \li \image imagine/images/tabbutton-background-pressed.9.png
2144 \li \image imagine/images/tabbutton-background-checked.9.png
2150 \li \image imagine/images/tabbutton-background-hovered.9.png
2155 \li disabled, checked
2156 \li \image imagine/images/tabbutton-background-disabled-checked.9.png
2162 \li \image imagine/images/textarea-background.9.png
2168 \li \image imagine/images/textarea-background-disabled.9.png
2174 \li \image imagine/images/textarea-background-focused.9.png
2180 \li \image imagine/images/textfield-background.9.png
2186 \li \image imagine/images/textfield-background-disabled.9.png
2192 \li \image imagine/images/textfield-background-focused.9.png
2198 \li \image imagine/images/toolbar-background.png
2204 \li \image imagine/images/toolbutton-background.9.png
2209 \li disabled, checked
2210 \li \image imagine/images/toolbutton-background-disabled-checked.9.png
2216 \li \image imagine/images/toolbutton-background-focused.9.png
2222 \li \image imagine/images/toolbutton-background-pressed.9.png
2228 \li \image imagine/images/toolbutton-background-checked.9.png
2233 \li checked, focused
2234 \li \image imagine/images/toolbutton-background-checked-focused.9.png
2239 \li checked, hovered
2240 \li \image imagine/images/toolbutton-background-checked-hovered.9.png
2246 \li \image imagine/images/toolbutton-background-hovered.9.png
2249 \li \l ToolSeparator
2252 \li \image imagine/images/toolseparator-separator-horizontal.9.png
2258 \li \image imagine/images/toolseparator-separator-vertical.9.png
2264 \li \image imagine/images/tooltip-background.9.png
2269 \sup 1 A 1x1 image containing one color, stretched to fill the control.
2271 \section2 9-Patch Images
2273 The Imagine style uses \l
2274 {https://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch}{9-patch
2275 images} in order to give designers control over how a particular element
2276 responds to being resized. Here is an example of a 9-patch image that
2277 represents a \l {Button}'s \l {Control::}{background}, alongside a
2278 magnified version (to make it easier to see the 9-patch lines):
2280 \image qtquickcontrols-imagine-9-patch-4x.png
2282 The content of the image is 44 pixels wide by 32 pixels high. Every 9-patch
2283 image needs a one pixel thick line (collectively referred to as
2284 "9-patch lines") around every side, so the actual size of the image becomes
2285 46 pixels wide by 34 pixels high. Note that the 9-patch lines must be one
2286 pixel thick regardless of the target DPI of the image. For example,
2287 the 9-patch lines for button-background.9.png and button-background@2x.9.png
2288 must both be one pixel thick.
2290 The 9-patch lines must be black, and the remaining areas must be transparent
2293 \image qtquickcontrols-imagine-9-patch-size.png
2295 \section3 Stretchable Areas
2297 The 9-patch lines on the top and left edges determine which parts of the
2298 image are stretched when it is resized.
2300 Below are examples of the 9-patch image being resized to one and a half
2301 times its original size in various dimensions:
2303 \image qtquickcontrols-imagine-9-patch-resized-stretchable.png
2305 Notice how the the rounded corners keep their original size, as they are
2306 outside the range of the lines.
2308 \section3 Padding Areas
2310 The 9-patch lines on the right and bottom edges determine how much space
2311 is available for the control's \l {Control::}{contentItem}, which means it
2312 can also be thought of as controlling the \l {Control::}{padding}. For a
2313 diagram that illustrates padding, see \l {Control Layout}.
2315 Below are more examples of the 9-patch image being resized, but this time
2316 demonstrating how the padding 9-patch lines work.
2318 \image qtquickcontrols-imagine-9-patch-resized-padding.png
2320 The \c contentItem can take up as much space as it needs within the shaded
2321 areas. If the padding lines are left out, the \c contentItem will take as
2322 much space as it needs without exceeding the stretchable areas.
2324 \section3 Inset Areas
2326 In some cases it is necessary for a control to have a drop shadow, for
2327 example. However, if we were to add a drop shadow to the button above, it
2328 would affect its size, which presents problems for both layouting and
2329 mouse/touch input boundaries.
2331 Inset areas accounts for this by telling the control that a certain area of
2332 the 9-patch image should go outside of the control:
2334 \image qtquickcontrols-imagine-9-patch-inset.png
2336 In the image below, the dashed line represents the button's clickable area,
2337 as well as the space that it will take up in a layout. The shadow is marked
2338 by the striped area behind it:
2340 \image qtquickcontrols-imagine-9-patch-inset-boundaries.png
2342 \section3 Exporting 9-Patch Images
2344 Various vector and bitmap editors can be used to create 9-patch images
2345 suitable for use with the Imagine style. The following sections briefly
2346 explain the export process for each editor, and the last section explains
2347 how to ensure the exported images are 9-patch-conformant.
2349 \section4 Affinity Designer
2351 See Affinity's \l {https://affinity.help/publisher/en-US.lproj/pages/Publishing/exportSettings.html}
2352 {Export Settings} documentation.
2354 \section4 Adobe Illustrator
2357 \l {https://helpx.adobe.com/in/illustrator/using/collect-assets-export-for-screens.html#panel}
2358 {Asset Export panel} documentation.
2360 \section4 Adobe Photoshop
2363 \l {https://helpx.adobe.com/photoshop/using/generate-assets-layers.html}
2364 {Generate image assets from layers} documentation.
2368 The \l {https://github.com/mitchcurtis/inkscape-9-patch-export}
2369 {Inkscape 9-Patch Export Extension} can be used to export assets with
2374 See Sketch's \l {https://sketchapp.com/docs/exporting/}{Exporting} documentation.
2376 Qt Quick Controls also provides a
2377 \l {http://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quickcontrols/imagine/design}
2378 {plugin} for Sketch that automatically fixes the thickness of the 9-patch lines
2379 after the assets are exported. To install this file, double-click on it.
2380 Once Sketch has confirmed that the 9-patch export plugin has been installed,
2381 the plugin will automatically process images when they are exported.
2383 \section4 Fixing 9-Patch Lines
2385 When exporting 9-patch images in several DPI variants (\c {@2x}, \c {@3x},
2386 etc.), the 9-patch lines will typically be scaled up along with the image.
2387 There are several ways to fix this, but perhaps the simplest approach is
2388 to use \l {https://www.imagemagick.org/script/mogrify.php}{ImageMagick's mogrify}
2389 tool. The tool has a \c -shave feature that can be used to crop the image
2390 to reduce the thickness of the 9-patch lines:
2393 mogrify -shave 1x1 -path path/to/images *@2x.9.png
2394 mogrify -shave 2x2 -path path/to/images *@3x.9.png
2395 mogrify -shave 3x3 -path path/to/images *@4x.9.png
2398 Regular DPI images (those without the \c @Nx prefix) are not affected, so it
2399 is only necessary to run the command on images intended for high DPI displays.
2401 \section2 Animated Images
2403 The \l {https://developers.google.com/speed/webp/}{WebP} and GIF animated
2404 image formats are supported by the Imagine style.
2406 \section2 Customization
2410 The Imagine style allows customizing the \l {imagine-path-attached-prop}{path}
2411 that is used to do the image asset selection. The path can be specified for any
2412 window or item, and it automatically propagates to children in the same manner as
2413 \l {Control::font}{fonts}. In the following example, the window and all three radio
2414 buttons appear with dark image assets (files that are located in "qrc:/themes/dark").
2421 import QtQuick.Controls 2.12
2422 import QtQuick.Controls.Imagine 2.12
2427 Imagine.path: "qrc:/themes/dark"
2430 anchors.centerIn: parent
2432 RadioButton { text: qsTr("Small") }
2433 RadioButton { text: qsTr("Medium"); checked: true }
2434 RadioButton { text: qsTr("Large") }
2439 \image qtquickcontrols-imagine-customization-dark.png
2442 In addition to specifying the path in QML, it is also possible to specify
2443 it via an \l {imagine-customization-environment-variable}{environment variable}
2444 or in a \l {imagine-customization-configuration-file}{configuration file}.
2445 Attributes specified in QML take precedence over all other methods.
2447 \section4 Configuration File
2448 \target imagine-customization-configuration-file
2450 \include qquickimaginestyle.qdocinc conf
2452 See \l {Qt Quick Controls Configuration File} for more details about the
2455 \section4 Environment Variables
2456 \target imagine-customization-environment-variable
2458 \include qquickimaginestyle.qdocinc env
2460 See \l {Supported Environment Variables in Qt Quick Controls} for the full
2461 list of supported environment variables.
2465 The Imagine style supports palette customization via the \l {Item::}{palette}
2466 property and the \l {Palette Configuration}{qtquickcontrols2.conf} file.
2467 As with other styles, the exact \l[QML]{Palette}{palette roles}
2468 that the Imagine style uses are style-dependent. However, as most of the visual
2469 appearance of controls (for example: backgrounds) are managed through image assets,
2470 only the roles that are typically used for text will have an effect.
2474 Custom fonts can be set via the \l {Control::}{font} property and the
2475 \l {Font Configuration}{configuration} file.
2477 \section2 Dependency
2479 The Imagine style must be separately imported to gain access to the
2480 attributes that are specific to the Imagine style. It should be noted
2481 that regardless of the references to the Imagine style, the same
2482 application code runs with any other style. Imagine-specific attributes
2483 only have an effect when the application is run with the Imagine style.
2485 If the Imagine style is imported in a QML file that is always loaded, the
2486 Imagine style must be deployed with the application in order to be able
2487 to run the application regardless of which style the application is run with.
2488 By using \l {Using File Selectors with Qt Quick Controls}{file selectors},
2489 style-specific tweaks can be applied without creating a hard dependency to
2492 \b {See also} \l {Styling Qt Quick Controls}
2494 \section1 Attached Property Documentation
2496 \styleproperty {Imagine.path} {string} {imagine-path-attached-prop}
2497 \target imagine-path-attached-prop
2498 This attached property holds the path to the image assets...
2502 Imagine.path: "qrc:/themes/dark"
2508 \section1 Related Information
2511 \li \l{Styling Qt Quick Controls}
2512 \li \l{Qt Quick Controls - Imagine Style Example: Automotive}{Automotive Example}