m_pTableModel->setColumnCount(5);
m_pTableModel->insertRow(0);
m_pTableModel->setData(m_pTableModel->index(0, 0), 160);
m_pTableModel->setData(m_pTableModel->index(0, 1), 123);
m_pTableModel->setData(m_pTableModel->index(0, 2), "XYZ");
m_pTableModel->setData(m_pTableModel->index(0, 3), "XYZ");
m_pTableModel->setData(m_pTableModel->index(0, 4), "XYZ");
m_pTimeTableView->setModel(m_pTableModel);
QTableView *m_pTimeTableView;
QStandardItemModel *m_pTableModel ;
m_pTableModel = new QStandardItemModel(0,5,this);
m_pTableModel->setColumnCount(5);
m_pTableModel->insertRow(0);
m_pTableModel->setData(m_pTableModel->index(0, 0), 160);
m_pTableModel->setData(m_pTableModel->index(0, 1), 123);
m_pTableModel->setData(m_pTableModel->index(0, 2), "XYZ");
m_pTableModel->setData(m_pTableModel->index(0, 3), "XYZ");
m_pTableModel->setData(m_pTableModel->index(0, 4), "XYZ");
m_pTimeTableView->setModel(m_pTableModel);
To copy to clipboard, switch view to plain text mode
If i do this I am getting headers in both horizantal and vertical .. and i am getting one more extra column at last .
Bookmarks