Fix tooltip layout with Qt 6.9
This commit is contained in:
parent
c93f7e7385
commit
75359bb1c4
1 changed files with 11 additions and 1 deletions
|
|
@ -69,9 +69,19 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It would be better to use TextMetrics here, but it always lays out
|
||||||
|
// the text slightly more compactly than real Text does in ToolTip,
|
||||||
|
// causing unexpected line breaks to be inserted
|
||||||
|
Text {
|
||||||
|
id: tooltipTextLayoutHelper
|
||||||
|
visible: false
|
||||||
|
font: ToolTip.toolTip.font
|
||||||
|
text: ToolTip.toolTip.text
|
||||||
|
}
|
||||||
|
|
||||||
// This configures the maximum width of the singleton attached QML ToolTip. If left unconstrained,
|
// This configures the maximum width of the singleton attached QML ToolTip. If left unconstrained,
|
||||||
// it will never insert a line break and just extend on forever.
|
// it will never insert a line break and just extend on forever.
|
||||||
ToolTip.toolTip.contentWidth: ToolTip.toolTip.implicitContentWidth < 400 ? ToolTip.toolTip.implicitContentWidth : 400
|
ToolTip.toolTip.contentWidth: Math.min(tooltipTextLayoutHelper.width, 400)
|
||||||
|
|
||||||
function goBack() {
|
function goBack() {
|
||||||
if (clearOnBack) {
|
if (clearOnBack) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue