diff options
Diffstat (limited to 'examples')
29 files changed, 36 insertions, 18 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 Binary files differindex db43e273..db43e273 100644 --- a/examples/quickcontrols2/gallery/images/back.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png Binary files differindex 1e974efa..1e974efa 100644 --- a/examples/quickcontrols2/gallery/images/drawer.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu.png b/examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png Binary files differindex a10473d9..a10473d9 100644 --- a/examples/quickcontrols2/gallery/images/menu.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20/menu.png diff --git a/examples/quickcontrols2/gallery/images/back@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png Binary files differindex c55ab315..c55ab315 100644 --- a/examples/quickcontrols2/gallery/images/back@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png Binary files differindex eba3b6cc..eba3b6cc 100644 --- a/examples/quickcontrols2/gallery/images/drawer@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu@2x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png Binary files differindex 649c2a08..649c2a08 100644 --- a/examples/quickcontrols2/gallery/images/menu@2x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@2/menu.png diff --git a/examples/quickcontrols2/gallery/images/back@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png Binary files differindex b228eb87..b228eb87 100644 --- a/examples/quickcontrols2/gallery/images/back@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png Binary files differindex 3584ed6d..3584ed6d 100644 --- a/examples/quickcontrols2/gallery/images/drawer@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu@3x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png Binary files differindex 9554b695..9554b695 100644 --- a/examples/quickcontrols2/gallery/images/menu@3x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@3/menu.png diff --git a/examples/quickcontrols2/gallery/images/back@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png Binary files differindex dd157e78..dd157e78 100644 --- a/examples/quickcontrols2/gallery/images/back@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/back.png diff --git a/examples/quickcontrols2/gallery/images/drawer@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png Binary files differindex 60d93aff..60d93aff 100644 --- a/examples/quickcontrols2/gallery/images/drawer@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/drawer.png diff --git a/examples/quickcontrols2/gallery/images/menu@4x.png b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png Binary files differindex 187c171c..187c171c 100644 --- a/examples/quickcontrols2/gallery/images/menu@4x.png +++ b/examples/quickcontrols2/gallery/icons/gallery/20x20@4/menu.png 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 Binary files differdeleted file mode 100644 index ebc1000f..00000000 --- a/examples/quickcontrols2/gallery/images/+material/back.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/back@2x.png b/examples/quickcontrols2/gallery/images/+material/back@2x.png Binary files differdeleted file mode 100644 index cf6163c8..00000000 --- a/examples/quickcontrols2/gallery/images/+material/back@2x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/back@3x.png b/examples/quickcontrols2/gallery/images/+material/back@3x.png Binary files differdeleted file mode 100644 index 96376a5a..00000000 --- a/examples/quickcontrols2/gallery/images/+material/back@3x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/back@4x.png b/examples/quickcontrols2/gallery/images/+material/back@4x.png Binary files differdeleted file mode 100644 index 578ac14f..00000000 --- a/examples/quickcontrols2/gallery/images/+material/back@4x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/drawer.png b/examples/quickcontrols2/gallery/images/+material/drawer.png Binary files differdeleted file mode 100644 index 615cc817..00000000 --- a/examples/quickcontrols2/gallery/images/+material/drawer.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@2x.png b/examples/quickcontrols2/gallery/images/+material/drawer@2x.png Binary files differdeleted file mode 100644 index b1dd106d..00000000 --- a/examples/quickcontrols2/gallery/images/+material/drawer@2x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@3x.png b/examples/quickcontrols2/gallery/images/+material/drawer@3x.png Binary files differdeleted file mode 100644 index 289889bf..00000000 --- a/examples/quickcontrols2/gallery/images/+material/drawer@3x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/drawer@4x.png b/examples/quickcontrols2/gallery/images/+material/drawer@4x.png Binary files differdeleted file mode 100644 index 215e6a82..00000000 --- a/examples/quickcontrols2/gallery/images/+material/drawer@4x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/menu.png b/examples/quickcontrols2/gallery/images/+material/menu.png Binary files differdeleted file mode 100644 index f02429e9..00000000 --- a/examples/quickcontrols2/gallery/images/+material/menu.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/menu@2x.png b/examples/quickcontrols2/gallery/images/+material/menu@2x.png Binary files differdeleted file mode 100644 index 9309ad9a..00000000 --- a/examples/quickcontrols2/gallery/images/+material/menu@2x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/menu@3x.png b/examples/quickcontrols2/gallery/images/+material/menu@3x.png Binary files differdeleted file mode 100644 index 7bddf71f..00000000 --- a/examples/quickcontrols2/gallery/images/+material/menu@3x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/images/+material/menu@4x.png b/examples/quickcontrols2/gallery/images/+material/menu@4x.png Binary files differdeleted file mode 100644 index e5c23a3b..00000000 --- a/examples/quickcontrols2/gallery/images/+material/menu@4x.png +++ /dev/null diff --git a/examples/quickcontrols2/gallery/pages/DialogPage.qml b/examples/quickcontrols2/gallery/pages/DialogPage.qml index daaa7329..8bade21f 100644 --- a/examples/quickcontrols2/gallery/pages/DialogPage.qml +++ b/examples/quickcontrols2/gallery/pages/DialogPage.qml @@ -50,7 +50,7 @@ import QtQuick 2.6 import QtQuick.Layouts 1.0 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.3 ScrollablePage { id: page @@ -101,7 +101,7 @@ ScrollablePage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - parent: ApplicationWindow.overlay + parent: Overlay.overlay modal: true title: "Confirmation" @@ -134,7 +134,7 @@ ScrollablePage { y: (parent.height - height) / 2 width: Math.min(page.width, page.height) / 3 * 2 contentHeight: logo.height * 2 - parent: ApplicationWindow.overlay + parent: Overlay.overlay modal: true title: "Content" @@ -194,7 +194,7 @@ ScrollablePage { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - parent: ApplicationWindow.overlay + parent: Overlay.overlay focus: true modal: true |