diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-08-20 15:12:16 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-08-20 15:12:16 (GMT) |
commit | a1d2cc819f381db6b7371c55d3c22ffe56596aed (patch) | |
tree | fde0ccfc77b9b74e0527db0b45781b5d4accdd3f /Swift/QtUI/QtWebView.h | |
parent | 7e78cc2b173db39f12e92a929ad17b706877e33d (diff) | |
download | swift-a1d2cc819f381db6b7371c55d3c22ffe56596aed.zip swift-a1d2cc819f381db6b7371c55d3c22ffe56596aed.tar.bz2 |
Focus the chat input again when the chat log is clicked.
Resolves: #532
Diffstat (limited to 'Swift/QtUI/QtWebView.h')
-rw-r--r-- | Swift/QtUI/QtWebView.h | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Swift/QtUI/QtWebView.h b/Swift/QtUI/QtWebView.h index 8ed5842..3ab5c64 100644 --- a/Swift/QtUI/QtWebView.h +++ b/Swift/QtUI/QtWebView.h @@ -11,22 +11,14 @@ namespace Swift { class QtWebView : public QWebView { + Q_OBJECT public: - QtWebView(QWidget* parent) : QWebView(parent) {} - void keyPressEvent(QKeyEvent* event) { - Qt::KeyboardModifiers modifiers = event->modifiers(); - int key = event->key(); - if (modifiers == Qt::ShiftModifier && (key == Qt::Key_PageUp || key == Qt::Key_PageDown)) { - modifiers = Qt::NoModifier; - } - QKeyEvent* translatedEvent = new QKeyEvent(QEvent::KeyPress, - key, - modifiers, - event->text(), - event->isAutoRepeat(), - event->count()); - QWebView::keyPressEvent(translatedEvent); - delete translatedEvent; - }; + QtWebView(QWidget* parent); + void keyPressEvent(QKeyEvent* event); + signals: + void gotFocus(); + + protected: + void focusInEvent(QFocusEvent* event); }; } |