diff options
author | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-06-05 14:53:22 (GMT) |
---|---|---|
committer | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-06-05 14:53:22 (GMT) |
commit | 93ea4a9cd6336de6e2a63b1ca075a7fdb835cfa7 (patch) | |
tree | cb16e903ad861814ee136db6a4f5dbfbf4fd4d3c | |
parent | 67cb3b73b6c6672983751b9d53c33e91f588f863 (diff) | |
parent | e827ba44fbe7d30473855fe782ab2d02f8acf47f (diff) | |
download | Qt-93ea4a9cd6336de6e2a63b1ca075a7fdb835cfa7.zip Qt-93ea4a9cd6336de6e2a63b1ca075a7fdb835cfa7.tar.gz Qt-93ea4a9cd6336de6e2a63b1ca075a7fdb835cfa7.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into softkeys
-rw-r--r-- | doc/src/emb-install.qdoc | 4 | ||||
-rw-r--r-- | doc/src/installation.qdoc | 41 | ||||
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_symbian.cpp | 6 | ||||
-rw-r--r-- | src/gui/inputmethod/qwininputcontext_win.cpp | 7 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 87 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 7 |
6 files changed, 93 insertions, 59 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: 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 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(); 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); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 83f5a6b..ab2c2ff 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() @@ -560,10 +557,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 @@ -709,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); } @@ -1772,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; } } @@ -1791,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; } } @@ -2004,7 +2018,8 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti else if (const QStyleOptionFrame *cmb = qstyleoption_cast<const QStyleOptionFrame *>(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 @@ -2257,10 +2272,37 @@ 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; + break; + 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; } @@ -2589,6 +2631,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: @@ -2693,9 +2737,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); } @@ -2809,7 +2854,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<const QWidget *>(target); + const QWidget *widget = static_cast<const QWidget *>(target); const QRegion translated = rgn.translated(offset); const QVector<QRect> &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<QPair<QS60StyleEnums::FontCategories , int>, QFont> m_mappedFontsCache; - mutable QHash<QS60StylePrivate::SkinFrameElements, QColor> m_colorCache; + mutable QHash<SkinFrameElements, QColor> 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); |