C++ (Qt)void MyWidget::MyEventHandler() { ui->tableWidget->setRowCount(3); ui->tableWidget->setColumnCount(3); QTableWidgetItem *item = new QTableWidgetItem("Alexu007 nubas"); ui->tableWidget->setItem(0, 0, item); //ui->tableWidget->item(1,1)->setText("Alexu007 nubas"); return; }
C++ (Qt) QIcon icon("C:/temp/qwe.png"); QTableWidgetItem *icon_item = new QTableWidgetItem; icon_item->setIcon(icon); icon_item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); ui->tableWidget->setItem(0, 1, icon_item);
C++ (Qt)public slots: void MyEventHandler(); QObject::connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(MyEventHandler())); void MyWidget::MyEventHandler() { }
C++ (Qt)void QAbstractItemView::setIconSize( const QSize& size );
C++ (Qt) QSize& size(64, 64); void QAbstractItemView::setIconSize(const QSize& size);
C++ (Qt)ui->tableWidget->setIconSize(QSize(32, 32));