File tree Expand file tree Collapse file tree 5 files changed +38
-8
lines changed Expand file tree Collapse file tree 5 files changed +38
-8
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ Item {
22
22
visible: {
23
23
// If the environment variable configured the ACCENT color to match our sentinel,
24
24
// then every instance of DebugRect will become visible:
25
- Material .accent == sentinelColor
25
+ var detectionInQt5 = (Material .accent == sentinelColor);
26
+ // See the `runscene` script in this repo. Qt6 requires a new approach:
27
+ var detectionInQt6 = (' -myqmldebug' == Qt .application .arguments .find ((element ) => element == ' -myqmldebug' ));
28
+
29
+ // Either detection mechanism can enable the DebugRect(s):
30
+ detectionInQt5 || detectionInQt6
26
31
}
27
32
28
33
// Limiting ourselves to this palette helps us unambiguously grep for color names
Original file line number Diff line number Diff line change @@ -15,7 +15,16 @@ Rectangle {
15
15
// or under qmlscene), then just do this before launch:
16
16
// export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"
17
17
readonly property color sentinelColor: " #0B610B"
18
- visible: Material .accent == sentinelColor
18
+ visible: {
19
+ // If the environment variable configured the ACCENT color to match our sentinel,
20
+ // then every instance of DebugRect will become visible:
21
+ var detectionInQt5 = (Material .accent == sentinelColor);
22
+ // See the `runscene` script in this repo. Qt6 requires a new approach:
23
+ var detectionInQt6 = (' -myqmldebug' == Qt .application .arguments .find ((element ) => element == ' -myqmldebug' ));
24
+
25
+ // Either detection mechanism can enable the DebugRect(s):
26
+ detectionInQt5 || detectionInQt6
27
+ }
19
28
20
29
anchors .fill : toFill
21
30
z: 200
Original file line number Diff line number Diff line change @@ -160,8 +160,8 @@ ApplicationWindow {
160
160
text: " SPACEBAR (on logo): rotates logo"
161
161
162
162
DebugRect {
163
- // To make the DebugRect show up in the GUI, change your environment:
164
- // export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"
163
+ // This shows a "visual debug" border, but when only when you
164
+ // enable the feature.
165
165
// (See comments in DebugRect.qml for more information.)
166
166
color: red
167
167
}
Original file line number Diff line number Diff line change @@ -7,10 +7,18 @@ source "${DIR}/../../../tools/ci/rootdirhelper.bash"
7
7
8
8
source $CUR_GUICODE_ROOT /path_to_qmake.bash # path to qmake is also path to qmlscene
9
9
10
- # In order to cause our DebugRectangle instances to become visible, uncomment:
10
+ # In order to cause our DebugRectangle instances to become visible, do the following
11
+ # in your terminal before you call `runscene`:
11
12
# export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"
12
13
14
+ RUNSCENE_EXTRA_CONF=()
15
+ if [[ ${QT_QUICK_CONTROLS_MATERIAL_ACCENT-} == " #0B610B" ]]; then
16
+ # The 'material accent' hack only worked in Qt5.
17
+ # Here is our adaptation for Qt6:
18
+ RUNSCENE_EXTRA_CONF=(' -myqmldebug' )
19
+ fi
20
+
13
21
# In order that all the qml 'import' statements for our supporting libraries can
14
22
# successfully load, you must feed some additional paths to qmlscene like so:
15
23
16
- qmlscene -I ../../libstyles/imports/ " $@ "
24
+ qmlscene -I ../../libstyles/imports/ ${RUNSCENE_EXTRA_CONF[@]} " $@ "
Original file line number Diff line number Diff line change @@ -7,10 +7,18 @@ source "${DIR}/../../../tools/ci/rootdirhelper.bash"
7
7
8
8
source $CUR_GUICODE_ROOT /path_to_qmake.bash # path to qmake is also path to qmlscene
9
9
10
- # In order to cause our DebugRectangle instances to become visible, uncomment:
10
+ # In order to cause our DebugRectangle instances to become visible, do the following
11
+ # in your terminal before you call `runscene`:
11
12
# export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"
12
13
14
+ RUNSCENE_EXTRA_CONF=()
15
+ if [[ ${QT_QUICK_CONTROLS_MATERIAL_ACCENT-} == " #0B610B" ]]; then
16
+ # The 'material accent' hack only worked in Qt5.
17
+ # Here is our adaptation for Qt6:
18
+ RUNSCENE_EXTRA_CONF=(' -myqmldebug' )
19
+ fi
20
+
13
21
# In order that all the qml 'import' statements for our supporting libraries can
14
22
# successfully load, you must feed some additional paths to qmlscene like so:
15
23
16
- qmlscene -I ../../libstyles/imports/ -style fusion " $@ "
24
+ qmlscene -I ../../libstyles/imports/ ${RUNSCENE_EXTRA_CONF[@]} -style fusion " $@ "
You can’t perform that action at this time.
0 commit comments