Results 1 to 2 of 2

Thread: How to insert the blank row in table widget when click push button

  1. #1
    Join Date
    Jul 2019
    Posts
    9
    Qt products
    Qt5
    Platforms
    Windows

    Question How to insert the blank row in table widget when click push button

    I created table widget, 3 rows and 6 columns using qt creator GUI, and it is placed on certain area of my GUI. Now, i want to insert blank row as 4th, 5th, 6th row continuously. I made slot to that push button, but i do not know what code i should use for it. Can anyone help me?
    1.JPG

    I tried this code, but it is not working. pushbutton_12 is the add button name.

    void MainWindow:n_pushButton_12_clicked()
    {
    int i = ui->tableWidget->rowCount();
    ui->tableWidget->insertRow(i);

    }

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to insert the blank row in table widget when click push button

    What aspect of it is "not working"? The button slot is never called, a new row is not added, the new row is not added at the end...

Similar Threads

  1. Push Button Right Click implementation
    By RSK in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2018, 17:33
  2. push button on specific places of man widget
    By sanjeet in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2011, 04:37
  3. Replies: 1
    Last Post: 21st April 2011, 09:36
  4. Replies: 4
    Last Post: 4th February 2008, 06:16
  5. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40

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.