Results 1 to 7 of 7

Thread: Customizing QTreeview/QTreeWidget

  1. #1
    Join Date
    Jul 2011
    Location
    Pune, India
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Customizing QTreeview/QTreeWidget

    Hi All,
    I am looking to customize the QTreeWidget in way that the arrows pointing to the branching can be shown on right side.
    Thought the items in QTreeWidget will be from left to right in orientation.
    Read a post where one can not just use paint for QTreeWidget.
    Need all the help i can get.
    Thanks!
    Last edited by wysota; 12th January 2012 at 11:48. Reason: reformatted to look better

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Customizing QTreeview/QTreeWidget

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    ommharidaas (19th January 2012)

  4. #3
    Join Date
    Jul 2011
    Location
    Pune, India
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizing QTreeview/QTreeWidget

    Quote Originally Posted by wysota View Post

    Hi Wysota,
    Thanks for putting me in a right direction. Have implemented QTreeView::drawRow().
    A small hick-up though.
    Is there any way to find out which brach of the tree has sub-trees??
    Need little insight.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Customizing QTreeview/QTreeWidget

    Query the model for it and/or use the information provided in QStyleOptionViewItem object.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    ommharidaas (20th January 2012)

  7. #5
    Join Date
    Jul 2011
    Location
    Pune, India
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizing QTreeview/QTreeWidget

    Quote Originally Posted by wysota View Post
    Query the model for it and/or use the information provided in QStyleOptionViewItem object.

    Wysota,
    I could not find any information (methods that can be used) on QStyleOptionViewItem object. I guess its only meant for increasing the aesthetics of the widget. Please enlighten me with what all can be achieved with QStyleOptionViewItem object.
    Though i was able to accomplish wat i was tryin to achieve... (Thnx to ur previous post).
    Cheers to Qt!
    Last edited by ommharidaas; 20th January 2012 at 09:02. Reason: updated contents

  8. #6
    Join Date
    Jul 2011
    Location
    Pune, India
    Posts
    21
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customizing QTreeview/QTreeWidget

    Quote Originally Posted by ommharidaas View Post

    Wysota,
    I could not find any information (methods that can be used) on QStyleOptionViewItem object. Though i was able to accomplish wat i was tryin to achieve... (Thnx to ur previous post).
    Cheers to Qt!

    Hi Wysota,
    Also, on second thoughts, I wanted to ask you whether this sort of customization is achievable using style sheets alone??
    Please help.

  9. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Customizing QTreeview/QTreeWidget

    I don't think so. And please stop using this ugly large blue font in your posts.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. The following user says thank you to wysota for this useful post:

    ommharidaas (30th January 2012)

Similar Threads

  1. QCombobox with QTreeView/QTreeWidget
    By swiety in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2011, 19:27
  2. Customizing QTreeWidget and QTreeWidgetItem
    By mots_g in forum Qt Programming
    Replies: 0
    Last Post: 18th August 2010, 06:53
  3. Filling QTreeWidget / Using QTreeView
    By stefanborries in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2009, 15:25
  4. QTreeWidget or QTreeView ?
    By vieraci in forum Qt Programming
    Replies: 3
    Last Post: 7th November 2007, 09:31
  5. QTreeView / QTreeWidget
    By morty in forum Qt Programming
    Replies: 4
    Last Post: 8th October 2006, 00:40

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.