example
{
Q_OBJECT
public:
};
...
table->setItemDelegate(new MyDelegate());
for (int row = 0; row < 10; ++row) {
for (int col = 0; col < 10; ++col) {
table->setItem(row, col, item);
}
}
...
class MyDelegate: public QItemDelegate
{
Q_OBJECT
public:
virtual void drawFocus ( QPainter * /*painter*/, const QStyleOptionViewItem & /*option*/, const QRect & /*rect*/ ) const {}
};
...
QTableWidget *table = new QTableWidget(10, 10);
table->setItemDelegate(new MyDelegate());
for (int row = 0; row < 10; ++row) {
for (int col = 0; col < 10; ++col) {
QTableWidgetItem *item = new QTableWidgetItem();
table->setItem(row, col, item);
}
}
...
To copy to clipboard, switch view to plain text mode
Bookmarks