I have a QTableView with data in it. What is the easiest way to add a string?
Thanks!
QTableView is model-based, if you donβt know which model, then I suggest you read here .
Using a QTableWidget instead is a lot easier for beginners, and you can add a row just like this.
ui->tableWidget->insertRow(0);
As you use som YourModel to show it in YourTableView (QTableView), follow these steps:
YourModel->insertRow(YourModel->rowCount(QModelIndex())); // paste some data to new row
Updating a model causes a view update.
Source: https://habr.com/ru/post/1442696/More articles:JSF 2 equivalent of IBM hx: scriptCollector postRender - jsfPixel-by-pixel animation with javascript - javascriptHow to pass a vector parameter to the OpenCL core in C? - cWhy can't I use the same Span to install twice twice? - androidfailed to initialize opencl vector literal - openclUnable to switch to Golo Dark's theme - androidSort order guarantee for the key argument (value) of the CouchDB reduction function? - couchdbOverride Sharepoint 2010 css with your own css - cssSQLite Unable to add more than 1000 lines - iosClient sent invalid Host header - apacheAll Articles