Results 1 to 10 of 10

Thread: selectRow()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8

    Question selectRow()

    I need an advise...
    I need a widget that would go throug the whole model and do some comparing with items in it...then when comparing passes I need to select a row on which the item is...
    So I wrote this code:

    Qt Code:
    1. if(model->rowCount()){
    2. for(int row=0; row<model->msgList.size();++row){
    3. const QVcaCanMsg &msg = model->msgList.at(row);
    4. if((msg.id()==id) && (msg.flags()==flags)){
    5. msgLogView->selectRow(row);
    6. }
    7. }
    8. }
    To copy to clipboard, switch view to plain text mode 

    But the problem is that it selects one after another so only the last item that passes the comparing stays selected in a view...
    Is there any way how to make it so ALL items that pass the comparing will get selected ?
    Thanks
    Last edited by gyre; 11th December 2007 at 20:42. Reason: updated contents

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
  •  
Qt is a trademark of The Qt Company.