Results 1 to 2 of 2

Thread: Invisible information associated with certain row in QTableWidget.

  1. #1
    Join Date
    Feb 2010
    Posts
    68
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Invisible information associated with certain row in QTableWidget.

    I'm using QTableWidget to represent data in my peer2mail client - each row stores data of one file. When user performs an action on any file (= row), for example when he pauses it, I need to know which file has been paused. Until now, each file/row had its unique id which was equal to the numer of row in which its data was stored. I've been using currentRow() function to know which file is paused/deleted/resumed. But because I want to let user sort the files by name, size etc. and remove specific file/row from the client, I can't use currentRow() function anymore, because it'll not return correct unique id, since it's no longer equal to the number of the row.
    Then what I want to do, is to assign an unique id to the file/row on its addition to the table so that if I select the row and click "pause" button the file/row id will be returned. I was wondering how to do it, I tried to make an addtional, invisible column in which each row would have its id but I don't know how to turn off the visibility.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Invisible information associated with certain row in QTableWidget.

    Quote Originally Posted by kremuwa View Post
    I tried to make an addtional, invisible column in which each row would have its id but I don't know how to turn off the visibility.
    That's the right way. See QTableView::hideColumn(). Or you also can add to every first item of your table a cutom user data and read that out. But a hidden column is the best.

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

    kremuwa (3rd August 2010)

Similar Threads

  1. Invisible characters
    By Myrgy in forum Qt Programming
    Replies: 0
    Last Post: 1st March 2010, 12:37
  2. QTableView header invisible
    By smacchia in forum Qt Programming
    Replies: 7
    Last Post: 20th November 2009, 03:21
  3. set QwtPlotCurve invisible
    By gyre in forum Qwt
    Replies: 2
    Last Post: 19th December 2007, 07:53
  4. Invisible but still active QActions
    By barnabyr in forum Newbie
    Replies: 6
    Last Post: 21st November 2006, 20:22
  5. [qt3]invisible toolbar
    By lszk in forum Qt Programming
    Replies: 2
    Last Post: 26th February 2006, 18:34

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.