Results 1 to 5 of 5

Thread: removing of selected rows

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    72
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60
    Thanks
    3
    Thanked 4 Times in 4 Posts

    Thumbs up removing of selected rows

    Hello everyone ........
    I have a problem that I wana remove selected row from Q3Table but whenever i remove it , there remains one selected row.............
    I don't know what mistake I m doing ????
    My code is as following ......
    Qt Code:
    1. void dlgCreateplaylist::pbRemove_clicked()
    2.  
    3. {
    4.  
    5.  
    6.  
    7. int flag=0;
    8.  
    9. numberFrame1=0,numberFrame2=0,numberFrame3=0;
    10.  
    11. pbSelectall2->setText("Select All");
    12.  
    13. int checked[25],index=0;
    14.  
    15.  
    16.  
    17. /******************************************************
    18.  
    19.   *check the row number in table2 is checked or unhecked and remove*********
    20.  
    21. ******************************************************/
    22.  
    23. Q3CheckTableItem *pb1 = new Q3CheckTableItem(Table2, " ");
    24.  
    25. for(int r=0;r<Table2->numRows();r++)
    26.  
    27. {
    28.  
    29. pb1=(Q3CheckTableItem *) Table2->item(r,0);
    30.  
    31. if(pb1->isChecked())
    32.  
    33.  
    34. {
    35.  
    36.  
    37.  
    38. checked[index++]=r;
    39.  
    40.  
    41.  
    42. Table2->removeRow(r);
    43.  
    44.  
    45. qDebug()<<"value of Index"<<index;
    46.  
    47. r=r-1;
    48.  
    49. flag=1;
    50.  
    51. flags=0;
    52.  
    53. }
    54.  
    55.  
    56.  
    57. }
    58.  
    59.  
    60. if(flag==0)
    61.  
    62. {
    63.  
    64. QMessageBox::information( this, "Createplaylist","Select the Media item to Deleted.");
    65.  
    66. }
    To copy to clipboard, switch view to plain text mode 

    Please if anyone can do something I'll apperciate his reply........Thanx in advance
    Last edited by jpn; 9th June 2008 at 09:15. Reason: missing [code] tags

Similar Threads

  1. Remove selected rows from a QTableView
    By niko in forum Qt Programming
    Replies: 4
    Last Post: 3rd March 2016, 13:49
  2. iterating selected rows in a qtableview
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2008, 15:29
  3. Removing rows
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2007, 17:54
  4. Showing selected rows in a separate table
    By dnnc in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2007, 17:35
  5. Get list of selected rows from QTableView
    By jnk5y in forum Qt Programming
    Replies: 8
    Last Post: 17th February 2006, 17:59

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.