Results 1 to 8 of 8

Thread: QTableWidget Bug : can't remove row !

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    May 2009
    Posts
    28
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default

    Hello
    thnaks for your responses

    this is my code :

    here , a QPushButton to run the action :

    Qt Code:
    1. void AcheterMed::on_suppMed_clicked()
    2. {
    3. pieces->removeRow(pieces->currentIndex().row());
    4. }
    To copy to clipboard, switch view to plain text mode 

    pieces is my QTableWidget , i add items in with this code :

    Qt Code:
    1. void AcheterMed::on_valider_clicked()
    2. {
    3. item1->setText(numero->text());
    4. item2->setText(libelle->text());
    5. item1->setFlags(Qt::ItemIsEditable);
    6. item2->setFlags(Qt::ItemIsEditable);
    7. int j = pieces->rowCount();
    8. for(int i=0;i<nbrePieces->text().toInt();i++)
    9. {
    10. pieces->insertRow(j + i);
    11. pieces->setItem(j + i,0,item1);
    12. pieces->setItem(j + i,1,item2);
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 

    and i have no others slots !
    i still have the same problem

    n.b : i want to remove the row selected from pieces , pieces is set to singleselections + selectrows .

    this is all !

    thanks again

    i had also the same problem with clearContents() of my QTableWidget , but i use setRowCount(0) , and it's working
    Last edited by wysota; 15th May 2009 at 17:01. Reason: Posts merged

Similar Threads

  1. remove node in xml file
    By mattia in forum Newbie
    Replies: 1
    Last Post: 6th March 2008, 13:25
  2. QComboBox in QTableWidget : display troubles.
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 23:29
  3. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  4. Replies: 6
    Last Post: 5th March 2006, 21:05
  5. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 08:58

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.