diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qcolor.cpp | 23 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_mmx.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_mmx3dnow.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qdrawutil.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qmatrix.cpp | 3 | ||||
-rw-r--r-- | src/gui/painting/qmatrix.h | 14 | ||||
-rw-r--r-- | src/gui/painting/qpaintbuffer.cpp | 18 | ||||
-rw-r--r-- | src/gui/painting/qpaintbuffer_p.h | 4 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 46 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster_p.h | 4 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_s60.cpp | 37 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_s60_p.h | 36 | ||||
-rw-r--r-- | src/gui/painting/qpaintengineex.cpp | 7 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qprintengine_pdf.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qprintengine_win.cpp | 5 | ||||
-rw-r--r-- | src/gui/painting/qprinter.cpp | 6 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_x11.cpp | 13 |
18 files changed, 198 insertions, 32 deletions
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 5659aef..62e08f3 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -691,6 +691,8 @@ void QColor::setHsv(int h, int s, int v, int a) } /*! + \since 4.6 + Sets the contents pointed to by \a h, \a s, \a l, and \a a, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value. @@ -719,6 +721,8 @@ void QColor::getHslF(qreal *h, qreal *s, qreal *l, qreal *a) const } /*! + \since 4.6 + Sets the contents pointed to by \a h, \a s, \a l, and \a a, to the hue, saturation, lightness, and alpha-channel (transparency) components of the color's HSL value. @@ -747,6 +751,8 @@ void QColor::getHsl(int *h, int *s, int *l, int *a) const } /*! + \since 4.6 + Sets a HSL color lightness; \a h is the hue, \a s is the saturation, \a l is the lightness and \a a is the alpha component of the HSL color. @@ -773,6 +779,8 @@ void QColor::setHslF(qreal h, qreal s, qreal l, qreal a) } /*! + \since 4.6 + Sets a HSL color value; \a h is the hue, \a s is the saturation, \a l is the lightness and \a a is the alpha component of the HSL color. @@ -1332,6 +1340,8 @@ qreal QColor::valueF() const } /*! + \since 4.6 + Returns the hue color component of this color. \sa getHslF(), getHsl() @@ -1344,6 +1354,8 @@ int QColor::hslHue() const } /*! + \since 4.6 + Returns the saturation color component of this color. \sa saturationF(), getHsv(), {QColor#The HSV Color Model}{The HSV Color @@ -1357,6 +1369,8 @@ int QColor::hslSaturation() const } /*! + \since 4.6 + Returns the lightness color component of this color. \sa lightnessF(), getHsl() @@ -1369,6 +1383,8 @@ int QColor::lightness() const } /*! + \since 4.6 + Returns the hue color component of this color. \sa hue(), getHslF() @@ -1381,6 +1397,8 @@ qreal QColor::hslHueF() const } /*! + \since 4.6 + Returns the saturation color component of this color. \sa saturationF() getHslF() @@ -1393,6 +1411,8 @@ qreal QColor::hslSaturationF() const } /*! + \since 4.6 + Returns the lightness color component of this color. \sa value() getHslF() @@ -1979,6 +1999,8 @@ QColor QColor::fromHsvF(qreal h, qreal s, qreal v, qreal a) } /*! + \since 4.6 + Static convenience function that returns a QColor constructed from the HSV color values, \a h (hue), \a s (saturation), \a l (lightness), and \a a (alpha-channel, i.e. transparency). @@ -2010,6 +2032,7 @@ QColor QColor::fromHsl(int h, int s, int l, int a) /*! \overload + \since 4.6 Static convenience function that returns a QColor constructed from the HSV color values, \a h (hue), \a s (saturation), \a l (lightness), and \a a diff --git a/src/gui/painting/qdrawhelper_mmx.cpp b/src/gui/painting/qdrawhelper_mmx.cpp index 0dcc3dd..d81e2a9 100644 --- a/src/gui/painting/qdrawhelper_mmx.cpp +++ b/src/gui/painting/qdrawhelper_mmx.cpp @@ -128,7 +128,7 @@ void qt_blend_rgb32_on_rgb32_mmx(uchar *destPixels, int dbpl, } } +QT_END_NAMESPACE #endif // QT_HAVE_MMX -QT_END_NAMESPACE diff --git a/src/gui/painting/qdrawhelper_mmx3dnow.cpp b/src/gui/painting/qdrawhelper_mmx3dnow.cpp index 0db89f0..2d40ae3 100644 --- a/src/gui/painting/qdrawhelper_mmx3dnow.cpp +++ b/src/gui/painting/qdrawhelper_mmx3dnow.cpp @@ -101,6 +101,7 @@ void qt_blend_color_argb_mmx3dnow(int count, const QSpan *spans, void *userData) (CompositionFunctionSolid*)qt_functionForModeSolid_MMX3DNOW); } +QT_END_NAMESPACE + #endif // QT_HAVE_3DNOW -QT_END_NAMESPACE diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 0a82a9f..716300e 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1070,6 +1070,9 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs, \since 4.6 \overload + \brief The qDrawBorderPixmap function is for drawing a pixmap into + the margins of a rectangle. + Draws the given \a pixmap into the given \a target rectangle, using the given \a painter. The pixmap will be split into nine segments and drawn according to the \a margins structure. diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index 0f0d405..88b2b7a 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -1209,6 +1209,9 @@ QDebug operator<<(QDebug dbg, const QMatrix &m) \relates QMatrix \since 4.6 + \brief The qFuzzyCompare function is for comparing two matrices + using a fuzziness factor. + Returns true if \a m1 and \a m2 are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise. */ diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h index 983ebd5..8887f0e 100644 --- a/src/gui/painting/qmatrix.h +++ b/src/gui/painting/qmatrix.h @@ -129,13 +129,13 @@ private: , _m22(1.) , _dx(0.) , _dy(0.) {} - inline QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy, bool) - : _m11(m11) - , _m12(m12) - , _m21(m21) - , _m22(m22) - , _dx(dx) - , _dy(dy) {} + inline QMatrix(qreal am11, qreal am12, qreal am21, qreal am22, qreal adx, qreal ady, bool) + : _m11(am11) + , _m12(am12) + , _m21(am21) + , _m22(am22) + , _dx(adx) + , _dy(ady) {} friend class QTransform; qreal _m11, _m12; qreal _m21, _m22; diff --git a/src/gui/painting/qpaintbuffer.cpp b/src/gui/painting/qpaintbuffer.cpp index 1038f74..6b9d77c 100644 --- a/src/gui/painting/qpaintbuffer.cpp +++ b/src/gui/painting/qpaintbuffer.cpp @@ -44,11 +44,14 @@ //#include <private/qtextengine_p.h> #include <private/qfontengine_p.h> #include <private/qemulationpaintengine_p.h> +#include <private/qimage_p.h> #include <QDebug> //#define QPAINTBUFFER_DEBUG_DRAW +QT_BEGIN_NAMESPACE + extern int qt_defaultDpiX(); extern int qt_defaultDpiY(); extern void qt_format_text(const QFont &font, @@ -890,6 +893,12 @@ void QPaintBufferEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) buffer->updateBoundingRect(QRectF(pos, pm.size())); } +static inline QImage qpaintbuffer_storable_image(const QImage &src) +{ + QImageData *d = const_cast<QImage &>(src).data_ptr(); + return d->own_data ? src : src.copy(); +} + void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags /*flags */) { @@ -897,7 +906,8 @@ void QPaintBufferEngine::drawImage(const QRectF &r, const QImage &image, const Q qDebug() << "QPaintBufferEngine: drawImage: src/dest rects " << r << sr; #endif QPaintBufferCommand *cmd = - buffer->addCommand(QPaintBufferPrivate::Cmd_DrawPixmapRect, QVariant(image)); + buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImageRect, + QVariant(qpaintbuffer_storable_image(image))); cmd->extra = buffer->addData((qreal *) &r, 4); buffer->addData((qreal *) &sr, 4); // ### flags... @@ -911,7 +921,8 @@ void QPaintBufferEngine::drawImage(const QPointF &pos, const QImage &image) qDebug() << "QPaintBufferEngine: drawImage: pos:" << pos; #endif QPaintBufferCommand *cmd = - buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos, QVariant(image)); + buffer->addCommand(QPaintBufferPrivate::Cmd_DrawImagePos, + QVariant(qpaintbuffer_storable_image(image))); cmd->extra = buffer->addData((qreal *) &pos, 2); if (buffer->calculateBoundingRect) buffer->updateBoundingRect(QRectF(pos, image.size())); @@ -1740,7 +1751,9 @@ struct QPaintBufferCacheEntry QVariant::Type type; quint64 cacheKey; }; +QT_END_NAMESPACE Q_DECLARE_METATYPE(QPaintBufferCacheEntry) +QT_BEGIN_NAMESPACE QDataStream &operator<<(QDataStream &stream, const QPaintBufferCacheEntry &entry) { @@ -1832,3 +1845,4 @@ QDataStream &operator>>(QDataStream &stream, QPaintBuffer &buffer) return stream; } +QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintbuffer_p.h b/src/gui/painting/qpaintbuffer_p.h index a80fa8d..6a7ac73 100644 --- a/src/gui/painting/qpaintbuffer_p.h +++ b/src/gui/painting/qpaintbuffer_p.h @@ -59,6 +59,8 @@ #include <private/qtextengine_p.h> #include <QDebug> +QT_BEGIN_NAMESPACE + class QPaintBufferPrivate; class QPaintBufferPlayback; @@ -440,4 +442,6 @@ private: FreeFunc free; }; +QT_END_NAMESPACE + #endif // QPAINTBUFFER_P_H diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index f41d7b4..6037bd5 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -3056,7 +3056,43 @@ void QRasterPaintEngine::drawCachedGlyphs(const QPointF &p, const QTextItemInt & return; } +#if defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) +void QRasterPaintEngine::drawGlyphsS60(const QPointF &p, const QTextItemInt &ti) +{ + Q_D(QRasterPaintEngine); + QRasterPaintEngineState *s = state(); + + QFontEngine *fontEngine = ti.fontEngine; + if (fontEngine->type() != QFontEngine::S60FontEngine) { + QPaintEngineEx::drawTextItem(p, ti); + return; + } + + QFontEngineS60 *fe = static_cast<QFontEngineS60 *>(fontEngine); + + QVarLengthArray<QFixedPoint> positions; + QVarLengthArray<glyph_t> glyphs; + QTransform matrix = s->matrix; + matrix.translate(p.x(), p.y()); + ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); + + const QFixed aliasDelta = QFixed::fromReal(aliasedCoordinateDelta); + + for (int i=0; i<glyphs.size(); ++i) { + TOpenFontCharMetrics tmetrics; + const TUint8 *glyphBitmapBytes; + TSize glyphBitmapSize; + fe->getCharacterData(glyphs[i], tmetrics, glyphBitmapBytes, glyphBitmapSize); + const glyph_metrics_t metrics = ti.fontEngine->boundingBox(glyphs[i]); + const int x = qFloor(positions[i].x + metrics.x + aliasDelta); + const int y = qFloor(positions[i].y + metrics.y + aliasDelta); + alphaPenBlt(glyphBitmapBytes, glyphBitmapSize.iWidth, 8, x, y, glyphBitmapSize.iWidth, glyphBitmapSize.iHeight); + } + + return; +} +#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE /*! * Returns true if the rectangle is completly within the current clip @@ -3191,7 +3227,7 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte ensurePen(); ensureState(); -#if defined (Q_WS_WIN) || defined(Q_WS_MAC) || (defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE)) +#if defined (Q_WS_WIN) || defined(Q_WS_MAC) bool drawCached = true; @@ -3224,7 +3260,12 @@ void QRasterPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte return; } -#else // Q_WS_WIN || Q_WS_MAC || Q_OS_SYMBIAN && QT_NO_FREETYPE +#elif defined (Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) // Q_WS_WIN || Q_WS_MAC + if (s->matrix.type() <= QTransform::TxTranslate) { + drawGlyphsS60(p, ti); + return; + } +#else // Q_WS_WIN || Q_WS_MAC QFontEngine *fontEngine = ti.fontEngine; @@ -3622,6 +3663,7 @@ void QRasterPaintEngine::drawEllipse(const QRectF &rect) ensurePen(); if (((qpen_style(s->lastPen) == Qt::SolidLine && s->flags.fast_pen) || (qpen_style(s->lastPen) == Qt::NoPen && !s->flags.antialiased)) + && qMax(rect.width(), rect.height()) < QT_RASTER_COORD_LIMIT #ifdef FLOATING_POINT_BUGGY_OR_NO_FPU && qMax(rect.width(), rect.height()) < 128 // integer math breakdown #endif diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index fcf92cd..1787d16 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -259,6 +259,10 @@ private: void drawCachedGlyphs(const QPointF &p, const QTextItemInt &ti); +#if defined(Q_OS_SYMBIAN) && defined(QT_NO_FREETYPE) + void drawGlyphsS60(const QPointF &p, const QTextItemInt &ti); +#endif // Q_OS_SYMBIAN && QT_NO_FREETYPE + inline void ensureBrush(const QBrush &brush) { if (!qbrush_fast_equals(state()->lastBrush, brush) || state()->fillFlags) updateBrush(brush); diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_s60.cpp index 2aa179a..e17dba1 100644 --- a/src/gui/painting/qpaintengine_s60.cpp +++ b/src/gui/painting/qpaintengine_s60.cpp @@ -1,14 +1,43 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ - #include <private/qpaintengine_s60_p.h> #include <private/qpixmap_s60_p.h> #include <private/qt_s60_p.h> diff --git a/src/gui/painting/qpaintengine_s60_p.h b/src/gui/painting/qpaintengine_s60_p.h index b38ef93..33067b5 100644 --- a/src/gui/painting/qpaintengine_s60_p.h +++ b/src/gui/painting/qpaintengine_s60_p.h @@ -1,11 +1,41 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the $MODULE$ of the Qt Toolkit. +** This file is part of the QtGui module of the Qt Toolkit. ** -** $TROLLTECH_DUAL_LICENSE$ +** $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$ ** ****************************************************************************/ diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index e5da392..60e4df6 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -416,8 +416,8 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) if (d->stroker.capStyle() == Qt::RoundCap || d->stroker.joinStyle() == Qt::RoundJoin) flags |= QVectorPath::CurvedShapeHint; - qreal txscale = 1; - if (!(pen.isCosmetic() || (qt_scaleForTransform(state()->matrix, &txscale) && txscale != 1))) { + // ### Perspective Xforms are currently not supported... + if (!pen.isCosmetic()) { // We include cosmetic pens in this case to avoid having to // change the current transform. Normal transformed, // non-cosmetic pens will be transformed as part of fill @@ -474,8 +474,6 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) flags); fill(strokePath, pen.brush()); } else { - const qreal strokeWidth = d->stroker.strokeWidth(); - d->stroker.setStrokeWidth(strokeWidth * txscale); // For cosmetic pens we need a bit of trickery... We to process xform the input points if (state()->matrix.type() >= QTransform::TxProject) { QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath()); @@ -535,7 +533,6 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) d->activeStroker->end(); } - d->stroker.setStrokeWidth(strokeWidth); QVectorPath strokePath(d->strokeHandler->pts.data(), d->strokeHandler->types.size(), d->strokeHandler->types.data(), diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index ed1b5d1..f271af9 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1895,6 +1895,8 @@ QPaintEngine *QPainter::paintEngine() const } /*! + \since 4.6 + Flushes the painting pipeline and prepares for the user issuing commands directly to the underlying graphics context. Must be followed by a call to endNativePainting(). @@ -1919,6 +1921,8 @@ void QPainter::beginNativePainting() } /*! + \since 4.6 + Restores the painter after manually issuing native painting commands. Lets the painter restore any native state that it relies on before calling any other painter commands. diff --git a/src/gui/painting/qprintengine_pdf.cpp b/src/gui/painting/qprintengine_pdf.cpp index 1471fe3..e73282f 100644 --- a/src/gui/painting/qprintengine_pdf.cpp +++ b/src/gui/painting/qprintengine_pdf.cpp @@ -935,7 +935,7 @@ void QPdfEnginePrivate::writeInfo() "/Title (%s)\n" // "/Author (%s)\n" "/Creator (%s)\n" - "/Producer (Qt " QT_VERSION_STR " (C) 1992-$THISYEAR$ Nokia Corporation and/or its subsidiary(-ies))\n", + "/Producer (Qt " QT_VERSION_STR " (C) 2009 Nokia Corporation and/or its subsidiary(-ies))\n", title.toUtf8().constData(), // author.toUtf8().constData(), creator.toUtf8().constData()); diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index e59155c..a3f94d9 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -374,6 +374,11 @@ void QWin32PrintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem convertToText = false; break; } + + if (ti.logClusters[i] != i) { + convertToText = false; + break; + } } COLORREF cf = RGB(qRed(brushColor), qGreen(brushColor), qBlue(brushColor)); diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index eb9b11b..5ff0b96 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -1275,7 +1275,7 @@ QPrinter::ColorMode QPrinter::colorMode() const buffering up the copies and in those cases the application must make an explicit call to the print code for each copy. - \sa setNumCopies() + \sa setNumCopies(), actualNumCopies() */ int QPrinter::numCopies() const @@ -1286,13 +1286,15 @@ int QPrinter::numCopies() const /*! + \since 4.6 + Returns the number of copies that will be printed. The default value is 1. This function always returns the actual value specified in the print dialog or using setNumCopies(). - \sa setNumCopies(), numCopies(); + \sa setNumCopies(), numCopies() */ int QPrinter::actualNumCopies() const { diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp index ffd6f17..5e4433c 100644 --- a/src/gui/painting/qwindowsurface_x11.cpp +++ b/src/gui/painting/qwindowsurface_x11.cpp @@ -139,7 +139,8 @@ void QX11WindowSurface::setGeometry(const QRect &rect) QWindowSurface::setGeometry(rect); const QSize size = rect.size(); - if (d_ptr->device.size() == size) + + if (d_ptr->device.size() == size || size.width() <= 0 || size.height() <= 0) return; #ifndef QT_NO_XRENDER if (d_ptr->translucentBackground) { @@ -183,10 +184,14 @@ void QX11WindowSurface::setGeometry(const QRect &rect) } } - if (gc) + if (gc) { XFreeGC(X11->display, gc); - gc = XCreateGC(X11->display, d_ptr->device.handle(), 0, 0); - XSetGraphicsExposures(X11->display, gc, False); + gc = 0; + } + if (!d_ptr->device.isNull()) { + gc = XCreateGC(X11->display, d_ptr->device.handle(), 0, 0); + XSetGraphicsExposures(X11->display, gc, False); + } } bool QX11WindowSurface::scroll(const QRegion &area, int dx, int dy) |