Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.0
-
None
Description
Under Qt 5.15, the following code:
// file ToolTip.qml import QtQuick 2.15 import QtQuick.Templates 2.15 as T T.ToolTip { id: control contentItem: Text { id: msg text: control.text } background: Rectangle { width: msg.implicitWidth height: msg.implicitHeight color: "red" } }
// file main.qml import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { width: 640 height: 480 visible: true Button { anchors.fill: parent ToolTip.text: "hello" ToolTip.visible: pressed } }
shows, as expected, the tooltip "hello" on a red background.
Under Qt 6.4, among other visual differences in placement and styling, the red background does not show.
Removing the version numbers from the import statements does not change anything, nor does importing "QtQuick.Controls.Basic" instead of "QtQuick.Controls" in main.qml.
How can the background of a ToolTip be set in the template under Qt 6.4?
Attachments
Issue Links
- relates to
-
QTBUG-96733 Prevent users from customising native styles
- Reported
- resulted in
-
QTBUG-108089 Investigate if we can make attached ToolTips support compile-time style selection
- Reported