0

How to merge two columns in header using QT. This setSpan was setting columns span, but not in header.. Can anybody help me to column span in header. I given my code and help me how to set a header columns to merge.

-----------------------------------------------------------------
|      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);
Senthil Kumar
  • 562
  • 1
  • 6
  • 14
  • 1
    Possible duplicate of [Spanning horizontal header in Qt](http://stackoverflow.com/questions/22755171/spanning-horizontal-header-in-qt) – arturx64 May 05 '17 at 09:30
  • I have checked spanning-horizontal-header-in-qt answer it was too heavy code.. iam checking there is any reserved key word for horizontal spanning in qt following methods. – Senthil Kumar May 05 '17 at 09:43

0 Answers0