Results 1 to 6 of 6

Thread: Not able to see plus sign even if I pass true from hasChildren function in Qt

  1. #1
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Not able to see plus sign even if I pass true from hasChildren function in Qt

    Hi,
    I am implementing tree view, I have sub classed my model and view. initially I am populating all the top level items and I don't know how many child's are there for each top level items but I know all the top level items has a child's, so I have re-implemented hasChildren() function and pass true for all the top level items, but I am not able to see + sign for the top level items even i pass true. Please let me know the problem

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Not able to see plus sign even if I pass true from hasChildren function in Qt

    Have you tried your model with the standard tree view?
    Have you tried your view with an existing tree model, e.g. QFileSystemModel?

    Cheers,
    _

  3. #3
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Not able to see plus sign even if I pass true from hasChildren function in Qt

    I have customized my view and model both.

    re implemented QTreeView & QAbstractItemModel.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Not able to see plus sign even if I pass true from hasChildren function in Qt

    Yes, you already wrote that.

    Cheers,
    _

  5. #5
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Not able to see plus sign even if I pass true from hasChildren function in Qt

    Have you tried your model with the standard tree view?
    Have you tried your view with an existing tree model, e.g. QFileSystemModel?
    I have tried my model with Qtreeview and my view with QStandardItemModel. I could see same result.

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Not able to see plus sign even if I pass true from hasChildren function in Qt

    So if you have a QStandardItemModel, you are not seeing any expand indicators either?

    Just to verify: using that model with a QTreeView works, right?

    Cheers,
    _

Similar Threads

  1. How to pass a QML ListModel to C++ function
    By cmessineo in forum Newbie
    Replies: 3
    Last Post: 29th May 2015, 12:04
  2. Pass a QIcon as an argument to a function
    By aguleo in forum Newbie
    Replies: 1
    Last Post: 29th January 2014, 19:47
  3. pass member function as argument int template function
    By bibhukalyana in forum General Programming
    Replies: 1
    Last Post: 12th March 2013, 08:05
  4. Replies: 14
    Last Post: 1st December 2009, 21:45
  5. How to pass a QComboBox to a function?
    By Ricardo_arg in forum General Programming
    Replies: 4
    Last Post: 9th March 2008, 23:16

Tags for this Thread

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.