Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib_app/qml/DebugRect.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ Item {
visible: {
// If the environment variable configured the ACCENT color to match our sentinel,
// then every instance of DebugRect will become visible:
Material.accent == sentinelColor
var detectionInQt5 = (Material.accent == sentinelColor)
// See the `runscene` script in this repo. Qt6 requires a new approach:
var detectionInQt6 = ('-myqmldebug' == Qt.application.arguments.find(
element => element == '-myqmldebug'))

// Either detection mechanism can enable the DebugRect(s):
detectionInQt5 || detectionInQt6
}

// Limiting ourselves to this palette helps us unambiguously grep for color names
Expand Down
12 changes: 11 additions & 1 deletion src/lib_app/qml/DebugRectangle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ Rectangle {
// or under qmlscene), then just do this before launch:
// export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"
readonly property color sentinelColor: "#0B610B"
visible: Material.accent == sentinelColor
visible: {
// If the environment variable configured the ACCENT color to match our sentinel,
// then every instance of DebugRect will become visible:
var detectionInQt5 = (Material.accent == sentinelColor)
// See the `runscene` script in this repo. Qt6 requires a new approach:
var detectionInQt6 = ('-myqmldebug' == Qt.application.arguments.find(
element => element == '-myqmldebug'))

// Either detection mechanism can enable the DebugRect(s):
detectionInQt5 || detectionInQt6
}

anchors.fill: toFill
z: 200
Expand Down
4 changes: 2 additions & 2 deletions src/lib_app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ ApplicationWindow {
text: "SPACEBAR (on logo): rotates logo"

DebugRect {
// To make the DebugRect show up in the GUI, change your environment:
// export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"
// This shows a "visual debug" border, but when only when you
// enable the feature.
// (See comments in DebugRect.qml for more information.)
color: red
}
Expand Down
12 changes: 10 additions & 2 deletions src/lib_app/qml/runscene
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ source "${DIR}/../../../tools/ci/rootdirhelper.bash"

source $CUR_GUICODE_ROOT/path_to_qmake.bash # path to qmake is also path to qmlscene

# In order to cause our DebugRectangle instances to become visible, uncomment:
# In order to cause our DebugRectangle instances to become visible, do the following
# in your terminal before you call `runscene`:
# export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"

RUNSCENE_EXTRA_CONF=()
if [[ ${QT_QUICK_CONTROLS_MATERIAL_ACCENT-} == "#0B610B" ]]; then
# The 'material accent' hack only worked in Qt5.
# Here is our adaptation for Qt6:
RUNSCENE_EXTRA_CONF=('-myqmldebug')
fi

# In order that all the qml 'import' statements for our supporting libraries can
# successfully load, you must feed some additional paths to qmlscene like so:

qmlscene -I ../../libstyles/imports/ "$@"
qmlscene -I ../../libstyles/imports/ ${RUNSCENE_EXTRA_CONF[@]} "$@"
12 changes: 10 additions & 2 deletions src/lib_app/qml/runstyledscene
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@ source "${DIR}/../../../tools/ci/rootdirhelper.bash"

source $CUR_GUICODE_ROOT/path_to_qmake.bash # path to qmake is also path to qmlscene

# In order to cause our DebugRectangle instances to become visible, uncomment:
# In order to cause our DebugRectangle instances to become visible, do the following
# in your terminal before you call `runscene`:
# export QT_QUICK_CONTROLS_MATERIAL_ACCENT="#0B610B"

RUNSCENE_EXTRA_CONF=()
if [[ ${QT_QUICK_CONTROLS_MATERIAL_ACCENT-} == "#0B610B" ]]; then
# The 'material accent' hack only worked in Qt5.
# Here is our adaptation for Qt6:
RUNSCENE_EXTRA_CONF=('-myqmldebug')
fi

# In order that all the qml 'import' statements for our supporting libraries can
# successfully load, you must feed some additional paths to qmlscene like so:

qmlscene -I ../../libstyles/imports/ -style fusion "$@"
qmlscene -I ../../libstyles/imports/ ${RUNSCENE_EXTRA_CONF[@]} -style fusion "$@"
Loading