hello,
how to select an element in a QComboBox programatically and prevent users from changing the selection, whithout setting the QComboBox desabled.
thanks
hello,
how to select an element in a QComboBox programatically and prevent users from changing the selection, whithout setting the QComboBox desabled.
thanks
I'd say that preventing the selection from changing without disabling the combo box will just confuse your users. Adding a non-selectable item amongst other selectable items is a different story.
J-P Nurmi
actually, the QComboBox is in a dialog box used in diffirent situations, and sometimes I would really give a unique choice to prevent errors.
It's hard to suggest anything concrete with this amount of background information, but have you considered any other UI components for solving the problem? You know, there are many ways to express "selection", perhaps combo box isn't the best possible choice in this case. Many times this is the case when one has to start customizing functionality of readily available widgets. In worst case the widget loses its intuitivity...
J-P Nurmi
the component here is constraint by the available dialog box space => QComboBox is suitable ?have you considered any other UI components for solving the problem? You know, there are many ways to express "selection"
that's the case.this is the case when one has to start customizing functionality of readily available widgets
thanks.
You could set a custom model for your combo box. Then you can return the appropriate flags.
Ok, let's say it is. But combo box is also a well known and widely accepted UI component. People expect it to behave in a certain way. What's the problem with disabling it? That's the normal way of preventing selection... But making it semi-disabled in the sense that you can pop up the view but you still can't change the selection will most likely just confuse end-users, because that's not what people are used to.
Sure it's possible. There's a solution somewhere on this forum. But the question is... is it really a sensible thing to do?![]()
J-P Nurmi
Bookmarks