[Qt-interest] In-place editing
KC Jones
kc at asperasoft.com
Thu Oct 29 17:29:35 CET 2009
If you cannot live with QLineEdit enable/disable, you *might* consider
using a QStackedWidget to toggle between display and edit views. It
may be like swatting a fly with a cannon. But it will give you
complete freedom to provide whatever edit and presentation controls
you really want. And the screen transition will be quick, though
potentially jarring.
I suppose you could even use multiple QStackedWidgets on a per-field
basis. That could allow you to toggle the edit state field by field
without the jarring screen flicker. Fields that remain disabled will
stay put and only the activated fields will change. (I guess that
would be swatting a swarm of flies with a machine gun?)
On Thu, Oct 29, 2009 at 9:16 AM, Christopher Rasch-Olsen Raa
<christopher at technophile.info> wrote:
>
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list