From 180e36e586437ffb751166f0088329ecbec3001e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 30 Oct 2009 13:43:40 +0200 Subject: S60Style: List items should be taller for touch use (5th Edition) This fixes private JIRA issue: QT-1479. The change makes itemview items taller by twice the QStyle::PM_FocusFrameVMargin amount (both margins) when touch is in use. It is rather curious that the QCommonStyle modifies QRect for itemviews in horizontal direction by twice the QStyle::PM_FocusFrameHMargin amount, but does not do it in vertical direction. Task-number: QT-1479 (private) Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b87f3a8..dc38397 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2266,10 +2266,19 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz += QSize(2*f->lineWidth, 4*f->lineWidth); break; case CT_TabBarTab: - QSize naviPaneSize = QS60StylePrivate::naviPaneSize(); + { + const QSize naviPaneSize = QS60StylePrivate::naviPaneSize(); + sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); + if (naviPaneSize.height() > sz.height()) + sz.setHeight(naviPaneSize.height()); + } + break; + case CT_ItemViewItem: sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); - if (naviPaneSize.height() > sz.height()) - sz.setHeight(naviPaneSize.height()); + if (QS60StylePrivate::isTouchSupported()) + //Make itemview easier to use in touch devices + //QCommonStyle does not adjust height with horizontal margin, it only adjusts width + sz.setHeight(sz.height() + 2*pixelMetric(QStyle::PM_FocusFrameVMargin)); break; default: sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); -- cgit v0.12 From 4e60cdcf222f607ccc49138035fb3d17140fee51 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 30 Oct 2009 13:54:24 +0200 Subject: Fixed keypad navigation in QFileDialog details view Made it possible to navigate out of QFileDialog details view using keypad navigation. Task-number: QTBUG-4793 Reviewed-by: Alessandro Portale --- src/gui/dialogs/qfiledialog.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index eab842f..50823cd 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3187,7 +3187,17 @@ void QFileDialogTreeView::keyPressEvent(QKeyEvent *e) if (!d_ptr->itemViewKeyboardEvent(e)) { QTreeView::keyPressEvent(e); } +#ifdef QT_KEYPAD_NAVIGATION + else if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder + || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) + && !hasEditFocus()) { + e->ignore(); + } else { + e->accept(); + } +#else e->accept(); +#endif } QSize QFileDialogTreeView::sizeHint() const -- cgit v0.12 From 1c44377d84976afa10b5ebae7d6ede5f226a2b3e Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 30 Oct 2009 11:55:56 +0100 Subject: Fixed namespacing in qatomic_symbian.h The namespace needs to be there, even if empty, to avoid warnings. Also, the header declaration was moved to avoid nested header declarations. RevBy: hjk --- src/corelib/arch/qatomic_symbian.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h index 5880120..3721aca 100644 --- a/src/corelib/arch/qatomic_symbian.h +++ b/src/corelib/arch/qatomic_symbian.h @@ -42,8 +42,6 @@ #ifndef QATOMIC_SYMBIAN_H #define QATOMIC_SYMBIAN_H -QT_BEGIN_HEADER - #if defined(Q_CC_RVCT) # define QT_NO_ARM_EABI # include @@ -51,6 +49,16 @@ QT_BEGIN_HEADER # include #endif +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Core) + +// Empty, but needed to avoid warnings + +QT_END_NAMESPACE + QT_END_HEADER #endif // QATOMIC_SYMBIAN_H -- cgit v0.12 From fab1697ff467e6c9ec02ffe6eccf65a6e779fd6b Mon Sep 17 00:00:00 2001 From: axis Date: Fri, 30 Oct 2009 13:50:04 +0100 Subject: Moved a resource file from the static wrapper app to QtGui. It's more appropriate to have it in QtGui after the framework classes were moved there. This also means that the rsgfix needed earlier is not necessary anymore, since QtGui is not a static library. RevBy: Janne Anttila --- src/gui/s60framework/s60framework.pri | 11 +++++ src/gui/s60framework/s60main.rss | 85 +++++++++++++++++++++++++++++++++++ src/s60main/s60main.pro | 20 --------- src/s60main/s60main.rss | 85 ----------------------------------- 4 files changed, 96 insertions(+), 105 deletions(-) create mode 100644 src/gui/s60framework/s60main.rss delete mode 100644 src/s60main/s60main.rss diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri index fea74fe..5884b68 100644 --- a/src/gui/s60framework/s60framework.pri +++ b/src/gui/s60framework/s60framework.pri @@ -1,3 +1,14 @@ +# This block serves the minimalistic resource file for S60 3.1 platforms. +# Note there is no way to ifdef S60 version in mmp file, that is why the resource +# file is always compiled for WINSCW +minimalAppResource31 = \ + "SOURCEPATH s60framework" \ + "START RESOURCE s60main.rss" \ + "HEADER" \ + "TARGETPATH resource\apps" \ + "END" +MMP_RULES += minimalAppResource31 + SOURCES += s60framework/qs60mainapplication.cpp \ s60framework/qs60mainappui.cpp \ s60framework/qs60maindocument.cpp diff --git a/src/gui/s60framework/s60main.rss b/src/gui/s60framework/s60main.rss new file mode 100644 index 0000000..07dc6a1 --- /dev/null +++ b/src/gui/s60framework/s60main.rss @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the Symbian application wrapper of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// Even S60 application have ENoAppResourceFile and ENonStandardResourceFile +// flags set, the S60 3rd Edition FP1 emulator requires applications to have +// very minimalistic application resource file, otherwise apps refures to start +// This file serves the minimalistic resource file for S60 3.1 platforms. + +// RESOURCE IDENTIFIER +NAME QTMA // 4 letter ID + +// INCLUDES +//#include +#include +#include +#include +#include +#include + +// RESOURCE DEFINITIONS +RESOURCE RSS_SIGNATURE + { + } + +RESOURCE TBUF r_default_document_name + { + buf="QTMA"; + } + +RESOURCE EIK_APP_INFO + { + menubar = r_qt_wrapperapp_menubar; + cba = R_AVKON_SOFTKEYS_EXIT; + } + +RESOURCE MENU_BAR r_qt_wrapperapp_menubar + { + titles = + { + MENU_TITLE { menu_pane = r_qt_wrapperapp_menu; } + }; + } + +RESOURCE MENU_PANE r_qt_wrapperapp_menu + { + } +// End of File diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index cc3c547..47cf020 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -16,16 +16,6 @@ symbian { SOURCES = qts60main.cpp \ qts60main_mcrt0.cpp - # This block serves the minimalistic resource file for S60 3.1 platforms. - # Note there is no way to ifdef S60 version in mmp file, that is why the resource - # file is always compiled for WINSCW - minimalAppResource31 = \ - "START RESOURCE s60main.rss" \ - "HEADER" \ - "TARGETPATH resource\apps" \ - "END" - MMP_RULES += minimalAppResource31 - # s60main needs to be built in ARM mode for GCCE to work. MMP_RULES+="ALWAYS_BUILD_AS_ARM" @@ -36,14 +26,4 @@ symbian { error("$$_FILE_ is intended only for Symbian!") } -symbian-abld: { - # abld build commands generated resources after the static library is built, and - # we have dependency to resource from static lib -> resources need to be generated - # explicitly before library - rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)Epoc32\Data\z\resource\apps\s60main.rsc >NUL 2>&1" - rsgFix.commands = "-$(ABLD) resource $(PLATFORM) $(CFG) 2>NUL" - QMAKE_EXTRA_TARGETS += rsgFix rsgFix2 - PRE_TARGETDEPS += rsgFix rsgFix2 -} - include(../qbase.pri) diff --git a/src/s60main/s60main.rss b/src/s60main/s60main.rss deleted file mode 100644 index 07dc6a1..0000000 --- a/src/s60main/s60main.rss +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the Symbian application wrapper of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Even S60 application have ENoAppResourceFile and ENonStandardResourceFile -// flags set, the S60 3rd Edition FP1 emulator requires applications to have -// very minimalistic application resource file, otherwise apps refures to start -// This file serves the minimalistic resource file for S60 3.1 platforms. - -// RESOURCE IDENTIFIER -NAME QTMA // 4 letter ID - -// INCLUDES -//#include -#include -#include -#include -#include -#include - -// RESOURCE DEFINITIONS -RESOURCE RSS_SIGNATURE - { - } - -RESOURCE TBUF r_default_document_name - { - buf="QTMA"; - } - -RESOURCE EIK_APP_INFO - { - menubar = r_qt_wrapperapp_menubar; - cba = R_AVKON_SOFTKEYS_EXIT; - } - -RESOURCE MENU_BAR r_qt_wrapperapp_menubar - { - titles = - { - MENU_TITLE { menu_pane = r_qt_wrapperapp_menu; } - }; - } - -RESOURCE MENU_PANE r_qt_wrapperapp_menu - { - } -// End of File -- cgit v0.12 From 4f10520a2a931ed0cccba3d36d9c196902049282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Fri, 30 Oct 2009 15:53:28 +0200 Subject: S60Style: User set header view palettes are ignored QS60Style ignores user defined palettes for QHeaderViews. With this fix, style takes palette changes into account and also draws QTableCornerButton correctly. Task-number: QTBUG-4522 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index dc38397..10a63a8 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1752,7 +1752,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, #endif //QT_NO_MENUBAR case CE_HeaderSection: - if ( const QStyleOptionHeader *header = qstyleoption_cast(option)) { + if (const QStyleOptionHeader *header = qstyleoption_cast(option)) { painter->save(); QPen linePen = QPen(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 1, header)); const int penWidth = (header->orientation == Qt::Horizontal) ? @@ -1770,6 +1770,25 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } } painter->restore(); + + //Draw corner button as normal pushButton. + if (qobject_cast(widget)) { + //Make cornerButton slightly smaller so that it is not on top of table border graphic. + QStyleOptionHeader subopt = *header; + const int borderTweak = + QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth)>>1; + if (subopt.direction == Qt::LeftToRight) + subopt.rect.adjust(borderTweak, borderTweak, 0, -borderTweak); + else + subopt.rect.adjust(0, borderTweak, -borderTweak, -borderTweak); + drawPrimitive(PE_PanelButtonBevel, &subopt, painter, widget); + } else if ((header->palette.brush(QPalette::Button) != Qt::transparent)) { + //Draw non-themed background. Background for theme is drawn in CE_ShapedFrame + //to get continuous theme graphic across all the header cells. + qDrawShadePanel(painter, header->rect, header->palette, + header->state & (State_Sunken | State_On), penWidth, + &header->palette.brush(QPalette::Button)); + } } break; case CE_HeaderEmptyArea: // no need to draw this @@ -1840,15 +1859,24 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } else if (qobject_cast(widget)) { QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableItem, painter, option->rect, flags); } else if (const QHeaderView *header = qobject_cast(widget)) { - if (header->orientation() == Qt::Horizontal) { - QRect headerRect = option->rect; - const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); - headerRect.adjust(0,frameWidth,-2*frameWidth,0); - QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, headerRect, flags); - } else { + //QS60style draws header background here instead of in each headersection, to get + //continuous graphic from section to section. + QS60StylePrivate::SkinElementFlags adjustableFlags = flags; + QRect headerRect = option->rect; + if (header->orientation() != Qt::Horizontal) { //todo: update to horizontal table graphic - QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, option->rect, flags | QS60StylePrivate::SF_PointWest); + adjustableFlags = (adjustableFlags | QS60StylePrivate::SF_PointWest); + } else { + const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth); + if (option->direction == Qt::LeftToRight) + headerRect.adjust(-2*frameWidth, 0, 0, 0); + else + headerRect.adjust(0, 0, 2*frameWidth, 0); } + if (option->palette.brush(QPalette::Button).color() == Qt::transparent) + QS60StylePrivate::drawSkinElement( + QS60StylePrivate::SE_TableHeaderItem, painter, headerRect, adjustableFlags); + } else if (qobject_cast(widget)) { QCommonStyle::drawControl(element, option, painter, widget); } -- cgit v0.12 From 8910b449dafcb3475ab8c6f90213cd632412da68 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 30 Oct 2009 16:08:46 +0200 Subject: Fixed statuspane visibility after dialog closed from fullsreen widget. - Comparing TBool == bool did not work correctly since TBool is effectively int. For example statusPane->IsVisible() in this particular case returns 2, which compared to true as an int fails. Casting to bool seems to solve the problem. Another possibility would be to use Symbian COMPARE_BOOLS macro. - Changing statuspane visibility now affects to widget size also - Some tab/space fixes Task-number: QTBUG-4876 Reviewed-by: Sami Merila --- src/gui/kernel/qapplication_s60.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 30bf99a..e5ee2f1 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -836,7 +836,7 @@ void QSymbianControl::Draw(const TRect& controlRect) const if (qwidget->d_func()->isOpaque) gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect); - } + } } else { surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint()); } @@ -910,9 +910,9 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) CEikStatusPane* statusPane = S60->statusPane(); CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; - if (statusPane && (statusPane->IsVisible() == isFullscreen)) + if (statusPane && (bool)statusPane->IsVisible() == isFullscreen) statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen)) + if (buttonGroup && (bool)buttonGroup->IsVisible() == isFullscreen) buttonGroup->MakeVisible(!isFullscreen); #endif } else if (QApplication::activeWindow() == qwidget->window()) { @@ -925,6 +925,12 @@ void QSymbianControl::HandleResourceChange(int resourceType) { switch (resourceType) { case KInternalStatusPaneChange: + if (qwidget->isFullScreen()) { + SetExtentToWholeScreen(); + } else if (qwidget->isMaximized()) { + TRect r = static_cast(S60->appUi())->ClientRect(); + SetExtent(r.iTl, r.Size()); + } qwidget->d_func()->setWindowIcon_sys(true); break; case KUidValueCoeFontChangeEvent: @@ -1080,9 +1086,9 @@ void qt_init(QApplicationPrivate * /* priv */, int) // enable focus events - used to re-enable mouse after focus changed between mouse and non mouse app, // and for dimming behind modal windows - S60->windowGroup().EnableFocusChangeEvents(); + S60->windowGroup().EnableFocusChangeEvents(); - //Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this) + //Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this) const TInt KMachineUidSamsungI8510 = 0x2000C51E; // HAL::Get(HALData::EPen, TInt& result) may set 'result' to 1 on some 3.1 systems (e.g. N95). // But we know that S60 systems below 5.0 did not support touch. @@ -1560,7 +1566,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) } #endif break; - default: + default: break; } -- cgit v0.12 From fc6822cb2c1a09b018189168965a8ade23cf1074 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 2 Nov 2009 10:23:12 +0200 Subject: Fix for static QSound::play in Symbian and code style fixes. Static QSound::play(const QString& filename) API did work for Symbian, since local stack variable was deleted before asynchronous play completed. This happened with the following seqeunce: - void QAuServer::play() is called and creates a QSound on the stack - QAuBucketS60::play() is called - m_prepared is false, so the actual play will happen a bit later - The QSound created on the stack is deleted -> Silence This scenario is now fixed by making copy of QSound object to internal list, and temp object is being deleted when play is completed either successfully or unsuccessfully. Added also manual test case for static play. Task-number: QTBUG-5217 Reviewed-by: Miikka Heikkinen --- src/gui/kernel/qsound_s60.cpp | 94 ++++++++++++++++++++++++---------------- tests/auto/qsound/tst_qsound.cpp | 26 ++++++++--- 2 files changed, 75 insertions(+), 45 deletions(-) diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp index 352580e..e4b7cec 100644 --- a/src/gui/kernel/qsound_s60.cpp +++ b/src/gui/kernel/qsound_s60.cpp @@ -60,13 +60,13 @@ class QAuServerS60; class QAuBucketS60 : public QAuBucket, public MMdaAudioPlayerCallback { public: - QAuBucketS60( QAuServerS60 *server, QSound *sound); + QAuBucketS60(QAuServerS60 *server, QSound *sound); ~QAuBucketS60(); void play(); void stop(); - inline QSound* sound() const { return m_sound; } + inline QSound *sound() const { return m_sound; } public: // from MMdaAudioPlayerCallback void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration); @@ -77,88 +77,106 @@ private: QAuServerS60 *m_server; bool m_prepared; bool m_playCalled; - CMdaAudioPlayerUtility* m_playUtility; + CMdaAudioPlayerUtility *m_playUtility; }; class QAuServerS60 : public QAuServer { public: - QAuServerS60( QObject* parent ); + QAuServerS60(QObject *parent); - void init( QSound* s ) + void init(QSound *s) { - QAuBucketS60 *bucket = new QAuBucketS60( this, s ); - setBucket( s, bucket ); + QAuBucketS60 *bucket = new QAuBucketS60(this, s); + setBucket(s, bucket); } - void play( QSound* s ) + void play(QSound *s) { - bucket( s )->play(); + bucket(s)->play(); } - void stop( QSound* s ) + void stop(QSound *s) { - bucket( s )->stop(); + bucket(s)->stop(); } bool okay() { return true; } + void play(const QString& filename); + protected: - void playCompleted(QAuBucketS60* bucket, int error) - { - QSound *sound = bucket->sound(); - if(!error) { - // We need to handle repeats by ourselves, since with Symbian API we don't - // know how many loops have been played when user asks it - if( decLoop( sound ) ) { - play( sound ); - } - } else { - // We don't have a way to inform about errors -> just decrement loops - // in order that QSound::isFinished will return true; - while(decLoop(sound)) {} - } - } + void playCompleted(QAuBucketS60 *bucket, int error); protected: - QAuBucketS60* bucket( QSound *s ) + QAuBucketS60 *bucket(QSound *s) { - return (QAuBucketS60*)QAuServer::bucket( s ); + return (QAuBucketS60 *)QAuServer::bucket( s ); } friend class QAuBucketS60; + // static QSound::play(filename) cannot be stopped, meaning that playCompleted + // will get always called and QSound gets removed form this list. + QList staticPlayingSounds; }; -QAuServerS60::QAuServerS60(QObject* parent) : +QAuServerS60::QAuServerS60(QObject *parent) : QAuServer(parent) { setObjectName(QLatin1String("QAuServerS60")); } +void QAuServerS60::play(const QString& filename) +{ + QSound *s = new QSound(filename); + staticPlayingSounds.append(s); + play(s); +} + +void QAuServerS60::playCompleted(QAuBucketS60 *bucket, int error) +{ + QSound *sound = bucket->sound(); + if (!error) { + // We need to handle repeats by ourselves, since with Symbian API we don't + // know how many loops have been played when user asks it + if (decLoop(sound)) { + play(sound); + } else { + if (staticPlayingSounds.removeAll(sound)) + delete sound; + } + } else { + // We don't have a way to inform about errors -> just decrement loops + // in order that QSound::isFinished will return true; + while (decLoop(sound)) {} + if (staticPlayingSounds.removeAll(sound)) + delete sound; + } +} -QAuServer* qt_new_audio_server() +QAuServer *qt_new_audio_server() { return new QAuServerS60(qApp); } -QAuBucketS60::QAuBucketS60( QAuServerS60 *server, QSound *sound ) - : m_sound( sound ), m_server( server ), m_prepared(false), m_playCalled(false) +QAuBucketS60::QAuBucketS60(QAuServerS60 *server, QSound *sound) + : m_sound(sound), m_server(server), m_prepared(false), m_playCalled(false) { - QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath(); + QString filepath = QFileInfo(m_sound->fileName()).absoluteFilePath(); filepath = QDir::toNativeSeparators(filepath); TPtrC filepathPtr(qt_QString2TPtrC(filepath)); TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this); m_playUtility->OpenFileL(filepathPtr)); - if(err){ + if (err) { m_server->playCompleted(this, err); } } void QAuBucketS60::play() { - if(m_prepared) { + if (m_prepared) { // OpenFileL call is completed we can start playing immediately m_playUtility->Play(); } else { @@ -180,11 +198,11 @@ void QAuBucketS60::MapcPlayComplete(TInt aError) void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) { - if(aError) { + if (aError) { m_server->playCompleted(this, aError); } else { m_prepared = true; - if(m_playCalled){ + if (m_playCalled){ play(); } } @@ -192,7 +210,7 @@ void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds QAuBucketS60::~QAuBucketS60() { - if(m_playUtility){ + if (m_playUtility){ m_playUtility->Stop(); m_playUtility->Close(); } diff --git a/tests/auto/qsound/tst_qsound.cpp b/tests/auto/qsound/tst_qsound.cpp index 56a330b..73eca98 100644 --- a/tests/auto/qsound/tst_qsound.cpp +++ b/tests/auto/qsound/tst_qsound.cpp @@ -55,20 +55,32 @@ public: tst_QSound( QObject* parent=0) : QObject(parent) {} private slots: - void checkFinished(); + void checkFinished(); + + // Manual tests + void staticPlay(); }; void tst_QSound::checkFinished() { - QSound sound(SRCDIR"4.wav"); - sound.setLoops(3); - sound.play(); - QTest::qWait(5000); + QSound sound(SRCDIR"4.wav"); + sound.setLoops(3); + sound.play(); + QTest::qWait(5000); #if defined(Q_WS_QWS) - QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort); + QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort); #endif - QVERIFY(sound.isFinished() ); + QVERIFY(sound.isFinished() ); +} + +void tst_QSound::staticPlay() +{ + QSKIP("Test disabled -- only for manual purposes", SkipAll); + + // Check that you hear sound with static play also. + QSound::play(SRCDIR"4.wav"); + QTest::qWait(2000); } QTEST_MAIN(tst_QSound); -- cgit v0.12 From a80e58335e69c8ce96d1596e0ed2d14e424a0d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 2 Nov 2009 12:03:52 +0200 Subject: Style's theme palette hash is lost after orientation switch Currently, after orientation switch when new theme background is applied, it is done using QApplication::setPalette(). This unfortunately tosses away the palette hash. So instead directly calling QApplication::setPalette(), the fix is to call the style's internal setThemePalette(), which copies the hash also to QApplication palette. This is related to bug QT-1478 in Private JIRA. Task-number: QT-1478 Reviewed-by: Shane Kearns --- src/gui/styles/qs60style.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 10a63a8..48f7042 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -499,7 +499,7 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const Q_UNUSED(app) QPalette applicationPalette = QApplication::palette(); applicationPalette.setBrush(QPalette::Window, backgroundTexture()); - QApplication::setPalette(applicationPalette); + setThemePalette(app); } void QS60StylePrivate::deleteBackground() -- cgit v0.12 From 56da3aca1fc8a7c269acf3cf1d4c3586ea8cdfd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Mon, 2 Nov 2009 15:37:17 +0200 Subject: QS60Style - TabWidget text changes color when widget becomes dimmed Style sets the tabWidget palette hash only for QPalette::Active. So, when widget becomes disabled, text color changes back to default. Task-number: QTBUG-4625 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 48f7042..949dfcb 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -743,7 +743,7 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const const QColor mainAreaTextColor = s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0); - widgetPalette.setColor(QPalette::All, QPalette::WindowText, + widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0)); QApplication::setPalette(widgetPalette, "QSlider"); // return to original palette after each widget @@ -767,34 +767,34 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QApplication::setPalette(widgetPalette, "QHeaderView"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::All, QPalette::ButtonText, + widgetPalette.setColor(QPalette::ButtonText, s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0)); QApplication::setPalette(widgetPalette, "QMenuBar"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::Active, QPalette::WindowText, + widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0)); QApplication::setPalette(widgetPalette, "QTabBar"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::All, QPalette::Text, + widgetPalette.setColor(QPalette::Text, s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); QApplication::setPalette(widgetPalette, "QTableView"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + widgetPalette.setColor(QPalette::HighlightedText, s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QLineEdit"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::All, QPalette::Text, + widgetPalette.setColor(QPalette::Text, s60Color(QS60StyleEnums::CL_QsnTextColors, 34, 0)); - widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + widgetPalette.setColor(QPalette::HighlightedText, s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QTextEdit"); widgetPalette = *palette; - widgetPalette.setColor(QPalette::All, QPalette::HighlightedText, + widgetPalette.setColor(QPalette::HighlightedText, s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0)); QApplication::setPalette(widgetPalette, "QComboBox"); widgetPalette = *palette; -- cgit v0.12 From 298e0d28106fd7ef3fe7232c71dd05a57b5d1d90 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Mon, 2 Nov 2009 15:35:56 +0200 Subject: Re-added checking for existence of sqlite3 binaries to Symbian builds Always adding export for sqlite3 binaries will cause cleanup of platform provided versions on platforms that provide them. Fixed by adding check for existence of sqlite3.dso before adding the export statement to bld.inf. Task-number: QT-2419 Reviewed-by: Janne Koskinen --- src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro index 4734144..158633d 100644 --- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro +++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro @@ -1,5 +1,7 @@ # Use subdirs template to suppress generation of unnecessary files TEMPLATE = subdirs -# We just want to extract the zip file containing sqlite binaries for Symbian -BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip" +# We just want to export the sqlite3 binaries for Symbian for platforms that do not have them. +!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) { + BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip" +} -- cgit v0.12 From 83b069307781f138394d29540a35c62d1dc584c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 3 Nov 2009 11:58:53 +0200 Subject: Build break fix for S60Simulated style S60Simulated style broke down after change SHA da9880eaed0d09338717db1a73db01e6b0ab080d, because part()-method call in simulated style was not updated to have additional parameter. Task-number: None Reviewed-by: Shane Kearns --- src/gui/styles/qs60style_simulated.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 14f0424..706b4e9 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -322,7 +322,7 @@ QPixmap QS60StylePrivate::backgroundTexture() { if (!m_background) { const QSize size = QApplication::desktop()->screen()->size(); - QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size); + QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size, 0); m_background = new QPixmap(background); } return *m_background; -- cgit v0.12 From 1ef5dddf91c666664911686ca77cb6c1b2cde828 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 3 Nov 2009 12:06:35 +0200 Subject: Force Qt libs to install on phone memory in Symbian. Starting Qt apps when Qt libs are installed on a memory card takes ages (15-20 seconds), because Symbian recalculates hash of the dll every time it loads it from a non-system drive. Worked around this issue by forcing installation of Qt libs to the C-drive. Task-number: QT-690 Reviewed-by: Janne Koskinen --- src/s60installs/s60installs.pro | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 022a072..9c53167 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -12,7 +12,7 @@ symbian: { VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc - qtresources.path = $$APP_RESOURCE_DIR + qtresources.path = c:$$APP_RESOURCE_DIR qtlibraries.sources = \ QtCore.dll \ @@ -24,24 +24,24 @@ symbian: { qts60plugindeployment = \ "IF package(0x1028315F)" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"!:\\sys\\bin\\qts60plugin_5_0.dll\"" \ + " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \ "ELSEIF package(0x102752AE)" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_2.dll\" - \"!:\\sys\\bin\\qts60plugin_3_2.dll\"" \ + " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_2.dll\" - \"c:\\sys\\bin\\qts60plugin_3_2.dll\"" \ "ELSEIF package(0x102032BE)" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"!:\\sys\\bin\\qts60plugin_3_1.dll\"" \ + " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"c:\\sys\\bin\\qts60plugin_3_1.dll\"" \ "ELSE" \ - " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"!:\\sys\\bin\\qts60plugin_5_0.dll\"" \ + " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \ "ENDIF" qtlibraries.pkg_postrules += qts60plugindeployment sqlitedeployment = \ "; Deploy sqlite onto phone that does not have it (this should be replaced with embedded sis file when available)" \ "IF NOT package(0x2002533b) " \ - "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/sqlite3.dll\" - \"!:\\sys\\bin\\sqlite3.dll\"" \ + "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/sqlite3.dll\" - \"c:\\sys\\bin\\sqlite3.dll\"" \ "ENDIF" qtlibraries.pkg_postrules += sqlitedeployment - qtlibraries.path = /sys/bin + qtlibraries.path = c:/sys/bin vendorinfo = \ "; Localised Vendor name" \ @@ -67,15 +67,15 @@ symbian: { !contains(QT_CONFIG, no-mng): imageformats_plugins.sources += qmng.dll !contains(QT_CONFIG, no-tiff): imageformats_plugins.sources += qtiff.dll !contains(QT_CONFIG, no-ico): imageformats_plugins.sources += qico.dll - imageformats_plugins.path = $$QT_PLUGINS_BASE_DIR/imageformats + imageformats_plugins.path = c:$$QT_PLUGINS_BASE_DIR/imageformats codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll - codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs + codecs_plugins.path = c:$$QT_PLUGINS_BASE_DIR/codecs contains(QT_CONFIG, phonon-backend) { phonon_backend_plugins.sources += phonon_mmf.dll - phonon_backend_plugins.path = $$QT_PLUGINS_BASE_DIR/phonon_backend + phonon_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/phonon_backend DEPLOYMENT += phonon_backend_plugins } @@ -85,7 +85,7 @@ symbian: { qtlibraries.sources += QtSvg.dll imageformats_plugins.sources += qsvg.dll iconengines_plugins.sources = qsvgicon.dll - iconengines_plugins.path = $$QT_PLUGINS_BASE_DIR/iconengines + iconengines_plugins.path = c:$$QT_PLUGINS_BASE_DIR/iconengines DEPLOYMENT += iconengines_plugins } @@ -105,7 +105,7 @@ symbian: { qtlibraries.sources += QtWebKit.dll } - graphicssystems_plugins.path = $$QT_PLUGINS_BASE_DIR/graphicssystems + graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems contains(QT_CONFIG, openvg) { qtlibraries.sources = QtOpenVG.dll graphicssystems_plugins.sources += qvggraphicssystem.dll -- cgit v0.12 From 1db4a133a9d35e00bad50541fb8d64079a7debea Mon Sep 17 00:00:00 2001 From: Liang QI Date: Tue, 3 Nov 2009 12:05:50 +0100 Subject: Fix tst_qwebpage and tst_qwebframe compilation on Symbian. RevBy: TrustMe --- src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro | 2 +- src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 4 ++++ src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro | 2 +- src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro index 4c92e91..df447d8 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro @@ -5,6 +5,6 @@ SOURCES += tst_qwebframe.cpp RESOURCES += qwebframe.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -DEFINES += SRCDIR=\\\"$$PWD/resources\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\" symbian:TARGET.UID3 = 0xA000E53D diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index 100f272..f8c3440 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -38,6 +38,10 @@ #endif #include "../util.h" +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + //TESTED_CLASS= //TESTED_FILES= diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro index 101837a..7d581cd 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro @@ -5,6 +5,6 @@ SOURCES += tst_qwebpage.cpp RESOURCES += tst_qwebpage.qrc QT += testlib network QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR -DEFINES += SRCDIR=\\\"$$PWD/\\\" +!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\" symbian:TARGET.UID3 = 0xA000E53E diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index 21b3bc7..51611b0 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -37,6 +37,10 @@ #include #include +#if defined(Q_OS_SYMBIAN) +# define SRCDIR "" +#endif + // Will try to wait for the condition while allowing event processing #define QTRY_COMPARE(__expr, __expected) \ do { \ -- cgit v0.12 From cb396cf4851b961fb42e21866d7467efb3642a04 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 3 Nov 2009 12:45:44 +0100 Subject: Fixed compile error on Symbian emulator. RevBy: Trust me --- src/gui/itemviews/qabstractitemview.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/itemviews/qabstractitemview.h b/src/gui/itemviews/qabstractitemview.h index 7a0509b..ea5d259 100644 --- a/src/gui/itemviews/qabstractitemview.h +++ b/src/gui/itemviews/qabstractitemview.h @@ -363,6 +363,7 @@ private: friend class QTreeViewPrivate; // needed to compile with MSVC friend class QAccessibleItemRow; friend class QListModeViewBase; + friend class QListViewPrivate; // needed to compile for Symbian emulator }; Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers) -- cgit v0.12 From dc89c842779f87ce69882ba54fa8d5bb79e0edbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 3 Nov 2009 14:02:03 +0200 Subject: QS60Style: impossible to open menu from styled QToolButton QS60Style ignores toolButton's menu indicator rect. This means that the button's menu cannot be triggered by the user, as the style does not draw the indicator at all. With this fix, style calculates a rect (including margins) for menu indicator and draws that (arrow down) into toolButton (by making the button bevel larger). Task-number: QTBUG-5266 Reviewed-by: Alessandro Portale --- src/gui/styles/qs60style.cpp | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 949dfcb..350a8e6 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -994,6 +994,10 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast(option)) { const State bflags = toolBtn->state; const QRect button(subControlRect(control, toolBtn, SC_ToolButton, widget)); + QRect menuRect = QRect(); + if (toolBtn->subControls & SC_ToolButtonMenu) + menuRect = subControlRect(control, toolBtn, SC_ToolButtonMenu, widget); + QStyleOptionToolButton toolButton = *toolBtn; if (sub&SC_ToolButton) { @@ -1006,7 +1010,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom toolBar = qobject_cast(widget->parentWidget()); if (bflags & (State_Sunken | State_On | State_Raised)) { - tool.rect = button; + tool.rect = button.unite(menuRect); tool.state = bflags; // todo: I'd like to move extension button next to where last button is @@ -1061,6 +1065,12 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom } else { drawPrimitive(PE_PanelButtonTool, &tool, painter, widget); } + + if (toolButton.subControls & SC_ToolButtonMenu) { + tool.rect = menuRect; + tool.state = bflags; + drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget); + } } } @@ -2232,7 +2242,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti // todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases case PE_FrameLineEdit: - case PE_IndicatorButtonDropDown: case PE_IndicatorDockWidgetResizeHandle: case PE_PanelTipLabel: case PE_PanelScrollAreaCorner: @@ -2561,6 +2570,29 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple } } break; + case CC_ToolButton: + if (const QStyleOptionToolButton *toolButton = qstyleoption_cast(option)) { + const int indicatorRect = pixelMetric(PM_MenuButtonIndicator, toolButton, widget) + + 2*pixelMetric(PM_ButtonMargin, toolButton, widget); + ret = toolButton->rect; + const bool popup = (toolButton->features & + (QStyleOptionToolButton::MenuButtonPopup | QStyleOptionToolButton::PopupDelay)) + == QStyleOptionToolButton::MenuButtonPopup; + switch (scontrol) { + case SC_ToolButton: + if (popup) + ret.adjust(0, 0, -indicatorRect, 0); + break; + case SC_ToolButtonMenu: + if (popup) + ret.adjust(ret.width() - indicatorRect, ret.height() - indicatorRect, 0, 0); + break; + default: + break; + } + ret = visualRect(toolButton->direction, toolButton->rect, ret); + } + break; default: ret = QCommonStyle::subControlRect(control, option, scontrol, widget); } -- cgit v0.12 From ddbccf7f066d26d3420c9ed18d8c930200814ce1 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 30 Oct 2009 12:14:39 +0100 Subject: Add the Symbian Foundation OS versions Symbian^1 - SV_SF_1 Symbian^2 - SV_SF_2 etc. This is for the benefit of developers working with the Symbian master codelines. Reviewed-by: axis --- src/corelib/global/qglobal.cpp | 22 +++++++++++++++------- src/corelib/global/qglobal.h | 17 +++++++++++++---- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 33c6a34..5578091 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -960,7 +960,7 @@ QT_BEGIN_NAMESPACE \relates Turns the major, minor and patch numbers of a version into an - integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can + integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can be compared with another similarly processed version id. \sa QT_VERSION @@ -1795,7 +1795,7 @@ QSysInfo::S60Version QSysInfo::s60Version() TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_S60SystemInstallDir, contents); if (err == KErrNone) { err = contents->Sort(EDescending|ESortByName); - if (err == KErrNone) { + if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 12) { TInt major = (*contents)[0].iName[9] - '0'; TInt minor = (*contents)[0].iName[11] - '0'; if (major == 3) { @@ -1808,6 +1808,12 @@ QSysInfo::S60Version QSysInfo::s60Version() if (minor == 0) { return cachedS60Version = SV_S60_5_0; } + else if (minor == 1) { + return cachedS60Version = SV_S60_5_1; + } + else if (minor == 2) { + return cachedS60Version = SV_S60_5_2; + } } } delete contents; @@ -1822,12 +1828,10 @@ QSysInfo::S60Version QSysInfo::s60Version() return cachedS60Version = SV_S60_3_2; # elif defined(__S60_50__) return cachedS60Version = SV_S60_5_0; -# else - return cachedS60Version = SV_S60_Unknown; # endif -# else - return cachedS60Version = SV_S60_Unknown; # endif + //If reaching here, it was not possible to determine the version + return cachedS60Version = SV_S60_Unknown; } QSysInfo::SymbianVersion QSysInfo::symbianVersion() { @@ -1838,6 +1842,10 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion() return SV_9_3; case SV_S60_5_0: return SV_9_4; + case SV_S60_5_1: + return SV_9_4; + case SV_S60_5_2: + return SV_9_4; default: return SV_Unknown; } @@ -2572,7 +2580,7 @@ void qsrand() seed = GetTickCount(); srand(seed); -#else +#else // Symbian? #endif // defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index cbb8fda..95f09ea 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1478,17 +1478,26 @@ public: #ifdef Q_OS_SYMBIAN enum SymbianVersion { SV_Unknown = 0x0000, + //These are the Symbian Ltd versions 9.2-9.4 SV_9_2 = 10, SV_9_3 = 20, - SV_9_4 = 30 + SV_9_4 = 30, + //Following values are the symbian foundation versions, i.e. Symbian^1 == SV_SF_1 + SV_SF_1 = SV_9_4, + SV_SF_2 = 40, + SV_SF_3 = 50, + SV_SF_4 = 60 }; static SymbianVersion symbianVersion(); enum S60Version { SV_S60_None = 0, SV_S60_Unknown = 1, - SV_S60_3_1 = 10, - SV_S60_3_2 = 20, - SV_S60_5_0 = 30 + SV_S60_3_1 = SV_9_2, + SV_S60_3_2 = SV_9_3, + SV_S60_5_0 = SV_9_4, + //versions beyond 5.0 are to be confirmed - it is better to use symbian version + SV_S60_5_1 = SV_SF_2, + SV_S60_5_2 = SV_SF_3 }; static S60Version s60Version(); #endif -- cgit v0.12 From 92a393940d2dc3a9e2cd4f27e4ca62643c816f6f Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 30 Oct 2009 17:43:45 +0100 Subject: Fix crash in QApplication autotest introduced by native pixmaps (S60 3.1) Problem was caused by S60 closing a handle under our feet when QApplication is destroyed. To avoid this, we open our own handle for the global lock instead of using the shared one inside CFbsBitmap. Also the global unlock/relock is not needed on S60 3.2 so this can be eliminated and save a few cycles (the function call was a no-op before) Reviewed-by: Jani Hautakangas --- src/gui/image/qpixmap_s60.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 7086341..5c7e93f 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -73,27 +73,27 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, used to lock the global bitmap heap. Only used in S60 v3.1 and S60 v3.2. */ +_LIT(KFBSERVLargeBitmapAccessName,"FbsLargeBitmapAccess"); class QSymbianFbsClient { public: - QSymbianFbsClient() : heapLock(0), heapLocked(false) + QSymbianFbsClient() : heapLocked(false) { - QT_TRAP_THROWING(heapLock = new(ELeave) CFbsBitmap); - heapLock->Create(TSize(0,0), S60->screenDevice()->DisplayMode()); + heapLock.OpenGlobal(KFBSERVLargeBitmapAccessName); } ~QSymbianFbsClient() { - delete heapLock; + heapLock.Close(); } bool lockHeap() { bool wasLocked = heapLocked; - if (heapLock && !heapLocked) { - heapLock->LockHeap(ETrue); + if (heapLock.Handle() && !heapLocked) { + heapLock.Wait(); heapLocked = true; } @@ -104,8 +104,8 @@ public: { bool wasLocked = heapLocked; - if (heapLock && heapLocked) { - heapLock->UnlockHeap(ETrue); + if (heapLock.Handle() && heapLocked) { + heapLock.Signal(); heapLocked = false; } @@ -115,7 +115,7 @@ public: private: - CFbsBitmap *heapLock; + RMutex heapLock; bool heapLocked; }; @@ -169,7 +169,7 @@ public: inline void beginDataAccess(CFbsBitmap *bitmap) { - if (symbianVersion == QSysInfo::SV_9_2 || symbianVersion == QSysInfo::SV_9_3) + if (symbianVersion == QSysInfo::SV_9_2) heapWasLocked = qt_symbianFbsClient()->lockHeap(); else bitmap->LockHeap(ETrue); @@ -177,7 +177,7 @@ public: inline void endDataAccess(CFbsBitmap *bitmap) { - if (symbianVersion == QSysInfo::SV_9_2 || symbianVersion == QSysInfo::SV_9_3) { + if (symbianVersion == QSysInfo::SV_9_2) { if (!heapWasLocked) qt_symbianFbsClient()->unlockHeap(); } else { -- cgit v0.12 From 5308b1c607c1209822078d8aae329308c8017636 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 3 Nov 2009 09:47:25 +0100 Subject: Fix for potential crash in S60 style Leaving function called without a TRAP Reviewed-by: Sami Merila --- src/gui/styles/qs60style_s60.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 678844c..0cd87bd 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1382,13 +1382,13 @@ QSize QS60StylePrivate::naviPaneSize() QSize QS60StyleModeSpecifics::naviPaneSize() { CAknNavigationControlContainer* naviContainer; - if (S60->statusPane()) - naviContainer = static_cast - (S60->statusPane()->ControlL(TUid::Uid(EEikStatusPaneUidNavi))); - if (naviContainer) - return QSize(naviContainer->Size().iWidth, naviContainer->Size().iHeight); - else - return QSize(0,0); + if (S60->statusPane()) { + TRAPD(err, naviContainer = static_cast + (S60->statusPane()->ControlL(TUid::Uid(EEikStatusPaneUidNavi)))); + if (err==KErrNone) + return QSize(naviContainer->Size().iWidth, naviContainer->Size().iHeight); + } + return QSize(0,0); } #endif // Q_WS_S60 -- cgit v0.12 From 3769f290ccc20ff92dd43038743f96097d9fabd0 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 3 Nov 2009 13:03:11 +0100 Subject: Fix cleanupstack crash on exit in Symbian OS 9.2 Destroying the control environment also pops items from the original cleanup stack which is not owned by the control environment. This is a platform issue (and does not occur in 9.3 & 9.4). To avoid this causing a panic, the s60main is changed to not push items on the cleanup stack (instead, it TRAPs the call to main(), and deletes its allocations manually). A further 9.2 cleanup stack crash was caused when application construction fails (because of missing resource files). The resulting exception would bypass deleting the control environment, and return from main with the wrong cleanup stack active. This is resolved by doing the TRAP / cleanup / throw manually instead of using qt_trap_throwing (The control environment cannot be pushed to the cleanup stack, because it owns the cleanup stack at that time). This isn't a 9.2 specific bug, but rather is revealed by 9.2 because the missing resource file is non fatal in 9.3 and 9.4. Fixes many autotests which have crashed on S60 3.1 since the cleanup stack swapping patch. Reviewed-by: axis --- src/gui/kernel/qapplication_s60.cpp | 11 ++++++++++- src/s60main/qts60main_mcrt0.cpp | 8 +++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e5ee2f1..1b0659a 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1052,8 +1052,17 @@ void qt_init(QApplicationPrivate * /* priv */, int) // After this construction, CEikonEnv will be available from CEikonEnv::Static(). // (much like our qApp). CEikonEnv* coe = new CEikonEnv; - QT_TRAP_THROWING(coe->ConstructAppFromCommandLineL(factory,*commandLine)); + //not using QT_TRAP_THROWING, because coe owns the cleanupstack so it can't be pushed there. + if(err == KErrNone) + TRAP(err, coe->ConstructAppFromCommandLineL(factory,*commandLine)); delete commandLine; + if(err != KErrNone) { + qWarning() << "qt_init: Eikon application construct failed (" + << err + << "), maybe missing resource file on S60 3.1?"; + delete coe; + qt_symbian_throwIfError(err); + } S60->s60InstalledTrapHandler = User::SetTrapHandler(origTrapHandler); diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp index d30e07a..edc2fb8 100644 --- a/src/s60main/qts60main_mcrt0.cpp +++ b/src/s60main/qts60main_mcrt0.cpp @@ -83,12 +83,10 @@ GLDEF_C TInt QtMainWrapper() char **envp = 0; // get args & environment __crt0(argc, argv, envp); - CleanupArrayDelete::PushL(argv); - CleanupArrayDelete::PushL(envp); //Call user(application)'s main - int ret = 0; - QT_TRYCATCH_LEAVING(ret = CALLMAIN(argc, argv, envp);); - CleanupStack::PopAndDestroy(2, argv); + TRAPD(ret, QT_TRYCATCH_LEAVING(ret = CALLMAIN(argc, argv, envp);)); + delete[] argv; + delete[] envp; return ret; } -- cgit v0.12 From 5919feba122d0e5a696a72a3d1e2eff6928824f8 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 3 Nov 2009 13:49:32 +0100 Subject: Fix qclipboard autotest on s60 3.1 It launches 2 subprocesses that use QApplication. Added the resource files to deployment so that construction does not fail Reviewed-by: axis --- tests/auto/qclipboard/test/test.pro | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro index 508eba1..62a38af 100644 --- a/tests/auto/qclipboard/test/test.pro +++ b/tests/auto/qclipboard/test/test.pro @@ -13,7 +13,18 @@ win32 { wince*|symbian*: { copier.sources = ../copier/copier.exe copier.path = copier - paster.sources = ../paster/paster.exe + paster.sources = ../paster/paster.exe paster.path = paster - DEPLOYMENT = copier paster + + symbian*: { + load(data_caging_paths) + rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc + rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc + rsc.path = $$APP_RESOURCE_DIR + reg_resource.sources = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc + reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc + reg_resource.path = $$REG_RESOURCE_IMPORT_DIR + } + + DEPLOYMENT = copier paster rsc reg_resource } \ No newline at end of file -- cgit v0.12 From 95f7076937065a78029fc50d506fba58f8c6199c Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 3 Nov 2009 13:51:49 +0100 Subject: Fix qdatetime autotest regression My previous addition to the test case to validate local time was too strict for all platforms. Reviewed-by: Paul --- tests/auto/qdatetime/tst_qdatetime.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index c53780e..1140402 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -450,11 +450,12 @@ void tst_QDateTime::toString_enumformat() qDebug() << str3; QVERIFY(!str3.isEmpty()); //check for date/time components in any order - QVERIFY(str3.contains("1995")); + //year may be 2 or 4 digits + QVERIFY(str3.contains("95")); //day and month may be in numeric or word form QVERIFY(str3.contains("12")); QVERIFY(str3.contains("34")); - QVERIFY(str3.contains("56")); + //seconds may be absent } void tst_QDateTime::addDays() -- cgit v0.12 From 381247326743888075979664f50ea804d6123c42 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 3 Nov 2009 13:56:42 +0100 Subject: Fixed an input method bug when erasing the last character. Previously we didn't update the editor contents if the new preedit string was empty. However, it could be empty because the user just erased it, so the bug was fixed by checking whether the preedit string in the event and in the editor are different. RevBy: Denis Dzyubenko --- src/gui/text/qtextcontrol.cpp | 3 ++- src/gui/widgets/qlinecontrol.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 3f6545c..9497b6f 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1831,7 +1831,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) e->ignore(); return; } - bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty() + bool isGettingInput = !e->commitString().isEmpty() + || e->preeditString() != cursor.block().layout()->preeditAreaText() || e->replacementLength() > 0; if (isGettingInput) { diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 8f17e98..0fc94c9 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -401,7 +401,8 @@ void QLineControl::moveCursor(int pos, bool mark) void QLineControl::processInputMethodEvent(QInputMethodEvent *event) { int priorState = 0; - bool isGettingInput = !event->commitString().isEmpty() || !event->preeditString().isEmpty() + bool isGettingInput = !event->commitString().isEmpty() + || event->preeditString() != preeditAreaText() || event->replacementLength() > 0; bool cursorPositionChanged = false; -- cgit v0.12 From 03c5d276c6ffc16c43ac554aa2e22b5824c35c95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sami=20Meril=C3=A4?= Date: Tue, 3 Nov 2009 16:03:10 +0200 Subject: Inclusion of QtOpenVg overwrites all other modules in s60install.pro The pro-file is missing '+' when it is adding QtOpenVg support for sis file. Task-number: None Reviewed-by: Janne Koskinen --- src/s60installs/s60installs.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 9c53167..90c9f27 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -107,7 +107,7 @@ symbian: { graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems contains(QT_CONFIG, openvg) { - qtlibraries.sources = QtOpenVG.dll + qtlibraries.sources += QtOpenVG.dll graphicssystems_plugins.sources += qvggraphicssystem.dll } -- cgit v0.12 From fc45c07c27100591750ad5c360fde535e15b9dbd Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 3 Nov 2009 16:45:10 +0200 Subject: Made xmlpatterns autotests compile for Symbian Fixed xmlpatterns autotests so that they compile for Symbian with both RVCT and NokiaX86 compilers. Reviewed-by: Janne Koskinen --- src/xmlpatterns/acceltree/qacceltree_p.h | 2 +- src/xmlpatterns/acceltree/qcompressedwhitespace_p.h | 2 +- tests/auto/checkxmlfiles/checkxmlfiles.pro | 2 +- tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp | 2 +- tests/auto/qxmlquery/tst_qxmlquery.cpp | 14 +++++++------- tests/auto/qxmlschema/tst_qxmlschema.cpp | 4 ++-- tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp | 12 ++++++------ tests/auto/qxmlserializer/tst_qxmlserializer.cpp | 4 ++-- tests/auto/xmlpatterns.pri | 5 +++-- tests/auto/xmlpatterns/tst_xmlpatterns.cpp | 10 +++++++++- tests/auto/xmlpatterns/xmlpatterns.pro | 6 +++--- tests/auto/xmlpatternsdiagnosticsts/test/test.pro | 4 ++-- tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro | 5 +++-- tests/auto/xmlpatternsxqts/lib/Global.h | 2 +- tests/auto/xmlpatternsxqts/lib/lib.pro | 6 ++++++ 15 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/xmlpatterns/acceltree/qacceltree_p.h b/src/xmlpatterns/acceltree/qacceltree_p.h index 8da61c9..ee7d6f6 100644 --- a/src/xmlpatterns/acceltree/qacceltree_p.h +++ b/src/xmlpatterns/acceltree/qacceltree_p.h @@ -89,7 +89,7 @@ namespace QPatternist * @see Accelerating * XPath Evaluation in Any RDBMS, Torsten Grust */ - class AccelTree : public QAbstractXmlNodeModel + class Q_AUTOTEST_EXPORT AccelTree : public QAbstractXmlNodeModel { friend class AccelTreePrivate; public: diff --git a/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h b/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h index bb547bd..27e3c22 100644 --- a/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h +++ b/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h @@ -84,7 +84,7 @@ namespace QPatternist * * @author Frans Englich */ - class CompressedWhitespace + class Q_AUTOTEST_EXPORT CompressedWhitespace { public: /** diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro index c368c02..d53c11c 100644 --- a/tests/auto/checkxmlfiles/checkxmlfiles.pro +++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro @@ -12,7 +12,7 @@ addFiles.sources = \ $$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \ $$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/globals.gccxml \ $$QT_SOURCE_TREE/doc/src/diagrams/stylesheet/treeview.svg \ - $$QT_SOURCE_TREE/doc/src/diagrams/designer-mainwindow-actions.ui \ + $$QT_SOURCE_TREE/doc/src/diagrams/designer-manual/designer-mainwindow-actions.ui \ $$QT_SOURCE_TREE/demos/undo/undo.qrc addFiles.path = xmlfiles DEPLOYMENT += addFiles diff --git a/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp b/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp index cb6bd4d..c19deb6 100644 --- a/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp +++ b/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp @@ -178,7 +178,7 @@ void tst_QXmlNodeModelIndex::model() const /* Check default value. */ { const QXmlNodeModelIndex index; - QCOMPARE(index.model(), static_cast(0)); + QCOMPARE(index.model(), static_cast(0)); } } diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp index 8a9d4ef..49f2b08 100644 --- a/tests/auto/qxmlquery/tst_qxmlquery.cpp +++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp @@ -345,8 +345,8 @@ void tst_QXmlQuery::copyConstructor() const query1.setInitialTemplateName(name); const QXmlQuery query2(query1); - QCOMPARE(query2.messageHandler(), &silencer); - QCOMPARE(query2.uriResolver(), &resolver); + QCOMPARE(query2.messageHandler(), static_cast(&silencer)); + QCOMPARE(query2.uriResolver(), static_cast(&resolver)); QCOMPARE(query2.queryLanguage(), QXmlQuery::XSLT20); QCOMPARE(query2.initialTemplateName(), name); QCOMPARE(query2.networkAccessManager(), &networkManager); @@ -522,7 +522,7 @@ void tst_QXmlQuery::assignmentOperator() const QVERIFY(copy.isValid()); QCOMPARE(copy.uriResolver(), static_cast(&returnURI)); - QCOMPARE(copy.messageHandler(), &silencer); + QCOMPARE(copy.messageHandler(), static_cast(&silencer)); QCOMPARE(testName.localName(copy.namePool()), QString::fromLatin1("somethingToCheck")); QXmlResultItems result; @@ -559,7 +559,7 @@ void tst_QXmlQuery::assignmentOperator() const /* Check that the copy picked up the new things. */ QVERIFY(copy.isValid()); QCOMPARE(copy.uriResolver(), static_cast(&secondUriResolver)); - QCOMPARE(copy.messageHandler(), &secondSilencer); + QCOMPARE(copy.messageHandler(), static_cast(&secondSilencer)); QXmlResultItems resultCopy; copy.evaluateTo(&resultCopy); @@ -577,7 +577,7 @@ void tst_QXmlQuery::assignmentOperator() const /* Check that the original is unchanged. */ QVERIFY(original.isValid()); QCOMPARE(original.uriResolver(), static_cast(&returnURI)); - QCOMPARE(original.messageHandler(), &silencer); + QCOMPARE(original.messageHandler(), static_cast(&silencer)); QXmlResultItems resultOriginal; original.evaluateTo(&resultOriginal); @@ -931,7 +931,7 @@ void tst_QXmlQuery::setMessageHandler() const QXmlQuery query; MessageSilencer silencer; query.setMessageHandler(&silencer); - QCOMPARE(&silencer, query.messageHandler()); + QCOMPARE(static_cast(&silencer), query.messageHandler()); } void tst_QXmlQuery::evaluateToReceiver() @@ -1691,7 +1691,7 @@ void tst_QXmlQuery::setUriResolver() const TestURIResolver resolver; QXmlQuery query; query.setUriResolver(&resolver); - QCOMPARE(query.uriResolver(), &resolver); + QCOMPARE(query.uriResolver(), static_cast(&resolver)); } } diff --git a/tests/auto/qxmlschema/tst_qxmlschema.cpp b/tests/auto/qxmlschema/tst_qxmlschema.cpp index 79f5587..ec91f88 100644 --- a/tests/auto/qxmlschema/tst_qxmlschema.cpp +++ b/tests/auto/qxmlschema/tst_qxmlschema.cpp @@ -357,7 +357,7 @@ void tst_QXmlSchema::messageHandler() const QXmlSchema schema; schema.setMessageHandler(&handler); - QCOMPARE(schema.messageHandler(), &handler); + QCOMPARE(schema.messageHandler(), static_cast(&handler)); } } @@ -394,7 +394,7 @@ void tst_QXmlSchema::uriResolver() const QXmlSchema schema; schema.setUriResolver(&resolver); - QCOMPARE(schema.uriResolver(), &resolver); + QCOMPARE(schema.uriResolver(), static_cast(&resolver)); } } diff --git a/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp b/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp index 519f864..9fc784b 100644 --- a/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp +++ b/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp @@ -149,8 +149,8 @@ void tst_QXmlSchemaValidator::propertyInitialization() const schema.setNetworkAccessManager(&manager); QXmlSchemaValidator validator(schema); - QCOMPARE(validator.messageHandler(), &handler); - QCOMPARE(validator.uriResolver(), &resolver); + QCOMPARE(validator.messageHandler(), static_cast(&handler)); + QCOMPARE(validator.uriResolver(), static_cast(&resolver)); QCOMPARE(validator.networkAccessManager(), &manager); } } @@ -384,7 +384,7 @@ void tst_QXmlSchemaValidator::messageHandler() const QXmlSchemaValidator validator(schema); validator.setMessageHandler(&handler); - QCOMPARE(validator.messageHandler(), &handler); + QCOMPARE(validator.messageHandler(), static_cast(&handler)); } /* Test that we return the message handler that was set, even if the schema changed in between. */ @@ -399,7 +399,7 @@ void tst_QXmlSchemaValidator::messageHandler() const const QXmlSchema schema2; validator.setSchema(schema2); - QCOMPARE(validator.messageHandler(), &handler); + QCOMPARE(validator.messageHandler(), static_cast(&handler)); } } @@ -452,7 +452,7 @@ void tst_QXmlSchemaValidator::uriResolver() const QXmlSchemaValidator validator(schema); validator.setUriResolver(&resolver); - QCOMPARE(validator.uriResolver(), &resolver); + QCOMPARE(validator.uriResolver(), static_cast(&resolver)); } /* Test that we return the uri resolver that was set, even if the schema changed in between. */ @@ -467,7 +467,7 @@ void tst_QXmlSchemaValidator::uriResolver() const const QXmlSchema schema2; validator.setSchema(schema2); - QCOMPARE(validator.uriResolver(), &resolver); + QCOMPARE(validator.uriResolver(), static_cast(&resolver)); } } diff --git a/tests/auto/qxmlserializer/tst_qxmlserializer.cpp b/tests/auto/qxmlserializer/tst_qxmlserializer.cpp index aeca140..51044ff 100644 --- a/tests/auto/qxmlserializer/tst_qxmlserializer.cpp +++ b/tests/auto/qxmlserializer/tst_qxmlserializer.cpp @@ -148,7 +148,7 @@ void tst_QXmlSerializer::outputDevice() const { const QXmlQuery query; const QXmlSerializer serializer(query, &file); - QCOMPARE(serializer.outputDevice(), &file); + QCOMPARE(serializer.outputDevice(), static_cast< QIODevice *>(&file)); } } @@ -158,7 +158,7 @@ void tst_QXmlSerializer::serializationError() const QXmlQuery query; MessageSilencer silencer; query.setMessageHandler(&silencer); - + query.setQuery(queryString); QByteArray output; diff --git a/tests/auto/xmlpatterns.pri b/tests/auto/xmlpatterns.pri index 7cdd67f..8c8ccad 100644 --- a/tests/auto/xmlpatterns.pri +++ b/tests/auto/xmlpatterns.pri @@ -15,8 +15,9 @@ QT -= gui XMLPATTERNS_SDK = QtXmlPatternsSDK if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { - win32:XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}d - else: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}_debug + symbian: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK} + else:win32: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}d + else: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}_debug } INCLUDEPATH += \ diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp index 0dcb070..22f6693 100644 --- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp +++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp @@ -48,6 +48,10 @@ #include "../qxmlquery/TestFundament.h" #include "../network-settings.h" +#if defined(Q_OS_SYMBIAN) +#define SRCDIR "" +#endif + /*! \class tst_XmlPatterns \internal @@ -130,6 +134,8 @@ void tst_XmlPatterns::xquerySupport() #ifdef Q_OS_WINCE QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll); +#elif defined(Q_OS_SYMBIAN) + QSKIP("Symbian: This test uses unsupported Symbian functionality (QProcess with std streams)", SkipAll); #endif QFETCH(int, expectedExitCode); @@ -218,7 +224,7 @@ void tst_XmlPatterns::xquerySupport() void tst_XmlPatterns::xquerySupport_data() const { -#ifdef Q_OS_WINCE +#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) return; #endif @@ -849,6 +855,8 @@ void tst_XmlPatterns::xsltSupport_data() const #ifdef Q_OS_WINCE QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll); +#elif defined(Q_OS_SYMBIAN) + QSKIP("Symbian: This test uses unsupported Symbian functionality (QProcess with std streams)", SkipAll); #endif QTest::addColumn("expectedExitCode"); diff --git a/tests/auto/xmlpatterns/xmlpatterns.pro b/tests/auto/xmlpatterns/xmlpatterns.pro index 01e3b2b..54dd9aa 100644 --- a/tests/auto/xmlpatterns/xmlpatterns.pro +++ b/tests/auto/xmlpatterns/xmlpatterns.pro @@ -2,10 +2,10 @@ load(qttest_p4) SOURCES += tst_xmlpatterns.cpp \ ../qxmlquery/TestFundament.cpp -!wince* { -DEFINES += SRCDIR=\\\"$$PWD/\\\" -} else { +wince* { DEFINES += SRCDIR=\\\"./\\\" +} else:!symbian { +DEFINES += SRCDIR=\\\"$$PWD/\\\" } include (../xmlpatterns.pri) diff --git a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro b/tests/auto/xmlpatternsdiagnosticsts/test/test.pro index aeff896..acd71e4 100644 --- a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro +++ b/tests/auto/xmlpatternsdiagnosticsts/test/test.pro @@ -25,8 +25,8 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/lib/ \ ../../xmlpatternsxqts/test \ ../../xmlpatternsxqts/lib -wince*: { - catalog.sources = TestSuite Baseline.xml +wince*|symbian { + catalog.sources = ../TestSuite ../Baseline.xml catalog.path = . DEPLOYMENT += catalog } diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro index bcc988a..0f55078 100644 --- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro +++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro @@ -11,8 +11,9 @@ SOURCES += ../xmlpatternsxqts/test/tst_suitetest.cpp PATTERNIST_SDK = QtXmlPatternsSDK if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { - win32:PATTERNIST_SDK = $${PATTERNIST_SDK}d - else: PATTERNIST_SDK = $${PATTERNIST_SDK}_debug + symbian: PATTERNIST_SDK = $${PATTERNIST_SDK} + else:win32: PATTERNIST_SDK = $${PATTERNIST_SDK}d + else: PATTERNIST_SDK = $${PATTERNIST_SDK}_debug } LIBS += -l$$PATTERNIST_SDK diff --git a/tests/auto/xmlpatternsxqts/lib/Global.h b/tests/auto/xmlpatternsxqts/lib/Global.h index eadb940..a620417 100644 --- a/tests/auto/xmlpatternsxqts/lib/Global.h +++ b/tests/auto/xmlpatternsxqts/lib/Global.h @@ -47,7 +47,7 @@ #include "private/qitem_p.h" #include "private/qnamepool_p.h" -#ifdef Q_WS_WIN +#if defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN) # ifdef Q_PATTERNISTSDK_BUILDING #define Q_PATTERNISTSDK_EXPORT __declspec(dllexport) #else diff --git a/tests/auto/xmlpatternsxqts/lib/lib.pro b/tests/auto/xmlpatternsxqts/lib/lib.pro index cb9453a..f5b0a06 100644 --- a/tests/auto/xmlpatternsxqts/lib/lib.pro +++ b/tests/auto/xmlpatternsxqts/lib/lib.pro @@ -13,6 +13,12 @@ mac { INSTALLS += target } +symbian { + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = All -Tcb + MMP_RULES += EXPORTUNFROZEN +} + # We add gui, because xmlpatterns.pri pull it out. QT += xmlpatterns xml network testlib gui -- cgit v0.12