Hi there,
I would like to display some text data from a model.
As mentioned in "books" or "combowidgetmapper" demo QLineEdit works just out of the box:
...
...
mapper->setModel(model);
mapper->addMapping(nameEdit, 0);
...
QLineEdit nameEdit;
...
mapper = new QDataWidgetMapper(this);
mapper->setModel(model);
mapper->addMapping(nameEdit, 0);
To copy to clipboard, switch view to plain text mode
Because I just want to display the text I'm willing to use QLabel instead.
How do I have to derive QLabel that I can use it as QLineEdit
MyLabel namelabel;
...
mapper->setModel(model);
mapper->addMapping(nameLabel, 0);
MyLabel namelabel;
...
mapper = new QDataWidgetMapper(this);
mapper->setModel(model);
mapper->addMapping(nameLabel, 0);
To copy to clipboard, switch view to plain text mode
Or in other words why is the signal setText() not enough for QWidgetMapper
regards
Bookmarks