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
{
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);
}
}
}
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);
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks