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

QTooltip on readOnly widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 410 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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      2
      • mrjjM mrjj

        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 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.

        mrjjM 1 Reply Last reply
        0
        • B bday1223

          @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.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on 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
          0
          • mrjjM mrjj

            @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 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
            • mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on 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

              • Login

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