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. CheckBox in QTableView with custom model
Forum Updated to NodeBB v4.3 + New Features

CheckBox in QTableView with custom model

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 584 Views 2 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.
  • HarbH Offline
    HarbH Offline
    Harb
    wrote on last edited by Harb
    #1

    Hi!

    I am creating my custom model for QTableView. I want one column to be checkable. I have implemented
    flags function:
    if (index.column()==0) return QAbstractTableModel::flags(index)|Qt::ItemIsUserCheckable|Qt::ItemIsEditable;
    also I have implemented data funtion:
    else if (role==Qt::CheckStateRole)
    {
    if (index.column()==Name) return Qt::Checked;
    }

    But i still don't see checkboxes in QTableView in my "Name" column. Any ideas?

    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