From 35f993eaa233f4729118eb796554b0ccce85b67e Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 08:46:25 +0200 Subject: Remove scrollbar context menu from QS60Style Currently style does not forbid scrollbar context menu, so by default long pressing over the scrollbar widget shows the context menu. This is not according to 'S60-style', so from now on the stylehint SH_ScrollBar_ContextMenu returns false. Task-number: QTBUG-8194 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 14e9b95..7372c3c 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2481,6 +2481,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_FormLayoutWrapPolicy: retValue = QFormLayout::WrapLongRows; break; + case SH_ScrollBar_ContextMenu: + retValue = false; + break; default: retValue = QCommonStyle::styleHint(sh, opt, widget, hret); break; -- cgit v0.12 From b92b103d1b88760ff5b05163865593be6e937b07 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 08:55:42 +0200 Subject: QS60Style draws drop area as a black rect When Drag-n-Dropping elements in itemviews QS60Style draws drop area as a black rect. Change this so that native graphics are used instead. This change only affects touch-devices as non-touch 3.x devices do not have the native graphics defined. In 3.x non-touch devices, style still uses QCommonStyle to draw the DropArea. Task-number: QTBUG-8193 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 11 +++++++++-- src/gui/styles/qs60style_p.h | 2 ++ src/gui/styles/qs60style_s60.cpp | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 7372c3c..8f253cd 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -289,6 +289,9 @@ void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, case SE_Editor: drawFrame(SF_FrameLineEdit, painter, rect, flags | SF_PointNorth); break; + case SE_DropArea: + drawPart(QS60StyleEnums::SP_QgnGrafOrgBgGrid, painter, rect, flags | SF_PointNorth); + break; default: break; } @@ -2302,7 +2305,12 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti break; case PE_PanelScrollAreaCorner: break; - + case PE_IndicatorItemViewItemDrop: + if (QS60StylePrivate::isTouchSupported()) + QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_DropArea, painter, option->rect, flags); + else + commonStyleDraws = true; + break; // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: case PE_IndicatorDockWidgetResizeHandle: @@ -2323,7 +2331,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti #endif //QT_NO_TOOLBAR #ifndef QT_NO_COLUMNVIEW case PE_IndicatorColumnViewArrow: - case PE_IndicatorItemViewItemDrop: #endif //QT_NO_COLUMNVIEW case PE_FrameTabBarBase: // since tabs are in S60 always in navipane, let's use common style for tab base in Qt. default: diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index eae2291..0119398 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -131,6 +131,7 @@ public: SP_QgnGrafBarFrameSideL, SP_QgnGrafBarFrameSideR, SP_QgnGrafBarProgress, + SP_QgnGrafOrgBgGrid SP_QgnGrafScrollArrowDown, SP_QgnGrafScrollArrowLeft, SP_QgnGrafScrollArrowRight, @@ -428,6 +429,7 @@ public: SE_ScrollBarHandlePressedVertical, SE_ButtonInactive, SE_Editor, + SE_DropArea }; enum SkinFrameElements { diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 872bc2b..e9b2da8 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -178,6 +178,7 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_All, -1,-1}, + /* SP_QgnGrafOrgBgGrid */ {KAknsIIDQgnGrafOrgBgGrid, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawGulIcon, ES60_All, -1,-1}, -- cgit v0.12 From a4fdbdca6d55fa9e569a446c0f161a72205a0a4e Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 08:58:54 +0200 Subject: Scroll bar handle/groove ends are squeezed (in nHD resolution) QS60Style uses non-square area for scrollbar end graphics areas. It then tries to scale the areas to make them look like native graphics (and keeps the width-height ratio), thus squeezing them. Change style so that scrollbar end areas are squares, just like in native graphics they are. Task-number: QTBUG-7996 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 8f253cd..dd1489f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -847,15 +847,18 @@ QSize QS60StylePrivate::partSize(QS60StyleEnums::SkinParts part, SkinElementFlag result.setWidth(pixelMetric(PM_Custom_FrameCornerWidth)); break; - case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: case QS60StyleEnums::SP_QsnCpScrollHandleTopPressed: - case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: case QS60StyleEnums::SP_QsnCpScrollBgBottom: - case QS60StyleEnums::SP_QsnCpScrollBgMiddle: case QS60StyleEnums::SP_QsnCpScrollBgTop: case QS60StyleEnums::SP_QsnCpScrollHandleBottom: - case QS60StyleEnums::SP_QsnCpScrollHandleMiddle: case QS60StyleEnums::SP_QsnCpScrollHandleTop: + case QS60StyleEnums::SP_QsnCpScrollHandleBottomPressed: + result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent)); + result.setWidth(pixelMetric(QStyle::PM_ScrollBarExtent)); + break; + case QS60StyleEnums::SP_QsnCpScrollHandleMiddlePressed: + case QS60StyleEnums::SP_QsnCpScrollBgMiddle: + case QS60StyleEnums::SP_QsnCpScrollHandleMiddle: result.setHeight(pixelMetric(QStyle::PM_ScrollBarExtent)); result.setWidth(pixelMetric(QStyle::PM_ScrollBarSliderMin)); break; -- cgit v0.12 From 12bbcde642ed81c574b8f8d7af1d15885e998582 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 09:11:09 +0200 Subject: Compilation error fix: missing comma in enum list in QS60Style Fix for QTBUG-8193 introduced a new enum value into s60style. Unfortunately, the comma after the value didn't make it into the fix itself. Adding the comma to allow compilation of style. Task-number: QTBUG-8193 Reviewed-by: TrustMe --- src/gui/styles/qs60style_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 0119398..ea30b81 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -131,7 +131,7 @@ public: SP_QgnGrafBarFrameSideL, SP_QgnGrafBarFrameSideR, SP_QgnGrafBarProgress, - SP_QgnGrafOrgBgGrid + SP_QgnGrafOrgBgGrid, SP_QgnGrafScrollArrowDown, SP_QgnGrafScrollArrowLeft, SP_QgnGrafScrollArrowRight, -- cgit v0.12 From 6e88bdd8012b54549a22e22da4c35215bbc67917 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 09:13:38 +0200 Subject: QS60Style: Branch indicator in tree view is misplaced Fix for QTBUG-7258 make itemview margins larger. This broke the treeviews visually, as indicators are not shown in correct places. Now, indocators are placed correctly for treeviews as well. Task-number: QTBUG-7995 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index dd1489f..ea7399f 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2277,14 +2277,16 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti QS60StyleEnums::SkinParts skinPart = (option->state & State_Open) ? QS60StyleEnums::SP_QgnIndiHlColSuper : QS60StyleEnums::SP_QgnIndiHlExpSuper; int minDimension = qMin(option->rect.width(), option->rect.height()); - const int resizeValue = minDimension >> 1; - minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. QRect iconRect(option->rect.topLeft(), QSize(minDimension, minDimension)); - int verticalMagic(0); - // magic values for positioning svg icon. - if (option->rect.width() <= option->rect.height()) - verticalMagic = 3; - iconRect.translate(3, verticalMagic - resizeValue); + const int magicTweak = 3; + int resizeValue = minDimension >> 1; + if (!QS60StylePrivate::isTouchSupported()) { + minDimension += resizeValue; // Adjust the icon bigger because of empty space in svg icon. + iconRect.setSize(QSize(minDimension, minDimension)); + const int verticalMagic = (option->rect.width() <= option->rect.height()) ? magicTweak : 0; + resizeValue = verticalMagic - resizeValue; + } + iconRect.translate(magicTweak, resizeValue); QS60StylePrivate::drawSkinPart(skinPart, painter, iconRect, flags); } } -- cgit v0.12 From 60db3752fbbf6453ae935798d149986fb64e0507 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Mon, 15 Feb 2010 11:45:02 +0200 Subject: Build break fix for QS60Style. Very recent change for QS60Style breaks compilation of the style for 3.1. This is due to that style refers to a skin item ID that is not existing on 3.1 environment. Fixed by referring to the skin ID with its internal values. Task-number: QTBUG-8193 Reviewed-by: TrustMe --- src/gui/styles/qs60style_s60.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index e9b2da8..d57b187 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -178,7 +178,8 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = { /* SP_QgnGrafBarFrameSideL */ {KAknsIIDQgnGrafBarFrameSideL, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarFrameSideR */ {KAknsIIDQgnGrafBarFrameSideR, EDrawIcon, ES60_All, -1,-1}, /* SP_QgnGrafBarProgress */ {KAknsIIDQgnGrafBarProgress, EDrawIcon, ES60_All, -1,-1}, - /* SP_QgnGrafOrgBgGrid */ {KAknsIIDQgnGrafOrgBgGrid, EDrawIcon, ES60_All, -1,-1}, + // No drop area for 3.x non-touch devices + /* SP_QgnGrafOrgBgGrid */ {KAknsIIDNone, EDrawIcon, ES60_3_X, EAknsMajorGeneric ,0x1eba}, //KAknsIIDQgnGrafOrgBgGrid /* SP_QgnGrafScrollArrowDown */ {KAknsIIDQgnGrafScrollArrowDown, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowLeft */ {KAknsIIDQgnGrafScrollArrowLeft, EDrawGulIcon, ES60_All, -1,-1}, /* SP_QgnGrafScrollArrowRight */ {KAknsIIDQgnGrafScrollArrowRight, EDrawGulIcon, ES60_All, -1,-1}, -- cgit v0.12 From e024cc10a97b9518b2dd577175feb66258d7ac05 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 15 Feb 2010 17:04:03 +0100 Subject: Fixed missing repaints on S60 3.1. The bug happened when a paint event came in from Symbian, but the painted area was bigger than the exposed rect being passed in by Symbian. In these cases we would lose updates to the area outside. Fixed by calling Draw() once more if we detect that we painted a larger area to the backing store. It is still a mystery why this worked on 5.0 though... :-P AutoTest: QWidget passed RevBy: Jason Barron Task: QTBUG-8200 --- src/gui/painting/qwindowsurface_s60.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 6cbf3d9..028ec48 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -149,11 +149,19 @@ void QS60WindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoi Q_ASSERT(window); QTLWExtra *topExtra = window->d_func()->maybeTopData(); Q_ASSERT(topExtra); + QRect qr = region.boundingRect(); if (!topExtra->inExpose) { topExtra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again - TRect tr = qt_QRect2TRect(region.boundingRect()); + TRect tr = qt_QRect2TRect(qr); widget->winId()->DrawNow(tr); topExtra->inExpose = false; + } else { + // This handles the case when syncBackingStore updates content outside of the + // original drawing rectangle. This might happen if there are pending update() + // events at the same time as we get a Draw() from Symbian. + QRect drawRect = qt_TRect2QRect(widget->winId()->DrawableWindow()->GetDrawRect()); + if (!drawRect.contains(qr)) + widget->winId()->DrawDeferred(); } } -- cgit v0.12 From 916d59cec5247f8df9a3a5e0e329d973dc4380c0 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 16 Feb 2010 10:20:30 +0100 Subject: Partial upgrade packages for QtCore and QtGui When debugging or benchmarking changes in QtCore / QtGui, it is inconvenient to reinstall the whole of Qt. This allows 'make sis' to generate a partial upgrade sis files, which can be installed on top of an existing Qt installation. This relies on binary compatibility, so you should be using def files. Self-signed partial upgrade can only install on top of self-signed Qt. Reviewed-by: Miikka Heikkinen --- src/corelib/corelib.pro | 16 ++++++++++++++++ src/gui/gui.pro | 27 +++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 9a15bf1..efee610 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -35,4 +35,20 @@ symbian: { # Workaroud for problems with paging this dll MMP_RULES -= PAGED MMP_RULES *= UNPAGED + + # Partial upgrade SIS file + vendorinfo = \ + "&EN" \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + pu_header = "; Partial upgrade package for testing QtCore changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"Qt corelib\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.sources = qtcore.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT = partial_upgrade $$DEPLOYMENT } diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 8ad3bac..d46f3b4 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -51,8 +51,27 @@ contains(DEFINES,QT_EVAL):include($$QT_SOURCE_TREE/src/corelib/eval.pri) QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist DEFINES += Q_INTERNAL_QAPP_SRC -symbian:TARGET.UID3=0x2001B2DD +symbian: { + TARGET.UID3=0x2001B2DD + + # ro-section in gui can exceed default allocated space, so move rw-section a little further + QMAKE_LFLAGS.ARMCC += --rw-base 0x800000 + QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 + + # Partial upgrade SIS file + vendorinfo = \ + "&EN" \ + "; Localised Vendor name" \ + "%{\"Nokia, Qt\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia, Qt\"" \ + " " + pu_header = "; Partial upgrade package for testing QtGui changes without reinstalling everything" \ + "$${LITERAL_HASH}{\"Qt gui\"}, (0x2001E61C), $${QT_MAJOR_VERSION},$${QT_MINOR_VERSION},$${QT_PATCH_VERSION}, TYPE=PU" + partial_upgrade.pkg_prerules = pu_header vendorinfo + partial_upgrade.sources = qtgui.dll + partial_upgrade.path = c:/sys/bin + DEPLOYMENT = partial_upgrade $$DEPLOYMENT +} -# ro-section in gui can exceed default allocated space, so more rw-section little further -symbian-sbsv2: QMAKE_LFLAGS.ARMCC += --rw-base 0x800000 -symbian: QMAKE_LFLAGS.GCCE += -Tdata 0xC00000 -- cgit v0.12 From c21f29ffdee20495ec93ab8937c51c825703c319 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 16 Feb 2010 13:52:44 +0200 Subject: Fix QT_BUILD_KEY for Symbian. Symbian builds didn't set build key properly, so it defaulted to a Windows key. This caused problems with loading plugins. Task-number: QTBUG-7942 Reviewed-by: axis --- tools/configure/configureapp.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 83b4d9c..9e0cb70 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2265,24 +2265,31 @@ void Configure::generateBuildKey() QString build32Key = buildKey + "Windows " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" "); QString build64Key = buildKey + "Windows x64 " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" "); + QString buildSymbianKey = buildKey + "Symbian " + build_options.join(" ") + " " + build_defines.join(" "); build32Key = build32Key.simplified(); build64Key = build64Key.simplified(); - build32Key.prepend("# define "); - build64Key.prepend("# define "); + buildSymbianKey = buildSymbianKey.simplified(); + build32Key.prepend("# define "); + build64Key.prepend("# define "); + buildSymbianKey.prepend("# define "); - QString buildkey = // Debug builds - "#if (defined(_DEBUG) || defined(DEBUG))\n" - "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + QString buildkey = "#if defined(__SYMBIAN32__)\n" + + buildSymbianKey + "\"\n" + "#else\n" + // Debug builds + "# if (defined(_DEBUG) || defined(DEBUG))\n" + "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + build64Key.arg("debug") + "\"\n" - "# else\n" + "# else\n" + build32Key.arg("debug") + "\"\n" - "# endif\n" - "#else\n" + "# endif\n" + "# else\n" // Release builds - "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" + build64Key.arg("release") + "\"\n" - "# else\n" + "# else\n" + build32Key.arg("release") + "\"\n" + "# endif\n" "# endif\n" "#endif\n"; -- cgit v0.12