diff options
Diffstat (limited to 'src')
78 files changed, 1193 insertions, 471 deletions
diff --git a/src/3rdparty/phonon/ds9/videowidget.cpp b/src/3rdparty/phonon/ds9/videowidget.cpp index 1eddaee..09d42a4 100644 --- a/src/3rdparty/phonon/ds9/videowidget.cpp +++ b/src/3rdparty/phonon/ds9/videowidget.cpp @@ -223,6 +223,9 @@ namespace Phonon if (toNative && m_noNativeRendererSupported) return current; //no switch here + if (!mediaObject()) + return current; + //firt we delete the renderer //initialization of the widgets for(int i = 0; i < FILTER_COUNT; ++i) { diff --git a/src/3rdparty/phonon/mmf/environmentalreverb.cpp b/src/3rdparty/phonon/mmf/environmentalreverb.cpp index 4a6ce29..d4f5223 100644 --- a/src/3rdparty/phonon/mmf/environmentalreverb.cpp +++ b/src/3rdparty/phonon/mmf/environmentalreverb.cpp @@ -139,77 +139,68 @@ bool EnvironmentalReverb::getParameters(CMdaAudioOutputStream *stream, TInt32 min, max; TUint32 umin, umax; - // DecayHFRatio - // Ratio of high-frequency decay time to the value specified by - // DecayTime. effect->DecayHFRatioRange(umin, umax); + //: DecayHFRatio: Ratio of high-frequency decay time to the value specified by + //: DecayTime. parameters.append(createParameter( DecayHFRatio, tr("Decay HF ratio (%)"), effect->DecayHFRatio(), umin, umax)); - // DecayTime - // Time over which reverberation is diminished. effect->DecayTimeRange(umin, umax); + //: DecayTime: Time over which reverberation is diminished. parameters.append(createParameter( DecayTime, tr("Decay time (ms)"), effect->DecayTime(), umin, umax)); - // Density - // Delay between first and subsequent reflections. - // Note that the S60 platform documentation does not make clear - // the distinction between this value and the Diffusion value. + //: Density Delay between first and subsequent reflections. + //: Note that the S60 platform documentation does not make clear + //: the distinction between this value and the Diffusion value. parameters.append(createParameter( Density, tr("Density (%)"), effect->Density(), 0, 100)); - // Diffusion - // Delay between first and subsequent reflections. - // Note that the S60 platform documentation does not make clear - // the distinction between this value and the Density value. + //: Diffusion: Delay between first and subsequent reflections. + //: Note that the S60 platform documentation does not make clear + //: the distinction between this value and the Density value. parameters.append(createParameter( Diffusion, tr("Diffusion (%)"), effect->Diffusion(), 0, 100)); - // ReflectionsDelay - // Amount of delay between the arrival the direct path from the - // source and the arrival of the first reflection. + //: ReflectionsDelay: Amount of delay between the arrival the direct + //: path from the source and the arrival of the first reflection. parameters.append(createParameter( ReflectionsDelay, tr("Reflections delay (ms)"), effect->ReflectionsDelay(), 0, effect->ReflectionsDelayMax())); - // ReflectionsLevel - // Amplitude of reflections. This value is corrected by the RoomLevel - // to give the final reflection amplitude. - effect->ReflectionLevelRange(min, max); + effect->ReflectionLevelRange(min, max); + //: ReflectionsLevel: Amplitude of reflections. This value is + //: corrected by the RoomLevel to give the final reflection amplitude. parameters.append(createParameter( ReflectionsLevel, tr("Reflections level (mB)"), effect->ReflectionsLevel(), min, max, EffectParameter::LogarithmicHint)); - // ReverbDelay - // Amount of time between arrival of the first reflection and start of - // the late reverberation. + //: ReverbDelay: Amount of time between arrival of the first + //: reflection and start of the late reverberation. parameters.append(createParameter( ReverbDelay, tr("Reverb delay (ms)"), effect->ReverbDelay(), 0, effect->ReverbDelayMax())); - // ReverbLevel - // Amplitude of reverberations. This value is corrected by the - // RoomLevel to give the final reverberation amplitude. effect->ReverbLevelRange(min, max); + //: ReverbLevel Amplitude of reverberations. This value is + //: corrected by the RoomLevel to give the final reverberation + //: amplitude. parameters.append(createParameter( ReverbLevel, tr("Reverb level (mB)"), effect->ReverbLevel(), min, max, EffectParameter::LogarithmicHint)); - // RoomHFLevel - // Amplitude of low-pass filter used to attenuate the high frequency - // component of reflected sound. effect->RoomHFLevelRange(min, max); + //: RoomHFLevel: Amplitude of low-pass filter used to attenuate the + //: high frequency component of reflected sound. parameters.append(createParameter( RoomHFLevel, tr("Room HF level"), effect->RoomHFLevel(), min, max)); - // RoomLevel - // Master volume control for all reflected sound. effect->RoomLevelRange(min, max); + //: RoomLevel: Master volume control for all reflected sound. parameters.append(createParameter( RoomLevel, tr("Room level (mB)"), effect->RoomLevel(), min, max, EffectParameter::LogarithmicHint)); diff --git a/src/3rdparty/s60/eiksoftkeyimage.h b/src/3rdparty/s60/eiksoftkeyimage.h new file mode 100644 index 0000000..84f6108a --- /dev/null +++ b/src/3rdparty/s60/eiksoftkeyimage.h @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module 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$ +** +****************************************************************************/ + +/* +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Changes cba button's label to image. +* +*/ + +#ifndef EIKSOFTKEYIMAGE_H +#define EIKSOFTKEYIMAGE_H + +// FORWARD DECLARATIONS +class CEikButtonGroupContainer; + +// CLASS DECLARATION + +/** +* Changes cba button's label to image. +* +* @lib EIKCOCTL +* @since 2.0 +*/ +class EikSoftkeyImage + { + public: + + /** + * Set image to cba button by replacing label + * @since 2.0 + * @param aButtonGroupContainer Button container + * @param aImage Image to button, + * Takes Images ownership + * @param aLeft Boolean: left or right button. + * If true, then change left, + * if false, change right + */ + IMPORT_C static void SetImage(CEikButtonGroupContainer* aButtonGroupContainer, CEikImage& aImage, TBool aLeft); + + /** + * Change to cba button image back to label + * @since 2.0 + * @param aButtonGroupContainer Button container + * @param aLeft Boolean: left or right button. + * If true, then change left, + * if false, change right + */ + IMPORT_C static void SetLabel(CEikButtonGroupContainer* aButtonGroupContainer, TBool aLeft); + + private: + + /** + * C++ default constructor. + */ + EikSoftkeyImage() {}; + + + }; + +#endif // EIKSOFTKEYIMAGE_H + +// End of File + diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index c304876..4348cbc 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 69dd29fbeb12d076741dce70ac6bc155101ccd6f + da5d96a26e80162027bc95ce7e5725fe4b277ff7 diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 18d119a..1f6f290 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -2,6 +2,44 @@ Reviewed by Kenneth Rohde Christiansen. + [Qt] In the StyledPainter determine the style from the Render and Scrollbar theme instead of from the paint device + https://bugs.webkit.org/show_bug.cgi?id=34054 + + Getting the style from the painter's paint device is a hack that breaks when + the paint device's style is different than the style that is used when + calculating the metries earlier when there is no painter available. + + This change moves us closer to always using the same style. + + * platform/qt/RenderThemeQt.cpp: + (WebCore::StylePainter::StylePainter): + (WebCore::StylePainter::init): + (WebCore::RenderThemeQt::paintButton): + (WebCore::RenderThemeQt::paintTextField): + (WebCore::RenderThemeQt::paintMenuList): + (WebCore::RenderThemeQt::paintMenuListButton): + (WebCore::RenderThemeQt::paintSliderTrack): + (WebCore::RenderThemeQt::paintMediaMuteButton): + (WebCore::RenderThemeQt::paintMediaPlayButton): + (WebCore::RenderThemeQt::paintMediaSliderTrack): + (WebCore::RenderThemeQt::paintMediaSliderThumb): + * platform/qt/RenderThemeQt.h: + * platform/qt/ScrollbarThemeQt.cpp: + (WebCore::ScrollbarThemeQt::paint): + (WebCore::ScrollbarThemeQt::hitTest): + (WebCore::ScrollbarThemeQt::shouldCenterOnThumb): + (WebCore::ScrollbarThemeQt::scrollbarThickness): + (WebCore::ScrollbarThemeQt::thumbLength): + (WebCore::ScrollbarThemeQt::trackPosition): + (WebCore::ScrollbarThemeQt::trackLength): + (WebCore::ScrollbarThemeQt::paintScrollCorner): + (WebCore::ScrollbarThemeQt::style): + * platform/qt/ScrollbarThemeQt.h: + +2010-01-25 Simon Hausmann <hausmann@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + [Qt] Use the fallback style on Maemo 5 https://bugs.webkit.org/show_bug.cgi?id=34376 diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp index 6a1eee8..37a6408 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp @@ -44,6 +44,7 @@ #include "Page.h" #include "RenderBox.h" #include "RenderTheme.h" +#include "ScrollbarThemeQt.h" #include "UserAgentStyleSheets.h" #include "QWebPageClient.h" #include "qwebpage.h" @@ -66,17 +67,17 @@ namespace WebCore { using namespace HTMLNames; -StylePainter::StylePainter(const RenderObject::PaintInfo& paintInfo) +StylePainter::StylePainter(RenderThemeQt* theme, const RenderObject::PaintInfo& paintInfo) { - init(paintInfo.context ? paintInfo.context : 0); + init(paintInfo.context ? paintInfo.context : 0, theme->qStyle()); } -StylePainter::StylePainter(GraphicsContext* context) +StylePainter::StylePainter(ScrollbarThemeQt* theme, GraphicsContext* context) { - init(context); + init(context, theme->style()); } -void StylePainter::init(GraphicsContext* context) +void StylePainter::init(GraphicsContext* context, QStyle* themeStyle) { painter = static_cast<QPainter*>(context->platformContext()); widget = 0; @@ -85,7 +86,7 @@ void StylePainter::init(GraphicsContext* context) dev = painter->device(); if (dev && dev->devType() == QInternal::Widget) widget = static_cast<QWidget*>(dev); - style = (widget ? widget->style() : QApplication::style()); + style = themeStyle; if (painter) { // the styles often assume being called with a pristine painter where no brush is set, @@ -464,7 +465,7 @@ void RenderThemeQt::setButtonPadding(RenderStyle* style) const bool RenderThemeQt::paintButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { - StylePainter p(i); + StylePainter p(this, i); if (!p.isValid()) return true; @@ -497,7 +498,7 @@ void RenderThemeQt::adjustTextFieldStyle(CSSStyleSelector*, RenderStyle* style, bool RenderThemeQt::paintTextField(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { - StylePainter p(i); + StylePainter p(this, i); if (!p.isValid()) return true; @@ -566,7 +567,7 @@ void RenderThemeQt::setPopupPadding(RenderStyle* style) const bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { - StylePainter p(i); + StylePainter p(this, i); if (!p.isValid()) return true; @@ -606,7 +607,7 @@ void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* st bool RenderThemeQt::paintMenuListButton(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r) { - StylePainter p(i); + StylePainter p(this, i); if (!p.isValid()) return true; @@ -837,7 +838,7 @@ bool RenderThemeQt::paintMediaMuteButton(RenderObject* o, const RenderObject::Pa if (!mediaElement) return false; - StylePainter p(paintInfo); + StylePainter p(this, paintInfo); if (!p.isValid()) return true; @@ -866,7 +867,7 @@ bool RenderThemeQt::paintMediaPlayButton(RenderObject* o, const RenderObject::Pa if (!mediaElement) return false; - StylePainter p(paintInfo); + StylePainter p(this, paintInfo); if (!p.isValid()) return true; @@ -905,7 +906,7 @@ bool RenderThemeQt::paintMediaSliderTrack(RenderObject* o, const RenderObject::P if (!mediaElement) return false; - StylePainter p(paintInfo); + StylePainter p(this, paintInfo); if (!p.isValid()) return true; @@ -932,7 +933,7 @@ bool RenderThemeQt::paintMediaSliderThumb(RenderObject* o, const RenderObject::P if (!mediaElement) return false; - StylePainter p(paintInfo); + StylePainter p(this, paintInfo); if (!p.isValid()) return true; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h index 19337ac..13fb42f 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.h @@ -35,6 +35,7 @@ namespace WebCore { class RenderStyle; class HTMLMediaElement; +class ScrollbarThemeQt; class RenderThemeQt : public RenderTheme { private: @@ -75,6 +76,8 @@ public: virtual String extraMediaControlsStyleSheet(); #endif + QStyle* qStyle() const; + protected: virtual bool paintCheckbox(RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& r); virtual void setCheckboxSize(RenderStyle*) const; @@ -137,7 +140,6 @@ private: void setButtonPadding(RenderStyle*) const; void setPopupPadding(RenderStyle*) const; - QStyle* qStyle() const; QStyle* fallbackStyle() const; Page* m_page; @@ -152,8 +154,8 @@ private: class StylePainter { public: - explicit StylePainter(const RenderObject::PaintInfo& paintInfo); - explicit StylePainter(GraphicsContext* context); + explicit StylePainter(RenderThemeQt*, const RenderObject::PaintInfo&); + explicit StylePainter(ScrollbarThemeQt*, GraphicsContext*); ~StylePainter(); bool isValid() const { return painter && style; } @@ -170,7 +172,7 @@ public: { style->drawComplexControl(cc, &opt, painter, widget); } private: - void init(GraphicsContext* context); + void init(GraphicsContext* context, QStyle*); QBrush oldBrush; bool oldAntialiasing; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp index 561e55f..c0692ca 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.cpp @@ -140,7 +140,7 @@ bool ScrollbarThemeQt::paint(Scrollbar* scrollbar, GraphicsContext* graphicsCont return false; } - StylePainter p(graphicsContext); + StylePainter p(this, graphicsContext); if (!p.isValid()) return true; @@ -172,14 +172,14 @@ ScrollbarPart ScrollbarThemeQt::hitTest(Scrollbar* scrollbar, const PlatformMous QStyleOptionSlider* opt = styleOptionSlider(scrollbar); const QPoint pos = scrollbar->convertFromContainingWindow(evt.pos()); opt->rect.moveTo(QPoint(0, 0)); - QStyle::SubControl sc = QApplication::style()->hitTestComplexControl(QStyle::CC_ScrollBar, opt, pos, 0); + QStyle::SubControl sc = style()->hitTestComplexControl(QStyle::CC_ScrollBar, opt, pos, 0); return scrollbarPart(sc); } bool ScrollbarThemeQt::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt) { // Middle click centers slider thumb (if supported) - return QApplication::style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition) && evt.button() == MiddleButton; + return style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition) && evt.button() == MiddleButton; } void ScrollbarThemeQt::invalidatePart(Scrollbar* scrollbar, ScrollbarPart) @@ -190,13 +190,12 @@ void ScrollbarThemeQt::invalidatePart(Scrollbar* scrollbar, ScrollbarPart) int ScrollbarThemeQt::scrollbarThickness(ScrollbarControlSize controlSize) { - QStyle* s = QApplication::style(); QStyleOptionSlider o; o.orientation = Qt::Vertical; o.state &= ~QStyle::State_Horizontal; if (controlSize != RegularScrollbar) o.state |= QStyle::State_Mini; - return s->pixelMetric(QStyle::PM_ScrollBarExtent, &o, 0); + return style()->pixelMetric(QStyle::PM_ScrollBarExtent, &o, 0); } int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar) @@ -209,21 +208,21 @@ int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar) int ScrollbarThemeQt::thumbLength(Scrollbar* scrollbar) { QStyleOptionSlider* opt = styleOptionSlider(scrollbar); - IntRect thumb = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarSlider, 0); + IntRect thumb = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarSlider, 0); return scrollbar->orientation() == HorizontalScrollbar ? thumb.width() : thumb.height(); } int ScrollbarThemeQt::trackPosition(Scrollbar* scrollbar) { QStyleOptionSlider* opt = styleOptionSlider(scrollbar); - IntRect track = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0); + IntRect track = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0); return scrollbar->orientation() == HorizontalScrollbar ? track.x() - scrollbar->x() : track.y() - scrollbar->y(); } int ScrollbarThemeQt::trackLength(Scrollbar* scrollbar) { QStyleOptionSlider* opt = styleOptionSlider(scrollbar); - IntRect track = QApplication::style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0); + IntRect track = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0); return scrollbar->orientation() == HorizontalScrollbar ? track.width() : track.height(); } @@ -237,7 +236,7 @@ void ScrollbarThemeQt::paintScrollCorner(ScrollView* scrollView, GraphicsContext #if QT_VERSION < 0x040500 context->fillRect(rect, QApplication::palette().color(QPalette::Normal, QPalette::Window)); #else - StylePainter p(context); + StylePainter p(this, context); if (!p.isValid()) return; @@ -247,5 +246,10 @@ void ScrollbarThemeQt::paintScrollCorner(ScrollView* scrollView, GraphicsContext #endif } +QStyle* ScrollbarThemeQt::style() const +{ + return QApplication::style(); +} + } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h index 6ca44ea..cf4882d 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h +++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollbarThemeQt.h @@ -28,6 +28,12 @@ #include "ScrollbarTheme.h" +#include <QtCore/qglobal.h> + +QT_BEGIN_NAMESPACE +class QStyle; +QT_END_NAMESPACE + namespace WebCore { class ScrollbarThemeQt : public ScrollbarTheme { @@ -49,6 +55,8 @@ public: virtual int trackLength(Scrollbar*); virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); + + QStyle* style() const; }; } diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 86845c7..43ea1c8 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -958,8 +958,8 @@ QTextCodec *QTextCodec::codecForName(const QByteArray &name) if (nameMatch(cursor->name(), name)) return cursor; QList<QByteArray> aliases = cursor->aliases(); - for (int i = 0; i < aliases.size(); ++i) - if (nameMatch(aliases.at(i), name)) + for (int y = 0; y < aliases.size(); ++y) + if (nameMatch(aliases.at(y), name)) return cursor; } diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 7f33791..9a15bf1 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -35,6 +35,4 @@ symbian: { # Workaroud for problems with paging this dll MMP_RULES -= PAGED MMP_RULES *= UNPAGED - # Timezone server - LIBS += -ltzclient } diff --git a/src/corelib/kernel/qabstractitemmodel.cpp b/src/corelib/kernel/qabstractitemmodel.cpp index 8b9cec8..b0503be 100644 --- a/src/corelib/kernel/qabstractitemmodel.cpp +++ b/src/corelib/kernel/qabstractitemmodel.cpp @@ -1006,6 +1006,9 @@ void QAbstractItemModelPrivate::columnsRemoved(const QModelIndex &parent, Returns the child of the model index that is stored in the given \a row and \a column. + \note This function does not work for an invalid model index which is often + used as the root index. + \sa parent(), sibling() */ diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 9a361c0..c1027ed 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -75,7 +75,6 @@ #if defined(Q_OS_SYMBIAN) #include <e32std.h> -#include <tz.h> #endif QT_BEGIN_NAMESPACE @@ -3722,32 +3721,23 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time) #elif defined(Q_OS_SYMBIAN) // months and days are zero index based _LIT(KUnixEpoch, "19700000:000000.000000"); + TTimeIntervalSeconds utcOffset = User::UTCOffset(); TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC); TTime epochTTime; TInt err = epochTTime.Set(KUnixEpoch); tm res; if(err == KErrNone) { TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC; - TRAP(err, - RTz tz; - User::LeaveIfError(tz.Connect()); - CleanupClosePushL(tz); - res.tm_isdst = tz.IsDaylightSavingOnL(*tz.GetTimeZoneIdL(),utcTTime); - User::LeaveIfError(tz.ConvertToLocalTime(utcTTime)); - CleanupStack::PopAndDestroy(&tz)); - if (KErrNone == err) { - TDateTime localDateTime = utcTTime.DateTime(); - res.tm_sec = localDateTime.Second(); - res.tm_min = localDateTime.Minute(); - res.tm_hour = localDateTime.Hour(); - res.tm_mday = localDateTime.Day() + 1; // non-zero based index for tm struct - res.tm_mon = localDateTime.Month(); - res.tm_year = localDateTime.Year() - 1900; - // Symbian's timezone server doesn't know how to handle DST before year 1997 - if (res.tm_year < 97) - res.tm_isdst = -1; - brokenDown = &res; - } + utcTTime = utcTTime + utcOffset; + TDateTime utcDateTime = utcTTime.DateTime(); + res.tm_sec = utcDateTime.Second(); + res.tm_min = utcDateTime.Minute(); + res.tm_hour = utcDateTime.Hour(); + res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct + res.tm_mon = utcDateTime.Month(); + res.tm_year = utcDateTime.Year() - 1900; + res.tm_isdst = 0; + brokenDown = &res; } #elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) // use the reentrant version of localtime() where available @@ -3822,27 +3812,23 @@ static void localToUtc(QDate &date, QTime &time, int isdst) #elif defined(Q_OS_SYMBIAN) // months and days are zero index based _LIT(KUnixEpoch, "19700000:000000.000000"); + TTimeIntervalSeconds utcOffset = TTimeIntervalSeconds(0 - User::UTCOffset().Int()); TTimeIntervalSeconds tTimeIntervalSecsSince1Jan1970UTC(secsSince1Jan1970UTC); TTime epochTTime; TInt err = epochTTime.Set(KUnixEpoch); tm res; if(err == KErrNone) { - TTime localTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC; - RTz tz; - if (KErrNone == tz.Connect()) { - if (KErrNone == tz.ConvertToUniversalTime(localTTime)) { - TDateTime utcDateTime = localTTime.DateTime(); - res.tm_sec = utcDateTime.Second(); - res.tm_min = utcDateTime.Minute(); - res.tm_hour = utcDateTime.Hour(); - res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct - res.tm_mon = utcDateTime.Month(); - res.tm_year = utcDateTime.Year() - 1900; - res.tm_isdst = (int)isdst; - brokenDown = &res; - } - tz.Close(); - } + TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC; + utcTTime = utcTTime + utcOffset; + TDateTime utcDateTime = utcTTime.DateTime(); + res.tm_sec = utcDateTime.Second(); + res.tm_min = utcDateTime.Minute(); + res.tm_hour = utcDateTime.Hour(); + res.tm_mday = utcDateTime.Day() + 1; // non-zero based index for tm struct + res.tm_mon = utcDateTime.Month(); + res.tm_year = utcDateTime.Year() - 1900; + res.tm_isdst = (int)isdst; + brokenDown = &res; } #elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) // use the reentrant version of gmtime() where available diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index ddb5c7d..74661c2 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -71,7 +71,7 @@ public: private: const int m_size; - const char *m_data; + const char * const m_data; }; struct Q_CORE_EXPORT QAbstractConcatenable diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 21650bb..089e04a 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -229,11 +229,10 @@ Q_GUI_EXPORT _qt_filedialog_save_filename_hook qt_filedialog_save_filename_hook \value ReadOnly Indicates that the model is readonly. \value HideNameFilterDetails Indicates if the is hidden or not. - This value is obsolete and does nothing since Qt 4.5: \value DontUseSheet In previous versions of Qt, the static functions would create a sheet by default if the static function - was given a parent. This is no longer supported in Qt 4.5, The + was given a parent. This is no longer supported and does nothing in Qt 4.5, The static functions will always be an application modal dialog. If you want to use sheets, use QFileDialog::open() instead. diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index ed36f87..b4e19d1 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2569,6 +2569,7 @@ void QGraphicsItem::setOpacity(qreal opacity) if (newOpacity == d_ptr->opacity) return; + bool wasFullyTransparent = d_ptr->isOpacityNull(); d_ptr->opacity = newOpacity; // Notify change. @@ -2584,7 +2585,9 @@ void QGraphicsItem::setOpacity(qreal opacity) d_ptr->scene->d_func()->markDirty(this, QRectF(), /*invalidateChildren=*/true, /*force=*/false, - /*ignoreOpacity=*/true); + /*ignoreOpacity=*/d_ptr->isOpacityNull()); + if (wasFullyTransparent) + d_ptr->paintedViewBoundingRectsNeedRepaint = 1; } if (d_ptr->isObject) diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 5ad6cd5..b3ca3b5 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -358,14 +358,20 @@ public: return o; } + inline bool isOpacityNull() const + { return (opacity < qreal(0.001)); } + + static inline bool isOpacityNull(qreal opacity) + { return (opacity < qreal(0.001)); } + inline bool isFullyTransparent() const { - if (opacity < 0.001) + if (isOpacityNull()) return true; if (!parent) return false; - return calcEffectiveOpacity() < 0.001; + return isOpacityNull(calcEffectiveOpacity()); } inline qreal effectiveOpacity() const { diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 478669e..9a36d46 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -251,6 +251,7 @@ #endif #include <private/qgraphicseffect_p.h> #include <private/qgesturemanager_p.h> +#include <private/qpathclipper_p.h> // #define GESTURE_DEBUG #ifndef GESTURE_DEBUG @@ -372,7 +373,10 @@ void QGraphicsScenePrivate::_q_emitUpdated() } } } else { - updateAll = false; + if (views.isEmpty()) { + updateAll = false; + return; + } for (int i = 0; i < views.size(); ++i) views.at(i)->d_func()->processPendingUpdates(); // It's important that we update all views before we dispatch, hence two for-loops. @@ -4605,6 +4609,7 @@ void QGraphicsScenePrivate::drawItems(QPainter *painter, const QTransform *const if (!unpolishedItems.isEmpty()) _q_polishItems(); + updateAll = false; QRectF exposedSceneRect; if (exposedRegion && indexMethod != QGraphicsScene::NoIndex) { exposedSceneRect = exposedRegion->boundingRect().adjusted(-1, -1, 1, 1); @@ -4632,7 +4637,7 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * return; // Item has neither contents nor children!(?) const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); - const bool itemIsFullyTransparent = (opacity < 0.0001); + const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity); if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity())) return; @@ -4752,7 +4757,7 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q qreal opacity, const QTransform *effectTransform, bool wasDirtyParentSceneTransform, bool drawItem) { - const bool itemIsFullyTransparent = (opacity < 0.0001); + const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity); const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape); const bool itemHasChildren = !item->d_ptr->children.isEmpty(); @@ -4767,7 +4772,12 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q painter->setWorldTransform(*transformPtr * *effectTransform); else painter->setWorldTransform(*transformPtr); - painter->setClipPath(item->shape(), Qt::IntersectClip); + QRectF clipRect; + const QPainterPath clipPath(item->shape()); + if (QPathClipper::pathToRect(clipPath, &clipRect)) + painter->setClipRect(clipRect, Qt::IntersectClip); + else + painter->setClipPath(clipPath, Qt::IntersectClip); } // Draw children behind @@ -4803,8 +4813,14 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q painter->setWorldTransform(*transformPtr); } - if (itemClipsToShape) - painter->setClipPath(item->shape(), Qt::IntersectClip); + if (itemClipsToShape) { + QRectF clipRect; + const QPainterPath clipPath(item->shape()); + if (QPathClipper::pathToRect(clipPath, &clipRect)) + painter->setClipRect(clipRect, Qt::IntersectClip); + else + painter->setClipPath(clipPath, Qt::IntersectClip); + } painter->setOpacity(opacity); if (!item->d_ptr->cacheMode && !item->d_ptr->isWidget) @@ -4982,7 +4998,8 @@ void QGraphicsScenePrivate::processDirtyItemsRecursive(QGraphicsItem *item, bool } const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); - const bool itemIsFullyTransparent = !item->d_ptr->ignoreOpacity && opacity < 0.0001; + const bool itemIsFullyTransparent = !item->d_ptr->ignoreOpacity + && QGraphicsItemPrivate::isOpacityNull(opacity); if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity())) { resetDirtyItem(item, /*recursive=*/itemHasChildren); return; @@ -5155,6 +5172,7 @@ void QGraphicsScene::drawItems(QPainter *painter, if (!d->unpolishedItems.isEmpty()) d->_q_polishItems(); + d->updateAll = false; QTransform viewTransform = painter->worldTransform(); Q_UNUSED(options); diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp index 043c4eb..707c71f 100644 --- a/src/gui/graphicsview/qgraphicssceneindex.cpp +++ b/src/gui/graphicsview/qgraphicssceneindex.cpp @@ -279,7 +279,7 @@ void QGraphicsSceneIndexPrivate::recursive_items_helper(QGraphicsItem *item, QRe return; const qreal opacity = item->d_ptr->combineOpacityFromParent(parentOpacity); - const bool itemIsFullyTransparent = (opacity < 0.0001); + const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity); const bool itemHasChildren = !item->d_ptr->children.isEmpty(); if (itemIsFullyTransparent && (!itemHasChildren || item->d_ptr->childrenCombineOpacity())) return; @@ -554,7 +554,7 @@ QList<QGraphicsItem *> QGraphicsSceneIndex::estimateTopLevelItems(const QRectF & /*! \fn QList<QGraphicsItem *> QGraphicsSceneIndex::items(Qt::SortOrder order = Qt::DescendingOrder) const - + This pure virtual function all items in the index and sort them using \a order. */ diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 451f183..96b9373 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -2748,7 +2748,6 @@ bool QGraphicsView::viewportEvent(QEvent *event) } } } - d->scene->d_func()->updateAll = false; } break; case QEvent::TouchBegin: diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp index 61d538f..ace4bb6 100644 --- a/src/gui/image/qimagepixmapcleanuphooks.cpp +++ b/src/gui/image/qimagepixmapcleanuphooks.cpp @@ -62,12 +62,12 @@ QImagePixmapCleanupHooks *QImagePixmapCleanupHooks::instance() return qt_image_and_pixmap_cleanup_hooks(); } -void QImagePixmapCleanupHooks::addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm hook) +void QImagePixmapCleanupHooks::addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd hook) { pixmapModificationHooks.append(hook); } -void QImagePixmapCleanupHooks::addPixmapDestructionHook(_qt_pixmap_cleanup_hook_pm hook) +void QImagePixmapCleanupHooks::addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) { pixmapDestructionHooks.append(hook); } @@ -78,12 +78,12 @@ void QImagePixmapCleanupHooks::addImageHook(_qt_image_cleanup_hook_64 hook) imageHooks.append(hook); } -void QImagePixmapCleanupHooks::removePixmapModificationHook(_qt_pixmap_cleanup_hook_pm hook) +void QImagePixmapCleanupHooks::removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd hook) { pixmapModificationHooks.removeAll(hook); } -void QImagePixmapCleanupHooks::removePixmapDestructionHook(_qt_pixmap_cleanup_hook_pm hook) +void QImagePixmapCleanupHooks::removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd hook) { pixmapDestructionHooks.removeAll(hook); } @@ -93,24 +93,24 @@ void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook) imageHooks.removeAll(hook); } -void QImagePixmapCleanupHooks::executePixmapModificationHooks(QPixmap* pm) +void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* pmd) { QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); for (int i = 0; i < h->pixmapModificationHooks.count(); ++i) - h->pixmapModificationHooks[i](pm); + h->pixmapModificationHooks[i](pmd); if (qt_pixmap_cleanup_hook_64) - qt_pixmap_cleanup_hook_64(pm->cacheKey()); + qt_pixmap_cleanup_hook_64(pmd->cacheKey()); } -void QImagePixmapCleanupHooks::executePixmapDestructionHooks(QPixmap* pm) +void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(QPixmapData* pmd) { QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i) - h->pixmapDestructionHooks[i](pm); + h->pixmapDestructionHooks[i](pmd); if (qt_pixmap_cleanup_hook_64) - qt_pixmap_cleanup_hook_64(pm->cacheKey()); + qt_pixmap_cleanup_hook_64(pmd->cacheKey()); } void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h index 7176044..88dd3a6 100644 --- a/src/gui/image/qimagepixmapcleanuphooks_p.h +++ b/src/gui/image/qimagepixmapcleanuphooks_p.h @@ -58,7 +58,8 @@ QT_BEGIN_NAMESPACE typedef void (*_qt_image_cleanup_hook_64)(qint64); -typedef void (*_qt_pixmap_cleanup_hook_pm)(QPixmap*); +typedef void (*_qt_pixmap_cleanup_hook_pmd)(QPixmapData*); + class QImagePixmapCleanupHooks; @@ -71,27 +72,27 @@ public: static void enableCleanupHooks(const QPixmap &pixmap); static void enableCleanupHooks(QPixmapData *pixmapData); - // Gets called when a pixmap is about to be modified: - void addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm); + // Gets called when a pixmap data is about to be modified: + void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd); - // Gets called when a pixmap is about to be destroyed: - void addPixmapDestructionHook(_qt_pixmap_cleanup_hook_pm); + // Gets called when a pixmap data is about to be destroyed: + void addPixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd); // Gets called when an image is about to be modified or destroyed: void addImageHook(_qt_image_cleanup_hook_64); - void removePixmapModificationHook(_qt_pixmap_cleanup_hook_pm); - void removePixmapDestructionHook(_qt_pixmap_cleanup_hook_pm); + void removePixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd); + void removePixmapDataDestructionHook(_qt_pixmap_cleanup_hook_pmd); void removeImageHook(_qt_image_cleanup_hook_64); - static void executePixmapModificationHooks(QPixmap*); - static void executePixmapDestructionHooks(QPixmap*); + static void executePixmapDataModificationHooks(QPixmapData*); + static void executePixmapDataDestructionHooks(QPixmapData*); static void executeImageHooks(qint64 key); private: QList<_qt_image_cleanup_hook_64> imageHooks; - QList<_qt_pixmap_cleanup_hook_pm> pixmapModificationHooks; - QList<_qt_pixmap_cleanup_hook_pm> pixmapDestructionHooks; + QList<_qt_pixmap_cleanup_hook_pmd> pixmapModificationHooks; + QList<_qt_pixmap_cleanup_hook_pmd> pixmapDestructionHooks; }; QT_END_NAMESPACE diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index e51d858..7cafbd0 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -320,8 +320,6 @@ QPixmap::QPixmap(const char * const xpm[]) QPixmap::~QPixmap() { Q_ASSERT(!data || data->ref >= 1); // Catch if ref-counting changes again - if (data && data->is_cached && data->ref == 1) // ref will be decrememnted after destructor returns - QImagePixmapCleanupHooks::executePixmapDestructionHooks(this); } /*! @@ -1025,12 +1023,8 @@ qint64 QPixmap::cacheKey() const if (isNull()) return 0; - int classKey = data->classId(); - if (classKey >= 1024) - classKey = -(classKey >> 10); - return ((((qint64) classKey) << 56) - | (((qint64) data->serialNumber()) << 32) - | ((qint64) (data->detach_no))); + Q_ASSERT(data); + return data->cacheKey(); } static void sendResizeEvents(QWidget *target) @@ -1963,7 +1957,7 @@ void QPixmap::detach() } if (data->is_cached && data->ref == 1) - QImagePixmapCleanupHooks::executePixmapModificationHooks(this); + QImagePixmapCleanupHooks::executePixmapDataModificationHooks(data.data()); #if defined(Q_WS_MAC) QMacPixmapData *macData = id == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(data.data()) : 0; diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 0e66e09..e1e8a0d 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -68,6 +68,7 @@ #include "qx11info_x11.h" #include <private/qdrawhelper_p.h> #include <private/qimage_p.h> +#include <private/qimagepixmapcleanuphooks_p.h> #include <stdlib.h> @@ -1228,6 +1229,12 @@ void QX11PixmapData::fill(const QColor &fillColor) QX11PixmapData::~QX11PixmapData() { + // Cleanup hooks have to be called before the handles are freed + if (is_cached) { + QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this); + is_cached = false; + } + release(); } @@ -1236,8 +1243,13 @@ void QX11PixmapData::release() delete pengine; pengine = 0; - if (!X11) + if (!X11) { +#ifndef QT_NO_DEBUG + qWarning("~QX11PixmapData(): QPixmap objects must be destroyed before the QApplication" + " object, otherwise the native pixmap object will be leaked."); +#endif return; + } if (x11_mask) { #ifndef QT_NO_XRENDER diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp index 65032da..ea4fe6b 100644 --- a/src/gui/image/qpixmapdata.cpp +++ b/src/gui/image/qpixmapdata.cpp @@ -45,6 +45,7 @@ #include <QtGui/qimagereader.h> #include <private/qgraphicssystem_p.h> #include <private/qapplication_p.h> +#include <private/qimagepixmapcleanuphooks_p.h> QT_BEGIN_NAMESPACE @@ -80,6 +81,16 @@ QPixmapData::QPixmapData(PixelType pixelType, int objectId) QPixmapData::~QPixmapData() { + // Sometimes the pixmap cleanup hooks will be called from derrived classes, which will + // then set is_cached to false. For example, on X11 QtOpenGL needs to delete the GLXPixmap + // or EGL Pixmap Surface for a given pixmap _before_ the native X11 pixmap is deleted, + // otherwise some drivers will leak the GL surface. In this case, QX11PixmapData will + // call the cleanup hooks itself before deleting the native pixmap and set is_cached to + // false. + if (is_cached) { + QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(this); + is_cached = false; + } } QPixmapData *QPixmapData::createCompatiblePixmapData() const diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h index 1125515..827fa18 100644 --- a/src/gui/image/qpixmapdata_p.h +++ b/src/gui/image/qpixmapdata_p.h @@ -117,6 +117,14 @@ public: inline int colorCount() const { return metric(QPaintDevice::PdmNumColors); } inline int depth() const { return d; } inline bool isNull() const { return is_null; } + inline qint64 cacheKey() const { + int classKey = id; + if (classKey >= 1024) + classKey = -(classKey >> 10); + return ((((qint64) classKey) << 56) + | (((qint64) ser_no) << 32) + | ((qint64) detach_no)); + } #if defined(Q_OS_SYMBIAN) virtual void* toNativeType(NativeType type); diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h index f5034fc..d5243c3 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_p.h +++ b/src/gui/inputmethod/qcoefepinputcontext_p.h @@ -96,7 +96,7 @@ protected: void timerEvent(QTimerEvent *timerEvent); private: - void commitCurrentString(bool triggeredBySymbian); + void commitCurrentString(bool cancelFepTransaction); void updateHints(bool mustUpdateInputCapabilities); void applyHints(Qt::InputMethodHints hints); void applyFormat(QList<QInputMethodEvent::Attribute> *attributes); @@ -127,7 +127,7 @@ public: private: void DoCommitFepInlineEditL(); MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue); - void ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType); + void ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType); // From MCoeFepAwareTextEditor_Extension1 public: @@ -151,7 +151,6 @@ private: int m_inlinePosition; MFepInlineTextFormatRetriever *m_formatRetriever; MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler; - int m_longPress; int m_cursorPos; QBasicTimer m_tempPreeditStringTimeout; bool m_hasTempPreeditString; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index e5ab300..2b91711 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -71,7 +71,6 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent) m_inlinePosition(0), m_formatRetriever(0), m_pointerHandler(0), - m_longPress(0), m_cursorPos(0), m_hasTempPreeditString(false) { @@ -101,7 +100,7 @@ QCoeFepInputContext::~QCoeFepInputContext() void QCoeFepInputContext::reset() { - commitCurrentString(false); + commitCurrentString(true); } void QCoeFepInputContext::ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType) @@ -126,7 +125,7 @@ void QCoeFepInputContext::update() void QCoeFepInputContext::setFocusWidget(QWidget *w) { - commitCurrentString(false); + commitCurrentString(true); QInputContext::setFocusWidget(w); @@ -219,7 +218,7 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) break; case Qt::Key_Select: if (!m_preeditString.isEmpty()) { - commitCurrentString(false); + commitCurrentString(true); return true; } break; @@ -231,10 +230,11 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) && focusWidget()->inputMethodHints() & Qt::ImhHiddenText && !keyEvent->text().isEmpty()) { // Send some temporary preedit text in order to make text visible for a moment. + m_cursorPos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); m_preeditString = keyEvent->text(); QList<QInputMethodEvent::Attribute> attributes; QInputMethodEvent imEvent(m_preeditString, attributes); - QApplication::sendEvent(focusWidget(), &imEvent); + sendEvent(imEvent); m_tempPreeditStringTimeout.start(1000, this); m_hasTempPreeditString = true; update(); @@ -293,7 +293,7 @@ void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event) Q_ASSERT(focusWidget()); if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) { - commitCurrentString(false); + commitCurrentString(true); int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); QList<QInputMethodEvent::Attribute> attributes; @@ -739,31 +739,33 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin void QCoeFepInputContext::DoCommitFepInlineEditL() { - commitCurrentString(true); + commitCurrentString(false); } -void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian) +void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction) { + int longPress = 0; + if (m_preeditString.size() == 0) { QWidget *w = focusWidget(); - if (triggeredBySymbian && w) { + if (!cancelFepTransaction && w) { // We must replace the last character only if the input box has already accepted one if (w->inputMethodQuery(Qt::ImCursorPosition).toInt() != m_cursorPos) - m_longPress = 1; + longPress = 1; } return; } QList<QInputMethodEvent::Attribute> attributes; QInputMethodEvent event(QLatin1String(""), attributes); - event.setCommitString(m_preeditString, 0-m_longPress, m_longPress); + event.setCommitString(m_preeditString, 0-longPress, longPress); m_preeditString.clear(); sendEvent(event); m_hasTempPreeditString = false; - m_longPress = 0; + longPress = 0; - if (!triggeredBySymbian) { + if (cancelFepTransaction) { CCoeFep* fep = CCoeEnv::Static()->Fep(); if (fep) fep->CancelTransaction(); diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 4b7d949..8ddd051 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -715,6 +715,10 @@ QActionGroup *QAction::actionGroup() const it is displayed to the left of the menu text. There is no default icon. + On Symbian the icons which are passed to softkeys, i.e. to actions with + softkey role, need to have pixmap alpha channel correctly set otherwise + drawing artifacts will appear when softkey is pressed down. + If a null icon (QIcon::isNull() is passed into this function, the icon of the action is cleared. */ diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 20b8030..87de602 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -924,8 +924,8 @@ void QSymbianControl::PositionChanged() cr.moveTopLeft(newPos); qwidget->data->crect = cr; QTLWExtra *top = qwidget->d_func()->maybeTopData(); - if (top) - top->normalGeometry = cr; + if (top && (qwidget->windowState() & (~Qt::WindowActive)) == Qt::WindowNoState) + top->normalGeometry.moveTopLeft(newPos); if (qwidget->isVisible()) { QMoveEvent e(newPos, oldPos); qt_sendSpontaneousEvent(qwidget, &e); @@ -960,15 +960,14 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowIcon_sys(true); qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 - // If widget is fullscreen, hide status pane and button container - // otherwise show them. + // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. CEikStatusPane* statusPane = S60->statusPane(); CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; - if (statusPane && (bool)statusPane->IsVisible() == isFullscreen) - statusPane->MakeVisible(!isFullscreen); - if (buttonGroup && (bool)buttonGroup->IsVisible() == isFullscreen) - buttonGroup->MakeVisible(!isFullscreen); + TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); + if (statusPane) + statusPane->MakeVisible(visible); + if (buttonGroup) + buttonGroup->MakeVisible(visible); #endif } else if (QApplication::activeWindow() == qwidget->window()) { if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { @@ -1647,6 +1646,9 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { delete w->d_func()->topData()->backingStore; w->d_func()->topData()->backingStore = 0; + // In order to ensure that any resources used by the window surface + // are immediately freed, we flush the WSERV command buffer. + S60->wsSession().Flush(); } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) && !w->d_func()->maybeBackingStore()) { w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm index 3012093..0b48efd 100644 --- a/src/gui/kernel/qcocoapanel_mac.mm +++ b/src/gui/kernel/qcocoapanel_mac.mm @@ -47,6 +47,9 @@ #import <private/qcocoaview_mac_p.h> #import <private/qcocoawindowcustomthemeframe_mac_p.h> #import <private/qcocoaapplication_mac_p.h> +#include <private/qapplication_p.h> +#include <private/qbackingstore_p.h> + #include <QtGui/QWidget> diff --git a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h index d8bbcd4..a1d2c61 100644 --- a/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h +++ b/src/gui/kernel/qcocoasharedwindowmethods_mac_p.h @@ -51,6 +51,9 @@ NSPanel, while QCocoaWindow needs to inherit NSWindow rather than NSPanel). ****************************************************************************/ +// WARNING: Don't include any header files from within this file. Put them +// directly into qcocoawindow_mac_p.h and qcocoapanel_mac_p.h + QT_BEGIN_NAMESPACE extern Qt::MouseButton cocoaButton2QtButton(NSInteger buttonNum); // qcocoaview.mm extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp @@ -205,7 +208,7 @@ QT_END_NAMESPACE qt_button_down = widget; handled = qt_mac_handleMouseEvent(view, event, QEvent::MouseButtonPress, mouseButton); // Don't call super here. This prevents us from getting the mouseUp event, - // which we need to send even if the mouseDown event was not accepted. + // which we need to send even if the mouseDown event was not accepted. // (this is standard Qt behavior.) break; case NSRightMouseDown: @@ -303,9 +306,9 @@ QT_END_NAMESPACE { // The user dragged something into the window. Send a draggingEntered message // to the QWidget under the mouse. As the drag moves over the window, and over - // different widgets, we will handle enter and leave events from within + // different widgets, we will handle enter and leave events from within // draggingUpdated below. The reason why we handle this ourselves rather than - // subscribing for drag events directly in QCocoaView is that calling + // subscribing for drag events directly in QCocoaView is that calling // registerForDraggedTypes on the views will severly degrade initialization time // for an application that uses a lot of drag subscribing widgets. @@ -369,3 +372,18 @@ QT_END_NAMESPACE return dropResult; } +- (void)displayIfNeeded +{ + + QWidget *qwidget = [[QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate] qt_qwidgetForWindow:self]; + if (qwidget == 0) { + [super displayIfNeeded]; + return; + } + + if (QApplicationPrivate::graphicsSystem() != 0) { + if (QWidgetBackingStore *bs = qt_widget_private(qwidget)->maybeBackingStore()) + bs->sync(qwidget, qwidget->rect()); + } + [super displayIfNeeded]; +} diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 8c5d166..70c78c8 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -474,10 +474,11 @@ extern "C" { - (void)drawRect:(NSRect)aRect { if (QApplicationPrivate::graphicsSystem() != 0) { - if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore()) - bs->markDirty(qwidget->rect(), qwidget); - qwidgetprivate->syncBackingStore(qwidget->rect()); - return; + if (QWidgetBackingStore *bs = qwidgetprivate->maybeBackingStore()) { + // Drawing is handled on the window level + // See qcocoasharedwindowmethods_mac_p. + return; + } } CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; qwidgetprivate->hd = cg; diff --git a/src/gui/kernel/qcocoawindow_mac_p.h b/src/gui/kernel/qcocoawindow_mac_p.h index 403a1a5..21f82df 100644 --- a/src/gui/kernel/qcocoawindow_mac_p.h +++ b/src/gui/kernel/qcocoawindow_mac_p.h @@ -53,6 +53,9 @@ #ifdef QT_MAC_USE_COCOA #include "qmacdefines_mac.h" #import <Cocoa/Cocoa.h> +#include <private/qapplication_p.h> +#include <private/qbackingstore_p.h> + enum { QtMacCustomizeWindow = 1 << 21 }; // This will one day be run over by diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp index 77745ea..84e3c5d 100644 --- a/src/gui/kernel/qdesktopwidget_s60.cpp +++ b/src/gui/kernel/qdesktopwidget_s60.cpp @@ -88,24 +88,20 @@ QDesktopWidgetPrivate::~QDesktopWidgetPrivate() void QDesktopWidgetPrivate::init(QDesktopWidget *that) { - int screenCount=0; +// int screenCount=0; - if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone) - QDesktopWidgetPrivate::screenCount = screenCount; - else - QDesktopWidgetPrivate::screenCount = 0; + // ### TODO: Implement proper multi-display support + QDesktopWidgetPrivate::screenCount = 1; +// if (HAL::Get(0, HALData::EDisplayNumberOfScreens, screenCount) == KErrNone) +// QDesktopWidgetPrivate::screenCount = screenCount; +// else +// QDesktopWidgetPrivate::screenCount = 0; rects = new QVector<QRect>(); workrects = new QVector<QRect>(); rects->resize(QDesktopWidgetPrivate::screenCount); workrects->resize(QDesktopWidgetPrivate::screenCount); - - // ### TODO: Implement proper multi-display support - rects->resize(1); - rects->replace(0, that->rect()); - workrects->resize(1); - workrects->replace(0, that->rect()); } void QDesktopWidgetPrivate::cleanup() diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 67ed8b0..af84a8f 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -49,7 +49,7 @@ #include "private/qsoftkeymanager_p.h" #include "private/qsoftkeymanager_s60_p.h" #include "private/qobject_p.h" -//#include <eiksoftkeyimage.h> +#include <eiksoftkeyimage.h> #include <eikcmbut.h> #ifndef QT_NO_SOFTKEYMANAGER @@ -64,6 +64,8 @@ QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60() { cachedCbaIconSize[0] = QSize(0,0); cachedCbaIconSize[1] = QSize(0,0); + cachedCbaIconSize[2] = QSize(0,0); + cachedCbaIconSize[3] = QSize(0,0); skipNextUpdate = false; } @@ -149,6 +151,39 @@ void QSoftKeyManagerPrivateS60::setNativeSoftkey(CEikButtonGroupContainer &cba, QT_TRAP_THROWING(cba.SetCommandL(position, command, text)); } +QPoint QSoftKeyManagerPrivateS60::softkeyIconPosition(int position, QSize sourceSize, QSize targetSize) +{ + QPoint iconPosition(0,0); + switch( AknLayoutUtils::CbaLocation() ) + { + case AknLayoutUtils::EAknCbaLocationBottom: + // RSK must be moved to right, LSK in on correct position by default + if (position == RSK_POSITION) + iconPosition.setX(targetSize.width() - sourceSize.width()); + break; + case AknLayoutUtils::EAknCbaLocationRight: + case AknLayoutUtils::EAknCbaLocationLeft: + // Already in correct position + default: + break; + } + + // Align horizontally to center + iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1); + return iconPosition; +} + +QPixmap QSoftKeyManagerPrivateS60::prepareSoftkeyPixmap(QPixmap src, int position, QSize targetSize) +{ + QPixmap target(targetSize); + target.fill(Qt::transparent); + QPainter p; + p.begin(&target); + p.drawPixmap(softkeyIconPosition(position, src.size(), targetSize), src); + p.end(); + return target; +} + bool QSoftKeyManagerPrivateS60::isOrientationLandscape() { // Hard to believe that there is no public API in S60 to @@ -158,15 +193,11 @@ bool QSoftKeyManagerPrivateS60::isOrientationLandscape() QSize QSoftKeyManagerPrivateS60::cbaIconSize(CEikButtonGroupContainer *cba, int position) { - Q_UNUSED(cba); - Q_UNUSED(position); - // Will be implemented when EikSoftkeyImage usage license wise is OK -/* - const int index = isOrientationLandscape() ? 0 : 1; + int index = position; + index += isOrientationLandscape() ? 0 : 1; if(cachedCbaIconSize[index].isNull()) { // Only way I figured out to get CBA icon size without RnD SDK, was - // Only way I figured out to get CBA icon size without RnD SDK, was // to set some dummy icon to CBA first and then ask CBA button CCoeControl::Size() // The returned value is cached to avoid unnecessary icon setting every time. const bool left = (position == LSK_POSITION); @@ -178,38 +209,46 @@ QSize QSoftKeyManagerPrivateS60::cbaIconSize(CEikButtonGroupContainer *cba, int setNativeSoftkey(*cba, position, command, KNullDesC()); cachedCbaIconSize[index] = qt_TSize2QSize(cba->ControlOrNull(command)->Size()); EikSoftkeyImage::SetLabel(cba, left); + + if(cachedCbaIconSize[index] == QSize(138,72)) { + // Hack for S60 5.0 (5800) landscape orientation, which return wrong icon size + cachedCbaIconSize[index] = QSize(60,60); + } } } return cachedCbaIconSize[index]; -*/ - return QSize(); } bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba, QAction &action, int position) { bool ret = false; - Q_UNUSED(cba); - Q_UNUSED(action); - Q_UNUSED(position); - // Will be implemented when EikSoftkeyImage usage license wise is OK - /* const bool left = (position == LSK_POSITION); if(position == LSK_POSITION || position == RSK_POSITION) { QIcon icon = action.icon(); if (!icon.isNull()) { - QPixmap pm = icon.pixmap(cbaIconSize(cba, position)); - pm = pm.scaled(cbaIconSize(cba, position)); - QBitmap mask = pm.mask(); - if (mask.isNull()) { - mask = QBitmap(pm.size()); - mask.fill(Qt::color1); + // Get size of CBA icon area based on button position and orientation + QSize requiredIconSize = cbaIconSize(cba, position); + // Get pixmap out of icon based on preferred size, the aspect ratio is kept + QPixmap pmWihtAspectRatio = icon.pixmap(requiredIconSize); + // Native softkeys require that pixmap size is exactly the same as requiredIconSize + // prepareSoftkeyPixmap creates a new pixmap with requiredIconSize and blits the 'pmWihtAspectRatio' + // to correct location of it + QPixmap softkeyPixmap = prepareSoftkeyPixmap(pmWihtAspectRatio, position, requiredIconSize); + + QPixmap softkeyAlpha = softkeyPixmap.alphaChannel(); + // Alpha channel in 5.1 and older devices need to be inverted + // TODO: Switch to use toSymbianCFbsBitmap with invert when available + if(QSysInfo::s60Version() <= QSysInfo::SV_S60_5_1) { + QImage alphaImage = softkeyAlpha.toImage(); + alphaImage.invertPixels(); + softkeyAlpha = QPixmap::fromImage(alphaImage); } - CFbsBitmap* nBitmap = pm.toSymbianCFbsBitmap(); - CFbsBitmap* nMask = mask.toSymbianCFbsBitmap(); + CFbsBitmap* nBitmap = softkeyPixmap.toSymbianCFbsBitmap(); + CFbsBitmap* nMask = softkeyAlpha.toSymbianCFbsBitmap(); CEikImage* myimage = new (ELeave) CEikImage; myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered @@ -221,7 +260,6 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba, EikSoftkeyImage::SetLabel(cba, left); } } - */ return ret; } @@ -272,6 +310,7 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba) if (windowType != Qt::Dialog && windowType != Qt::Popup) { QString text(QSoftKeyManager::tr("Exit")); TPtrC nativeText = qt_QString2TPtrC(text); + EikSoftkeyImage::SetLabel(&cba, false); setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText); return true; } @@ -303,7 +342,6 @@ void QSoftKeyManagerPrivateS60::setSoftkeys(CEikButtonGroupContainer &cba) void QSoftKeyManagerPrivateS60::updateSoftKeys_sys() { - //bool status = CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog(); if (skipCbaUpdate()) return; diff --git a/src/gui/kernel/qsoftkeymanager_s60_p.h b/src/gui/kernel/qsoftkeymanager_s60_p.h index 46e3596..f8bd6d9 100644 --- a/src/gui/kernel/qsoftkeymanager_s60_p.h +++ b/src/gui/kernel/qsoftkeymanager_s60_p.h @@ -84,6 +84,8 @@ private: QAction *highestPrioritySoftkey(QAction::SoftKeyRole role); static bool actionPriorityMoreThan(const QAction* item1, const QAction* item2); void setNativeSoftkey(CEikButtonGroupContainer &cba, TInt position, TInt command, const TDesC& text); + QPoint softkeyIconPosition(int position, QSize sourceSize, QSize targetSize); + QPixmap prepareSoftkeyPixmap(QPixmap src, int position, QSize targetSize); bool isOrientationLandscape(); QSize cbaIconSize(CEikButtonGroupContainer *cba, int position); bool setSoftkeyImage(CEikButtonGroupContainer *cba, QAction &action, int position); @@ -95,7 +97,7 @@ private: private: QHash<int, QAction*> realSoftKeyActions; - QSize cachedCbaIconSize[2]; + QSize cachedCbaIconSize[4]; bool skipNextUpdate; }; diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 377e5a0..4e51cf4 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1162,7 +1162,7 @@ CGContextRef qt_mac_graphicsContextFor(QWidget *widget) CGrafPtr port = GetWindowPort(qt_mac_window_for(widget)); QDBeginCGContext(port, &context); #else - CGContextRef context = (CGContextRef)[[NSGraphicsContext graphicsContextWithWindow:qt_mac_window_for(widget)] graphicsPort]; + CGContextRef context = reinterpret_cast<CGContextRef>([[qt_mac_window_for(widget) graphicsContext] graphicsPort]); #endif return context; } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 884447d..2e951b6 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1439,6 +1439,18 @@ QWidget::~QWidget() } #endif +#ifdef Q_OS_SYMBIAN + if (d->extra && d->extra->topextra && d->extra->topextra->backingStore) { + // Okay, we are about to destroy the top-level window that owns + // the backing store. Make sure we delete the backing store right away + // before the window handle is invalid. This is important because + // the backing store will delete its window surface, which may or may + // not have a reference to this widget that will be used later to + // notify the window it no longer has a surface. + delete d->extra->topextra->backingStore; + d->extra->topextra->backingStore = 0; + } +#endif if (QWidgetBackingStore *bs = d->maybeBackingStore()) { bs->removeDirtyWidget(this); if (testAttribute(Qt::WA_StaticContents)) @@ -1660,7 +1672,13 @@ void QWidgetPrivate::syncBackingStore() repaint_sys(dirty); dirty = QRegion(); } else if (QWidgetBackingStore *bs = maybeBackingStore()) { +#ifdef QT_MAC_USE_COCOA + Q_UNUSED(bs); + void qt_mac_set_needs_display(QWidget *, QRegion); + qt_mac_set_needs_display(q_func(), QRegion()); +#else bs->sync(); +#endif } } @@ -1668,8 +1686,15 @@ void QWidgetPrivate::syncBackingStore(const QRegion ®ion) { if (paintOnScreen()) repaint_sys(region); - else if (QWidgetBackingStore *bs = maybeBackingStore()) + else if (QWidgetBackingStore *bs = maybeBackingStore()) { +#ifdef QT_MAC_USE_COCOA + Q_UNUSED(bs); + void qt_mac_set_needs_display(QWidget *, QRegion); + qt_mac_set_needs_display(q_func(), region); +#else bs->sync(q_func(), region); +#endif + } } void QWidgetPrivate::setUpdatesEnabled_helper(bool enable) @@ -6422,6 +6447,8 @@ void QWidget::setTabOrder(QWidget* first, QWidget *second) first = fp; } + if (fp == second) + return; if (QWidget *sp = second->focusProxy()) second = sp; diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 878b776..a5633d3 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -565,6 +565,25 @@ inline static void qt_mac_set_window_group_to_popup(OSWindowRef window) } #endif +#ifdef QT_MAC_USE_COCOA +void qt_mac_set_needs_display(QWidget *widget, QRegion region) +{ + NSView *theNSView = qt_mac_nativeview_for(widget); + if (region.isEmpty()) { + [theNSView setNeedsDisplay:YES]; + return; + } + + QVector<QRect> rects = region.rects(); + for (int i = 0; i<rects.count(); ++i) { + const QRect &rect = rects.at(i); + NSRect nsrect = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()); + [theNSView setNeedsDisplayInRect:nsrect]; + } + +} +#endif + inline static bool updateRedirectedToGraphicsProxyWidget(QWidget *widget, const QRect &rect) { if (!widget) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 00f2213..a844430 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1046,96 +1046,48 @@ void QWidget::setWindowState(Qt::WindowStates newstate) return; if (isWindow()) { -#ifdef Q_WS_S60 - // Change window decoration visibility if switching to or from fullsccreen - // In addition decoration visibility is changed when the initial has been - // WindowNoState. - // The window decoration visibility has to be changed before doing actual - // window state change since in that order the availableGeometry will return - // directly the right size and we will avoid unnecessarty redraws - if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen) || - oldstate == Qt::WindowNoState) { - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - if (newstate & Qt::WindowFullScreen) { - if (statusPane) - statusPane->MakeVisible(false); - if (buttonGroup) - buttonGroup->MakeVisible(false); - } else { - if (statusPane) - statusPane->MakeVisible(true); - if (buttonGroup) - buttonGroup->MakeVisible(true); - } + QSymbianControl *window = static_cast<QSymbianControl *>(effectiveWinId()); + if (window && newstate & Qt::WindowMinimized) { + window->setFocusSafely(false); + window->MakeVisible(false); + } else if (window && oldstate & Qt::WindowMinimized) { + window->setFocusSafely(true); + window->MakeVisible(true); } + +#ifdef Q_WS_S60 + // Hide window decoration when switching to fullsccreen / minimized otherwise show decoration. + // The window decoration visibility has to be changed before doing actual window state + // change since in that order the availableGeometry will return directly the right size and + // we will avoid unnecessarty redraws + CEikStatusPane* statusPane = S60->statusPane(); + CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); + TBool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); + if (statusPane) + statusPane->MakeVisible(visible); + if (buttonGroup) + buttonGroup->MakeVisible(visible); #endif // Q_WS_S60 createWinId(); Q_ASSERT(testAttribute(Qt::WA_WState_Created)); - QTLWExtra *top = d->topData(); - // Ensure the initial size is valid, since we store it as normalGeometry below. if (!testAttribute(Qt::WA_Resized) && !isVisible()) adjustSize(); - if ((oldstate & Qt::WindowMaximized) != (newstate & Qt::WindowMaximized)) { - if ((newstate & Qt::WindowMaximized)) { - const QRect normalGeometry = geometry(); + QTLWExtra *top = d->topData(); + const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry; - const QRect r = top->normalGeometry; - setGeometry(qApp->desktop()->availableGeometry(this)); - top->normalGeometry = r; + if (newstate & Qt::WindowFullScreen) + setGeometry(qApp->desktop()->screenGeometry(this)); + else if (newstate & Qt::WindowMaximized) + setGeometry(qApp->desktop()->availableGeometry(this)); + else + setGeometry(normalGeometry); - if (top->normalGeometry.width() < 0) - top->normalGeometry = normalGeometry; - } else { - // restore original geometry - setGeometry(top->normalGeometry); - } - } - if ((oldstate & Qt::WindowFullScreen) != (newstate & Qt::WindowFullScreen)) { - if (newstate & Qt::WindowFullScreen) { - const QRect normalGeometry = geometry(); - const QRect r = top->normalGeometry; - setGeometry(qApp->desktop()->screenGeometry(this)); - - top->normalGeometry = r; - if (top->normalGeometry.width() < 0) - top->normalGeometry = normalGeometry; - } else { - if (newstate & Qt::WindowMaximized) { - const QRect r = top->normalGeometry; - setGeometry(qApp->desktop()->availableGeometry(this)); - top->normalGeometry = r; - } else { - setGeometry(top->normalGeometry); - } - } - } - if ((oldstate & Qt::WindowMinimized) != (newstate & Qt::WindowMinimized)) { - if (newstate & Qt::WindowMinimized) { - if (isVisible()) { - QSymbianControl *id = static_cast<QSymbianControl *>(effectiveWinId()); - if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->setFocusSafely(false); - id->MakeVisible(false); - } - } else { - if (isVisible()) { - QSymbianControl *id = static_cast<QSymbianControl *>(effectiveWinId()); - id->MakeVisible(true); - if (!id->IsFocused()) // Avoid unnecessary calls to FocusChanged() - id->setFocusSafely(true); - } - const QRect normalGeometry = geometry(); - const QRect r = top->normalGeometry; - top->normalGeometry = r; - if (top->normalGeometry.width() < 0) - top->normalGeometry = normalGeometry; - } - } + //restore normal geometry + top->normalGeometry = normalGeometry; } data->window_state = newstate; @@ -1195,6 +1147,10 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (destroyWindow) { delete id; + // At this point the backing store should already be destroyed + // so we flush the command buffer to ensure that the freeing of + // those resources and deleting the window can happen "atomically" + S60->wsSession().Flush(); } } diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp index 4684bc1..10fb009 100644 --- a/src/gui/kernel/qwidget_x11.cpp +++ b/src/gui/kernel/qwidget_x11.cpp @@ -346,11 +346,6 @@ Q_GUI_EXPORT void qt_x11_enforce_cursor(QWidget * w) qt_x11_enforce_cursor(w, false); } -static Bool checkForConfigureAndExpose(Display *, XEvent *e, XPointer) -{ - return e->type == ConfigureNotify || e->type == Expose; -} - Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) { if (!w || (!w->isWindow() && !w->internalWinId())) @@ -363,38 +358,60 @@ Q_GUI_EXPORT void qt_x11_wait_for_window_manager(QWidget* w) if (!w->testAttribute(Qt::WA_WState_Created)) return; - if (!(w->windowFlags() & Qt::X11BypassWindowManagerHint)) { - // if the window is not override-redirect, then the window manager - // will reparent us to the frame decoration window. - while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), ReparentNotify, &ev)) { - if (t.elapsed() > maximumWaitTime) - return; - qApp->syncX(); // non-busy wait - } - } + WId winid = w->internalWinId(); - while (!XCheckTypedWindowEvent(X11->display, w->effectiveWinId(), MapNotify, &ev)) { - if (t.elapsed() > maximumWaitTime) - return; - qApp->syncX(); // non-busy wait - } + // first deliver events that are already in the local queue + QApplication::sendPostedEvents(); - qApp->x11ProcessEvent(&ev); + // the normal sequence is: + // ... ConfigureNotify ... ReparentNotify ... MapNotify ... Expose + // with X11BypassWindowManagerHint: + // ConfigureNotify ... MapNotify ... Expose - // ok, seems like the window manager successfully reparented us, we'll wait - // for the first paint event to arrive, while handling ConfigureNotify in - // the arrival order - while(1) - { - if (XCheckIfEvent(X11->display, &ev, checkForConfigureAndExpose, 0)) { + enum State { + Initial, Reparented, Mapped + } state = Initial; + + do { + if (XEventsQueued(X11->display, QueuedAlready)) { + XNextEvent(X11->display, &ev); qApp->x11ProcessEvent(&ev); - if (ev.type == Expose) - return; + + if (w->windowFlags() & Qt::X11BypassWindowManagerHint) { + switch (state) { + case Initial: + case Reparented: + if (ev.type == MapNotify && ev.xany.window == winid) + state = Mapped; + break; + case Mapped: + if (ev.type == Expose && ev.xany.window == winid) + return; + break; + } + } else { + switch (state) { + case Initial: + if (ev.type == ReparentNotify && ev.xany.window == winid) + state = Reparented; + break; + case Reparented: + if (ev.type == MapNotify && ev.xany.window == winid) + state = Mapped; + break; + case Mapped: + if (ev.type == Expose && ev.xany.window == winid) + return; + break; + } + } + } else { + if (!XEventsQueued(X11->display, QueuedAfterFlush)) + qApp->syncX(); // non-busy wait } if (t.elapsed() > maximumWaitTime) return; - qApp->syncX(); // non-busy wait - } + } while(1); } void qt_change_net_wm_state(const QWidget* w, bool set, Atom one, Atom two = 0) diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 194dda3..660a2a8 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -2408,7 +2408,11 @@ static inline int soft_light_op(int dst, int src, int da, int sa) else if (4 * dst <= da) return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025; else { +# ifdef Q_CC_RVCT // needed to avoid compiler crash in RVCT 2.2 + return (dst * sa * 255 + da * (src2 - sa) * (qIntSqrtInt(dst_np * 255) - dst_np) + temp) / 65025; +# else return (dst * sa * 255 + da * (src2 - sa) * (int(sqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025; +# endif } } diff --git a/src/gui/painting/qmath_p.h b/src/gui/painting/qmath_p.h index cd9f5ea..8a5f5ab 100644 --- a/src/gui/painting/qmath_p.h +++ b/src/gui/painting/qmath_p.h @@ -54,6 +54,7 @@ // #include <math.h> +#include <qmath.h> QT_BEGIN_NAMESPACE @@ -61,6 +62,11 @@ static const qreal Q_PI = qreal(3.14159265358979323846); // pi static const qreal Q_2PI = qreal(6.28318530717958647693); // 2*pi static const qreal Q_PI2 = qreal(1.57079632679489661923); // pi/2 +inline int qIntSqrtInt(int v) +{ + return static_cast<int>(qSqrt(static_cast<qreal>(v))); +} + QT_END_NAMESPACE #endif // QMATH_P_H diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index cde6a2d..bf12c6b 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7509,7 +7509,7 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) return widgetPrivate->redirected(offset); } - if (*globalRedirectionAtomic() == 0) + if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) return 0; QMutexLocker locker(globalRedirectionsMutex()); @@ -7529,7 +7529,7 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) void qt_painter_removePaintDevice(QPaintDevice *dev) { - if (*globalRedirectionAtomic() == 0) + if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) return; QMutex *mutex = 0; diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 7997e77..bc81514 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -90,8 +90,6 @@ static QPointF normalize(const QPointF &p) return p / qSqrt(p.x() * p.x() + p.y() * p.y()); } -static bool pathToRect(const QPainterPath &path, QRectF *rect = 0); - struct QIntersection { qreal alphaA; @@ -1660,7 +1658,7 @@ static bool fuzzyCompare(qreal a, qreal b) return qFuzzyCompare(a, b); } -static bool pathToRect(const QPainterPath &path, QRectF *rect) +bool QPathClipper::pathToRect(const QPainterPath &path, QRectF *rect) { if (path.elementCount() != 5) return false; @@ -1693,7 +1691,7 @@ static bool pathToRect(const QPainterPath &path, QRectF *rect) return false; if (rect) - *rect = QRectF(QPointF(x1, y1), QPointF(x2, y2)); + rect->setCoords(x1, y1, x2, y2); return true; } diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h index 0d2c049..b900862 100644 --- a/src/gui/painting/qpathclipper_p.h +++ b/src/gui/painting/qpathclipper_p.h @@ -86,6 +86,8 @@ public: bool intersect(); bool contains(); + static bool pathToRect(const QPainterPath &path, QRectF *rect = 0); + private: Q_DISABLE_COPY(QPathClipper) diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index a0d2b9b..eee6bef 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -295,10 +295,8 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi CGContextRestoreGState(context); #ifndef QT_MAC_USE_COCOA QDEndCGContext(port, &context); -#else - CGContextFlush(context); -#endif #endif +#endif // Q_WS_MAC #ifdef Q_OS_SYMBIAN Q_UNUSED(widget); diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 3132dd1..7f9b058 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -1149,10 +1149,10 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTabV3 *opt, const QWidget int vpadding = proxyStyle->pixelMetric(QStyle::PM_TabBarTabVSpace, opt, widget) / 2; if (opt->shape == QTabBar::RoundedSouth || opt->shape == QTabBar::TriangularSouth) verticalShift = -verticalShift; - tr.adjust(hpadding, vpadding, horizontalShift - hpadding, verticalShift - vpadding); + tr.adjust(hpadding, verticalShift - vpadding, horizontalShift - hpadding, vpadding); bool selected = opt->state & QStyle::State_Selected; if (selected) { - tr.setBottom(tr.bottom() - verticalShift); + tr.setTop(tr.top() - verticalShift); tr.setRight(tr.right() - horizontalShift); } diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index a077cf0..40ee31d 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3391,8 +3391,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - pr.setHeight(pixmap.size().height()); - cr.adjust(0, pr.bottom() + 1, 0, 1); + QMainWindow *mw = qobject_cast<QMainWindow *>(w->window()); + if (mw && mw->unifiedTitleAndToolBarOnMac()) { + pr.setHeight(pixmap.size().height()); + cr.adjust(0, pr.bottom() + 1, 0, 1); + } else { + pr.setHeight(pixmap.size().height() + 6); + cr.adjust(0, pr.bottom(), 0, -3); + } alignment |= Qt::AlignCenter; } else { pr.setWidth(pixmap.width() + 8); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 9002172..1f9fc32 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1125,6 +1125,7 @@ void QRenderRule::fixupBorder(int nativeWidth) void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) { + setClip(p, rect); static const Qt::TileRule tileMode2TileRule[] = { Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; @@ -1142,6 +1143,7 @@ void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) QRect(QPoint(), borderImageData->pixmap.size()), sourceMargins, QTileRules(tileMode2TileRule[borderImageData->horizStretch], tileMode2TileRule[borderImageData->vertStretch])); p->setRenderHint(QPainter::SmoothPixmapTransform, wasSmoothPixmapTransform); + unsetClip(p); } QRect QRenderRule::originRect(const QRect &rect, Origin origin) const diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 3ae6fe9..87a73df 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -246,8 +246,8 @@ static void initializeDb() QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); const int numTypeFaces = QS60Data::screenDevice()->NumTypefaces(); - const QFontDatabaseS60StoreImplementation *store = dynamic_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store); - Q_ASSERT(store); + const QFontDatabaseS60StoreImplementation *store = + static_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store); bool fontAdded = false; for (int i = 0; i < numTypeFaces; i++) { TTypefaceSupport typefaceSupport; @@ -258,8 +258,7 @@ static void initializeDb() continue; if (font->TypeUid() == KCFbsFontUid) { TOpenFontFaceAttrib faceAttrib; - const CFbsFont *cfbsFont = dynamic_cast<const CFbsFont *>(font); - Q_ASSERT(cfbsFont); + const CFbsFont *cfbsFont = static_cast<const CFbsFont *>(font); cfbsFont->GetFaceAttrib(faceAttrib); QtFontStyle::Key styleKey; @@ -390,8 +389,8 @@ QFontEngine *QFontDatabase::findFont(int script, const QFontPrivate *, const QFo QFontDef request = req; request.family = fontFamily; #if defined(QT_NO_FREETYPE) - const QFontDatabaseS60StoreImplementation *store = dynamic_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store); - Q_ASSERT(store); + const QFontDatabaseS60StoreImplementation *store = + static_cast<const QFontDatabaseS60StoreImplementation*>(db->s60Store); const QFontEngineS60Extensions *extension = store->extension(fontFamily); fe = new QFontEngineS60(request, extension); #else diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp index 2fc1940..d30c996 100644 --- a/src/gui/text/qzip.cpp +++ b/src/gui/text/qzip.cpp @@ -54,10 +54,13 @@ #include <zlib.h> #if defined(Q_OS_WIN) -#undef S_IFREG -#define S_IFREG 0100000 +# undef S_IFREG +# define S_IFREG 0100000 +# ifndef S_IFDIR +# define S_IFDIR 0040000 +# endif # ifndef S_ISDIR -# define S_ISDIR(x) ((x) & 0040000) > 0 +# define S_ISDIR(x) ((x) & S_IFDIR) > 0 # endif # ifndef S_ISREG # define S_ISREG(x) ((x) & 0170000) == S_IFREG diff --git a/src/gui/text/qzipreader_p.h b/src/gui/text/qzipreader_p.h index 1086464..67a2ace 100644 --- a/src/gui/text/qzipreader_p.h +++ b/src/gui/text/qzipreader_p.h @@ -49,7 +49,7 @@ // ------------- // // This file is not part of the Qt API. It exists for the convenience -// of the QLibrary class. This header file may change from +// of the QZipReader class. This header file may change from // version to version without notice, or even be removed. // // We mean it. diff --git a/src/gui/text/qzipwriter_p.h b/src/gui/text/qzipwriter_p.h index 7b97937..9322f4a 100644 --- a/src/gui/text/qzipwriter_p.h +++ b/src/gui/text/qzipwriter_p.h @@ -47,7 +47,7 @@ // ------------- // // This file is not part of the Qt API. It exists for the convenience -// of the QLibrary class. This header file may change from +// of the QZipWriter class. This header file may change from // version to version without notice, or even be removed. // // We mean it. diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 87f6c83..1d496d5 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -1134,13 +1134,10 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e) void QAbstractScrollArea::wheelEvent(QWheelEvent *e) { Q_D(QAbstractScrollArea); - QScrollBar *const bars[2] = { d->hbar, d->vbar }; - int idx = (e->orientation() == Qt::Vertical) ? 1 : 0; - int other = (idx + 1) % 2; - if (!bars[idx]->isVisible() && bars[other]->isVisible()) - idx = other; // If the scrollbar of the event orientation is hidden, fallback to the other. - - QApplication::sendEvent(bars[idx], e); + if (static_cast<QWheelEvent*>(e)->orientation() == Qt::Horizontal) + QApplication::sendEvent(d->hbar, e); + else + QApplication::sendEvent(d->vbar, e); } #endif diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index 2874647..73c17db 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -214,8 +214,8 @@ QT_BEGIN_NAMESPACE */ QAbstractSliderPrivate::QAbstractSliderPrivate() - : minimum(0), maximum(99), singleStep(1), pageStep(10), - value(0), position(0), pressValue(-1), offset_accumulated(0), tracking(true), + : minimum(0), maximum(99), pageStep(10), value(0), position(0), pressValue(-1), + singleStep(1), offset_accumulated(0), tracking(true), blocktracking(false), pressed(false), invertedAppearance(false), invertedControls(false), orientation(Qt::Horizontal), repeatAction(QAbstractSlider::SliderNoAction) @@ -688,51 +688,62 @@ void QAbstractSlider::sliderChange(SliderChange) update(); } - -/*! - \reimp -*/ -#ifndef QT_NO_WHEELEVENT -void QAbstractSlider::wheelEvent(QWheelEvent * e) +bool QAbstractSliderPrivate::scrollByDelta(Qt::Orientation orientation, Qt::KeyboardModifiers modifiers, int delta) { - Q_D(QAbstractSlider); - e->ignore(); - + Q_Q(QAbstractSlider); int stepsToScroll = 0; - qreal offset = qreal(e->delta()) / 120; + // in Qt scrolling to the right gives negative values. + if (orientation == Qt::Horizontal) + delta = -delta; + qreal offset = qreal(delta) / 120; - if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) { + if ((modifiers & Qt::ControlModifier) || (modifiers & Qt::ShiftModifier)) { // Scroll one page regardless of delta: - stepsToScroll = qBound(-d->pageStep, int(offset * d->pageStep), d->pageStep); - d->offset_accumulated = 0; + stepsToScroll = qBound(-pageStep, int(offset * pageStep), pageStep); + offset_accumulated = 0; } else { // Calculate how many lines to scroll. Depending on what delta is (and // offset), we might end up with a fraction (e.g. scroll 1.3 lines). We can // only scroll whole lines, so we keep the reminder until next event. - qreal stepsToScrollF = offset * QApplication::wheelScrollLines() * d->effectiveSingleStep(); + qreal stepsToScrollF = offset * QApplication::wheelScrollLines() * effectiveSingleStep(); // Check if wheel changed direction since last event: - if (d->offset_accumulated != 0 && (offset / d->offset_accumulated) < 0) - d->offset_accumulated = 0; + if (offset_accumulated != 0 && (offset / offset_accumulated) < 0) + offset_accumulated = 0; - d->offset_accumulated += stepsToScrollF; - stepsToScroll = qBound(-d->pageStep, int(d->offset_accumulated), d->pageStep); - d->offset_accumulated -= int(d->offset_accumulated); + offset_accumulated += stepsToScrollF; + stepsToScroll = qBound(-pageStep, int(offset_accumulated), pageStep); + offset_accumulated -= int(offset_accumulated); if (stepsToScroll == 0) - return; + return false; } - if (d->invertedControls) + if (invertedControls) stepsToScroll = -stepsToScroll; - int prevValue = d->value; - d->position = d->overflowSafeAdd(stepsToScroll); // value will be updated by triggerAction() - triggerAction(SliderMove); + int prevValue = value; + position = overflowSafeAdd(stepsToScroll); // value will be updated by triggerAction() + q->triggerAction(QAbstractSlider::SliderMove); + + if (prevValue == value) { + offset_accumulated = 0; + return false; + } + return true; +} - if (prevValue == d->value) - d->offset_accumulated = 0; - else +/*! + \reimp +*/ +#ifndef QT_NO_WHEELEVENT +void QAbstractSlider::wheelEvent(QWheelEvent * e) +{ + Q_D(QAbstractSlider); + e->ignore(); + int delta = e->delta(); + if (d->scrollByDelta(e->orientation(), e->modifiers(), delta)) e->accept(); } + #endif #ifdef QT_KEYPAD_NAVIGATION /*! diff --git a/src/gui/widgets/qabstractslider_p.h b/src/gui/widgets/qabstractslider_p.h index 6cde468..6e6ff6e 100644 --- a/src/gui/widgets/qabstractslider_p.h +++ b/src/gui/widgets/qabstractslider_p.h @@ -138,6 +138,7 @@ public: } q->triggerAction(repeatAction); } + bool scrollByDelta(Qt::Orientation orientation, Qt::KeyboardModifiers modifiers, int delta); }; QT_END_NAMESPACE diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 48d7022..6a0e363 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -1017,6 +1017,8 @@ void QDialogButtonBox::removeButton(QAbstractButton *button) If the button has already been added, it is removed and added again with the new role. + \note The button box takes ownership of the button. + \sa removeButton(), clear() */ void QDialogButtonBox::addButton(QAbstractButton *button, ButtonRole role) diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index d1e7285..fc75c92 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -1627,6 +1627,13 @@ void QMainWindowLayout::animationFinished(QWidget *widget) tb->d_func()->plug(currentGapRect); #endif + savedState.clear(); + currentGapPos.clear(); + pluggingWidget = 0; + //applying the state will make sure that the currentGap is updated correctly + //and all the geometries (especially the one from the central widget) is correct + layoutState.apply(false); + #ifndef QT_NO_DOCKWIDGET #ifndef QT_NO_TABBAR if (qobject_cast<QDockWidget*>(widget) != 0) { @@ -1637,13 +1644,6 @@ void QMainWindowLayout::animationFinished(QWidget *widget) } #endif #endif - - savedState.clear(); - currentGapPos.clear(); - pluggingWidget = 0; - //applying the state will make sure that the currentGap is updated correctly - //and all the geometries (especially the one from the central widget) is correct - layoutState.apply(false); } if (!widgetAnimator.animating()) { diff --git a/src/gui/widgets/qscrollbar.cpp b/src/gui/widgets/qscrollbar.cpp index 73ce122..3eed3a9 100644 --- a/src/gui/widgets/qscrollbar.cpp +++ b/src/gui/widgets/qscrollbar.cpp @@ -521,6 +521,22 @@ bool QScrollBar::event(QEvent *event) if (const QHoverEvent *he = static_cast<const QHoverEvent *>(event)) d_func()->updateHoverControl(he->pos()); break; + case QEvent::Wheel: { + // override wheel event without adding virtual function override + QWheelEvent *ev = static_cast<QWheelEvent *>(event); + int delta = ev->delta(); + // scrollbar is a special case - in vertical mode it reaches minimum + // value in the upper position, however QSlider's minimum value is on + // the bottom. So we need to invert a value, but since the scrollbar is + // inverted by default, we need to inverse the delta value for the + // horizontal orientation. + if (ev->orientation() == Qt::Horizontal) + delta = -delta; + Q_D(QScrollBar); + if (d->scrollByDelta(ev->orientation(), ev->modifiers(), delta)) + event->accept(); + return true; + } default: break; } diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 7782448..7ed27ea 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -441,8 +441,7 @@ void QToolBarPrivate::plug(const QRect &r) When a QToolBar is not a child of a QMainWindow, it looses the ability to populate the extension pop up with widgets added to the toolbar using addWidget(). Please use widget actions created by inheriting QWidgetAction - and implementing QWidgetAction::createWidget() instead. This is a known - issue which will be fixed in a future release. + and implementing QWidgetAction::createWidget() instead. \sa QToolButton, QMenu, QAction, {Application Example} */ diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 24560d1..b17e3a1 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -559,6 +559,12 @@ void QGL2PaintEngineExPrivate::resetGLState() glStencilMask(0xff); glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glStencilFunc(GL_ALWAYS, 0, 0xff); + glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR); + glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR); + glDisableVertexAttribArray(QT_OPACITY_ATTR); +#ifndef QT_OPENGL_ES_2 + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); // color may have been changed by glVertexAttrib() +#endif } void QGL2PaintEngineEx::endNativePainting() diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index e9ca4c4..3e5c4fc 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1688,10 +1688,8 @@ QGLTextureCache::QGLTextureCache() Q_ASSERT(qt_gl_texture_cache == 0); qt_gl_texture_cache = this; - QImagePixmapCleanupHooks::instance()->addPixmapModificationHook(cleanupTextures); -#ifdef Q_WS_X11 - QImagePixmapCleanupHooks::instance()->addPixmapDestructionHook(cleanupPixmapSurfaces); -#endif + QImagePixmapCleanupHooks::instance()->addPixmapDataModificationHook(cleanupTextures); + QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(cleanupBeforePixmapDestruction); QImagePixmapCleanupHooks::instance()->addImageHook(imageCleanupHook); } @@ -1699,10 +1697,8 @@ QGLTextureCache::~QGLTextureCache() { qt_gl_texture_cache = 0; - QImagePixmapCleanupHooks::instance()->removePixmapModificationHook(cleanupTextures); -#ifdef Q_WS_X11 - QImagePixmapCleanupHooks::instance()->removePixmapDestructionHook(cleanupPixmapSurfaces); -#endif + QImagePixmapCleanupHooks::instance()->removePixmapDataModificationHook(cleanupTextures); + QImagePixmapCleanupHooks::instance()->removePixmapDataDestructionHook(cleanupBeforePixmapDestruction); QImagePixmapCleanupHooks::instance()->removeImageHook(imageCleanupHook); } @@ -1770,30 +1766,29 @@ void QGLTextureCache::imageCleanupHook(qint64 cacheKey) } -void QGLTextureCache::cleanupTextures(QPixmap* pixmap) +void QGLTextureCache::cleanupTextures(QPixmapData* pmd) { // ### remove when the GL texture cache becomes thread-safe if (qApp->thread() == QThread::currentThread()) { - const qint64 cacheKey = pixmap->cacheKey(); + const qint64 cacheKey = pmd->cacheKey(); QGLTexture *texture = instance()->getTexture(cacheKey); if (texture && texture->options & QGLContext::MemoryManagedBindOption) instance()->remove(cacheKey); } } -#if defined(Q_WS_X11) -void QGLTextureCache::cleanupPixmapSurfaces(QPixmap* pixmap) +void QGLTextureCache::cleanupBeforePixmapDestruction(QPixmapData* pmd) { // Remove any bound textures first: - cleanupTextures(pixmap); + cleanupTextures(pmd); - QPixmapData *pd = pixmap->data_ptr().data(); - if (pd->classId() == QPixmapData::X11Class) { - Q_ASSERT(pd->ref == 1); // Make sure reference counting isn't broken - QGLContextPrivate::destroyGlSurfaceForPixmap(pd); +#if defined(Q_WS_X11) + if (pmd->classId() == QPixmapData::X11Class) { + Q_ASSERT(pmd->ref == 0); // Make sure reference counting isn't broken + QGLContextPrivate::destroyGlSurfaceForPixmap(pmd); } -} #endif +} void QGLTextureCache::deleteIfEmpty() { diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index d17db3a..18fc9c2 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -520,7 +520,7 @@ public: QSize bindCompressedTexturePVR(const char *buf, int len); }; -class QGLTextureCache { +class Q_AUTOTEST_EXPORT QGLTextureCache { public: QGLTextureCache(); ~QGLTextureCache(); @@ -537,11 +537,8 @@ public: static QGLTextureCache *instance(); static void deleteIfEmpty(); static void imageCleanupHook(qint64 cacheKey); - static void cleanupTextures(QPixmap* pixmap); -#ifdef Q_WS_X11 - // X11 needs to catch pixmap data destruction to delete EGL/GLX pixmap surfaces - static void cleanupPixmapSurfaces(QPixmap* pixmap); -#endif + static void cleanupTextures(QPixmapData* pixmap); + static void cleanupBeforePixmapDestruction(QPixmapData* pixmap); private: QCache<qint64, QGLTexture> m_cache; diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index 11011ee..37bb7c0 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -319,14 +319,14 @@ public: ~QGLBlurTextureCache(); QGLBlurTextureInfo *takeBlurTextureInfo(const QPixmap &pixmap); - bool hasBlurTextureInfo(const QPixmap &pixmap) const; + bool hasBlurTextureInfo(quint64 cacheKey) const; void insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTextureInfo *info); - void clearBlurTextureInfo(const QPixmap &pixmap); + void clearBlurTextureInfo(quint64 cacheKey); void timerEvent(QTimerEvent *event); private: - static void pixmapDestroyed(QPixmap *pixmap); + static void pixmapDestroyed(QPixmapData *pixmap); QCache<quint64, QGLBlurTextureInfo > cache; @@ -379,21 +379,21 @@ QGLBlurTextureInfo *QGLBlurTextureCache::takeBlurTextureInfo(const QPixmap &pixm return cache.take(pixmap.cacheKey()); } -void QGLBlurTextureCache::clearBlurTextureInfo(const QPixmap &pixmap) +void QGLBlurTextureCache::clearBlurTextureInfo(quint64 cacheKey) { - cache.remove(pixmap.cacheKey()); + cache.remove(cacheKey); } -bool QGLBlurTextureCache::hasBlurTextureInfo(const QPixmap &pixmap) const +bool QGLBlurTextureCache::hasBlurTextureInfo(quint64 cacheKey) const { - return cache.contains(pixmap.cacheKey()); + return cache.contains(cacheKey); } void QGLBlurTextureCache::insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTextureInfo *info) { static bool hookAdded = false; if (!hookAdded) { - QImagePixmapCleanupHooks::instance()->addPixmapDestructionHook(pixmapDestroyed); + QImagePixmapCleanupHooks::instance()->addPixmapDataDestructionHook(pixmapDestroyed); hookAdded = true; } @@ -406,11 +406,11 @@ void QGLBlurTextureCache::insertBlurTextureInfo(const QPixmap &pixmap, QGLBlurTe timerId = startTimer(8000); } -void QGLBlurTextureCache::pixmapDestroyed(QPixmap *pixmap) +void QGLBlurTextureCache::pixmapDestroyed(QPixmapData *pmd) { foreach (QGLBlurTextureCache *cache, blurTextureCaches) { - if (cache->hasBlurTextureInfo(*pixmap)) - cache->clearBlurTextureInfo(*pixmap); + if (cache->hasBlurTextureInfo(pmd->cacheKey())) + cache->clearBlurTextureInfo(pmd->cacheKey()); } } diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 923563b..18d6b0a 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -188,6 +188,7 @@ public: bool maskValid; // True if vgMask() contains valid data. bool maskIsSet; // True if mask would be fully set if it was valid. + bool scissorMask; // True if scissor is used in place of the mask. bool rawVG; // True if processing a raw VG escape. QRect maskRect; // Rectangle version of mask if it is simple. @@ -355,6 +356,7 @@ void QVGPaintEnginePrivate::init() maskValid = false; maskIsSet = false; + scissorMask = false; rawVG = false; scissorActive = false; @@ -1539,7 +1541,28 @@ void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen) static inline bool clipTransformIsSimple(const QTransform& transform) { QTransform::TransformationType type = transform.type(); - return (type == QTransform::TxNone || type == QTransform::TxTranslate); + if (type == QTransform::TxNone || type == QTransform::TxTranslate) + return true; + if (type == QTransform::TxRotate) { + // Check for 0, 90, 180, and 270 degree rotations. + // (0 might happen after 4 rotations of 90 degrees). + qreal m11 = transform.m11(); + qreal m12 = transform.m12(); + qreal m21 = transform.m21(); + qreal m22 = transform.m22(); + if (m11 == 0.0f && m22 == 0.0f) { + if (m12 == 1.0f && m21 == -1.0f) + return true; // 90 degrees. + else if (m12 == -1.0f && m21 == 1.0f) + return true; // 270 degrees. + } else if (m12 == 0.0f && m21 == 0.0f) { + if (m11 == -1.0f && m22 == -1.0f) + return true; // 180 degrees. + else if (m11 == 1.0f && m22 == 1.0f) + return true; // 0 degrees. + } + } + return false; } #if defined(QVG_SCISSOR_CLIP) @@ -1661,12 +1684,12 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) if (op == Qt::NoClip) { d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); vgSeti(VG_MASKING, VG_FALSE); return; } -#if defined(QVG_NO_RENDER_TO_MASK) // We don't have vgRenderToMask(), so handle simple QRectF's only. if (path.shape() == QVectorPath::RectangleHint && path.elementCount() == 4 && clipTransformIsSimple(d->transform)) { @@ -1676,8 +1699,10 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) QRectF rect(points[0], points[1], points[2] - points[0], points[5] - points[1]); clip(rect.toRect(), op); + return; } -#else + +#if !defined(QVG_NO_RENDER_TO_MASK) QPaintDevice *pdev = paintDevice(); int width = pdev->width(); int height = pdev->height(); @@ -1708,6 +1733,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) vgSeti(VG_MASKING, VG_TRUE); d->maskValid = true; d->maskIsSet = false; + d->scissorMask = false; #endif } @@ -1728,6 +1754,7 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) { d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); vgSeti(VG_MASKING, VG_FALSE); } @@ -1743,6 +1770,7 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) vgSeti(VG_MASKING, VG_FALSE); d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); } else { // Special case: if the intersection of the system @@ -1760,6 +1788,7 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) if (clip.rectCount() != 1) { d->maskValid = false; d->maskIsSet = false; + d->scissorMask = false; d->maskRect = QRect(); d->modifyMask(this, VG_FILL_MASK, r); break; @@ -1768,6 +1797,7 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) } d->maskValid = false; d->maskIsSet = false; + d->scissorMask = true; d->maskRect = clipRect; vgSeti(VG_MASKING, VG_FALSE); updateScissor(); @@ -1778,13 +1808,30 @@ void QVGPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) case Qt::IntersectClip: { QRect r = d->transform.mapRect(rect); - if (d->maskIsSet && isDefaultClipRect(r)) { + if (!d->maskValid) { + // Mask has not been used yet, so intersect with + // the previous scissor-based region in maskRect. + if (d->scissorMask) + r = r.intersect(d->maskRect); + if (isDefaultClipRect(r)) { + // The clip is the full window, so turn off clipping. + d->maskIsSet = true; + d->maskRect = QRect(); + } else { + // Activate the scissor on a smaller maskRect. + d->maskIsSet = false; + d->maskRect = r; + } + d->scissorMask = true; + updateScissor(); + } else if (d->maskIsSet && isDefaultClipRect(r)) { // Intersecting a full-window clip with a full-window // region is the same as turning off clipping. if (d->maskValid) vgSeti(VG_MASKING, VG_FALSE); d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); } else { d->modifyMask(this, VG_INTERSECT_MASK, r); @@ -1826,6 +1873,7 @@ void QVGPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) { d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); vgSeti(VG_MASKING, VG_FALSE); } @@ -1841,6 +1889,7 @@ void QVGPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) vgSeti(VG_MASKING, VG_FALSE); d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); } else { // Special case: if the intersection of the system @@ -1854,12 +1903,14 @@ void QVGPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) if (clip.rectCount() == 1) { d->maskValid = false; d->maskIsSet = false; + d->scissorMask = true; d->maskRect = clip.boundingRect(); vgSeti(VG_MASKING, VG_FALSE); updateScissor(); } else { d->maskValid = false; d->maskIsSet = false; + d->scissorMask = false; d->maskRect = QRect(); d->modifyMask(this, VG_FILL_MASK, r); } @@ -1884,6 +1935,7 @@ void QVGPaintEngine::clip(const QRegion ®ion, Qt::ClipOperation op) vgSeti(VG_MASKING, VG_FALSE); d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); } else { d->modifyMask(this, VG_INTERSECT_MASK, r); @@ -1962,6 +2014,7 @@ void QVGPaintEngine::clip(const QPainterPath &path, Qt::ClipOperation op) if (op == Qt::NoClip) { d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); vgSeti(VG_MASKING, VG_FALSE); return; @@ -1997,6 +2050,7 @@ void QVGPaintEngine::clip(const QPainterPath &path, Qt::ClipOperation op) vgSeti(VG_MASKING, VG_TRUE); d->maskValid = true; d->maskIsSet = false; + d->scissorMask = false; #else QPaintEngineEx::clip(path, op); #endif @@ -2040,6 +2094,7 @@ void QVGPaintEnginePrivate::modifyMask vgSeti(VG_MASKING, VG_TRUE); maskValid = true; maskIsSet = false; + scissorMask = false; } void QVGPaintEnginePrivate::modifyMask @@ -2061,6 +2116,7 @@ void QVGPaintEnginePrivate::modifyMask vgSeti(VG_MASKING, VG_TRUE); maskValid = true; maskIsSet = false; + scissorMask = false; } #endif // !QVG_SCISSOR_CLIP @@ -2093,7 +2149,7 @@ void QVGPaintEngine::updateScissor() { #if !defined(QVG_SCISSOR_CLIP) // Combine the system clip with the simple mask rectangle. - if (!d->maskRect.isNull()) { + if (d->scissorMask) { if (region.isEmpty()) region = d->maskRect; else @@ -2184,6 +2240,7 @@ void QVGPaintEngine::clipEnabledChanged() // Replay the entire clip stack to put the mask into the right state. d->maskValid = false; d->maskIsSet = true; + d->scissorMask = false; d->maskRect = QRect(); s->clipRegion = defaultClipRegion(); d->replayClipOperations(); @@ -2193,6 +2250,7 @@ void QVGPaintEngine::clipEnabledChanged() vgSeti(VG_MASKING, VG_FALSE); d->maskValid = false; d->maskIsSet = false; + d->scissorMask = false; d->maskRect = QRect(); } #endif @@ -2311,12 +2369,7 @@ bool QVGPaintEngine::clearRect(const QRectF &rect, const QColor &color) Q_D(QVGPaintEngine); QVGPainterState *s = state(); if (!s->clipEnabled || s->clipOperation == Qt::NoClip) { - // The transform will either be identity or a simple translation, - // so do a simpler version of "r = d->transform.map(rect).toRect()". - QRect r = QRect(qRound(rect.x() + d->transform.dx()), - qRound(rect.y() + d->transform.dy()), - qRound(rect.width()), - qRound(rect.height())); + QRect r = d->transform.mapRect(rect).toRect(); int height = paintDevice()->height(); if (d->clearColor != color || d->clearOpacity != s->opacity) { VGfloat values[4]; @@ -3395,6 +3448,7 @@ void QVGPaintEngine::restoreState(QPaintEngine::DirtyFlags dirty) QPaintEngine::DirtyClipEnabled)) != 0) { d->maskValid = false; d->maskIsSet = false; + d->scissorMask = false; d->maskRect = QRect(); clipEnabledChanged(); } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 6b251c7..cd4d5c2 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -921,7 +921,7 @@ void QDirectFBScreenPrivate::setFlipFlags(const QStringList &args) qPrintable(flip)); } } else { - flipFlags = DSFLIP_BLIT; + flipFlags = DSFLIP_BLIT|DSFLIP_ONSYNC; } } diff --git a/src/plugins/imageformats/gif/qgifhandler.cpp b/src/plugins/imageformats/gif/qgifhandler.cpp index 6f049be..25d3dfa 100644 --- a/src/plugins/imageformats/gif/qgifhandler.cpp +++ b/src/plugins/imageformats/gif/qgifhandler.cpp @@ -71,7 +71,8 @@ public: ~QGIFFormat(); int decode(QImage *image, const uchar* buffer, int length, - int *nextFrameDelay, int *loopCount, QSize *nextSize); + int *nextFrameDelay, int *loopCount); + static void scan(QIODevice *device, QVector<QSize> *imageSizes, int *loopCount); bool newFrame; bool partialNewFrame; @@ -229,7 +230,7 @@ void QGIFFormat::disposePrevious(QImage *image) Returns the number of bytes consumed. */ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length, - int *nextFrameDelay, int *loopCount, QSize *nextSize) + int *nextFrameDelay, int *loopCount) { // We are required to state that // "The Graphics Interchange Format(c) is the Copyright property of @@ -346,10 +347,6 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length, bpl = image->bytesPerLine(); bits = image->bits(); memset(bits, 0, image->byteCount()); - - // ### size of the upcoming frame, should rather - // be known before decoding it. - *nextSize = QSize(swidth, sheight); } disposePrevious(image); @@ -645,6 +642,273 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length, return initial-length; } +/*! + Scans through the data stream defined by \a device and returns the image + sizes found in the stream in the \a imageSizes vector. +*/ +void QGIFFormat::scan(QIODevice *device, QVector<QSize> *imageSizes, int *loopCount) +{ + if (!device) + return; + + qint64 oldPos = device->pos(); + if (!device->seek(0)) + return; + + int colorCount = 0; + int localColorCount = 0; + int globalColorCount = 0; + int colorReadCount = 0; + bool localColormap = false; + bool globalColormap = false; + int count = 0; + int blockSize = 0; + int imageWidth = 0; + int imageHeight = 0; + bool done = false; + uchar hold[16]; + State state = Header; + + const int readBufferSize = 40960; // 40k read buffer + QByteArray readBuffer(device->read(readBufferSize)); + + if (readBuffer.isEmpty()) { + device->seek(oldPos); + return; + } + + // This is a specialized version of the state machine from decode(), + // which doesn't do any image decoding or mallocing, and has an + // optimized way of skipping SkipBlocks, ImageDataBlocks and + // Global/LocalColorMaps. + + while (!readBuffer.isEmpty()) { + int length = readBuffer.size(); + const uchar *buffer = (const uchar *) readBuffer.constData(); + while (!done && length) { + length--; + uchar ch = *buffer++; + switch (state) { + case Header: + hold[count++] = ch; + if (count == 6) { + state = LogicalScreenDescriptor; + count = 0; + } + break; + case LogicalScreenDescriptor: + hold[count++] = ch; + if (count == 7) { + imageWidth = LM(hold[0], hold[1]); + imageHeight = LM(hold[2], hold[3]); + globalColormap = !!(hold[4] & 0x80); + globalColorCount = 2 << (hold[4] & 0x7); + count = 0; + colorCount = globalColorCount; + if (globalColormap) { + int colorTableSize = 3 * globalColorCount; + if (length >= colorTableSize) { + // skip the global color table in one go + length -= colorTableSize; + buffer += colorTableSize; + state = Introducer; + } else { + colorReadCount = 0; + state = GlobalColorMap; + } + } else { + state=Introducer; + } + } + break; + case GlobalColorMap: + case LocalColorMap: + hold[count++] = ch; + if (count == 3) { + if (++colorReadCount >= colorCount) { + if (state == LocalColorMap) + state = TableImageLZWSize; + else + state = Introducer; + } + count = 0; + } + break; + case Introducer: + hold[count++] = ch; + switch (ch) { + case 0x2c: + state = ImageDescriptor; + break; + case 0x21: + state = ExtensionLabel; + break; + case 0x3b: + state = Done; + break; + default: + done = true; + state = Error; + } + break; + case ImageDescriptor: + hold[count++] = ch; + if (count == 10) { + int newLeft = LM(hold[1], hold[2]); + int newTop = LM(hold[3], hold[4]); + int newWidth = LM(hold[5], hold[6]); + int newHeight = LM(hold[7], hold[8]); + + if (imageWidth/10 > qMax(newWidth,200)) + imageWidth = -1; + if (imageHeight/10 > qMax(newHeight,200)) + imageHeight = -1; + + if (imageWidth <= 0) + imageWidth = newLeft + newWidth; + if (imageHeight <= 0) + imageHeight = newTop + newHeight; + + *imageSizes << QSize(imageWidth, imageHeight); + + localColormap = !!(hold[9] & 0x80); + localColorCount = localColormap ? (2 << (hold[9] & 0x7)) : 0; + if (localColorCount) + colorCount = localColorCount; + else + colorCount = globalColorCount; + + count = 0; + if (localColormap) { + int colorTableSize = 3 * localColorCount; + if (length >= colorTableSize) { + // skip the local color table in one go + length -= colorTableSize; + buffer += colorTableSize; + state = TableImageLZWSize; + } else { + colorReadCount = 0; + state = LocalColorMap; + } + } else { + state = TableImageLZWSize; + } + } + break; + case TableImageLZWSize: + if (ch > max_lzw_bits) + state = Error; + else + state = ImageDataBlockSize; + count = 0; + break; + case ImageDataBlockSize: + blockSize = ch; + if (blockSize) { + if (length >= blockSize) { + // we can skip the block in one go + length -= blockSize; + buffer += blockSize; + count = 0; + } else { + state = ImageDataBlock; + } + } else { + state = Introducer; + } + break; + case ImageDataBlock: + ++count; + if (count == blockSize) { + count = 0; + state = ImageDataBlockSize; + } + break; + case ExtensionLabel: + switch (ch) { + case 0xf9: + state = GraphicControlExtension; + break; + case 0xff: + state = ApplicationExtension; + break; + default: + state = SkipBlockSize; + } + count = 0; + break; + case ApplicationExtension: + if (count < 11) + hold[count] = ch; + ++count; + if (count == hold[0] + 1) { + if (qstrncmp((char*)(hold+1), "NETSCAPE", 8) == 0) + state=NetscapeExtensionBlockSize; + else + state=SkipBlockSize; + count = 0; + } + break; + case GraphicControlExtension: + if (count < 5) + hold[count] = ch; + ++count; + if (count == hold[0] + 1) { + count = 0; + state = SkipBlockSize; + } + break; + case NetscapeExtensionBlockSize: + blockSize = ch; + count = 0; + if (blockSize) + state = NetscapeExtensionBlock; + else + state = Introducer; + break; + case NetscapeExtensionBlock: + if (count < 3) + hold[count] = ch; + count++; + if (count == blockSize) { + *loopCount = LM(hold[1], hold[2]); + state = SkipBlockSize; + } + break; + case SkipBlockSize: + blockSize = ch; + count = 0; + if (blockSize) { + if (length >= blockSize) { + // we can skip the block in one go + length -= blockSize; + buffer += blockSize; + } else { + state = SkipBlock; + } + } else { + state = Introducer; + } + break; + case SkipBlock: + ++count; + if (count == blockSize) + state = SkipBlockSize; + break; + case Done: + done = true; + break; + case Error: + device->seek(oldPos); + return; + } + } + readBuffer = device->read(readBufferSize); + } + device->seek(oldPos); + return; +} + void QGIFFormat::fillRect(QImage *image, int col, int row, int w, int h, QRgb color) { if (w>0) { @@ -763,9 +1027,9 @@ QGifHandler::QGifHandler() { gifFormat = new QGIFFormat; nextDelay = 0; - loopCnt = 0; + loopCnt = 1; frameNumber = -1; - nextSize = QSize(); + scanIsCached = false; } QGifHandler::~QGifHandler() @@ -787,7 +1051,7 @@ bool QGifHandler::imageIsComing() const } int decoded = gifFormat->decode(&lastImage, (const uchar *)buffer.constData(), buffer.size(), - &nextDelay, &loopCnt, &nextSize); + &nextDelay, &loopCnt); if (decoded == -1) break; buffer.remove(0, decoded); @@ -831,7 +1095,7 @@ bool QGifHandler::read(QImage *image) } int decoded = gifFormat->decode(&lastImage, (const uchar *)buffer.constData(), buffer.size(), - &nextDelay, &loopCnt, &nextSize); + &nextDelay, &loopCnt); if (decoded == -1) break; buffer.remove(0, decoded); @@ -862,8 +1126,18 @@ bool QGifHandler::supportsOption(ImageOption option) const QVariant QGifHandler::option(ImageOption option) const { if (option == Size) { - if (imageIsComing()) - return nextSize; + if (!scanIsCached) { + QGIFFormat::scan(device(), &imageSizes, &loopCnt); + scanIsCached = true; + } + // before the first frame is read, or we have an empty data stream + if (frameNumber == -1) + return (imageSizes.count() > 0) ? QVariant(imageSizes.at(0)) : QVariant(); + // after the last frame has been read, the next size is undefined + if (frameNumber >= imageSizes.count() - 1) + return QVariant(); + // and the last case: the size of the next frame + return imageSizes.at(frameNumber + 1); } else if (option == Animation) { return true; } @@ -883,11 +1157,19 @@ int QGifHandler::nextImageDelay() const int QGifHandler::imageCount() const { - return 0; // Don't know + if (!scanIsCached) { + QGIFFormat::scan(device(), &imageSizes, &loopCnt); + scanIsCached = true; + } + return imageSizes.count(); } int QGifHandler::loopCount() const { + if (!scanIsCached) { + QGIFFormat::scan(device(), &imageSizes, &loopCnt); + scanIsCached = true; + } return loopCnt-1; // In GIF, loop count is iteration count, so subtract one } diff --git a/src/plugins/imageformats/gif/qgifhandler.h b/src/plugins/imageformats/gif/qgifhandler.h index a6e520f..8e07aff 100644 --- a/src/plugins/imageformats/gif/qgifhandler.h +++ b/src/plugins/imageformats/gif/qgifhandler.h @@ -87,7 +87,8 @@ private: mutable int nextDelay; mutable int loopCnt; int frameNumber; - mutable QSize nextSize; + mutable QVector<QSize> imageSizes; + mutable bool scanIsCached; }; QT_END_NAMESPACE diff --git a/src/plugins/imageformats/ico/qicohandler.cpp b/src/plugins/imageformats/ico/qicohandler.cpp index b2351fa..4edb87a 100644 --- a/src/plugins/imageformats/ico/qicohandler.cpp +++ b/src/plugins/imageformats/ico/qicohandler.cpp @@ -53,6 +53,7 @@ #include <QtGui/QImage> #include <QtCore/QFile> #include <QtCore/QBuffer> +#include <qvariant.h> // These next two structs represent how the icon information is stored // in an ICO file. typedef struct @@ -772,6 +773,29 @@ QtIcoHandler::~QtIcoHandler() delete m_pICOReader; } +QVariant QtIcoHandler::option(ImageOption option) const +{ + if (option == Size) { + QIODevice *device = QImageIOHandler::device(); + qint64 oldPos = device->pos(); + ICONDIRENTRY iconEntry; + if (device->seek(oldPos + ICONDIR_SIZE + (m_currentIconIndex * ICONDIRENTRY_SIZE))) { + if (readIconDirEntry(device, &iconEntry)) { + device->seek(oldPos); + return QSize(iconEntry.bWidth, iconEntry.bHeight); + } + } + if (!device->isSequential()) + device->seek(oldPos); + } + return QVariant(); +} + +bool QtIcoHandler::supportsOption(ImageOption option) const +{ + return option == Size; +} + /*! * Verifies if some values (magic bytes) are set as expected in the header of the file. * If the magic bytes were found, it is assumed that the QtIcoHandler can read the file. diff --git a/src/plugins/imageformats/ico/qicohandler.h b/src/plugins/imageformats/ico/qicohandler.h index b9ef27e..394a5eb 100644 --- a/src/plugins/imageformats/ico/qicohandler.h +++ b/src/plugins/imageformats/ico/qicohandler.h @@ -62,6 +62,9 @@ public: static bool canRead(QIODevice *device); + bool supportsOption(ImageOption option) const; + QVariant option(ImageOption option) const; + private: int m_currentIconIndex; ICOReader *m_pICOReader; diff --git a/src/plugins/kbddrivers/linuxinput/main.cpp b/src/plugins/kbddrivers/linuxinput/main.cpp index 19a3145..db5167e 100644 --- a/src/plugins/kbddrivers/linuxinput/main.cpp +++ b/src/plugins/kbddrivers/linuxinput/main.cpp @@ -69,7 +69,7 @@ QWSKeyboardHandler* QLinuxInputKbdDriver::create(const QString &driver, Q_UNUSED(device); if (driver.compare(QLatin1String("LinuxInput"), Qt::CaseInsensitive)) return 0; - return new QWSLinuxInputKeyboardHandler(driver, device); + return new QWSLinuxInputKeyboardHandler(device); } Q_EXPORT_PLUGIN2(qwslinuxinputkbddriver, QLinuxInputKbdDriver) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index 155e3e7..be7a6a0 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -2081,8 +2081,8 @@ EXPORTS ?addPixmap@QGraphicsScene@@QAEPAVQGraphicsPixmapItem@@ABVQPixmap@@@Z @ 2080 NONAME ; class QGraphicsPixmapItem * QGraphicsScene::addPixmap(class QPixmap const &) ?addPixmap@QIcon@@QAEXABVQPixmap@@W4Mode@1@W4State@1@@Z @ 2081 NONAME ; void QIcon::addPixmap(class QPixmap const &, enum QIcon::Mode, enum QIcon::State) ?addPixmap@QIconEngine@@UAEXABVQPixmap@@W4Mode@QIcon@@W4State@4@@Z @ 2082 NONAME ; void QIconEngine::addPixmap(class QPixmap const &, enum QIcon::Mode, enum QIcon::State) - ?addPixmapDestructionHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 2083 NONAME ; void QImagePixmapCleanupHooks::addPixmapDestructionHook(void (*)(class QPixmap *)) - ?addPixmapModificationHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 2084 NONAME ; void QImagePixmapCleanupHooks::addPixmapModificationHook(void (*)(class QPixmap *)) + ?addPixmapDestructionHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 2083 NONAME ABSENT ; void QImagePixmapCleanupHooks::addPixmapDestructionHook(void (*)(class QPixmap *)) + ?addPixmapModificationHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 2084 NONAME ABSENT ; void QImagePixmapCleanupHooks::addPixmapModificationHook(void (*)(class QPixmap *)) ?addPolygon@QGraphicsScene@@QAEPAVQGraphicsPolygonItem@@ABVQPolygonF@@ABVQPen@@ABVQBrush@@@Z @ 2085 NONAME ; class QGraphicsPolygonItem * QGraphicsScene::addPolygon(class QPolygonF const &, class QPen const &, class QBrush const &) ?addPolygon@QPainterPath@@QAEXABVQPolygonF@@@Z @ 2086 NONAME ; void QPainterPath::addPolygon(class QPolygonF const &) ?addRect@QGraphicsScene@@QAEPAVQGraphicsRectItem@@ABVQRectF@@ABVQPen@@ABVQBrush@@@Z @ 2087 NONAME ; class QGraphicsRectItem * QGraphicsScene::addRect(class QRectF const &, class QPen const &, class QBrush const &) @@ -4283,8 +4283,8 @@ EXPORTS ?executeDelayedItemsLayout@QAbstractItemView@@IAEXXZ @ 4282 NONAME ; void QAbstractItemView::executeDelayedItemsLayout(void) ?executeImageHooks@QImagePixmapCleanupHooks@@SAX_J@Z @ 4283 NONAME ; void QImagePixmapCleanupHooks::executeImageHooks(long long) ?executePendingSort@QTreeWidgetItem@@ABEXXZ @ 4284 NONAME ; void QTreeWidgetItem::executePendingSort(void) const - ?executePixmapDestructionHooks@QImagePixmapCleanupHooks@@SAXPAVQPixmap@@@Z @ 4285 NONAME ; void QImagePixmapCleanupHooks::executePixmapDestructionHooks(class QPixmap *) - ?executePixmapModificationHooks@QImagePixmapCleanupHooks@@SAXPAVQPixmap@@@Z @ 4286 NONAME ; void QImagePixmapCleanupHooks::executePixmapModificationHooks(class QPixmap *) + ?executePixmapDestructionHooks@QImagePixmapCleanupHooks@@SAXPAVQPixmap@@@Z @ 4285 NONAME ABSENT ; void QImagePixmapCleanupHooks::executePixmapDestructionHooks(class QPixmap *) + ?executePixmapModificationHooks@QImagePixmapCleanupHooks@@SAXPAVQPixmap@@@Z @ 4286 NONAME ABSENT ; void QImagePixmapCleanupHooks::executePixmapModificationHooks(class QPixmap *) ?expand@QTreeView@@QAEXABVQModelIndex@@@Z @ 4287 NONAME ; void QTreeView::expand(class QModelIndex const &) ?expandAll@QTreeView@@QAEXXZ @ 4288 NONAME ; void QTreeView::expandAll(void) ?expandItem@QTreeWidget@@QAEXPBVQTreeWidgetItem@@@Z @ 4289 NONAME ; void QTreeWidget::expandItem(class QTreeWidgetItem const *) @@ -7927,8 +7927,8 @@ EXPORTS ?removeItemWidget@QTreeWidget@@QAEXPAVQTreeWidgetItem@@H@Z @ 7926 NONAME ; void QTreeWidget::removeItemWidget(class QTreeWidgetItem *, int) ?removeMapping@QDataWidgetMapper@@QAEXPAVQWidget@@@Z @ 7927 NONAME ; void QDataWidgetMapper::removeMapping(class QWidget *) ?removePage@QWizard@@QAEXH@Z @ 7928 NONAME ; void QWizard::removePage(int) - ?removePixmapDestructionHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 7929 NONAME ; void QImagePixmapCleanupHooks::removePixmapDestructionHook(void (*)(class QPixmap *)) - ?removePixmapModificationHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 7930 NONAME ; void QImagePixmapCleanupHooks::removePixmapModificationHook(void (*)(class QPixmap *)) + ?removePixmapDestructionHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 7929 NONAME ABSENT ; void QImagePixmapCleanupHooks::removePixmapDestructionHook(void (*)(class QPixmap *)) + ?removePixmapModificationHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmap@@@Z@Z @ 7930 NONAME ABSENT ; void QImagePixmapCleanupHooks::removePixmapModificationHook(void (*)(class QPixmap *)) ?removeRow@QStandardItem@@QAEXH@Z @ 7931 NONAME ; void QStandardItem::removeRow(int) ?removeRow@QTableWidget@@QAEXH@Z @ 7932 NONAME ; void QTableWidget::removeRow(int) ?removeRows@QSortFilterProxyModel@@UAE_NHHABVQModelIndex@@@Z @ 7933 NONAME ; bool QSortFilterProxyModel::removeRows(int, int, class QModelIndex const &) @@ -12533,4 +12533,19 @@ EXPORTS ?symbianHandleCommand@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12532 NONAME ; int QApplicationPrivate::symbianHandleCommand(class QSymbianEvent const *) ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12533 NONAME ; int QApplicationPrivate::symbianProcessWsEvent(class QSymbianEvent const *) ?symbianResourceChange@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12534 NONAME ; int QApplicationPrivate::symbianResourceChange(class QSymbianEvent const *) + ?addPixmapDataDestructionHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmapData@@@Z@Z @ 12535 NONAME ; void QImagePixmapCleanupHooks::addPixmapDataDestructionHook(void (*)(class QPixmapData *)) + ?addPixmapDataModificationHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmapData@@@Z@Z @ 12536 NONAME ; void QImagePixmapCleanupHooks::addPixmapDataModificationHook(void (*)(class QPixmapData *)) + ?cacheKey@QPixmapData@@QBE_JXZ @ 12537 NONAME ; long long QPixmapData::cacheKey(void) const + ?eventFilter@QS60Style@@MAE_NPAVQObject@@PAVQEvent@@@Z @ 12538 NONAME ; bool QS60Style::eventFilter(class QObject *, class QEvent *) + ?executePixmapDataDestructionHooks@QImagePixmapCleanupHooks@@SAXPAVQPixmapData@@@Z @ 12539 NONAME ; void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(class QPixmapData *) + ?executePixmapDataModificationHooks@QImagePixmapCleanupHooks@@SAXPAVQPixmapData@@@Z @ 12540 NONAME ; void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(class QPixmapData *) + ?invalidateChildGraphicsEffectsRecursively@QGraphicsItemPrivate@@QAEXW4InvalidateReason@1@@Z @ 12541 NONAME ; void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(enum QGraphicsItemPrivate::InvalidateReason) + ?invalidateParentGraphicsEffectsRecursively@QGraphicsItemPrivate@@QAEXXZ @ 12542 NONAME ; void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively(void) + ?markParentDirty@QGraphicsItemPrivate@@QAEX_N@Z @ 12543 NONAME ; void QGraphicsItemPrivate::markParentDirty(bool) + ?removePixmapDataDestructionHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmapData@@@Z@Z @ 12544 NONAME ; void QImagePixmapCleanupHooks::removePixmapDataDestructionHook(void (*)(class QPixmapData *)) + ?removePixmapDataModificationHook@QImagePixmapCleanupHooks@@QAEXP6AXPAVQPixmapData@@@Z@Z @ 12545 NONAME ; void QImagePixmapCleanupHooks::removePixmapDataModificationHook(void (*)(class QPixmapData *)) + ?setParentItemHelper@QGraphicsItemPrivate@@QAEXPAVQGraphicsItem@@PBVQVariant@@1@Z @ 12546 NONAME ; void QGraphicsItemPrivate::setParentItemHelper(class QGraphicsItem *, class QVariant const *, class QVariant const *) + ?timerEvent@QS60Style@@MAEXPAVQTimerEvent@@@Z @ 12547 NONAME ; void QS60Style::timerEvent(class QTimerEvent *) + ?updateAncestorFlags@QGraphicsItemPrivate@@QAEXXZ @ 12548 NONAME ; void QGraphicsItemPrivate::updateAncestorFlags(void) + ?updateChildWithGraphicsEffectFlagRecursively@QGraphicsItemPrivate@@QAEXXZ @ 12549 NONAME ; void QGraphicsItemPrivate::updateChildWithGraphicsEffectFlagRecursively(void) diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def index a9a69aa..5cf700b 100644 --- a/src/s60installs/eabi/QtGuiu.def +++ b/src/s60installs/eabi/QtGuiu.def @@ -11648,12 +11648,12 @@ EXPORTS _ZN24QImagePixmapCleanupHooks18enableCleanupHooksEP11QPixmapData @ 11647 NONAME _ZN24QImagePixmapCleanupHooks18enableCleanupHooksERK6QImage @ 11648 NONAME _ZN24QImagePixmapCleanupHooks18enableCleanupHooksERK7QPixmap @ 11649 NONAME - _ZN24QImagePixmapCleanupHooks24addPixmapDestructionHookEPFvP7QPixmapE @ 11650 NONAME - _ZN24QImagePixmapCleanupHooks25addPixmapModificationHookEPFvP7QPixmapE @ 11651 NONAME - _ZN24QImagePixmapCleanupHooks27removePixmapDestructionHookEPFvP7QPixmapE @ 11652 NONAME - _ZN24QImagePixmapCleanupHooks28removePixmapModificationHookEPFvP7QPixmapE @ 11653 NONAME - _ZN24QImagePixmapCleanupHooks29executePixmapDestructionHooksEP7QPixmap @ 11654 NONAME - _ZN24QImagePixmapCleanupHooks30executePixmapModificationHooksEP7QPixmap @ 11655 NONAME + _ZN24QImagePixmapCleanupHooks24addPixmapDestructionHookEPFvP7QPixmapE @ 11650 NONAME ABSENT + _ZN24QImagePixmapCleanupHooks25addPixmapModificationHookEPFvP7QPixmapE @ 11651 NONAME ABSENT + _ZN24QImagePixmapCleanupHooks27removePixmapDestructionHookEPFvP7QPixmapE @ 11652 NONAME ABSENT + _ZN24QImagePixmapCleanupHooks28removePixmapModificationHookEPFvP7QPixmapE @ 11653 NONAME ABSENT + _ZN24QImagePixmapCleanupHooks29executePixmapDestructionHooksEP7QPixmap @ 11654 NONAME ABSENT + _ZN24QImagePixmapCleanupHooks30executePixmapModificationHooksEP7QPixmap @ 11655 NONAME ABSENT _ZN25QGraphicsDropShadowEffect13setBlurRadiusEf @ 11656 NONAME _ZN25QGraphicsDropShadowEffect17blurRadiusChangedEf @ 11657 NONAME _ZN25QGraphicsDropShadowEffect4drawEP8QPainter @ 11658 NONAME @@ -11792,4 +11792,17 @@ EXPORTS _ZN19QApplicationPrivate20symbianHandleCommandEPK13QSymbianEvent @ 11791 NONAME _ZN19QApplicationPrivate21symbianProcessWsEventEPK13QSymbianEvent @ 11792 NONAME _ZN19QApplicationPrivate21symbianResourceChangeEPK13QSymbianEvent @ 11793 NONAME + _ZN20QGraphicsItemPrivate19setParentItemHelperEP13QGraphicsItemPK8QVariantS4_ @ 11794 NONAME + _ZN20QGraphicsItemPrivate19updateAncestorFlagsEv @ 11795 NONAME + _ZN20QGraphicsItemPrivate41invalidateChildGraphicsEffectsRecursivelyENS_16InvalidateReasonE @ 11796 NONAME + _ZN20QGraphicsItemPrivate42invalidateParentGraphicsEffectsRecursivelyEv @ 11797 NONAME + _ZN20QGraphicsItemPrivate44updateChildWithGraphicsEffectFlagRecursivelyEv @ 11798 NONAME + _ZN24QImagePixmapCleanupHooks28addPixmapDataDestructionHookEPFvP11QPixmapDataE @ 11799 NONAME + _ZN24QImagePixmapCleanupHooks29addPixmapDataModificationHookEPFvP11QPixmapDataE @ 11800 NONAME + _ZN24QImagePixmapCleanupHooks31removePixmapDataDestructionHookEPFvP11QPixmapDataE @ 11801 NONAME + _ZN24QImagePixmapCleanupHooks32removePixmapDataModificationHookEPFvP11QPixmapDataE @ 11802 NONAME + _ZN24QImagePixmapCleanupHooks33executePixmapDataDestructionHooksEP11QPixmapData @ 11803 NONAME + _ZN24QImagePixmapCleanupHooks34executePixmapDataModificationHooksEP11QPixmapData @ 11804 NONAME + _ZN9QS60Style10timerEventEP11QTimerEvent @ 11805 NONAME + _ZN9QS60Style11eventFilterEP7QObjectP6QEvent @ 11806 NONAME diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro index 47cf020..25fb188 100644 --- a/src/s60main/s60main.pro +++ b/src/s60main/s60main.pro @@ -22,6 +22,9 @@ symbian { # staticlib should not have any lib depencies in s60 # This seems not to work, some hard coded libs are still added as dependency LIBS = + + # Workaround for abld toolchain problem to make ARMV6 qtmain.lib link with GCCE apps + symbian-abld: QMAKE_CXXFLAGS.ARMCC += --dllimport_runtime } else { error("$$_FILE_ is intended only for Symbian!") } diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 8099ffa..dc1d181 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -721,8 +721,9 @@ void WriteInitialization::acceptWidget(DomWidget *node) m_output << m_indent << parentWidget << "->addDockWidget(" << area << varName << ");\n"; } else if (m_uic->customWidgetsInfo()->extends(className, QLatin1String("QStatusBar"))) { m_output << m_indent << parentWidget << "->setStatusBar(" << varName << ");\n"; - } else { - m_output << m_indent << parentWidget << "->setCentralWidget(" << varName << ");\n"; + } else if (!m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3DockWindow")) + && !m_uic->customWidgetsInfo()->extends(className, QLatin1String("Q3ToolBar"))) { + m_output << m_indent << parentWidget << "->setCentralWidget(" << varName << ");\n"; } } diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index cae959b..8d9ae4f 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -2973,7 +2973,7 @@ QDomElement QDomNode::lastChildElement(const QString &tagName) const } /*! - Returns the next sibilng element with tag name \a tagName if \a tagName + Returns the next sibling element with tag name \a tagName if \a tagName is non-empty; otherwise returns any next sibling element. Returns a null element if no such sibling exists. |