Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    CheckBox in QAbstractItemModel while using QStyledItemDelegate in the view

    General and Desktop
    1
    1
    800
    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.
    • F
      farcat last edited by

      I might be missing something obvious, but i have the following problem:

      I am using QStyledItemDelegate to make treeview cells editable. Sometimes the field to edit is boolean and i use a QCheckBox. I also use the CheckStateRole in the QAbstractItemModel to show a checkbox when not editing.

      What happens is that when not editing everything is fine, but when editing the editable checkbox is placed next to the QAbstractItemModel checkbox, instead of replacing it or painting over it or whatever. I's like to use the delegate for editing of the checkbox for consistency sake.

      I would like to solve this elegantly, if possible, not make an exception only for boolean values.

      Cheers, Lars

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