Qt Code:
  1. Qt::CheckState state = static_cast<Qt::CheckState>(index.data(Qt::CheckStateRole).toInt());
  2. switch (state) {
  3. case Qt::Checked:
  4. // do stuff
  5. break;
  6. case Qt::Unchecked:
  7. // do other stuff
  8. break;
  9. case Qt::PartiallyChecked:
  10. // you might have these too
  11. break;
  12. }
To copy to clipboard, switch view to plain text mode 
This only tells you the check state of the item the user clicked on, not any others in the tree. If you want the check state of everything in the tree then you need to iterate over the entire tree to look at each.