here is an example, is it hard to write it by youself?
...
lineEdit->installEventFilter(this);
...
{
if (o
== lineEdit
&& e
->type
() == QEvent::KeyPress) { const QKeyEvent *ke
= static_cast<QKeyEvent
*>
(e
);
lineEdit->setText(ks.toString());
}
}
...
lineEdit = new QLineEdit();
lineEdit->installEventFilter(this);
...
bool MyWidget::eventFilter(QObject *o, QEvent *e)
{
if (o == lineEdit && e->type() == QEvent::KeyPress) {
const QKeyEvent *ke = static_cast<QKeyEvent *>(e);
const QKeySequence ks(ke->modifiers() + ke->key());
lineEdit->setText(ks.toString());
}
return QWidget::eventFilter(o, e);
}
To copy to clipboard, switch view to plain text mode
nothing special, right?
that's why you question is newbie.
Bookmarks