From c4dbc1c3feb04efae2734eb9f80735b47bc0d195 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 13 Nov 2009 16:31:10 +0100 Subject: Remove fake right mouse button events from long tap The context menu is launched by a separate event, not by the right mouse button. Generating the fake right mouse button caused side effects. We now treat the touch screen as a one button mouse, long taps still open the context menu using QContextMenuEvent. Task-number: QTBUG-5180 Reviewed-by: axis --- src/gui/kernel/qapplication_s60.cpp | 20 +------------------- src/gui/kernel/qt_s60_p.h | 1 - 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 04e4b31..c7f0c00 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -323,7 +323,6 @@ QSymbianControl::QSymbianControl(QWidget *w) , qwidget(w) , m_longTapDetector(0) , m_ignoreFocusChanged(0) - , m_previousEventLongTap(0) , m_symbianPopupIsOpen(0) { } @@ -362,9 +361,6 @@ QSymbianControl::~QSymbianControl() setFocusSafely(false); S60->appUi()->RemoveFromStack(this); delete m_longTapDetector; - - if(m_previousEventLongTap) - QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & ~Qt::RightButton; } void QSymbianControl::setWidget(QWidget *w) @@ -379,19 +375,11 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons alienWidget = qwidget->childAt(widgetPos); if (!alienWidget) alienWidget = qwidget; - QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons &(~Qt::LeftButton); - QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons | Qt::RightButton; - QMouseEvent mEvent(QEvent::MouseButtonPress, alienWidget->mapFrom(qwidget, widgetPos), globalPos, - Qt::RightButton, QApplicationPrivate::mouse_buttons, Qt::NoModifier); - - bool res = sendMouseEvent(alienWidget, &mEvent); #if !defined(QT_NO_CONTEXTMENU) - QContextMenuEvent contextMenuEvent(QContextMenuEvent::Mouse, widgetPos, globalPos, mEvent.modifiers()); + QContextMenuEvent contextMenuEvent(QContextMenuEvent::Mouse, widgetPos, globalPos, Qt::NoModifier); qt_sendSpontaneousEvent(alienWidget, &contextMenuEvent); #endif - - m_previousEventLongTap = true; } #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER @@ -515,12 +503,6 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent) mapS60MouseEventTypeToQt(&type, &button, &pEvent); Qt::KeyboardModifiers modifiers = mapToQtModifiers(pEvent.iModifiers); - if (m_previousEventLongTap) - if (type == QEvent::MouseButtonRelease){ - button = Qt::RightButton; - QApplicationPrivate::mouse_buttons = QApplicationPrivate::mouse_buttons & ~Qt::RightButton; - m_previousEventLongTap = false; - } if (type == QMouseEvent::None) return; diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index ec8c9cb..08f8bb5 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -204,7 +204,6 @@ private: QWidget *qwidget; QLongTapTimer* m_longTapDetector; bool m_ignoreFocusChanged : 1; - bool m_previousEventLongTap : 1; bool m_symbianPopupIsOpen : 1; #ifdef Q_WS_S60 -- cgit v0.12 From 57e2d478c47544c553d2a12237fa30b2c859536b Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 13 Nov 2009 17:08:05 +0100 Subject: Fix tst_qfile, disable largefile for symbian. RevBy: TrustMe --- tests/auto/qfile/qfile.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qfile/qfile.pro b/tests/auto/qfile/qfile.pro index f70f750..33fd2fd 100644 --- a/tests/auto/qfile/qfile.pro +++ b/tests/auto/qfile/qfile.pro @@ -5,5 +5,5 @@ wince*:{ SUBDIRS = test stdinprocess } -SUBDIRS += largefile +!symbian*:SUBDIRS += largefile -- cgit v0.12 From 900b24a38e9b07250ce900e45fb73a369f6fe62b Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Fri, 13 Nov 2009 17:17:51 +0100 Subject: Fix tst_collections compliation on symbian. RevBy: TrustMe --- tests/auto/collections/tst_collections.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index f97805e..84f466b 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -3586,7 +3586,7 @@ void tst_Collections::alignment() #else void tst_Collections::alignment() { - QSKIP("Compiler doesn't support necessary extension keywords", SkipAll) + QSKIP("Compiler doesn't support necessary extension keywords", SkipAll); } #endif -- cgit v0.12 From 85c341cee6bf3f4fa611e6d691a9156feb5d835e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 13 Nov 2009 18:05:29 +0100 Subject: Fix build error in QLibrary autotest Reviewed-by: Liang Qi --- tests/auto/qlibrary/lib2/lib2.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/qlibrary/lib2/lib2.pro b/tests/auto/qlibrary/lib2/lib2.pro index 436d7ba..fc00af8 100644 --- a/tests/auto/qlibrary/lib2/lib2.pro +++ b/tests/auto/qlibrary/lib2/lib2.pro @@ -37,9 +37,9 @@ symbian-abld: { symbian-sbsv2: { TARGET.CAPABILITY=ALL -TCB QMAKE_POST_LINK = \ - $(GNUCP) $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dl2 && \ - $(GNUCP) $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/system.trolltech.test.mylib.dll && \ - if test $(PLATFORM) != WINSCW;then $(GNUCP) $${EPOCROOT}epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${PWD}/../tst/mylib.dl2; fi + $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dl2 && \ + $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/system.trolltech.test.mylib.dll && \ + if test $(PLATFORM) != WINSCW;then $(GNUCP) $(EPOCROOT)epoc32/release/$(PLATFORM_PATH)/$(CFG_PATH)/mylib.dll $${PWD}/../tst/mylib.dl2; fi } #no special install rule for the library used by test -- cgit v0.12 From 15384f3017978a3d552077c8400b018efcfd793c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 16 Nov 2009 10:26:33 +0200 Subject: Define own palette for web-based widgets in QS60Style It makes no sense to use the S60-theme based palette in web based widgets. Web pages do not generally show theme background, but their own (or by default white) which clashes badly with WindowText and Text that are set to work with theme background. Therefore, QWebView and QGraphicsWebView need to be set their own palette for texts in theme palette hash. This improves visibility of text in webkit when QS60Style is active. Task-number: QTBUG-4885 Reviewed-by: Janne Koskinen --- src/gui/styles/qs60style.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 939ea45..7c3e11f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -783,6 +783,14 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const widgetPalette.setBrush(QPalette::Window, QBrush()); QApplication::setPalette(widgetPalette, "QScrollArea"); widgetPalette = *palette; + + //Webpages should not use S60 theme colors as they are designed to work + //with themeBackground and do not generally mesh well with web page backgrounds. + QPalette webPalette = *palette; + webPalette.setColor(QPalette::WindowText, Qt::black); + webPalette.setColor(QPalette::Text, Qt::black); + QApplication::setPalette(webPalette, "QWebView"); + QApplication::setPalette(webPalette, "QGraphicsWebView"); } QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags) @@ -2007,7 +2015,7 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti buttonRect.adjust(0,-newY,0,-newY); painter->save(); - QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnIconColors, 13, option); + QColor themeColor = d->s60Color(QS60StyleEnums::CL_QsnTextColors, 6, option); QColor buttonTextColor = option->palette.buttonText().color(); if (themeColor != buttonTextColor) painter->setPen(buttonTextColor); -- cgit v0.12