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. SetEnable(false) is making the widget dim in color
QtWS25 Last Chance

SetEnable(false) is making the widget dim in color

Scheduled Pinned Locked Moved General and Desktop
9 Posts 6 Posters 4.0k 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
    Dcqt
    wrote on last edited by
    #1

    Hi,

    i am using the setEnable(false) on widget and pushbuttons
    its is disabling the keyboard but the image on pushbutton gets dimmed ( mean becoming color less.).

    how to avoid that.

    i want to disable the keyboard, yet retain the image color as it is.

    please help.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You can "install an event filter":http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#installEventFilter on a button and inside the eventFilter method discard any keyboard and mouse events.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        Am I the only one that sees a lot of effort going into making UIs do things that people do not expect? The reason the widget is dimmed is a visual indicator that the user cannot interact with it before they go an click on it five times, question whether it's not working because of something they have done, before finally deciding that it's just broken/not meant to be used. Such indications have been standard for a long time for a reason.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DerManu
          wrote on last edited by
          #4

          [quote author="ChrisW67" date="1367012948"]Am I the only one that sees a lot of effort going into making UIs do things that people do not expect?[/quote]

          Absolutely agree. Same reason why people like stylesheets and create their own skins: No taste and no Idea what usability and consistency is good for. //EDIT: Now that I think of it, QML is the peak of this abominable mindset.

          1 Reply Last reply
          0
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            It's hard not to agree, but I've met with so much weird expectations on both - developers and users side that I don't even bother to question sometimes.

            To name some - "why can't I click anything under this window" when working with a modal dialog or "It's obvious to me that tab should accept my choice like enter does" when selecting a value from a combo, or my favorite: "I don't like this progress bar. the app is just slowed down by drawing it while it should be downloading" - thoughts on a dialog downloading 1Gb file over a few kbps connection.

            I've come to think it's actually better to let people learn the hard way by shooting themselves in a foot. This way after 10 or 15 iterations of bad practices and some pissed off users they have a nice little epiphany that they don't actually know better sometimes and that standards and well established practices are good :) Otherwise it's a discussion with "what do you mean this yellow text on a pink button is bad? I want my app to pop!".
            The price obviously being the amounts of poorly designed software out there.

            And then there are those one-in-a-million occasions when it's actually good or more intuitive to break the rules too so... I'm not judging OP.
            It would be nice if he could tell us what is the actual use-case here, so we could go "ohhhh, I see now" :)

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

              Very interesting discussion. :)

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

              1 Reply Last reply
              0
              • S Offline
                S Offline
                Sam
                wrote on last edited by
                #7

                I too had a "similar":http://qt-project.org/forums/viewthread/26093/ kind of requirement and ended up changing the color of the widget when disabled but keeping the same style.

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

                  [quote author="Sam" date="1367058677"]I too had a "similar":http://qt-project.org/forums/viewthread/26093/ kind of requirement and ended up changing the color of the widget when disabled but keeping the same style.
                  [/quote]

                  Sam, you are completely right there might be valid reasons for such a request. Sometimes it would be good to enlighten the community with a bit more detail for understanding the basis of a request. :-)

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

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    Sam
                    wrote on last edited by
                    #9

                    [quote author="koahnig" date="1367237043"]Sometimes it would be good to enlighten the community with a bit more detail for understanding the basis of a request. :-) [/quote]

                    Yes I do agree with that, for me the requirement was simple. I just wanted to change the look of the widget when disabled.

                    Unprocessed items:
                    !http://img221.imageshack.us/img221/1110/gps1v.jpg(enable combo)!

                    Processed Items:
                    !http://img526.imageshack.us/img526/88/gps2x.jpg(disable combo)!

                    I had a requirement where i used a listview to display processed/unprocessed items. If the item is not processed the user is allowed to change/select the items from comboBox,lineEdits whereas for processed items the combobox,lineEdits are disabled.

                    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