Important: Please read the 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!


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

Log in to reply