Important: Please read the Qt Code of Conduct -

[SOLVED] QTreeView mark item as expandable

  • Hi everybody
    I have problem with by treemodel. I have item without child in my tree but I want see it with plus [+]
    because I want to feel it after user click I am implement method canFetchMore that always return true, but it's not help

    thank you for help

  • implementation of method
    @bool hasChildren(const QModelIndex &parent);@
    do not help too

  • Tree item class should override method childCount

    @int QDBTreeItem::childCount() const {
    return Opened ? childItems.count() : 1;

Log in to reply