aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/gallery/gallery.cpp3
-rw-r--r--examples/quickcontrols2/gallery/gallery.pro3
-rw-r--r--examples/quickcontrols2/gallery/gallery.qml16
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20/back.png (renamed from examples/quickcontrols2/gallery/images/back.png)bin220 -> 220 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer.png)bin123 -> 123 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png (renamed from examples/quickcontrols2/gallery/images/menu.png)bin123 -> 123 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png (renamed from examples/quickcontrols2/gallery/images/back@2x.png)bin289 -> 289 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer@2x.png)bin126 -> 126 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png (renamed from examples/quickcontrols2/gallery/images/menu@2x.png)bin158 -> 158 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png (renamed from examples/quickcontrols2/gallery/images/back@3x.png)bin351 -> 351 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer@3x.png)bin130 -> 130 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png (renamed from examples/quickcontrols2/gallery/images/menu@3x.png)bin193 -> 193 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png (renamed from examples/quickcontrols2/gallery/images/back@4x.png)bin452 -> 452 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png (renamed from examples/quickcontrols2/gallery/images/drawer@4x.png)bin131 -> 131 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png (renamed from examples/quickcontrols2/gallery/images/menu@4x.png)bin223 -> 223 bytes
-rw-r--r--examples/quickcontrols2/gallery/icons/gallery/index.theme24
-rw-r--r--examples/quickcontrols2/gallery/images/+material/back.pngbin219 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/back@2x.pngbin299 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/back@3x.pngbin344 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/back@4x.pngbin473 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/drawer.pngbin213 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/drawer@2x.pngbin286 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/drawer@3x.pngbin345 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/drawer@4x.pngbin420 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/menu.pngbin232 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/menu@2x.pngbin366 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/menu@3x.pngbin499 -> 0 bytes
-rw-r--r--examples/quickcontrols2/gallery/images/+material/menu@4x.pngbin642 -> 0 bytes
28 files changed, 32 insertions, 14 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.cpp b/examples/quickcontrols2/gallery/gallery.cpp
index 7b70f1c8..b4d59685 100644
--- a/examples/quickcontrols2/gallery/gallery.cpp
+++ b/examples/quickcontrols2/gallery/gallery.cpp
@@ -53,6 +53,7 @@
#include <QQmlContext>
#include <QSettings>
#include <QQuickStyle>
+#include <QIcon>
int main(int argc, char *argv[])
{
@@ -62,6 +63,8 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
+ QIcon::setThemeName("gallery");
+
QSettings settings;
QString style = QQuickStyle::name();
if (!style.isEmpty())
diff --git a/examples/quickcontrols2/gallery/gallery.pro b/examples/quickcontrols2/gallery/gallery.pro
index 45496a35..705eeae0 100644
--- a/examples/quickcontrols2/gallery/gallery.pro
+++ b/examples/quickcontrols2/gallery/gallery.pro
@@ -8,8 +8,9 @@ SOURCES += \
RESOURCES += \
gallery.qml \
qtquickcontrols2.conf \
+ icons/gallery/index.theme \
+ $$files(icons/*.png, true) \
$$files(images/*.png) \
- $$files(images/+material/*.png) \
$$files(pages/*.qml)
target.path = $$[QT_INSTALL_EXAMPLES]/quickcontrols2/gallery
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml
index 9f253ab3..5344b74e 100644
--- a/examples/quickcontrols2/gallery/gallery.qml
+++ b/examples/quickcontrols2/gallery/gallery.qml
@@ -50,7 +50,7 @@
import QtQuick 2.9
import QtQuick.Layouts 1.3
-import QtQuick.Controls 2.2
+import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.1
import QtQuick.Controls.Universal 2.1
import Qt.labs.settings 1.0
@@ -89,12 +89,7 @@ ApplicationWindow {
anchors.fill: parent
ToolButton {
- contentItem: Image {
- fillMode: Image.Pad
- horizontalAlignment: Image.AlignHCenter
- verticalAlignment: Image.AlignVCenter
- source: stackView.depth > 1 ? "images/back.png" : "images/drawer.png"
- }
+ icon.name: stackView.depth > 1 ? "back" : "drawer"
onClicked: {
if (stackView.depth > 1) {
stackView.pop()
@@ -116,12 +111,7 @@ ApplicationWindow {
}
ToolButton {
- contentItem: Image {
- fillMode: Image.Pad
- horizontalAlignment: Image.AlignHCenter
- verticalAlignment: Image.AlignVCenter
- source: "images/menu.png"
- }
+ icon.name: "menu"
onClicked: optionsMenu.open()
Menu {
diff --git a/examples/quickcontrols2/gallery/images/back.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/back.png
index db43e273..db43e273 100644
--- a/examples/quickcontrols2/gallery/images/back.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/back.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/drawer.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png
index 1e974efa..1e974efa 100644
--- a/examples/quickcontrols2/gallery/images/drawer.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/menu.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png
index a10473d9..a10473d9 100644
--- a/examples/quickcontrols2/gallery/images/menu.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/back@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png
index c55ab315..c55ab315 100644
--- a/examples/quickcontrols2/gallery/images/back@2x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/drawer@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png
index eba3b6cc..eba3b6cc 100644
--- a/examples/quickcontrols2/gallery/images/drawer@2x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/menu@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png
index 649c2a08..649c2a08 100644
--- a/examples/quickcontrols2/gallery/images/menu@2x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/back@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png
index b228eb87..b228eb87 100644
--- a/examples/quickcontrols2/gallery/images/back@3x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/drawer@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png
index 3584ed6d..3584ed6d 100644
--- a/examples/quickcontrols2/gallery/images/drawer@3x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/menu@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png
index 9554b695..9554b695 100644
--- a/examples/quickcontrols2/gallery/images/menu@3x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/back@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png
index dd157e78..dd157e78 100644
--- a/examples/quickcontrols2/gallery/images/back@4x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/drawer@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png
index 60d93aff..60d93aff 100644
--- a/examples/quickcontrols2/gallery/images/drawer@4x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/menu@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png
index 187c171c..187c171c 100644
--- a/examples/quickcontrols2/gallery/images/menu@4x.png
+++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png
Binary files differ
diff --git a/examples/quickcontrols2/gallery/icons/gallery/index.theme b/examples/quickcontrols2/gallery/icons/gallery/index.theme
new file mode 100644
index 00000000..a1bcd5e0
--- /dev/null
+++ b/examples/quickcontrols2/gallery/icons/gallery/index.theme
@@ -0,0 +1,24 @@
+[Icon Theme]
+Name=Gallery
+Comment=Qt Quick Controls 2 Gallery Example Icon Theme
+
+Directories=20x20,20x20@2,20x20@3,20x20@4
+
+[20x20]
+Size=20
+Type=Fixed
+
+[20x20@2]
+Size=20
+Scale=2
+Type=Fixed
+
+[20x20@3]
+Size=20
+Scale=3
+Type=Fixed
+
+[20x20@4]
+Size=20
+Scale=4
+Type=Fixed
diff --git a/examples/quickcontrols2/gallery/images/+material/back.png b/examples/quickcontrols2/gallery/images/+material/back.png
deleted file mode 100644
index ebc1000f..00000000
--- a/examples/quickcontrols2/gallery/images/+material/back.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/back@2x.png b/examples/quickcontrols2/gallery/images/+material/back@2x.png
deleted file mode 100644
index cf6163c8..00000000
--- a/examples/quickcontrols2/gallery/images/+material/back@2x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/back@3x.png b/examples/quickcontrols2/gallery/images/+material/back@3x.png
deleted file mode 100644
index 96376a5a..00000000
--- a/examples/quickcontrols2/gallery/images/+material/back@3x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/back@4x.png b/examples/quickcontrols2/gallery/images/+material/back@4x.png
deleted file mode 100644
index 578ac14f..00000000
--- a/examples/quickcontrols2/gallery/images/+material/back@4x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/drawer.png b/examples/quickcontrols2/gallery/images/+material/drawer.png
deleted file mode 100644
index 615cc817..00000000
--- a/examples/quickcontrols2/gallery/images/+material/drawer.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@2x.png b/examples/quickcontrols2/gallery/images/+material/drawer@2x.png
deleted file mode 100644
index b1dd106d..00000000
--- a/examples/quickcontrols2/gallery/images/+material/drawer@2x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@3x.png b/examples/quickcontrols2/gallery/images/+material/drawer@3x.png
deleted file mode 100644
index 289889bf..00000000
--- a/examples/quickcontrols2/gallery/images/+material/drawer@3x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@4x.png b/examples/quickcontrols2/gallery/images/+material/drawer@4x.png
deleted file mode 100644
index 215e6a82..00000000
--- a/examples/quickcontrols2/gallery/images/+material/drawer@4x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/menu.png b/examples/quickcontrols2/gallery/images/+material/menu.png
deleted file mode 100644
index f02429e9..00000000
--- a/examples/quickcontrols2/gallery/images/+material/menu.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/menu@2x.png b/examples/quickcontrols2/gallery/images/+material/menu@2x.png
deleted file mode 100644
index 9309ad9a..00000000
--- a/examples/quickcontrols2/gallery/images/+material/menu@2x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/menu@3x.png b/examples/quickcontrols2/gallery/images/+material/menu@3x.png
deleted file mode 100644
index 7bddf71f..00000000
--- a/examples/quickcontrols2/gallery/images/+material/menu@3x.png
+++ /dev/null
Binary files differ
diff --git a/examples/quickcontrols2/gallery/images/+material/menu@4x.png b/examples/quickcontrols2/gallery/images/+material/menu@4x.png
deleted file mode 100644
index e5c23a3b..00000000
--- a/examples/quickcontrols2/gallery/images/+material/menu@4x.png
+++ /dev/null
Binary files differ