Results 1 to 4 of 4

Thread: traversing tree using mouse clicks

  1. #1
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default traversing tree using mouse clicks

    Hi I am very much new to Qt frame. one reason i need to program in Qt is due to project requirements and the other is due to my love for open source movement

    presently i need to show some data in a tree view. i used the simple tree model example code. i work on solaris 10.
    but the project requirement demands the tree traversal using mouse clicks.
    i will be great full if some body can send some code snippets which i can plug into the main stream with minor tweakings. thanks in advance.

    also i want to know how is there any function to give intelligence for the fetching the model index of its level?

    regards,
    krishna.

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

    Default Re: traversing tree using mouse clicks

    What do you mean by "traversal using mouse clicks"?

    And what kind of intelligence do you mean? Could you provide more details?

  3. #3
    Join Date
    Dec 2006
    Posts
    18
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: traversing tree using mouse clicks

    Thanks for the reply. i mean that if i double click or right click on any one of the rows how should the current row know that it has to fetch and display a particular column.

    Also how to display a image before a row. i already have seen some similar query but was unable to comprehend it well.

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

    Default Re: traversing tree using mouse clicks

    Quote Originally Posted by krishna.bv View Post
    Thanks for the reply. i mean that if i double click or right click on any one of the rows how should the current row know that it has to fetch and display a particular column.
    Connect to the doubleClicked() signal of your tree.

    Also how to display a image before a row.
    Set the image as the Qt::DecorationRole data piece for the item.

Similar Threads

  1. how to display full tree item name on mouse move ?
    By rajesh in forum Qt Programming
    Replies: 5
    Last Post: 15th November 2006, 08:41
  2. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13
  3. Replies: 3
    Last Post: 29th August 2006, 15:07
  4. Replies: 2
    Last Post: 24th July 2006, 18:36
  5. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25

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.