summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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();