Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Get tooltip text from QStyleSheet
Qt 6.12 LTS is out! See what's new in the release blog

Get tooltip text from QStyleSheet

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.1k Views 1 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.
  • M Offline
    M Offline
    moravas
    wrote on last edited by
    #1

    Hi Folks,

    as the title points to you, I would like to manage all of the tooltip texts from a centralised place.
    A bit detailed description: I have a quite complex UI with lots of control. I would like to set tooltips for each of that. I know the following two ways:

    • Set the text of ToolTip via Qt Designer (very decentralised, but I have lots of same resource text)
    • Call the setToolTip() method in (for example) the constructor (too much function call)

    Maybe, is it possible to set the text from the QStyleSheet, or some other centralised resource?

    Regards,
    Norbert

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vikaspachdha
      wrote on last edited by
      #2

      What about writing a script to do the job for you ? With style sheet you can change the look and feel only.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You can take a look at the "Tool Tip Example", it might give you some ideas

        Hope it helps

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        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
        • Unsolved