diff options
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea.cpp | 16 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea_p.h | 3 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea_p_p.h | 17 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache.cpp | 14 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativepixmapcache_p.h | 2 | ||||
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 10 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 9 | ||||
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 8 | ||||
-rw-r--r-- | src/s60installs/bwins/QtGuiu.def | 4 | ||||
-rw-r--r-- | tests/auto/qtreewidget/tst_qtreewidget.cpp | 20 |
11 files changed, 61 insertions, 44 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index 20ca0f6..18f008a 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -496,9 +496,6 @@ void QDeclarativeMouseArea::mousePressEvent(QGraphicsSceneMouseEvent *event) d->pressAndHoldTimer.start(PressAndHoldDelay, this); setKeepMouseGrab(d->stealMouse); event->setAccepted(setPressed(true)); - - if(!event->isAccepted() && d->forwardToList.count()) - d->forwardEvent(event); } } @@ -576,9 +573,6 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) me.setX(d->lastPos.x()); me.setY(d->lastPos.y()); emit positionChanged(&me); - - if(!event->isAccepted() && d->forwardToList.count()) - d->forwardEvent(event); } @@ -600,9 +594,6 @@ void QDeclarativeMouseArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (s && s->mouseGrabberItem() == this) ungrabMouse(); setKeepMouseGrab(false); - - if(!event->isAccepted() && d->forwardToList.count()) - d->forwardEvent(event); } d->doubleClick = false; } @@ -994,11 +985,4 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() */ -QDeclarativeListProperty<QGraphicsObject> QDeclarativeMouseArea::forwardTo() -{ - Q_D(QDeclarativeMouseArea); - return d->forwardTo; -} - - QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 8fd453f..f6f970b 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -130,7 +130,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeMouseArea : public QDeclarativeItem Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged) Q_PROPERTY(QDeclarativeDrag *drag READ drag CONSTANT) //### add flicking to QDeclarativeDrag or add a QDeclarativeFlick ??? Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged REVISION 1) - Q_PROPERTY(QDeclarativeListProperty<QGraphicsObject> forwardTo READ forwardTo); public: QDeclarativeMouseArea(QDeclarativeItem *parent=0); @@ -158,8 +157,6 @@ public: bool preventStealing() const; void setPreventStealing(bool prevent); - QDeclarativeListProperty<QGraphicsObject> forwardTo(); - Q_SIGNALS: void hoveredChanged(); void pressedChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h index 6626c56..f6ea00d 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p_p.h @@ -70,8 +70,6 @@ public: : absorb(true), hovered(false), pressed(false), longPress(false), moved(false), stealMouse(false), doubleClick(false), preventStealing(false), drag(0) { - Q_Q(QDeclarativeMouseArea); - forwardTo = QDeclarativeListProperty<QGraphicsObject>(q, forwardToList); } ~QDeclarativeMouseAreaPrivate(); @@ -91,18 +89,6 @@ public: lastModifiers = event->modifiers(); } - void forwardEvent(QGraphicsSceneMouseEvent* event) - { - Q_Q(QDeclarativeMouseArea); - for(int i=0; i < forwardToList.count(); i++){ - event->setPos(forwardToList[i]->mapFromScene(event->scenePos())); - forwardToList[i]->scene()->sendEvent(forwardToList[i], event); - if(event->isAccepted()) - break; - } - event->setPos(q->mapFromScene(event->scenePos())); - } - bool isPressAndHoldConnected() { Q_Q(QDeclarativeMouseArea); static int idx = QObjectPrivate::get(q)->signalIndex("pressAndHold(QDeclarativeMouseEvent*)"); @@ -135,9 +121,6 @@ public: Qt::MouseButtons lastButtons; Qt::KeyboardModifiers lastModifiers; QBasicTimer pressAndHoldTimer; - - QDeclarativeListProperty<QGraphicsObject> forwardTo; - QList<QGraphicsObject*> forwardToList; }; QT_END_NAMESPACE diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index 07d3977..3557425 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -584,6 +584,7 @@ public: void unreferencePixmap(QDeclarativePixmapData *); void referencePixmap(QDeclarativePixmapData *); + void flushCache(); protected: virtual void timerEvent(QTimerEvent *); @@ -682,6 +683,14 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *) } } +/* + Remove all unreferenced pixmaps from the cache. +*/ +void QDeclarativePixmapStore::flushCache() +{ + shrinkCache(m_unreferencedCost); +} + QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d) : data(d), reader(0), requestSize(d->requestSize), loading(false), redirectCount(0) { @@ -1075,6 +1084,11 @@ bool QDeclarativePixmap::connectDownloadProgress(QObject *object, int method) return QMetaObject::connect(d->reply, QDeclarativePixmapReply::downloadProgressIndex, object, method); } +void QDeclarativePixmap::flushCache() +{ + pixmapStore()->flushCache(); +} + QT_END_NAMESPACE #include <qdeclarativepixmapcache.moc> diff --git a/src/declarative/util/qdeclarativepixmapcache_p.h b/src/declarative/util/qdeclarativepixmapcache_p.h index 396c196..4976906 100644 --- a/src/declarative/util/qdeclarativepixmapcache_p.h +++ b/src/declarative/util/qdeclarativepixmapcache_p.h @@ -103,6 +103,8 @@ public: bool connectDownloadProgress(QObject *, const char *); bool connectDownloadProgress(QObject *, int); + static void flushCache(); + private: Q_DISABLE_COPY(QDeclarativePixmap) QDeclarativePixmapData *d; diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index cb30161..bdf1f90 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -648,7 +648,7 @@ void QMacPixmapData::macCreatePixels() } if (pixels) - memcpy(base_pixels, pixels, pixelsSize); + memcpy(base_pixels, pixels, qMin(pixelsSize, (uint) numBytes)); pixels = base_pixels; pixelsSize = numBytes; } diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 5ce94f8..96be2b8 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3167,7 +3167,15 @@ bool QRasterPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, } else #endif { - QFontEngineGlyphCache::Type glyphType = fontEngine->glyphFormat >= 0 ? QFontEngineGlyphCache::Type(fontEngine->glyphFormat) : d->glyphCacheType; + QFontEngineGlyphCache::Type glyphType; + if (fontEngine->glyphFormat >= 0) { + glyphType = QFontEngineGlyphCache::Type(fontEngine->glyphFormat); + } else if (s->matrix.type() > QTransform::TxTranslate + && d->glyphCacheType == QFontEngineGlyphCache::Raster_RGBMask) { + glyphType = QFontEngineGlyphCache::Raster_A8; + } else { + glyphType = d->glyphCacheType; + } QImageTextureGlyphCache *cache = static_cast<QImageTextureGlyphCache *>(fontEngine->glyphCache(0, glyphType, s->matrix)); diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 17b7451..760fdca 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2868,6 +2868,9 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) return; } + if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip) + op = Qt::ReplaceClip; + d->state->clipRegion = rect; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) @@ -2923,6 +2926,9 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) return; } + if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip) + op = Qt::ReplaceClip; + d->state->clipRegion = r; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) @@ -3328,6 +3334,9 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) return; } + if (d->state->clipOperation == Qt::NoClip && op == Qt::IntersectClip) + op = Qt::ReplaceClip; + d->state->clipPath = path; d->state->clipOperation = op; if (op == Qt::NoClip || op == Qt::ReplaceClip) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 53fefa4..dd56fbb 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -296,14 +296,10 @@ void QTextureGlyphCache::fillInPendingGlyphs() QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const { #if defined(Q_WS_X11) - if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) { + if (m_type != Raster_RGBMask && m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) { QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None; QImage::Format imageFormat = QImage::Format_Invalid; switch (m_type) { - case Raster_RGBMask: - format = QFontEngineFT::Format_A32; - imageFormat = QImage::Format_RGB32; - break; case Raster_A8: format = QFontEngineFT::Format_A8; imageFormat = QImage::Format_Indexed8; @@ -386,7 +382,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP } #endif - if (m_type == QFontEngineGlyphCache::Raster_RGBMask) { + if (m_type == QFontEngineGlyphCache::Raster_RGBMask) { QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()), qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(), m_image.format()); diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index f4a3481..8fc5333 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -14034,3 +14034,7 @@ EXPORTS ?releaseAllGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 14033 NONAME ; void QSymbianGraphicsSystemEx::releaseAllGpuResources(void) ?cursorMoveStyle@QLineControl@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14034 NONAME ; enum Qt::CursorMoveStyle QLineControl::cursorMoveStyle(void) const ?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 14035 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) + ?hasStaticContentsSupport@QWindowSurface@@QBE_NXZ @ 14036 NONAME ; bool QWindowSurface::hasStaticContentsSupport(void) const + ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 14037 NONAME ; bool QWindowSurface::hasPartialUpdateSupport(void) const + ??0QSymbianGraphicsSystemEx@@QAE@XZ @ 14038 NONAME ABSENT ; QSymbianGraphicsSystemEx::QSymbianGraphicsSystemEx(void) + ?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 14039 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void) diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp index dc878c4..7d2cdfb 100644 --- a/tests/auto/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp @@ -50,6 +50,8 @@ #include <qlineedit.h> #include <QScrollBar> #include <QStyledItemDelegate> +#include <QDesktopWidget> +#include <QApplication> #include "../../shared/util.h" @@ -3102,10 +3104,21 @@ void tst_QTreeWidget::task206367_duplication() QWidget topLevel; QTreeWidget treeWidget(&topLevel); topLevel.show(); +#ifndef Q_WS_S60 treeWidget.resize(200, 200); +#endif treeWidget.setSortingEnabled(true); QTreeWidgetItem* rootItem = new QTreeWidgetItem( &treeWidget, QStringList("root") ); +#ifdef Q_WS_S60 + // Ensure that eight items fit into tree widget. In Symbian VGA devices 8 rows of + // data will take more than 200 pixels. + int calculatedHeight = treeWidget.visualItemRect(treeWidget.topLevelItem(0)).height() + + 2 * QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, 0); + calculatedHeight *= 8; // eight 'rows': header, root and 2 items with 2 children + treeWidget.resize(200, qMax(200, calculatedHeight)); +#endif + for (int nFile = 0; nFile < 2; nFile++ ) { QTreeWidgetItem* itemFile = new QTreeWidgetItem(rootItem, QStringList(QString::number(nFile))); for (int nRecord = 0; nRecord < 2; nRecord++) @@ -3211,6 +3224,13 @@ void tst_QTreeWidget::task239150_editorWidth() { //we check that an item with no text will get an editor with a correct size QTreeWidget tree; +#ifdef Q_OS_SYMBIAN + //By default widgets are 640*360 in Symbian. Call to create_sys() sets the real size of the widget. + //Therefore, with VGA Symbian devices, we need to update the widget width to match screen width. + //As VGA devices have larger font, longer texts wouldn't otherwise fit into tree widget. + if (QApplication::desktop() && QApplication::desktop()->availableGeometry().width() > tree.width()) + tree.resize(QApplication::desktop()->availableGeometry().size()); +#endif QStyleOptionFrameV2 opt; opt.init(&tree); |