summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-11 15:03:54 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-11 15:05:09 (GMT)
commit73f845a3f380c5a1adbac2cf29e9f36cc9b498cf (patch)
tree25655c928aa2d4a8c05e54f9c7c18203286fb8f3 /Swift/QtUI/QtChatView.cpp
parent8b09a21b14488a6ceb159607511b351d5cd60ac2 (diff)
downloadswift-73f845a3f380c5a1adbac2cf29e9f36cc9b498cf.zip
swift-73f845a3f380c5a1adbac2cf29e9f36cc9b498cf.tar.bz2
Proper handling of keypresses in the chat input that're meant for the chat log.
Resolves: #284
Diffstat (limited to 'Swift/QtUI/QtChatView.cpp')
-rw-r--r--Swift/QtUI/QtChatView.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index 55f9fee..3324108 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -10,11 +10,12 @@
#include <QFile>
#include <QDesktopServices>
#include <QVBoxLayout>
-#include <QWebView>
#include <QWebFrame>
#include <QKeyEvent>
#include <QStackedWidget>
+#include "QtWebView.h"
+
namespace Swift {
QtChatView::QtChatView(QWidget* parent) : QWidget(parent) {
@@ -23,7 +24,7 @@ QtChatView::QtChatView(QWidget* parent) : QWidget(parent) {
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0,0,0,0);
- webView_ = new QWebView(this);
+ webView_ = new QtWebView(this);
webView_->setFocusPolicy(Qt::NoFocus);
connect(webView_, SIGNAL(linkClicked(const QUrl&)), SLOT(handleLinkClicked(const QUrl&)));
connect(webView_, SIGNAL(loadFinished(bool)), SLOT(handleViewLoadFinished(bool)));
@@ -62,6 +63,10 @@ QtChatView::QtChatView(QWidget* parent) : QWidget(parent) {
webPage_->mainFrame()->setHtml(pageHTML);
}
+void QtChatView::handleKeyPressEvent(QKeyEvent* event) {
+ webView_->keyPressEvent(event);
+}
+
void QtChatView::addMessage(const ChatSnippet& snippet) {
//bool wasScrolledToBottom = isScrolledToBottom();