Results 1 to 13 of 13

Thread: inserting a row in a QTableWidget doesn t work!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default inserting a row in a QTableWidget doesn t work!

    Hi everybody,
    i want to insert a row in QTableWidget with a buttonclick.

    Qt Code:
    1. class CoordinateTable:public QTableWidget
    2. {
    3. Q_OBJECT
    4. public:
    5. CoordinateTable(QWidget *parent=0);
    6.  
    7. private slots :
    8. void addrow();
    9.  
    10. };
    11.  
    12.  
    13. CoordinateTable::CoordinateTable(QWidget *parent)
    14. : QTableWidget(parent)
    15. { setColumnCount(2);
    16. setRowCount(2);
    17. };
    18. void CoordinateTable::addrow()
    19. {
    20. int row = CoordinateTable::rowCount();
    21. CoordinateTable:: insertRow(row);
    22.  
    23. };
    To copy to clipboard, switch view to plain text mode 

    In main

    Qt Code:
    1. ....
    2. CoordinateTable *tableWidget = new CoordinateTable;
    3. QObject::connect(okbutton, SIGNAL(clicked()),
    4. tableWidget ,SLOT(addrow()));
    To copy to clipboard, switch view to plain text mode 
    okbutton is a QT4 QPushButton.
    Nothing happens when i click the button and i dont understand why.
    Last edited by adonis; 28th April 2007 at 09:11. Reason: spelling error

Similar Threads

  1. Problem inserting in QTableWidget
    By DPinLV in forum Qt Programming
    Replies: 2
    Last Post: 2nd August 2006, 00:10

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.