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. Sub class QAbstractProxyModel
Forum Updated to NodeBB v4.3 + New Features

Sub class QAbstractProxyModel

Scheduled Pinned Locked Moved General and Desktop
subclassingqabstractproxym
2 Posts 2 Posters 996 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.
  • S Offline
    S Offline
    sachi
    wrote on last edited by
    #1

    Hi, I am trying to subclass proxymodel to add one more column to model other than columns exists on database table. i need model editable. what function i must implement to achieve this. i already try to do it but model is not editable.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      For item to be editable you would implement flags() in your model and make sure the returned flag set contains Qt::ItemIsEditable. You'd also need to implement the setData() method and handle Qt::EditRole in the data() method.

      For the columns from the database just return the base implementation of these methods and provide override only for your extra column.

      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