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. Add tooltip to windowTitle
Forum Updated to NodeBB v4.3 + New Features

Add tooltip to windowTitle

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 126 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.
  • D Offline
    D Offline
    DanMQt
    wrote last edited by DanMQt
    #1

    Hello, I have a use case I assumed would be fairly common. I am setting the windowTitle on my QMainWindow and using the windowModified mechanism. I would like to add a tooltip with the full file path when hovering over the window title. I would almost think this should be standard if both windowTitle and windowFilePath are both set. However, I can't figure out how to do this. I can't get the QLabel for the windowTitle, the windowIcon returns a QIcon which doesn't support a tooltip, I also can't figure out how to get the title bar widget. Is there something I am missing?

    I can add a statusToolTip to the QMainWindow but this is not what I want.

    Pl45m4P JonBJ 2 Replies Last reply
    0
    • HansonH Offline
      HansonH Offline
      Hanson
      wrote last edited by
      #2

      @DanMQt Hi
      You could try making the Mainwindow borderless and then personalizing the borders and window titles so you can set the tooltip.

      “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”
      —— Martin Golding

      1 Reply Last reply
      0
      • D DanMQt

        Hello, I have a use case I assumed would be fairly common. I am setting the windowTitle on my QMainWindow and using the windowModified mechanism. I would like to add a tooltip with the full file path when hovering over the window title. I would almost think this should be standard if both windowTitle and windowFilePath are both set. However, I can't figure out how to do this. I can't get the QLabel for the windowTitle, the windowIcon returns a QIcon which doesn't support a tooltip, I also can't figure out how to get the title bar widget. Is there something I am missing?

        I can add a statusToolTip to the QMainWindow but this is not what I want.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote last edited by
        #3

        @DanMQt

        The window decoration (like TitleBar) isn't controlled by Qt, so you can't just add a tooltip somehow.
        Haven't checked if there is any, but you need to find a native approach for your OS/environment.


        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
        • D DanMQt

          Hello, I have a use case I assumed would be fairly common. I am setting the windowTitle on my QMainWindow and using the windowModified mechanism. I would like to add a tooltip with the full file path when hovering over the window title. I would almost think this should be standard if both windowTitle and windowFilePath are both set. However, I can't figure out how to do this. I can't get the QLabel for the windowTitle, the windowIcon returns a QIcon which doesn't support a tooltip, I also can't figure out how to get the title bar widget. Is there something I am missing?

          I can add a statusToolTip to the QMainWindow but this is not what I want.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote last edited by
          #4

          @DanMQt
          As @Pl45m4 has written. Furthermore I have never seen a Windows or Linux app which has a tooltip when hovering the window title, so I don't know why you would think this is standard. Up to you whether you want to do the extra work to achieve it.

          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