From 847f669fd49a8691f1e765c8f2c4abf94e40f1c5 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 5 Jun 2009 14:29:48 +0300 Subject: Cut the process priority lowering timeout to 100ms in Symbian eventdispatcher, as some demos were getting ViewSrv 11 panics with 500ms timeout. --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 30b865e..c5d91c2 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -454,8 +454,8 @@ void QSelectThread::requestSocketEvents ( QSocketNotifier *notifier, TRequestSta } QSelectMutexGrabber lock(m_pipeEnds[1], &m_mutex); - - Q_ASSERT(!m_AOStatuses.contains(notifier)); + + Q_ASSERT(!m_AOStatuses.contains(notifier)); m_AOStatuses.insert(notifier, status); @@ -711,7 +711,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla break; } block = false; - if (timeState == TimeStarted && time.elapsed() > 500) { + if (timeState == TimeStarted && time.elapsed() > 100) { priority = m_processHandle.Priority(); m_processHandle.SetPriority(EPriorityLow); time.start(); -- cgit v0.12 From c39d1df4ab303472df479ba6c3d59ec30ec2995e Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Fri, 5 Jun 2009 13:53:25 +0200 Subject: Simplify binary package instructions for S60 --- doc/src/installation.qdoc | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/doc/src/installation.qdoc b/doc/src/installation.qdoc index befc7b6..697427d 100644 --- a/doc/src/installation.qdoc +++ b/doc/src/installation.qdoc @@ -532,55 +532,38 @@ in the \l{Qt for Windows CE Requirements} document. \o Depending on how you obtained the Qt for S60 release, follow the instructions in one of these pages: \list - \o \l{Installing Qt for S60 with installer} - \o \l{Installing Qt for S60 from source package} + \o \l{Installing Qt on S60 binary package} + \o \l{Installing Qt on S60 source package} \endlist \endlist */ /*! \page install-S60-installer.html -\title Installing Qt for S60 with installer +\title Installing Qt on S60 binary package \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 using installer. +\brief How to install Qt on S60 using the binary package. \list 1 \o Install Qt - Run the \c{qt-s60-%VERSION%.exe} to install Qt. + Run \c{qt-s60-%VERSION%.exe} and follow the instructions. \note Qt must be installed on the same drive as the S60 SDK you are using, and the install path must not contain any spaces. - \o Environment variables - - In order to build and use Qt, the \c PATH environment variable needs - to be extended: - - \snippet doc/src/snippets/code/doc_src_installation.qdoc 18 - - This is done by adding \c{c:\Qt\%VERSION%\bin} to the \c PATH variable. - - On Windows the PATH can be extended by navigating to - "Control Panel->System->Advanced->Environment variables". - - \note Instead of modifying system path, you can also use the "Qt S60 Command Prompt" - to build your applications. It can be launched from start menu. - - In addition, you must configure the environment for use with the S60 - emulator. This is done by locating the Carbide.c++ submenu on the Start - menu, and choosing "Configure environment for WINSCW command line". - \o Running Qt demos We've included a subset of the Qt demos in this package for you to try out. An excellent starting point is the "fluidlauncher" demo. To run the demo on a real device, you first have to install - \c{qt_libs.sis} and \c{fluidlauncher.sis} - found at Qt installation directory to the device. + \c{qt_libs.sisx} and \c{fluidlauncher.sisx} found in the Qt installation + directory. In Windows Explorer right click on the \c{.sisx} files and select + "Install with Nokia Application Installer" and follow the instructions. - To run the demos and examples on the emulator, you need to build them first: + To run the demos and examples on the emulator, you need to build them. + Open the "Qt for S60 Command Prompt" from the Start menu and type: \snippet doc/src/snippets/code/doc_src_installation.qdoc 25 @@ -600,10 +583,10 @@ in the \l{Qt for Windows CE Requirements} document. */ /*! \page install-S60-sources.html -\title Installing Qt for S60 from source package +\title Installing Qt on S60 source package \ingroup installation \ingroup qts60 -\brief How to install Qt on S60 from source package. +\brief How to install Qt on S60 using the source package. \list 1 -- cgit v0.12 From 7656e903a72c2bcb6a73a909bd75ff8817d4b869 Mon Sep 17 00:00:00 2001 From: Espen Riskedal Date: Fri, 5 Jun 2009 13:54:36 +0200 Subject: The product is called Qt for... but for installation we say Installing Qt on... --- doc/src/emb-install.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/emb-install.qdoc b/doc/src/emb-install.qdoc index 11b3f03..eb75697 100644 --- a/doc/src/emb-install.qdoc +++ b/doc/src/emb-install.qdoc @@ -42,10 +42,10 @@ /*! \page qt-embedded-install.html - \title Installing Qt for Embedded Linux + \title Installing Qt on Embedded Linux \ingroup qt-embedded-linux \ingroup installation - \brief How to install Qt for Embedded Linux. + \brief How to install Qt on Embedded Linux. This document describes how to install \l{Qt for Embedded Linux} in your development environment: -- cgit v0.12 From 541a387770966eb78958b38fe49fc62c2063b4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 15:52:34 +0300 Subject: S60Style: Drop middlesection from tab graphics, if there is very little of tab content. --- src/gui/styles/qs60style.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 83f5a6b..dbc0fe0 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -560,10 +560,20 @@ void QS60StylePrivate::drawRow(QS60StyleEnums::SkinParts start, startRect.setWidth(qMin(rect.width() >>1 - 1, startRect.width())); endRect = startRect.translated(rect.width() - startRect.width(), 0); middleRect.adjust(startRect.width(), 0, -startRect.width(), 0); + if (startRect.bottomRight().x() > endRect.topLeft().x()) { + const int overlap = (startRect.bottomRight().x() - endRect.topLeft().x())>>1; + startRect.setWidth(startRect.width()-overlap); + endRect.adjust(overlap,0,0,0); + } } else { startRect.setHeight(qMin(rect.height() >>1 - 1, startRect.height())); endRect = startRect.translated(0, rect.height() - startRect.height()); middleRect.adjust(0, startRect.height(), 0, -startRect.height()); + if (startRect.topRight().y() > endRect.bottomLeft().y()) { + const int overlap = (startRect.topRight().y() - endRect.bottomLeft().y())>>1; + startRect.setHeight(startRect.height()-overlap); + endRect.adjust(0,overlap,0,0); + } } #if 0 -- cgit v0.12 From bc88cd4796ef8845bbdc40b8b066d3ea1111fc3f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 5 Jun 2009 16:13:50 +0300 Subject: Added subElementRect implementation for SE_ItemViewItemCheckIndicator. S60Style did not implement SE_ItemViewItemCheckIndicator if given option was somethign else than QStyleOptionViewItemV4. This causes some autotests to fail. Added appropriate query for QCommonStyle. --- src/gui/styles/qs60style.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 83f5a6b..068f5b3 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2589,6 +2589,8 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con ret.setRect(opt->rect.right() - indicatorWidth - spacing, opt->rect.top() + heightOffset, indicatorWidth, indicatorHeight); } + } else { + ret = QCommonStyle::subElementRect(element, opt, widget); } break; case SE_HeaderLabel: -- cgit v0.12 From 426dc2fbefa8a901778c5fbafe6fb9ac61c4a004 Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 5 Jun 2009 15:53:56 +0200 Subject: Turned off input methods on Windows when using certain hints. If any of those hints are present, complex input is not possible, so input methods should be turned off on Windows. --- src/gui/inputmethod/qwininputcontext_win.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp index e3e8aa4..d670f5a 100644 --- a/src/gui/inputmethod/qwininputcontext_win.cpp +++ b/src/gui/inputmethod/qwininputcontext_win.cpp @@ -759,7 +759,12 @@ void QInputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus) { if (!w) return; - bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled(); + // It's always the proxy that carries the hints. + QWidget *focusProxyWidget = w->focusProxy(); + if (!focusProxyWidget) + focusProxyWidget = w; + bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled() + && !(focusProxyWidget->inputMethodHints() & Qt::ImhExclusiveInputMask); bool hasIme = e && hasFocus; #ifdef Q_IME_DEBUG qDebug("%s HasFocus = %d hasIme = %d e = %d ", w->className(), hasFocus, hasIme, e); -- cgit v0.12 From d0a2a16bfe73c4281277397dec0fdc8ca201f0fa Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 5 Jun 2009 15:58:30 +0200 Subject: Prevent double deletion of m_themePalette RevBy: Sami Merila --- src/gui/styles/qs60style.cpp | 29 ++++++++++++++++------------- src/gui/styles/qs60style_p.h | 7 ++++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 56b7e7c..fe24195 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -151,7 +151,7 @@ const double KTabFontMul = 0.72; QS60StylePrivate::~QS60StylePrivate() { clearCaches(); //deletes also background image - delete m_themePalette; + deleteThemePalette(); } void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, @@ -470,12 +470,10 @@ QColor QS60StylePrivate::colorFromFrameGraphics(QS60StylePrivate::SkinFrameEleme void QS60StylePrivate::setThemePalette(QApplication *app) const { - if (!app) - return; - + Q_UNUSED(app) QPalette widgetPalette = QPalette(Qt::white); setThemePalette(&widgetPalette); - app->setPalette(widgetPalette); + QApplication::setPalette(widgetPalette); } void QS60StylePrivate::setThemePalette(QStyleOption *option) const @@ -490,11 +488,10 @@ QPalette* QS60StylePrivate::themePalette() void QS60StylePrivate::setBackgroundTexture(QApplication *app) const { - if (!app) - return; - QPalette applicationPalette = app->palette(); + Q_UNUSED(app) + QPalette applicationPalette = QApplication::palette(); applicationPalette.setBrush(QPalette::Window, QS60StylePrivate::backgroundTexture()); - app->setPalette(applicationPalette); + QApplication::setPalette(applicationPalette); } void QS60StylePrivate::deleteBackground() @@ -719,13 +716,18 @@ void QS60StylePrivate::setThemePalette(QPalette *palette) const QS60StylePrivate::storeThemePalette(palette); } -void QS60StylePrivate::storeThemePalette(QPalette *palette) +void QS60StylePrivate::deleteThemePalette() { - //store specified palette for latter use. if (m_themePalette) { delete m_themePalette; m_themePalette = 0; } +} + +void QS60StylePrivate::storeThemePalette(QPalette *palette) +{ + deleteThemePalette(); + //store specified palette for latter use. m_themePalette = new QPalette(*palette); } @@ -2705,9 +2707,10 @@ void QS60Style::polish(QApplication *application) void QS60Style::unpolish(QApplication *application) { + Q_UNUSED(application) Q_D(QS60Style); const QPalette newPalette = QApplication::style()->standardPalette(); - application->setPalette(newPalette); + QApplication::setPalette(newPalette); QApplicationPrivate::setSystemPalette(d->m_originalPalette); } @@ -2821,7 +2824,7 @@ bool qt_s60_fill_background(QPainter *painter, const QRegion &rgn, const QPoint const QPaintDevice *target = painter->device(); if (target->devType() == QInternal::Widget) { - const QWidget *widget = static_cast(target); + const QWidget *widget = static_cast(target); const QRegion translated = rgn.translated(offset); const QVector &rects = translated.rects(); for (int i = 0; i < rects.size(); ++i) { diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 385c6e8..54da9e8 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -410,7 +410,7 @@ public: static bool isToolBarBackground(); // calculates average color based on button skin graphics (minus borders). - QColor colorFromFrameGraphics(QS60StylePrivate::SkinFrameElements frame) const; + QColor colorFromFrameGraphics(SkinFrameElements frame) const; //set theme palette for application void setThemePalette(QApplication *application) const; @@ -432,7 +432,7 @@ public: static const int m_numberOfLayouts; mutable QHash, QFont> m_mappedFontsCache; - mutable QHash m_colorCache; + mutable QHash m_colorCache; // Has one entry per SkinFrameElements static const struct frameElementCenter { @@ -465,7 +465,8 @@ private: void setThemePalette(QWidget *widget) const; void setThemePalette(QPalette *palette) const; void setThemePaletteHash(QPalette *palette) const; - static void QS60StylePrivate::storeThemePalette(QPalette *palette); + static void storeThemePalette(QPalette *palette); + static void deleteThemePalette(); static QSize partSize(QS60StyleEnums::SkinParts part, SkinElementFlags flags = KDefaultSkinElementFlags); -- cgit v0.12 From ba753f45e472810739c04e3677b754671e62b76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:34:22 +0300 Subject: S60Style: More styleHints --- src/gui/styles/qs60style.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index fe24195..9a96c05 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2269,10 +2269,36 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w retValue = '*'; break; case SH_ComboBox_PopupFrameStyle: - retValue = QFrame::NoFrame; + retValue = QFrame::NoFrame | QFrame::Plain; break; case SH_Dial_BackgroundRole: retValue = QPalette::Base; + case SH_ItemView_ActivateItemOnSingleClick: + retValue = true; + break; + case SH_ProgressDialog_TextLabelAlignment: + retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? + Qt::AlignLeft : + Qt::AlignRight; + break; + case SH_Menu_SubMenuPopupDelay: + retValue = 300; + break; + case SH_Menu_Scrollable: + retValue = true; + break; + case SH_Menu_SelectionWrap: + retValue = true; + break; + case SH_ItemView_ShowDecorationSelected: + retValue = true; + break; + case SH_ToolBar_Movable: + retValue = false; + break; + case SH_BlinkCursorWhenTextSelected: + retValue = true; + break; default: break; } -- cgit v0.12 From 6e0bca84e9a306281831ffc2a4d12fdde8023735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:35:15 +0300 Subject: S60Style: Missing break-statement --- src/gui/styles/qs60style.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 9a96c05..c394013 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2273,6 +2273,7 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w break; case SH_Dial_BackgroundRole: retValue = QPalette::Base; + break; case SH_ItemView_ActivateItemOnSingleClick: retValue = true; break; -- cgit v0.12 From e827ba44fbe7d30473855fe782ab2d02f8acf47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 5 Jun 2009 17:36:17 +0300 Subject: S60Style: Remove some magic numbers. --- src/gui/styles/qs60style.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index c394013..ab2c2ff 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1784,14 +1784,15 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, { QS60StylePrivate::SkinElementFlags adjFlags = flags; QRect emptyAreaRect = option->rect; + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); if (option->state & QStyle::State_Horizontal) { - emptyAreaRect.adjust(-2,-2,2,-2); + emptyAreaRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth); } else { if ( option->direction == Qt::LeftToRight ) { - emptyAreaRect.adjust(-2,-2,0,2); + emptyAreaRect.adjust(-frameWidth,-frameWidth,0,frameWidth); adjFlags |= QS60StylePrivate::SF_PointWest; } else { - emptyAreaRect.adjust(2,2,0,-2); + emptyAreaRect.adjust(frameWidth,frameWidth,0,-frameWidth); adjFlags |= QS60StylePrivate::SF_PointEast; } } @@ -1803,14 +1804,15 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, QS60StylePrivate::SkinElementFlags adjFlags = flags; QRect mtyRect = header->rect; QRect parentRect = widget->parentWidget()->rect(); + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); if (header->orientation == Qt::Horizontal) { - mtyRect.adjust(-2,-2,2,-2); + mtyRect.adjust(-frameWidth,-frameWidth,frameWidth,-frameWidth); } else { if ( header->direction == Qt::LeftToRight ) { - mtyRect.adjust(-2,-2,0,2); + mtyRect.adjust(-frameWidth,-frameWidth,0,frameWidth); adjFlags |= QS60StylePrivate::SF_PointWest; } else { - mtyRect.adjust(2,2,0,-2); + mtyRect.adjust(frameWidth,frameWidth,0,-frameWidth); adjFlags |= QS60StylePrivate::SF_PointEast; } } @@ -2016,7 +2018,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti else if (const QStyleOptionFrame *cmb = qstyleoption_cast(option)) { // We want to draw down arrow here for comboboxes as well. QStyleOptionFrame comboBox = *cmb; - comboBox.rect.adjust(0,2,0,-2); + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); + comboBox.rect.adjust(0,frameWidth,0,-frameWidth); QCommonStyle::drawPrimitive(element, &comboBox, painter, widget); } #endif //QT_NO_COMBOBOX -- cgit v0.12