Important: Please read the Qt Code of Conduct -

QStandardItem setCheckable(true) dosn't save checkbox state

  • i have simple QStandardItemModel that holds the date to show in QTreeview
    when i set one off the columns with :
    @items.insert(1,new QStandardItem());>setCheckable(true);

    then i check the checkbox , and close the QDialog that holds the Qtreeview .
    when i open the QDialog box again the state dosn't saved . i dont build it again , all the other columns that are text
    are saved in the view .
    what im doing wrong , i dont what to loop and save the states over and over .

  • you need set check state by dafault.

    void QStandardItem::setCheckState ( Qt::CheckState state )

    this is just only say that user can change state
    void QStandardItem::setCheckable ( bool checkable )

Log in to reply