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. Button hover action
Forum Updated to NodeBB v4.3 + New Features

Button hover action

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 461 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.
  • D Offline
    D Offline
    Dy3zz
    wrote on last edited by
    #1

    Hi. I am trying to make an info button so when the mouse is on the button a QTextEdit will show but i cannot figure out how to do this. Any suggestion? All I finded about hover refers to stylesheets but it doesn't help.

    MitsuriouM JonBJ 2 Replies Last reply
    0
    • D Dy3zz

      Hi. I am trying to make an info button so when the mouse is on the button a QTextEdit will show but i cannot figure out how to do this. Any suggestion? All I finded about hover refers to stylesheets but it doesn't help.

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #3

      @Dy3zz
      I don't know why you want a QTextEdit for hovering, but before you write code to reinvent the wheel have you seen that any QWidget has any of statusTip(), toolTip() and whatsThis() available? The last one is intended to be multiline/formatted, e.g. the picture in https://doc.qt.io/qt-5/qwhatsthis.html#details.

      Otherwise some approach like @Mitsuriou's.

      D 1 Reply Last reply
      3
      • D Dy3zz

        Hi. I am trying to make an info button so when the mouse is on the button a QTextEdit will show but i cannot figure out how to do this. Any suggestion? All I finded about hover refers to stylesheets but it doesn't help.

        MitsuriouM Offline
        MitsuriouM Offline
        Mitsuriou
        wrote on last edited by
        #2

        @Dy3zz

        Hello,
        If I am not mistaken, one possible thing could be making a class that inherits QPushButton, and overriding the method enterEvent. From there, you might be able to create a "floating" QTextEdit.

        1 Reply Last reply
        2
        • D Dy3zz

          Hi. I am trying to make an info button so when the mouse is on the button a QTextEdit will show but i cannot figure out how to do this. Any suggestion? All I finded about hover refers to stylesheets but it doesn't help.

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by JonB
          #3

          @Dy3zz
          I don't know why you want a QTextEdit for hovering, but before you write code to reinvent the wheel have you seen that any QWidget has any of statusTip(), toolTip() and whatsThis() available? The last one is intended to be multiline/formatted, e.g. the picture in https://doc.qt.io/qt-5/qwhatsthis.html#details.

          Otherwise some approach like @Mitsuriou's.

          D 1 Reply Last reply
          3
          • JonBJ JonB

            @Dy3zz
            I don't know why you want a QTextEdit for hovering, but before you write code to reinvent the wheel have you seen that any QWidget has any of statusTip(), toolTip() and whatsThis() available? The last one is intended to be multiline/formatted, e.g. the picture in https://doc.qt.io/qt-5/qwhatsthis.html#details.

            Otherwise some approach like @Mitsuriou's.

            D Offline
            D Offline
            Dy3zz
            wrote on last edited by
            #4

            @JonB Thank you so much. I didn't know about whatsThis() :)

            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