0

I rebuilt a periodic table using QML and stumbled upon the following problem. Due to size limitations I decided to reduce the amount of information that is shown to a minimum and instead implemented the option to hover over a certain element which causes a tooltip to show up, offering more information.

Periodic table

tooltip with more information

My problem is, that when you move the cursor to take a look at a different element, the tooltip will not stop showing immediately but slowly fade out instead. Rambling from side to side with your mouse will show this for example:

delayed tooltips

Is there a way to remove this fadeout and let the tooltips disappear immediately instead? Thanks in advance :)

PatrickRKa
  • 21
  • 4
  • Thank you for answering, I should have probably mentioned this beforehand, but I have already tried setting this property. Unfortunately it has nothing to do with the fading effect, it only sets the timespan in which the tooltip is being shown. – PatrickRKa Feb 03 '23 at 14:18

1 Answers1

1

This is defined in the style you are using. Either you write your own style, a custom ToolTip or overwrite manually every time. To fix it you need to overwrite the exit transition.

Button {
    id: button
    text: qsTr("Save")

    ToolTip {
        parent: button
        visible: button.hovered
        delay: 500
        text: "This is a ToolTip"
        exit: Transition {}
    }
}
iam_peter
  • 3,205
  • 1
  • 19
  • 31