
Originally Posted by
impeteperry
I haven't gotten the logic behind the "new" yet since I have designated the "cell", but I shall.
new is an operator that creates class instance on the heap and returns a pointer to it.
myTable->setItem( 3, 4, new QTableWidgetItem( "somthing" ) );
To copy to clipboard, switch view to plain text mode
is equivalent of:
myTable->setItem( 3, 4, item );
QTableWidgetItem *item = new QTableWidgetItem( "somthing" );
myTable->setItem( 3, 4, item );
To copy to clipboard, switch view to plain text mode
It the item already exists, you can access it like this:
myWidget->item( 3, 4 )->setText( "something" );
myWidget->item( 3, 4 )->setText( "something" );
To copy to clipboard, switch view to plain text mode
Bookmarks