Important: Please read the Qt Code of Conduct -

Search in QTreeWidget with QCompleter

  • Hello,

    I'd like to make a global search on items of a QTreeWidget, just like QTreeWidget::find() does it.
    However, I'd like to use a QCompleter to display the results of the search.

    Using QCompleter::setModel(treeWidget->model() ) let you work on a branch of the tree, not on the complete tree.
    The "Tree Model Completer Example" requires to define the path to the item. It doesn't provide a global search.

    Is there an elegant and existing solution ? (did I missed something in the documentation?)

    Thanks in adavance

Log in to reply