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. OpenPersistentEditor(QModelIndex) not working for child indexes
Forum Updated to NodeBB v4.3 + New Features

OpenPersistentEditor(QModelIndex) not working for child indexes

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

    Hello devnet,

    I'm trying to display some QDateEdit inside a QTreeView, which uses a QSortFilterProxyModel, which in turn uses a QAbstractItemModel as source model. The delegate itself is working fine, but it would be nice to always have the editor open to be able to quickly pick a date.

    So my first guess was calling
    @QAbstractItemView::openPersistentEditor(QModelIndex)@
    on every index that has a valid QDate as it's DisplayRole. I use
    @QAbstractItemModel::match()@
    of the proxy model to get a list of those indexes and then try to open the editor for every one of them.

    However it seems to only work for indexes that are in the top level of the tree, not for their children.
    Does anyone have a clue what reason this could have? Or is there a better way to accomplish my goal?

    I would be grateful for any information.
    Thanks in advance!

    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