Difference between disabled and read only?


Could you give me some advice about these read only and disabled states of components; what are the differences? I think that I understand the disable-function, but the read only is somewhat unclear.


Mr. Enabled Disabled

Disabled means “no ui events at all” and read-only means “no ui data modification events”. In practice: nothing… ?

It depends on the component if the difference makes sense.
Take table for instance: in read only mode you can still scroll, but you can’t select - so you can read it, but not change it. A disabled table can’t even be scrolled - it’s really disabled.
Often the difference is visual: a read only component is still clearly visible - and readable - while disabled components really look disabled.

Again: with some component this is more useful, others not so much…

Is there a list how the default components work on this. Or should I check the behavior my self? How?

Well, one easy and visual way is to try it out in the Featurebrowser (open the ‘properties’ -panel, and check/uncheck readonly and enabled, the click ‘set’).

But usually knowing this is enough: disabled components are grayed out, read-only components are not. Also: enabled/disabled is usually what you want, read-only is less useful (imo).

I think this illustrates what I meant when I said it makes more sense for some components:
What is a read-only Label? The user can’t change the Label anyway, so it does not get any more read-only even if you try :wink: Enable does gray the Label, which is useful sometimes, but it’s pretty disabled to begin with, in the sense that the user can not change it in any way…

For TextField, on the other hand, both read-only and enabled do useful things…

Hope this clears things up a little…