summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-20 15:12:16 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-20 15:12:16 (GMT)
commita1d2cc819f381db6b7371c55d3c22ffe56596aed (patch)
treefde0ccfc77b9b74e0527db0b45781b5d4accdd3f /Swift/QtUI/QtWebView.h
parent7e78cc2b173db39f12e92a929ad17b706877e33d (diff)
downloadswift-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.h24
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);
};
}