Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QStandardItem can only store text?



  • Hi!

    I'm trying to use a QStandardItemModel and feed it with QStandardItems: I need bool and QString values.

    From the docs, the constructor of QStandardItem is

    @QStandardItem::QStandardItem (const QString & text)@

    and therefore I don't know whether it's possible to store those boolean values in this class.

    The goal is to use the model with a QDataWidgetMapper with two QLineEdit and one QCheckBox.

    Any hint?

    Thank you very much!

    David



  • @virtual void setData ( const QVariant & value, int role = Qt::UserRole + 1 )@


Log in to reply