Originally Posted by spirit example Qt Code: Switch view class MyDelegate: public QItemDelegate{ Q_OBJECTpublic: 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); } }... 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 Thanks a lot Spirit, for not giving up on me I finally got what I need. Sami
class MyDelegate: public QItemDelegate{ Q_OBJECTpublic: 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); } }...
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); } } ...
Forum Rules
Bookmarks