summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2019-06-20 15:45:54 +0300
committerAntti Määttä <antti.maatta@qt.io>2019-06-20 16:34:07 +0300
commit74e1374b246f0b6d8c4560f052b9f880c41603ab (patch)
tree6d2556df3f2ec0e8c5edb1c81557d7aa62705e57 /tools
parent46a1400d950a735d85fb061b1d7264f1f8d3c542 (diff)
Add matteEnabled to viewer settings
The flag is required to disable clearing to black in qml applications, which support transparency. Task-number: QT3DS-3689 Task-number: QT3DS-3542 Change-Id: I27b1e07a394be30f0fb4841c69555dde5697a5cf Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Jari Karppinen <jari.karppinen@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/viewer/qml/main.qml16
1 files changed, 6 insertions, 10 deletions
diff --git a/tools/viewer/qml/main.qml b/tools/viewer/qml/main.qml
index 1357f39..258a539 100644
--- a/tools/viewer/qml/main.qml
+++ b/tools/viewer/qml/main.qml
@@ -46,9 +46,8 @@ ApplicationWindow {
property string error
property int previousVisibility
- property color showMatteColor: Qt.rgba(0.2, 0.2, 0.2, 1)
- property color hideMatteColor: Qt.rgba(0, 0, 0, 1)
- property color matteColor: hideMatteColor
+ property bool matteEnabled: false
+ property color matteColor: Qt.rgba(0.2, 0.2, 0.2, 1)
property bool showRenderStats: false
property int scaleMode: ViewerSettings.ScaleModeCenter
@@ -212,6 +211,7 @@ ApplicationWindow {
focus: true
ViewerSettings {
+ matteEnabled: window.matteEnabled
matteColor: window.matteColor
showRenderStats: window.showRenderStats
scaleMode: window.scaleMode
@@ -489,14 +489,10 @@ ApplicationWindow {
text: qsTr("Show Matte")
shortcut: "Ctrl+D"
enabled: _viewerHelper.contentView === ViewerHelper.StudioView
- showCheckMark: window.matteColor !== window.hideMatteColor
+ showCheckMark: window.matteEnabled
onTriggered: {
- if (enabled) {
- if (window.matteColor === window.hideMatteColor)
- window.matteColor = window.showMatteColor;
- else
- window.matteColor = window.hideMatteColor;
- }
+ if (enabled)
+ window.matteEnabled = !window.matteEnabled
}
}
StyledMenuItem {