Skip to content
  • 0 Votes
    4 Posts
    505 Views
    F

    An update on this from my side:

    My initial approach wasn't flawless, as @VRonin pointed out, because QAbstractItemModel::columnCount didn't return the appropriate values. I've fixed this, by not immediately passing the new count after inserting the elements to a list, of which the size was used, but instead have the model save exactly how many categories it currently accounts for, so the connection looks like this:

    connect(item_registry.get(), &item_registry::category_added, [this](int position, QSharedPointer<category>) { beginInsertColumns(QModelIndex{}, position, position); _current_category_count++; endInsertColumns(); });

    and likewise columnCount:

    int item_model::columnCount(QModelIndex const&) const { if(!_register) { qCritical() << "Item-model didn't have a register"; return 0; } return 1 /* name */ + _current_category_count; }
  • 1 Votes
    10 Posts
    4k Views
    O
    QListView {outline: none;}
  • 0 Votes
    9 Posts
    2k Views
    E

    If you mean outside of answering question here in forum, then no thank you. :)

    I am curious then if you would like to clarify related development topics.

    Do you know any higher level tools which can display structural differences between standard item models in a clear way? Have you got any experiences with “diff views” in this software area?