Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QPushbutton highlight why?
Qt 6.11 is out! See what's new in the release blog

QPushbutton highlight why?

Scheduled Pinned Locked Moved Mobile and Embedded
7 Posts 5 Posters 8.3k 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.
  • Q Offline
    Q Offline
    qt_qt
    wrote on last edited by
    #1

    Hello,
    i design an keypad and all works great.
    but the last pressed key is marked, selected.
    but i dont want this, it looks strange.

    i dont know what the reason is.

    please see the picture at button 4

    !http://imageshack.us/a/img849/4412/52502424.jpg(QPsuhButton 4)!

    thx for your help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hello,

      I would say that is because it's the last button that has the focus (but i might be wrong)

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qt_qt
        wrote on last edited by
        #3

        Hello,
        thanks for your reply.
        but how can i change it?

        thx

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qt_qt
          wrote on last edited by
          #4

          hi,
          sorry i forget som information.
          the problem exist overall in my program.
          greetigns

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sgtHartman88
            wrote on last edited by
            #5

            Hi,
            i think that you had only to set the value Qt::NoFocus in the focusPolicy property of your QPushButtons.

            Take a look at this "page":http://qt-project.org/doc/qt-4.8/qwidget.html#focusPolicy-prop, this will be helpful.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Kaluss
              wrote on last edited by
              #6

              Currently I got the same issue.
              When I set QPushButton::setCheckable(true);
              each button after clicking is highlighted, but if i set it to false highlighted is only button on which is currently mouse pointer.
              Does anybody know how to completly block that highlight?
              I have set also QPushButton::setFocusPolicy(Qt::No Focus), but problem still occurs
              Please help.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Devopia53
                wrote on last edited by
                #7

                Hi,
                You can use the setAutoDefault(false) and setDefault(false).

                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