summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/qt
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/qt')
-rw-r--r--WebCore/platform/qt/CookieJarQt.cpp2
-rw-r--r--WebCore/platform/qt/FileSystemQt.cpp28
-rw-r--r--WebCore/platform/qt/KURLQt.cpp3
-rw-r--r--WebCore/platform/qt/PlatformKeyboardEventQt.cpp49
-rw-r--r--WebCore/platform/qt/QWebPopup.cpp14
-rw-r--r--WebCore/platform/qt/RenderThemeQt.cpp4
-rw-r--r--WebCore/platform/qt/RenderThemeQt.h2
-rw-r--r--WebCore/platform/qt/WheelEventQt.cpp16
8 files changed, 87 insertions, 31 deletions
diff --git a/WebCore/platform/qt/CookieJarQt.cpp b/WebCore/platform/qt/CookieJarQt.cpp
index 0d24c7e..4077407 100644
--- a/WebCore/platform/qt/CookieJarQt.cpp
+++ b/WebCore/platform/qt/CookieJarQt.cpp
@@ -80,7 +80,7 @@ void setCookies(Document* document, const KURL& url, const KURL& policyURL, cons
++it;
}
#endif
- jar->setCookiesFromUrl(cookies, p);
+ jar->setCookiesFromUrl(cookies, u);
#else
QCookieJar::cookieJar()->setCookies(u, p, (QString)value);
#endif
diff --git a/WebCore/platform/qt/FileSystemQt.cpp b/WebCore/platform/qt/FileSystemQt.cpp
index 6dbe464..8a272c1 100644
--- a/WebCore/platform/qt/FileSystemQt.cpp
+++ b/WebCore/platform/qt/FileSystemQt.cpp
@@ -124,7 +124,7 @@ CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
return String(temp->fileName()).utf8();
}
handle = invalidPlatformFileHandle;
- return 0;
+ return CString();
}
void closeFile(PlatformFileHandle& handle)
@@ -143,32 +143,24 @@ int writeToFile(PlatformFileHandle handle, const char* data, int length)
return 0;
}
-#if defined(Q_WS_X11) || defined(Q_WS_QWS)
bool unloadModule(PlatformModule module)
{
+#if defined(Q_WS_MAC)
+ CFRelease(module);
+ return true;
+
+#elif defined(Q_OS_WIN)
+ return ::FreeLibrary(module);
+
+#else
if (module->unload()) {
delete module;
return true;
}
-
+
return false;
-}
-#endif
-
-#if defined(Q_WS_MAC)
-bool unloadModule(PlatformModule module)
-{
- CFRelease(module);
- return true;
-}
#endif
-
-#if defined(Q_OS_WIN)
-bool unloadModule(PlatformModule module)
-{
- return ::FreeLibrary(module);
}
-#endif
}
diff --git a/WebCore/platform/qt/KURLQt.cpp b/WebCore/platform/qt/KURLQt.cpp
index cdc4f48..0763fe0 100644
--- a/WebCore/platform/qt/KURLQt.cpp
+++ b/WebCore/platform/qt/KURLQt.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "KURL.h"
#include "CString.h"
+#include "TextEncoding.h"
#include "NotImplemented.h"
#include "qurl.h"
@@ -36,7 +37,7 @@ static inline char toHex(char c)
KURL::KURL(const QUrl& url)
{
- *this = KURL(url.toEncoded().constData());
+ *this = KURL(KURL(), url.toEncoded().constData(), UTF8Encoding());
}
KURL::operator QUrl() const
diff --git a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
index 76342ab..88cca5a 100644
--- a/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
+++ b/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
@@ -192,6 +192,55 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode)
case Qt::Key_Alt:
return VK_MENU; // (12) ALT key
+ case Qt::Key_F1:
+ return VK_F1;
+ case Qt::Key_F2:
+ return VK_F2;
+ case Qt::Key_F3:
+ return VK_F3;
+ case Qt::Key_F4:
+ return VK_F4;
+ case Qt::Key_F5:
+ return VK_F5;
+ case Qt::Key_F6:
+ return VK_F6;
+ case Qt::Key_F7:
+ return VK_F7;
+ case Qt::Key_F8:
+ return VK_F8;
+ case Qt::Key_F9:
+ return VK_F9;
+ case Qt::Key_F10:
+ return VK_F11;
+ case Qt::Key_F11:
+ return VK_F11;
+ case Qt::Key_F12:
+ return VK_F12;
+ case Qt::Key_F13:
+ return VK_F13;
+ case Qt::Key_F14:
+ return VK_F14;
+ case Qt::Key_F15:
+ return VK_F15;
+ case Qt::Key_F16:
+ return VK_F16;
+ case Qt::Key_F17:
+ return VK_F17;
+ case Qt::Key_F18:
+ return VK_F18;
+ case Qt::Key_F19:
+ return VK_F19;
+ case Qt::Key_F20:
+ return VK_F20;
+ case Qt::Key_F21:
+ return VK_F21;
+ case Qt::Key_F22:
+ return VK_F22;
+ case Qt::Key_F23:
+ return VK_F23;
+ case Qt::Key_F24:
+ return VK_F24;
+
case Qt::Key_Pause:
return VK_PAUSE; // (13) PAUSE key
case Qt::Key_CapsLock:
diff --git a/WebCore/platform/qt/QWebPopup.cpp b/WebCore/platform/qt/QWebPopup.cpp
index d463ddf..4d57c9b 100644
--- a/WebCore/platform/qt/QWebPopup.cpp
+++ b/WebCore/platform/qt/QWebPopup.cpp
@@ -22,7 +22,9 @@
#include "QWebPopup.h"
#include "PopupMenuStyle.h"
-#include <QCoreApplication>
+#include <QAbstractItemView>
+#include <QApplication>
+#include <QInputContext>
#include <QMouseEvent>
namespace WebCore {
@@ -54,6 +56,16 @@ void QWebPopup::showPopup()
void QWebPopup::hidePopup()
{
+ QWidget* activeFocus = QApplication::focusWidget();
+ if (activeFocus && activeFocus == view()
+ && activeFocus->testAttribute(Qt::WA_InputMethodEnabled)) {
+ QInputContext* qic = activeFocus->inputContext();
+ if (qic) {
+ qic->reset();
+ qic->setFocusWidget(0);
+ }
+ }
+
QComboBox::hidePopup();
if (!m_popupVisible)
return;
diff --git a/WebCore/platform/qt/RenderThemeQt.cpp b/WebCore/platform/qt/RenderThemeQt.cpp
index eee8c86..942e95b 100644
--- a/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/WebCore/platform/qt/RenderThemeQt.cpp
@@ -796,7 +796,7 @@ private:
HTMLMediaElement* RenderThemeQt::getMediaElementFromRenderObject(RenderObject* o) const
{
- Node* node = o->element();
+ Node* node = o->node();
Node* mediaNode = node ? node->shadowAncestorNode() : 0;
if (!mediaNode || (!mediaNode->hasTagName(videoTag) && !mediaNode->hasTagName(audioTag)))
return 0;
@@ -815,7 +815,7 @@ void RenderThemeQt::paintMediaBackground(QPainter* painter, const IntRect& r) co
QColor RenderThemeQt::getMediaControlForegroundColor(RenderObject* o) const
{
QColor fgColor = platformActiveSelectionBackgroundColor();
- if (o && o->element()->active())
+ if (o && o->node()->active())
fgColor = fgColor.lighter();
return fgColor;
}
diff --git a/WebCore/platform/qt/RenderThemeQt.h b/WebCore/platform/qt/RenderThemeQt.h
index 9a6cf0b..b4a5064 100644
--- a/WebCore/platform/qt/RenderThemeQt.h
+++ b/WebCore/platform/qt/RenderThemeQt.h
@@ -1,7 +1,7 @@
/*
* This file is part of the theme implementation for form controls in WebCore.
*
- * Copyright (C) 2007 Trolltech
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
diff --git a/WebCore/platform/qt/WheelEventQt.cpp b/WebCore/platform/qt/WheelEventQt.cpp
index cc8acd2..9534f20 100644
--- a/WebCore/platform/qt/WheelEventQt.cpp
+++ b/WebCore/platform/qt/WheelEventQt.cpp
@@ -21,7 +21,9 @@
#include "PlatformWheelEvent.h"
#include "PlatformMouseEvent.h"
+#include "Scrollbar.h"
+#include <qapplication.h>
#include <QWheelEvent>
namespace WebCore {
@@ -35,11 +37,7 @@ PlatformWheelEvent::PlatformWheelEvent(QWheelEvent* e)
#else
: m_position(e->pos())
, m_globalPosition(e->globalPos())
-#ifdef QT_MAC_USE_COCOA
, m_granularity(ScrollByPixelWheelEvent)
-#else
- , m_granularity(ScrollByLineWheelEvent)
-#endif
, m_isAccepted(false)
, m_shiftKey(e->modifiers() & Qt::ShiftModifier)
, m_ctrlKey(e->modifiers() & Qt::ControlModifier)
@@ -53,10 +51,14 @@ PlatformWheelEvent::PlatformWheelEvent(QWheelEvent* e)
m_deltaX = 0;
m_deltaY = (e->delta() / 120);
}
+ m_wheelTicksX = m_deltaX;
+ m_wheelTicksY = m_deltaY;
- // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
- m_deltaX *= horizontalLineMultiplier();
- m_deltaY *= verticalLineMultiplier();
+ // use the same single scroll step as QTextEdit (in
+ // QTextEditPrivate::init [h,v]bar->setSingleStep )
+ static const float cDefaultQtScrollStep = 20.f;
+ m_deltaX *= QApplication::wheelScrollLines() * cDefaultQtScrollStep;
+ m_deltaY *= QApplication::wheelScrollLines() * cDefaultQtScrollStep;
}
#endif // QT_NO_WHEELEVENT