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


Qt Code:
  1. void DataEditor::wheelEvent(QWheelEvent *e)
  2. {
  3.  
  4.  
  5.  
  6.  
  7. if (table->verticalScrollBar()->value()==table->verticalScrollBar()->maximum())
  8. {
  9. int count=table->rowCount()+1;
  10. table->setRowCount(count);
  11. }
  12. if (table->verticalScrollBar()->value()==table->verticalScrollBar()->minimum())
  13. {
  14.  
  15. if ((table->verticalScrollBar()->value())>20)
  16. { int count=table->rowCount()-1;
  17. table->setRowCount(count);
  18. }
  19.  
  20.  
  21. }
  22. }
To copy to clipboard, switch view to plain text mode