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. Setting a tool tip on the title bar of a dock widget
Forum Updated to NodeBB v4.3 + New Features

Setting a tool tip on the title bar of a dock widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 230 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 Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by
    #1

    If I use QDockWidget::setTitleBarWidget(QLabel*) I can set a tool tip on that label that says e.g.:

    Double click here to dock/undock the image list

    If OTOH I don't set a title bar widget, how do I set a tooltip that applies just to the title bar of the dock widget?

    Thanks
    David

    Pl45m4P 1 Reply Last reply
    0
    • PerdrixP Perdrix

      If I use QDockWidget::setTitleBarWidget(QLabel*) I can set a tool tip on that label that says e.g.:

      Double click here to dock/undock the image list

      If OTOH I don't set a title bar widget, how do I set a tooltip that applies just to the title bar of the dock widget?

      Thanks
      David

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Perdrix said in Setting a tool tip on the title bar of a dock widget:

      If OTOH I don't set a title bar widget, how do I set a tooltip that applies just to the title bar of the dock widget?

      I fear you can not :(

      void QDockWidget::setTitleBarWidget(QWidget *widget)

      If a title bar widget is set, QDockWidget will not use native window decorations when it is floated.

      (https://doc.qt.io/qt-6/qdockwidget.html#setTitleBarWidget)

      Ergo, it will use the native OS title bar + decorations if no custom QWidget is used as one.
      And I don't know of a way to set a QToolTip to some native OS controls.
      For Windows it could be possible by using WinAPI
      And you need different code for Linux/Mac then

      Maybe helpful?!

      • https://stackoverflow.com/questions/1333770/how-to-get-tooltip-text-for-a-given-hwnd

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

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

        Oh well it was worth asking - even if the answer's no.

        Thank you

        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