m_view = new QTableView (); m_view->setAlternatingRowColors(true); m_view->setSortingEnabled(true); m_view->hideRow(0); m_view->horizontalHeader()->setDefaultSectionSize(510/6); m_view->verticalHeader()->setDefaultSectionSize(20); m_view->verticalHeader()->hide(); m_view->setShowGrid(true); createViewModel(); m_view->horizontalHeader()->setResizeMode(QHeaderView::Stretch); m_view->verticalHeader()->hideSection(0); addItemModel(m_model,DataModel()); addItemModel(m_model,DataModel()); addItemModel(m_model,DataModel()); m_view->setModel(m_model);
C++ (Qt)QAbstractItemView::setEditTriggers( QAbstractItemView::NoEditTriggers );
m_view->hideRow(0); b=m_view->isRowHidden(0); qDebug("%d = first ",b); createViewModel(); addItemModel(m_model,DataModel()); addItemModel(m_model,DataModel()); addItemModel(m_model,DataModel()); m_view->setModel(m_model); m_view->hideRow(0); b=m_view->isRowHidden(0); qDebug("%d second",b);