Hello,
I try setWidget(), and it’s work. But there is one another Problem.
If i put:
tableWidget1->setItem(0,0,nameCell);
tableWidget1->setItem(1,1,keyCell);
tableWidget1->setItem(0,0,nameCell);
tableWidget1->setItem(1,1,keyCell);
To copy to clipboard, switch view to plain text mode
it works, but if I fill two rows:
tableWidget1->setItem(0,0,nameCell);
tableWidget1->setItem(1,1,keyCell);
tableWidget1->setItem(2,0,nameCell);
tableWidget1->setItem(3,1,keyCell);
tableWidget1->setItem(0,0,nameCell);
tableWidget1->setItem(1,1,keyCell);
tableWidget1->setItem(2,0,nameCell);
tableWidget1->setItem(3,1,keyCell);
To copy to clipboard, switch view to plain text mode
the prog fuckt up if I close that.
headerLables1 << "Name"<< "Key";
tableWidget1->setRowCount( 10 );
tableWidget1->setColumnCount( headerLables1.count() );
tableWidget1->setHorizontalHeaderLabels( headerLables1 );
tableWidget1->setItem(0,0,nameCell);
tableWidget1->setItem(1,1,keyCell);
//tableWidget1->setItem(2,0,nameCell);
//tableWidget1->setItem(3,1,keyCell);
dock->setMaximumWidth( 350 );
dock->setWidget( tableWidget1 );
addDockWidget(Qt::RightDockWidgetArea, dock);
QStringList headerLables1;
headerLables1 << "Name"<< "Key";
tableWidget1 = new QTableWidget();
tableWidget1->setRowCount( 10 );
tableWidget1->setColumnCount( headerLables1.count() );
tableWidget1->setHorizontalHeaderLabels( headerLables1 );
QTableWidgetItem *nameCell = new QTableWidgetItem( "name" );
QTableWidgetItem *keyCell = new QTableWidgetItem( "key" );
tableWidget1->setItem(0,0,nameCell);
tableWidget1->setItem(1,1,keyCell);
//tableWidget1->setItem(2,0,nameCell);
//tableWidget1->setItem(3,1,keyCell);
dock = new QDockWidget(tr("Koordinaten"), this);
dock->setMaximumWidth( 350 );
dock->setWidget( tableWidget1 );
addDockWidget(Qt::RightDockWidgetArea, dock);
To copy to clipboard, switch view to plain text mode
//////////////////////////////
There is a Problem in QTableWidget.cpp. But i don't know what it’s mean.
void QTableModel::clear()
{
for (int i = 0; i < table.count(); ++i) {
if (table.at(i)) {
table.at(i)->model = 0;
delete table.at(i); <---- that’s the problem
table[i] = 0;
}
}
void QTableModel::clear()
{
for (int i = 0; i < table.count(); ++i) {
if (table.at(i)) {
table.at(i)->model = 0;
delete table.at(i); <---- that’s the problem
table[i] = 0;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks