We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in ViewModelBase.cpp:
struct ViewModelBase::ViewModelBaseImpl { ViewModelBase* model{nullptr}; std::unique_ptr<ViewItem> root; ViewModelBaseImpl(ViewModelBase* model) : model(model) {} bool item_belongs_to_model(ViewItem* item) { return model->indexFromItem(item).isValid() || item == model->rootItem(); } }; QModelIndex ViewModelBase::indexFromItem(const ViewItem* item) const { return item && item->parent() ? createIndex(item->row(), item->column(), const_cast<ViewItem*>(item)) : QModelIndex(); }
How can we prove that an item(ViewItem) belongs to the current model(ViewModelBase).
if item is from another model, indexFromItem also return valid QModelIndex.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
in ViewModelBase.cpp:
How can we prove that an item(ViewItem) belongs to the current model(ViewModelBase).
if item is from another model, indexFromItem also return valid QModelIndex.
The text was updated successfully, but these errors were encountered: