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. QTooltip on readOnly widget
Forum Update on Monday, May 27th 2025

QTooltip on readOnly widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 413 Views
  • 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.
  • B Offline
    B Offline
    bday1223
    wrote on 14 Oct 2019, 20:41 last edited by
    #1

    Hello,

    I'm trying to add tooltips to a set of QLineEdit widgets that have been set to readOnly. These widgets are used for display purposes only, and only show a short cryptic mnemonic of an event. I'd like to add tooltips to these to show a more useful description of the abbreviated mnemonics, but it looks like the tooltips only show up if the QLineEdit widgets are not set as readOnly. (I'm using Qt 5.5).

    I'm also hoping to be able to set these exclusively from Qt Designer.

    Any help would be greatly appreciated. Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 14 Oct 2019, 20:49 last edited by mrjj
      #2

      Hi
      I just tried in Qt 5.13.1 on windows 10
      with readonly QLineEdit and it still shows the tooltip
      even when read only.

      alt text

      Also setting enabled to false, it still shows
      alt text

      So might be a bug in Qt 5.5 or it was simply changed later on.

      Is there a reason you use 5.5 ?

      B 1 Reply Last reply 14 Oct 2019, 20:52
      2
      • M mrjj
        14 Oct 2019, 20:49

        Hi
        I just tried in Qt 5.13.1 on windows 10
        with readonly QLineEdit and it still shows the tooltip
        even when read only.

        alt text

        Also setting enabled to false, it still shows
        alt text

        So might be a bug in Qt 5.5 or it was simply changed later on.

        Is there a reason you use 5.5 ?

        B Offline
        B Offline
        bday1223
        wrote on 14 Oct 2019, 20:52 last edited by
        #3

        @mrjj Yeah, I've got a suite of legacy applications, some of which use the old QWebkit, so I've been hesitant to upgrade/port to a newer version. This is for a bunch of Windows desktop applications built with mingw. Thanks.

        M 1 Reply Last reply 14 Oct 2019, 21:03
        0
        • B bday1223
          14 Oct 2019, 20:52

          @mrjj Yeah, I've got a suite of legacy applications, some of which use the old QWebkit, so I've been hesitant to upgrade/port to a newer version. This is for a bunch of Windows desktop applications built with mingw. Thanks.

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 14 Oct 2019, 21:03 last edited by
          #4

          @bday1223
          Ok so the "revived" version
          https://forum.qt.io/topic/76739/webkit-status-2017
          is not an option I guess.
          That said the old webkit is a safety concern if the app is not purely internal.

          I dont have 5.5 to test with but i wonder if you can install an event filter and
          check for the QEvent::ToolTip and show it manually
          like seen in
          https://doc.qt.io/qt-5/qtwidgets-widgets-tooltips-example.html

          B 1 Reply Last reply 14 Oct 2019, 21:23
          0
          • M mrjj
            14 Oct 2019, 21:03

            @bday1223
            Ok so the "revived" version
            https://forum.qt.io/topic/76739/webkit-status-2017
            is not an option I guess.
            That said the old webkit is a safety concern if the app is not purely internal.

            I dont have 5.5 to test with but i wonder if you can install an event filter and
            check for the QEvent::ToolTip and show it manually
            like seen in
            https://doc.qt.io/qt-5/qtwidgets-widgets-tooltips-example.html

            B Offline
            B Offline
            bday1223
            wrote on 14 Oct 2019, 21:23 last edited by
            #5

            @mrjj OK, never mind... I don't know what I've done, but it seems as though the tooltips are working, without any apparent mods to the code.

            Thanks for your time, though!

            1 Reply Last reply
            1
            • M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 14 Oct 2019, 21:24 last edited by mrjj
              #6

              Hi
              Yeah it does seem so.
              I installed 5.5 and to my surprise the same sample did still show tooltip :)

              Please mark as solved then :)

              1 Reply Last reply
              1

              1/6

              14 Oct 2019, 20:41

              • Login

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