[Interest] Revert the selection in a QTreeView

André Somers andre at familiesomers.nl
Wed Jan 14 10:25:07 CET 2015

Glenn Ramsey schreef op 14-1-2015 om 00:23:
> On 14/01/15 11:50, Nurmi J-P wrote:
>>> On 13 Jan 2015, at 22:45, Glenn Ramsey <gr at componic.co.nz> wrote:
>>> Hi,
>>> In a QTreeView how can I revert the selection?
>>> The behaviour I want is that when the user selects an item, then based on some
>>> other state, it will either accept the selection or message the user and revert
>>> to the previous selection.
>> Have you considered simply disabling such items? Then there's no need to revert anything or show annoying error messages. :)
> Yes, that might be the right solution. On the other hand, I'm not the interface
> designer.
Consider hiring one. Or at least stick to some basic design principles 
like the principle of least suprise: you don't want to leave your users 
guessing what will happen if they do something. They need confidence. 
One time just selecting an item working, and the next time throwing an 
error dialog in their face isn't exactly predictable, 
confidence-building behavior, so best avoid doing that.


More information about the Interest mailing list