[Qt-interest] In-place editing

Christopher Rasch-Olsen Raa christopher at technophile.info
Thu Oct 29 17:16:15 CET 2009


Hi,

I've got a widget that is supposed to display several fields with data, and upon the users request he / she should be able to edit same data. The data is today shown with QLabels.

What I'd like to happen is that when the user request to edit it, the fields should automatically 'convert' to something that is editable without there being too many disturbances. I have though about tqo options here:
  - having one QLabel and one QLineEdit pr field, and just alternate which is displayed according to the state one is in ('edit' / 'display' )
  - having a QLineEdit and changing style / properties on it according to current state so it displays and behaves as a QLineEdit when i edit-mode, and a QLabel when in display-mode

Both seems to me to be silly though, and I'd like to get some input and pointers on how to do this in a more elegant way.


--
Christopher




More information about the Qt-interest-old mailing list