QTableWidget how to add new rows automatically :)
-
In QTableWidget how can we add new rows like in C# grid view.
-
Can you show sample C# grid view code
-
You can add a new row using method "QTableWidget::insertRow":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#insertRow After that you can use "QTableWidget::setItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#setItem to set items inside the new row.
-
mmallad@
Can you remind me when you add a new row to a grid view is added to the database too? -
Ya it should be added to database.
[quote author="qxoz" date="1362115617"]mmallad@
Can you remind me when you add a new row to a grid view is added to the database too?[/quote] -
What i actually need is when you write in the cell the rows should be added automatically. So is there any way to do that. I am from .Net environment so there was that feature. Means you dont have to add row manually.
[quote author="leon.anavi" date="1362083040"]You can add a new row using method "QTableWidget::insertRow":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#insertRow After that you can use "QTableWidget::setItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#setItem to set items inside the new row.[/quote] -
In this case use QTableView with QSqlTableModel.
-
thanx :)
[quote author="qxoz" date="1362117824"]In this case use QTableView with QSqlTableModel.[/quote]