Results 1 to 2 of 2

Thread: [4.6] QTreeView Clicked() signal returns column specific data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default [4.6] QTreeView Clicked() signal returns column specific data

    Hi all!

    I am using a QTreeView whith 5 columns. The first one, labelled id contains a number. This number is used to retrieve information in an database. So I use the clicked signal : when I click on a line on the qtreeview, I can access the data I have clicked on (index.data(0)). But this behaviour forces me to click on the id column to get the information related to this line. Indeed, if I click any other column, a unrelevant qstring is catched and I can't use it to retrieve info in the db.

    What I would like is that whatever the column I click on, it returns me the value stored in the first column.

    I have seen row function but it is not suitable here as I use a QSortFilterProxyModule so if I filter the model, the row column isn't the right value.


    Thanks
    Last edited by Guilo; 22nd January 2010 at 22:14.

Similar Threads

  1. How to get all column data on row clicked
    By wirasto in forum Qt Programming
    Replies: 7
    Last Post: 9th November 2009, 05:21
  2. signal mapping on pushbutton signal clicked
    By wagmare in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2009, 07:54
  3. Strange error: doc.setContent(data) returns false
    By jiveaxe in forum Qt Programming
    Replies: 3
    Last Post: 9th January 2009, 01:38
  4. Emit clicked( QModelIndex &) from a QTreeView?
    By Ran in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2008, 04:42
  5. How to find which column clicked from a treeview.
    By mekos in forum Qt Programming
    Replies: 2
    Last Post: 4th August 2008, 16:44

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.