Results 1 to 3 of 3

Thread: how to get complete row from qtable widget?

  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default how to get complete row from qtable widget?

    Im performing search operation on a tablewidget.(using search key)
    Highlighted found key in the table widget.
    Now i want to update the table, which contains only those rows which has search key.

    Now i already highlighted the found search key, but i'm unable to fetch whole row which contains the search key.
    Please tell me how can i get that particular row, which contain that search key?
    Qt Code:
    1. QString SearchKey=ui->lineEdit_key->text();
    2. QList<QTableWidgetItem *> LTempTable =temp->findItems(SearchKey,Qt::MatchExactly);
    3.  
    4.  
    5. cout<<"the matched count:"<<LTempTable.count()<<endl;
    6. foreach(rowPtr,LTempTable)
    7. {
    8. rowPtr->setBackground(Qt::red);
    9. int rowNo=temp->row(rowPtr);
    10. cout<<"THE ROW NUMBER IS:"<<rowNo<<endl; <-----getting row number but how can i get complete row?
    11.  
    12. }
    13. }
    To copy to clipboard, switch view to plain text mode 

  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: how to get complete row from qtable widget?

    rowPtr contains the row data for each row found. Just ask it for the data you want.
    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. #3
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to get complete row from qtable widget?

    Ok thanks ..

Similar Threads

  1. QTable Widget
    By kavinsiva in forum Newbie
    Replies: 5
    Last Post: 23rd October 2009, 13:50
  2. problem with QTable Widget
    By navi1084 in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2008, 06:09
  3. QTable Widget
    By csvivek in forum Qt Programming
    Replies: 2
    Last Post: 12th May 2008, 13:37
  4. QTable widget works slow :(
    By THRESHE in forum Qt Programming
    Replies: 3
    Last Post: 27th February 2008, 12:54

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.