Results 1 to 4 of 4

Thread: QTreeWidget::findItems only searches top level items ?

  1. #1
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeWidget::findItems only searches top level items ?

    if I have a QTreeWidget like this one:

    "Base"
    +-"child1"
    +-"child2"

    and I use QTreeWidget->findItems ( QString ( "child" ), Qt::MatchContains )
    it will return an empty list. If I search for "ba" in the same tree it correctly returns a list with one item (the "Base" item).

    if I put more than the "Base" item to the same level I also can search for it... but no childs.

    is this behavior right or did I use findItems wrong ?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget::findItems only searches top level items ?

    Try using the combination of "Qt::MatchContains | Qt::MatchRecursive" as flags.

  3. The following 3 users say thank you to jpn for this useful post:

    eelik (10th February 2008), krisha (7th March 2006), melon (14th September 2012)

  4. #3
    Join Date
    Feb 2006
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTreeWidget::findItems only searches top level items ?

    thanks worked didn't see the flag and wondered an hour ...

  5. #4
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeWidget::findItems only searches top level items ?

    Add Qt::MatchRecursive Flag

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.