Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved QTreeView click problem

    General and Desktop
    2
    2
    397
    Loading More Posts
    • 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.
    • M
      MLGDN last edited by

      I use QTreeview with QStandardItemModel. for some reason I used a stylesheet to hide branch image, and set QStandardItem Icon with mine. I connect clicked(QModelIndex) signal with sltOnItemClicked(QModelIndex index) function to solve the expand and collapse problem. Displaying checkboxes is also needed, I do not use follow code connect(model, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(onItemChanged(QStandardItem*)));, as it caused my program crash, so I deal it in sltOnItemClicked(QModelIndex index) function. my problem is how to know the mouse click on the checkbox, then I can deal with these issues separately.

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        I think you can hookup to QAbstractItemModel::dataChanged
        and check the "checkbox" state there.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post