Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QStandardItem setCheckable(true) dosn't save checkbox state

QStandardItem setCheckable(true) dosn't save checkbox state

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    umen242
    wrote on last edited by
    #1

    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());
    items.at(1)->setCheckable(true);
    m_model->insertRow(0,items);@

    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 .

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stima_ua
      wrote on last edited by
      #2

      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 )
      @

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved