Reputation: 3444
How do you use the QTable object. I have searched the internet and the examples don't really seem to make sense. Do you just create a new row within the extended class. It all seems fussing. How do you retreive, edit and delete rows. Is there any extensions that could be used like
QRowObject *row = table->add("Main Title");
row->addSubColumnText("Second column");
otherRow = table->getRowByIndex(table->selectedIndex);
otherRow.remove;
How would any implement that?
Any extra information needed just ask.
Upvotes: 1
Views: 2328
Reputation: 41812
QTable is pretty old. You might be looking for QTableWidget. If you want to get into the whole 'Model-View' arch thing, look into QTableView.
// inside e.g. a QMainWindow, parent could be 'this'
QTableWidget *widget = new QTableWidget(parent);
// add to layout etc, then:
QStringList headerLabels;
headerLabels << "First Column" << "Second Column";
widget->setHorizontalHeaderLabels(headerLabels);
// here you would add data, then:
widget->removeRow(table->currentRow());
Upvotes: 3