Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Tooltip background?
Forum Updated to NodeBB v4.3 + New Features

Tooltip background?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 421 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Online
    PerdrixP Online
    Perdrix
    wrote on last edited by Perdrix
    #1

    I've set a tooltip on a QDockWidget title bar widget (a QLabel). The label has a gradient as a background. The tooltip is displayed with a background that seems to be derived from the background I specified for the label but it renders the tip very hard to read.

    6040c0d2-cf57-4246-9e23-2793e9bf7ded-image.png

    How can I get the tooltip to display without that background it has invented for itself (or with the same one as the label)?

    Thanks D.

    Chris KawaC 1 Reply Last reply
    0
    • PerdrixP Perdrix

      I've set a tooltip on a QDockWidget title bar widget (a QLabel). The label has a gradient as a background. The tooltip is displayed with a background that seems to be derived from the background I specified for the label but it renders the tip very hard to read.

      6040c0d2-cf57-4246-9e23-2793e9bf7ded-image.png

      How can I get the tooltip to display without that background it has invented for itself (or with the same one as the label)?

      Thanks D.

      Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Perdrix How do you set a gradient for the label? Through a palette brush, stylesheet, custom paint? If it's through a stylesheet it's just a question of scoping it to the label only.
      For example if you do "color: red" it will apply to the widget and all its children, including the tooltip, but if you do "QLabel { color: red }" it will only apply to the label or "QToolTip { color: red }" only to the tooltip.

      1 Reply Last reply
      1
      • PerdrixP Online
        PerdrixP Online
        Perdrix
        wrote on last edited by
        #3

        That was it! Changing the code to read:

        dockTitle->setStyleSheet(QString::fromUtf8("QLabel {"
        	"background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, "
        	"stop:0 rgba(138, 185, 242, 0), stop:1 rgba(138, 185, 242, 255))}"));
        

        solved the problem.

        Big thank you!
        D.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved