如何使用QT合并标题中的两列。这个setSpan设置了列span,但不在标题中。 任何人都可以帮助我在标题中的列跨度。我给出了我的代码,并帮助我设置如何合并标题列。
-----------------------------------------------------------------
| Date | Time | Description |
| | | |
-----------------------------------------------------------------
| 2000-05-10 | 05:00:00 | 10:35:00 | Information |
QTableWidget table = new QTableWidget();
table->resize(600, 250);
table->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
table->setColumnCount(4);
table->setRowCount(4);
//Header Label
table->verticalHeader ()->hide();
table->horizontalHeader()->show();
table->setFrameStyle(QFrame::NoFrame);
table->setHorizontalHeaderLabels(QString("Date; Time; Description").split(";"));
table->setItem(0, 0, new QTableWidgetItem("2000-05-10"));
table->setItem(1, 0, new QTableWidgetItem("05:00:00"));
table->setItem(2, 0, new QTableWidgetItem("10:35:00"));
table->setItem(3, 0, new QTableWidgetItem("Information"));
table->setSpan(0, 0, 1, 2);