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. Bug when customizing QPushButton?
QtWS25 Last Chance

Bug when customizing QPushButton?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.8k 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
    bovilexic
    wrote on last edited by
    #1

    Folks -

    I am customizing QPushButton widgets, via setting the style sheet in Designer. I have found that doing so results in the bottom half (or so) of the button becoming insensitive to mouse clicks, but only on the Mac version of Qt (4.7.4). In my case, the buttons are checkable.

    The stylesheet entry for the push buttons is taken from the Qt doc example page:

    http://doc.qt.nokia.com/stable/stylesheet-examples.html#customizing-qpushbutton

    Which looks like this:
    @
    QPushButton {
    border: 2px solid #8f8f91;
    border-radius: 6px;
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f6f7fa, stop: 1 #dadbde);
    min-width: 80px;
    }

    QPushButton:pressed {
    background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dadbde, stop: 1 #f6f7fa);
    }

    QPushButton:flat {
    border: none; /* no border for a flat push button */
    }

    QPushButton:default {
    border-color: navy; /* make the default button prominent */
    }
    @

    In fact, any customization results in this same problem. I can only presume this is some sort of a bug, but at this point I really need a workaround. Any ideas on what I might try would be most appreciated.

    Thanks!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bovilexic
      wrote on last edited by
      #2

      Surely looks like a bug: if I add this line

      @
      margin-bottom: 8px;
      @

      Then the "hitbox" for the QPushButton is just about right. Of course it does bad things to the surrounding layout... :-(

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        Did you consider filing a bug report on "JIRA":https://bugreports.qt.nokia.com/secure/QuickSearch.jspa ?
        This will help to keep of the issue. If you do file a bug report, please make sure to post a link here.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bovilexic
          wrote on last edited by
          #4

          Thanks - bug reported: https://bugreports.qt.nokia.com/browse/QTBUG-22929

          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