Results 1 to 2 of 2

Thread: Adding rows to Tableview

  1. #1
    Join Date
    Apr 2009
    Posts
    206
    Thanks
    34
    Thanked 2 Times in 2 Posts

    Default Adding rows to Tableview

    Hello friends,

    how can I add a row to a QTableview which is connected to a QSqlTabelmodel.

    That means that I want to right click the Tableview, a contextmenu is open and I choose for example <add row> after filling fields I submit (on manual submit).

    What are the steps to the target....

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Adding rows to Tableview

    Implement the context menu, assign an action to it, connect it to a slot where you will open a dialog to fill in the data, then call insertRecord() on the model and submit.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    codeman (5th October 2009)

Similar Threads

  1. adding rows to tablewidget
    By reshma in forum Qt Programming
    Replies: 4
    Last Post: 12th March 2009, 13:40
  2. TableView + SqlQueryModel: can't insert or edit rows
    By jiveaxe in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2008, 21:55
  3. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  4. Removing rows
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2007, 16:54
  5. Replies: 2
    Last Post: 12th June 2007, 17:23

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.