Hello,
I have followed the example of creating a spinboxdelegate in a QTableWidget.
http://doc.trolltech.com/4.3/itemvie...xdelegate.html
I have subclassed the QTableWidget in order to specify the return as hotkey for both open(F2) and close(return) the spinbox delegate. To do that I have overrided the keyPressEvent. This is the example code of the KeyPressEvent:
void MyTableWidget
::keyPressEvent(QKeyEvent *e
) {
if(e->key() == Qt::Key_Return)
{
n
= new QKeyEvent(e
->type
(), Qt
::Key_F2, e
->modifiers
(), e
->text
(), e
->isAutoRepeat
(), e
->count
());
}
else
{
n = e;
}
}
void MyTableWidget::keyPressEvent(QKeyEvent *e)
{
QKeyEvent *n;
if(e->key() == Qt::Key_Return)
{
n = new QKeyEvent(e->type(), Qt::Key_F2, e->modifiers(), e->text(), e->isAutoRepeat(), e->count());
}
else
{
n = e;
}
QTableWidget::keyPressEvent(n);
}
To copy to clipboard, switch view to plain text mode
I use:
tableWidget->setItemDelegateForColumn(1, new SpinBoxDelegate);
instead of the example codes:
SpinBoxDelegate delegate;
tableView.setItemDelegate(&delegate);
When I crosscompile & and transfer the example code to an embedded system (Arm9, QTopia 4.3) the spinbox delegate and its methods createEditor and setEditorData is never called when the cell is opened for editing?
I really need this to work. I have no idea why the spinbox delegate does not work on the embedded system? If you need further info to be able to help I will provide it for you.
Thank you in advance...
Bookmarks