Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
SetEnable(false) is making the widget dim in color
Dcqt last edited by
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.
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.
ChrisW67 last edited by
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.
DerManu last edited by
[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.
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" :)
koahnig last edited by
Very interesting discussion. :)
Sam last edited by
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.
koahnig last edited by
[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.
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. :-)
Sam last edited by
[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.
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.