PDA

View Full Version : add comobox as the header of QTableWidget



xiongxiongchuan
15th June 2010, 11:14
how to add the comobox in the header of the QTableWidget;,and how to control the TableWidget's rows and columns just by click the scroll button at the both side of the scroll bar.
i use the the wheel event to add rows ,but i can't find how to know the wheel's direction



void DataEditor::wheelEvent(QWheelEvent *e)
{




if (table->verticalScrollBar()->value()==table->verticalScrollBar()->maximum())
{
int count=table->rowCount()+1;
table->setRowCount(count);
}
if (table->verticalScrollBar()->value()==table->verticalScrollBar()->minimum())
{

if ((table->verticalScrollBar()->value())>20)
{ int count=table->rowCount()-1;
table->setRowCount(count);
}


}
}