diff --git src/gui/painting/qpainter.cpp src/gui/painting/qpainter.cpp --- src/gui/painting/qpainter.cpp +++ src/gui/painting/qpainter.cpp @@ -1567,17 +1567,17 @@ bool QPainter::isActive() const \sa begin(), {QPainter#Settings}{Settings} */ void QPainter::initFrom(const QWidget *widget) { Q_ASSERT_X(widget, "QPainter::initFrom(const QWidget *widget)", "Widget cannot be 0"); Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::initFrom: Painter not active, aborted"); +// qWarning("QPainter::initFrom: Painter not active, aborted"); return; } const QPalette &pal = widget->palette(); d->state->pen = QPen(pal.brush(widget->foregroundRole()), 0); d->state->bgBrush = pal.brush(widget->backgroundRole()); d->state->deviceFont = QFont(widget->font(), const_cast (widget)); d->state->font = d->state->deviceFont; @@ -1602,17 +1602,17 @@ void QPainter::initFrom(const QWidget *widget) void QPainter::save() { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::save()\n"); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::save: Painter not active"); +// qWarning("QPainter::save: Painter not active"); return; } if (d->extended) { d->state = d->extended->createState(d->states.back()); d->extended->setState(d->state); } else { d->updateState(d->state); @@ -1635,17 +1635,17 @@ void QPainter::restore() if (qt_show_painter_debug_output) printf("QPainter::restore()\n"); #endif Q_D(QPainter); if (d->states.size()<=1) { qWarning("QPainter::restore: Unbalanced save/restore"); return; } else if (!d->engine) { - qWarning("QPainter::restore: Painter not active"); +// qWarning("QPainter::restore: Painter not active"); return; } QPainterState *tmp = d->state; d->states.pop_back(); d->state = d->states.back(); d->txinv = false; @@ -1942,17 +1942,17 @@ bool QPainter::end() { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::end()\n"); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::end: Painter not active, aborted"); +// qWarning("QPainter::end: Painter not active, aborted"); qt_cleanup_painter_state(d); return false; } if (d->refcount > 1) { d->detachPainterPrivate(this); return true; } @@ -2037,17 +2037,17 @@ QPaintEngine *QPainter::paintEngine() const \snippet doc/src/snippets/code/src_gui_painting_qpainter.cpp 21 \sa endNativePainting() */ void QPainter::beginNativePainting() { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::beginNativePainting: Painter not active"); +// qWarning("QPainter::beginNativePainting: Painter not active"); return; } if (d->extended) d->extended->beginNativePainting(); } /*! @@ -2058,17 +2058,17 @@ void QPainter::beginNativePainting() other painter commands. \sa beginNativePainting() */ void QPainter::endNativePainting() { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::beginNativePainting: Painter not active"); +// qWarning("QPainter::beginNativePainting: Painter not active"); return; } if (d->extended) d->extended->endNativePainting(); else d->engine->syncState(); } @@ -2079,17 +2079,17 @@ void QPainter::endNativePainting() \sa font(), isActive(), {QPainter#Settings}{Settings} */ QFontMetrics QPainter::fontMetrics() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::fontMetrics: Painter not active"); +// qWarning("QPainter::fontMetrics: Painter not active"); return QFontMetrics(QFont()); } return QFontMetrics(d->state->font); } /*! Returns the font info for the painter if the painter is @@ -2097,34 +2097,34 @@ QFontMetrics QPainter::fontMetrics() const \sa font(), isActive(), {QPainter#Settings}{Settings} */ QFontInfo QPainter::fontInfo() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::fontInfo: Painter not active"); +// qWarning("QPainter::fontInfo: Painter not active"); return QFontInfo(QFont()); } return QFontInfo(d->state->font); } /*! \since 4.2 Returns the opacity of the painter. The default value is 1. */ qreal QPainter::opacity() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::opacity: Painter not active"); +// qWarning("QPainter::opacity: Painter not active"); return 1.0; } return d->state->opacity; } /*! \since 4.2 @@ -2136,17 +2136,17 @@ qreal QPainter::opacity() const individually. */ void QPainter::setOpacity(qreal opacity) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setOpacity: Painter not active"); +// qWarning("QPainter::setOpacity: Painter not active"); return; } opacity = qMin(qreal(1), qMax(qreal(0), opacity)); if (opacity == d->state->opacity) return; @@ -2164,17 +2164,17 @@ void QPainter::setOpacity(qreal opacity) \sa setBrushOrigin(), {QPainter#Settings}{Settings} */ QPoint QPainter::brushOrigin() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::brushOrigin: Painter not active"); +// qWarning("QPainter::brushOrigin: Painter not active"); return QPoint(); } return QPointF(d->state->brushOrigin).toPoint(); } /*! \fn void QPainter::setBrushOrigin(const QPointF &position) @@ -2197,17 +2197,17 @@ void QPainter::setBrushOrigin(const QPointF &p) { Q_D(QPainter); #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setBrushOrigin(), (%.2f,%.2f)\n", p.x(), p.y()); #endif if (!d->engine) { - qWarning("QPainter::setBrushOrigin: Painter not active"); +// qWarning("QPainter::setBrushOrigin: Painter not active"); return; } d->state->brushOrigin = p; if (d->extended) { d->extended->brushOriginChanged(); return; @@ -2407,17 +2407,17 @@ void QPainter::setBrushOrigin(const QPointF &p) described in compositionMode(). \sa compositionMode() */ void QPainter::setCompositionMode(CompositionMode mode) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setCompositionMode: Painter not active"); +// qWarning("QPainter::setCompositionMode: Painter not active"); return; } if (d->state->composition_mode == mode) return; if (d->extended) { d->state->composition_mode = mode; d->extended->compositionModeChanged(); return; @@ -2451,50 +2451,50 @@ void QPainter::setCompositionMode(CompositionMode mode) Returns the current composition mode. \sa CompositionMode, setCompositionMode() */ QPainter::CompositionMode QPainter::compositionMode() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::compositionMode: Painter not active"); +// qWarning("QPainter::compositionMode: Painter not active"); return QPainter::CompositionMode_SourceOver; } return d->state->composition_mode; } /*! Returns the current background brush. \sa setBackground(), {QPainter#Settings}{Settings} */ const QBrush &QPainter::background() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::background: Painter not active"); +// qWarning("QPainter::background: Painter not active"); return d->fakeState()->brush; } return d->state->bgBrush; } /*! Returns true if clipping has been set; otherwise returns false. \sa setClipping(), {QPainter#Clipping}{Clipping} */ bool QPainter::hasClipping() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::hasClipping: Painter not active"); +// qWarning("QPainter::hasClipping: Painter not active"); return false; } return d->state->clipEnabled && d->state->clipOperation != Qt::NoClip; } /*! Enables clipping if \a enable is true, or disables clipping if \a @@ -2508,17 +2508,17 @@ void QPainter::setClipping(bool enable) Q_D(QPainter); #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setClipping(), enable=%s, was=%s\n", enable ? "on" : "off", hasClipping() ? "on" : "off"); #endif if (!d->engine) { - qWarning("QPainter::setClipping: Painter not active, state will be reset by begin"); +// qWarning("QPainter::setClipping: Painter not active, state will be reset by begin"); return; } if (hasClipping() == enable) return; // we can't enable clipping if we don't have a clip if (enable @@ -2547,17 +2547,17 @@ void QPainter::setClipping(bool enable) \sa setClipRegion(), clipPath(), setClipping() */ QRegion QPainter::clipRegion() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::clipRegion: Painter not active"); +// qWarning("QPainter::clipRegion: Painter not active"); return QRegion(); } QRegion region; bool lastWasNothing = true; if (!d->txinv) const_cast(this)->d_ptr->updateInvMatrix(); @@ -2678,17 +2678,17 @@ extern Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion ®ion); */ QPainterPath QPainter::clipPath() const { Q_D(const QPainter); // ### Since we do not support path intersections and path unions yet, // we just use clipRegion() here... if (!d->engine) { - qWarning("QPainter::clipPath: Painter not active"); +// qWarning("QPainter::clipPath: Painter not active"); return QPainterPath(); } // No clip, return empty if (d->state->clipInfo.size() == 0) { return QPainterPath(); } else { @@ -2727,17 +2727,17 @@ QPainterPath QPainter::clipPath() const \since 4.8 */ QRectF QPainter::clipBoundingRect() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::clipBoundingRect: Painter not active"); +// qWarning("QPainter::clipBoundingRect: Painter not active"); return QRectF(); } // Accumulate the bounding box in device space. This is not 100% // precise, but it fits within the guarantee and it is reasonably // fast. QRectF bounds; for (int i=0; istate->clipInfo.size(); ++i) { @@ -2788,17 +2788,17 @@ void QPainter::setClipRect(const QRectF &rect, Qt::ClipOperation op) { Q_D(QPainter); if (d->extended) { if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) op = Qt::ReplaceClip; if (!d->engine) { - qWarning("QPainter::setClipRect: Painter not active"); +// qWarning("QPainter::setClipRect: Painter not active"); return; } qreal right = rect.x() + rect.width(); qreal bottom = rect.y() + rect.height(); qreal pts[] = { rect.x(), rect.y(), right, rect.y(), right, bottom, rect.x(), bottom }; @@ -2838,17 +2838,17 @@ void QPainter::setClipRect(const QRectF &rect, Qt::ClipOperation op) Enables clipping, and sets the clip region to the given \a rectangle using the given clip \a operation. */ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setClipRect: Painter not active"); +// qWarning("QPainter::setClipRect: Painter not active"); return; } if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) op = Qt::ReplaceClip; if (d->extended) { d->state->clipEnabled = true; @@ -2896,17 +2896,17 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) Q_D(QPainter); #ifdef QT_DEBUG_DRAW QRect rect = r.boundingRect(); if (qt_show_painter_debug_output) printf("QPainter::setClipRegion(), size=%d, [%d,%d,%d,%d]\n", r.rects().size(), rect.x(), rect.y(), rect.width(), rect.height()); #endif if (!d->engine) { - qWarning("QPainter::setClipRegion: Painter not active"); +// qWarning("QPainter::setClipRegion: Painter not active"); return; } if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) op = Qt::ReplaceClip; if (d->extended) { d->state->clipEnabled = true; @@ -2991,17 +2991,17 @@ void QPainter::setWorldMatrix(const QMatrix &matrix, bool combine) \sa {QPainter#Coordinate Transformations}{Coordinate Transformations}, {Coordinate System} */ const QMatrix &QPainter::worldMatrix() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::worldMatrix: Painter not active"); +// qWarning("QPainter::worldMatrix: Painter not active"); return d->fakeState()->transform.toAffine(); } return d->state->worldMatrix.toAffine(); } /*! \obsolete @@ -3065,17 +3065,17 @@ QMatrix QPainter::combinedMatrix() const not. \sa worldMatrix(), QPaintEngine::hasFeature(), */ const QMatrix &QPainter::deviceMatrix() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::deviceMatrix: Painter not active"); +// qWarning("QPainter::deviceMatrix: Painter not active"); return d->fakeState()->transform.toAffine(); } return d->state->matrix.toAffine(); } /*! \obsolete @@ -3111,17 +3111,17 @@ void QPainter::setWorldMatrixEnabled(bool enable) { Q_D(QPainter); #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setMatrixEnabled(), enable=%d\n", enable); #endif if (!d->engine) { - qWarning("QPainter::setMatrixEnabled: Painter not active"); +// qWarning("QPainter::setMatrixEnabled: Painter not active"); return; } if (enable == d->state->WxF) return; d->state->WxF = enable; d->updateMatrix(); } @@ -3134,17 +3134,17 @@ void QPainter::setWorldMatrixEnabled(bool enable) \sa setWorldMatrixEnabled(), worldTransform(), {Coordinate System} */ bool QPainter::worldMatrixEnabled() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::worldMatrixEnabled: Painter not active"); +// qWarning("QPainter::worldMatrixEnabled: Painter not active"); return false; } return d->state->WxF; } /*! \obsolete @@ -3181,17 +3181,17 @@ bool QPainter::matrixEnabled() const void QPainter::scale(qreal sx, qreal sy) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::scale(), sx=%f, sy=%f\n", sx, sy); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::scale: Painter not active"); +// qWarning("QPainter::scale: Painter not active"); return; } d->state->worldMatrix.scale(sx,sy); d->state->WxF = true; d->updateMatrix(); } @@ -3205,17 +3205,17 @@ void QPainter::scale(qreal sx, qreal sy) void QPainter::shear(qreal sh, qreal sv) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::shear(), sh=%f, sv=%f\n", sh, sv); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::shear: Painter not active"); +// qWarning("QPainter::shear: Painter not active"); return; } d->state->worldMatrix.shear(sh, sv); d->state->WxF = true; d->updateMatrix(); } @@ -3231,17 +3231,17 @@ void QPainter::shear(qreal sh, qreal sv) void QPainter::rotate(qreal a) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::rotate(), angle=%f\n", a); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::rotate: Painter not active"); +// qWarning("QPainter::rotate: Painter not active"); return; } d->state->worldMatrix.rotate(a); d->state->WxF = true; d->updateMatrix(); } @@ -3257,17 +3257,17 @@ void QPainter::translate(const QPointF &offset) qreal dx = offset.x(); qreal dy = offset.y(); #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::translate(), dx=%f, dy=%f\n", dx, dy); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::translate: Painter not active"); +// qWarning("QPainter::translate: Painter not active"); return; } d->state->worldMatrix.translate(dx, dy); d->state->WxF = true; d->updateMatrix(); } @@ -3304,17 +3304,17 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) QRectF b = path.boundingRect(); printf("QPainter::setClipPath(), size=%d, op=%d, bounds=[%.2f,%.2f,%.2f,%.2f]\n", path.elementCount(), op, b.x(), b.y(), b.width(), b.height()); } #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setClipPath: Painter not active"); +// qWarning("QPainter::setClipPath: Painter not active"); return; } if ((!d->state->clipEnabled && op != Qt::NoClip) || (d->state->clipOperation == Qt::NoClip && op == Qt::UniteClip)) op = Qt::ReplaceClip; if (d->extended) { d->state->clipEnabled = true; @@ -3345,17 +3345,17 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) \sa fillPath(), {QPainter#Drawing}{Drawing} */ void QPainter::strokePath(const QPainterPath &path, const QPen &pen) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::strokePath: Painter not active"); +// qWarning("QPainter::strokePath: Painter not active"); return; } if (path.isEmpty()) return; if (d->extended) { const QGradient *g = qpen_brush(pen).gradient(); @@ -3388,17 +3388,17 @@ void QPainter::strokePath(const QPainterPath &path, const QPen &pen) \sa drawPath() */ void QPainter::fillPath(const QPainterPath &path, const QBrush &brush) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::fillPath: Painter not active"); +// qWarning("QPainter::fillPath: Painter not active"); return; } if (path.isEmpty()) return; if (d->extended) { const QGradient *g = brush.gradient(); @@ -3443,17 +3443,17 @@ void QPainter::drawPath(const QPainterPath &path) printf("QPainter::drawPath(), size=%d, [%.2f,%.2f,%.2f,%.2f]\n", path.elementCount(), pathBounds.x(), pathBounds.y(), pathBounds.width(), pathBounds.height()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::drawPath: Painter not active"); +// qWarning("QPainter::drawPath: Painter not active"); return; } if (d->extended) { d->extended->drawPath(path); return; } d->updateState(d->state); @@ -3556,17 +3556,17 @@ void QPainter::drawRects(const QRectF *rects, int rectCount) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::drawRects(), count=%d\n", rectCount); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::drawRects: Painter not active"); +// qWarning("QPainter::drawRects: Painter not active"); return; } if (rectCount <= 0) return; if (d->extended) { d->extended->drawRects(rects, rectCount); @@ -3616,17 +3616,17 @@ void QPainter::drawRects(const QRect *rects, int rectCount) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::drawRects(), count=%d\n", rectCount); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::drawRects: Painter not active"); +// qWarning("QPainter::drawRects: Painter not active"); return; } if (rectCount <= 0) return; if (d->extended) { d->extended->drawRects(rects, rectCount); @@ -3716,17 +3716,17 @@ void QPainter::drawPoints(const QPointF *points, int pointCount) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::drawPoints(), count=%d\n", pointCount); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::drawPoints: Painter not active"); +// qWarning("QPainter::drawPoints: Painter not active"); return; } if (pointCount <= 0) return; if (d->extended) { d->extended->drawPoints(points, pointCount); @@ -3778,17 +3778,17 @@ void QPainter::drawPoints(const QPoint *points, int pointCount) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::drawPoints(), count=%d\n", pointCount); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::drawPoints: Painter not active"); +// qWarning("QPainter::drawPoints: Painter not active"); return; } if (pointCount <= 0) return; if (d->extended) { d->extended->drawPoints(points, pointCount); @@ -3886,17 +3886,17 @@ void QPainter::setBackgroundMode(Qt::BGMode mode) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setBackgroundMode(), mode=%d\n", mode); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setBackgroundMode: Painter not active"); +// qWarning("QPainter::setBackgroundMode: Painter not active"); return; } if (d->state->bgMode == mode) return; d->state->bgMode = mode; if (d->extended) { d->checkEmulation(); @@ -3909,17 +3909,17 @@ void QPainter::setBackgroundMode(Qt::BGMode mode) Returns the current background mode. \sa setBackgroundMode(), {QPainter#Settings}{Settings} */ Qt::BGMode QPainter::backgroundMode() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::backgroundMode: Painter not active"); +// qWarning("QPainter::backgroundMode: Painter not active"); return Qt::TransparentMode; } return d->state->bgMode; } /*! \overload @@ -3931,17 +3931,17 @@ Qt::BGMode QPainter::backgroundMode() const void QPainter::setPen(const QColor &color) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setPen(), color=%04x\n", color.rgb()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setPen: Painter not active"); +// qWarning("QPainter::setPen: Painter not active"); return; } if (d->state->pen.style() == Qt::SolidLine && d->state->pen.widthF() == 0 && d->state->pen.isSolid() && d->state->pen.color() == color) return; @@ -3969,17 +3969,17 @@ void QPainter::setPen(const QPen &pen) #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setPen(), color=%04x, (brushStyle=%d) style=%d, cap=%d, join=%d\n", pen.color().rgb(), pen.brush().style(), pen.style(), pen.capStyle(), pen.joinStyle()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setPen: Painter not active"); +// qWarning("QPainter::setPen: Painter not active"); return; } if (d->state->pen == pen) return; d->state->pen = pen; @@ -3998,17 +3998,17 @@ void QPainter::setPen(const QPen &pen) Sets the painter's pen to have the given \a style, width 0 and black color. */ void QPainter::setPen(Qt::PenStyle style) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setPen: Painter not active"); +// qWarning("QPainter::setPen: Painter not active"); return; } if (d->state->pen.style() == style && (style == Qt::NoPen || (d->state->pen.widthF() == 0 && d->state->pen.isSolid() && d->state->pen.color() == QColor(Qt::black)))) return; @@ -4029,17 +4029,17 @@ void QPainter::setPen(Qt::PenStyle style) \sa setPen(), {QPainter#Settings}{Settings} */ const QPen &QPainter::pen() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::pen: Painter not active"); +// qWarning("QPainter::pen: Painter not active"); return d->fakeState()->pen; } return d->state->pen; } /*! Sets the painter's brush to the given \a brush. @@ -4052,17 +4052,17 @@ const QPen &QPainter::pen() const void QPainter::setBrush(const QBrush &brush) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setBrush(), color=%04x, style=%d\n", brush.color().rgb(), brush.style()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setBrush: Painter not active"); +// qWarning("QPainter::setBrush: Painter not active"); return; } if (d->state->brush.d == brush.d) return; if (d->extended) { d->state->brush = brush; @@ -4082,17 +4082,17 @@ void QPainter::setBrush(const QBrush &brush) Sets the painter's brush to black color and the specified \a style. */ void QPainter::setBrush(Qt::BrushStyle style) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setBrush: Painter not active"); +// qWarning("QPainter::setBrush: Painter not active"); return; } if (d->state->brush.style() == style && (style == Qt::NoBrush || (style == Qt::SolidPattern && d->state->brush.color() == QColor(0, 0, 0)))) return; d->state->brush = QBrush(Qt::black, style); if (d->extended) @@ -4106,17 +4106,17 @@ void QPainter::setBrush(Qt::BrushStyle style) \sa QPainter::setBrush(), {QPainter#Settings}{Settings} */ const QBrush &QPainter::brush() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::brush: Painter not active"); +// qWarning("QPainter::brush: Painter not active"); return d->fakeState()->brush; } return d->state->brush; } /*! \fn void QPainter::setBackground(const QBrush &brush) @@ -4134,17 +4134,17 @@ void QPainter::setBackground(const QBrush &bg) { #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setBackground(), color=%04x, style=%d\n", bg.color().rgb(), bg.style()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setBackground: Painter not active"); +// qWarning("QPainter::setBackground: Painter not active"); return; } d->state->bgBrush = bg; if (!d->extended) d->state->dirtyFlags |= QPaintEngine::DirtyBackground; } /*! @@ -4165,17 +4165,17 @@ void QPainter::setFont(const QFont &font) Q_D(QPainter); #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setFont(), family=%s, pointSize=%d\n", font.family().toLatin1().constData(), font.pointSize()); #endif if (!d->engine) { - qWarning("QPainter::setFont: Painter not active"); +// qWarning("QPainter::setFont: Painter not active"); return; } d->state->font = QFont(font.resolve(d->state->deviceFont), device()); if (!d->extended) d->state->dirtyFlags |= QPaintEngine::DirtyFont; } @@ -4183,17 +4183,17 @@ void QPainter::setFont(const QFont &font) Returns the currently set font used for drawing text. \sa setFont(), drawText(), {QPainter#Settings}{Settings} */ const QFont &QPainter::font() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::font: Painter not active"); +// qWarning("QPainter::font: Painter not active"); return d->fakeState()->font; } return d->state->font; } /*! \since 4.4 @@ -7338,17 +7338,17 @@ QPainter::RenderHints QPainter::renderHints() const \sa setViewTransformEnabled(), worldTransform() */ bool QPainter::viewTransformEnabled() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::viewTransformEnabled: Painter not active"); +// qWarning("QPainter::viewTransformEnabled: Painter not active"); return false; } return d->state->VxF; } /*! \fn void QPainter::setWindow(const QRect &rectangle) @@ -7379,17 +7379,17 @@ void QPainter::setWindow(const QRect &r) #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setWindow(), [%d,%d,%d,%d]\n", r.x(), r.y(), r.width(), r.height()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setWindow: Painter not active"); +// qWarning("QPainter::setWindow: Painter not active"); return; } d->state->wx = r.x(); d->state->wy = r.y(); d->state->ww = r.width(); d->state->wh = r.height(); @@ -7402,17 +7402,17 @@ void QPainter::setWindow(const QRect &r) \sa setWindow(), setViewTransformEnabled() */ QRect QPainter::window() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::window: Painter not active"); +// qWarning("QPainter::window: Painter not active"); return QRect(); } return QRect(d->state->wx, d->state->wy, d->state->ww, d->state->wh); } /*! \fn void QPainter::setViewport(const QRect &rectangle) @@ -7443,17 +7443,17 @@ void QPainter::setViewport(const QRect &r) #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setViewport(), [%d,%d,%d,%d]\n", r.x(), r.y(), r.width(), r.height()); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setViewport: Painter not active"); +// qWarning("QPainter::setViewport: Painter not active"); return; } d->state->vx = r.x(); d->state->vy = r.y(); d->state->vw = r.width(); d->state->vh = r.height(); @@ -7466,17 +7466,17 @@ void QPainter::setViewport(const QRect &r) \sa setViewport(), setViewTransformEnabled() */ QRect QPainter::viewport() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::viewport: Painter not active"); +// qWarning("QPainter::viewport: Painter not active"); return QRect(); } return QRect(d->state->vx, d->state->vy, d->state->vw, d->state->vh); } /*! \fn bool QPainter::hasViewXForm() const \compat @@ -7519,17 +7519,17 @@ void QPainter::setViewTransformEnabled(bool enable) #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::setViewTransformEnabled(), enable=%d\n", enable); #endif Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setViewTransformEnabled: Painter not active"); +// qWarning("QPainter::setViewTransformEnabled: Painter not active"); return; } if (enable == d->state->VxF) return; d->state->VxF = enable; d->updateMatrix(); @@ -7549,17 +7549,17 @@ void QPainter::setViewTransformEnabled(bool enable) QPainter painter(this); qreal x = painter.worldTransform().dx(); \endcode */ qreal QPainter::translationX() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::translationX: Painter not active"); +// qWarning("QPainter::translationX: Painter not active"); return 0.0; } return d->state->worldMatrix.dx(); } /*! \obsolete @@ -7572,17 +7572,17 @@ qreal QPainter::translationX() const QPainter painter(this); qreal y = painter.worldTransform().dy(); \endcode */ qreal QPainter::translationY() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::translationY: Painter not active"); +// qWarning("QPainter::translationY: Painter not active"); return 0.0; } return d->state->worldMatrix.dy(); } /*! \fn void QPainter::map(int x, int y, int *rx, int *ry) const @@ -7604,17 +7604,17 @@ void QPainter::map(int x, int y, int *rx, int *ry) const Use combinedTransform() instead. */ QPoint QPainter::xForm(const QPoint &p) const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::xForm: Painter not active"); +// qWarning("QPainter::xForm: Painter not active"); return QPoint(); } if (d->state->matrix.type() == QTransform::TxNone) return p; return p * combinedMatrix(); } @@ -7625,17 +7625,17 @@ QPoint QPainter::xForm(const QPoint &p) const Use combinedTransform() instead of this function and call mapRect() on the result to obtain a QRect. */ QRect QPainter::xForm(const QRect &r) const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::xForm: Painter not active"); +// qWarning("QPainter::xForm: Painter not active"); return QRect(); } if (d->state->matrix.type() == QTransform::TxNone) return r; return combinedMatrix().mapRect(r); } /*! @@ -7644,17 +7644,17 @@ QRect QPainter::xForm(const QRect &r) const Use combinedTransform() instead. */ QPolygon QPainter::xForm(const QPolygon &a) const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::xForm: Painter not active"); +// qWarning("QPainter::xForm: Painter not active"); return QPolygon(); } if (d->state->matrix.type() == QTransform::TxNone) return a; return a * combinedMatrix(); } /*! @@ -7695,17 +7695,17 @@ QPolygon QPainter::xForm(const QPolygon &av, int index, int npoints) const QPoint transformed = point * painter.combinedTransform().inverted(); \endcode */ QPoint QPainter::xFormDev(const QPoint &p) const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::xFormDev: Painter not active"); +// qWarning("QPainter::xFormDev: Painter not active"); return QPoint(); } if(d->state->matrix.type() == QTransform::TxNone) return p; return p * combinedMatrix().inverted(); } /*! @@ -7724,17 +7724,17 @@ QPoint QPainter::xFormDev(const QPoint &p) const QRect transformed = region.boundingRect(); \endcode */ QRect QPainter::xFormDev(const QRect &r) const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::xFormDev: Painter not active"); +// qWarning("QPainter::xFormDev: Painter not active"); return QRect(); } if (d->state->matrix.type() == QTransform::TxNone) return r; return combinedMatrix().inverted().mapRect(r); } /*! @@ -7753,17 +7753,17 @@ QRect QPainter::xFormDev(const QRect &r) const QPolygon transformed = polygon * painter.combinedTransform().inverted(); \endcode */ QPolygon QPainter::xFormDev(const QPolygon &a) const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::xFormDev: Painter not active"); +// qWarning("QPainter::xFormDev: Painter not active"); return QPolygon(); } if (d->state->matrix.type() == QTransform::TxNone) return a; return a * combinedMatrix().inverted(); } /*! @@ -9085,17 +9085,17 @@ const QTransform & QPainter::transform() const \sa worldTransform(), QPaintEngine::hasFeature(), */ const QTransform & QPainter::deviceTransform() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::deviceTransform: Painter not active"); +// qWarning("QPainter::deviceTransform: Painter not active"); return d->fakeState()->transform; } return d->state->matrix; } /*! Resets any transformations that were made using translate(), @@ -9108,17 +9108,17 @@ const QTransform & QPainter::deviceTransform() const void QPainter::resetTransform() { Q_D(QPainter); #ifdef QT_DEBUG_DRAW if (qt_show_painter_debug_output) printf("QPainter::resetMatrix()\n"); #endif if (!d->engine) { - qWarning("QPainter::resetMatrix: Painter not active"); +// qWarning("QPainter::resetMatrix: Painter not active"); return; } d->state->wx = d->state->wy = d->state->vx = d->state->vy = 0; // default view origins d->state->ww = d->state->vw = d->device->metric(QPaintDevice::PdmWidth); d->state->wh = d->state->vh = d->device->metric(QPaintDevice::PdmHeight); d->state->worldMatrix = QTransform(); setMatrixEnabled(false); @@ -9137,17 +9137,17 @@ void QPainter::resetTransform() \sa transform(), setTransform() */ void QPainter::setWorldTransform(const QTransform &matrix, bool combine ) { Q_D(QPainter); if (!d->engine) { - qWarning("QPainter::setWorldTransform: Painter not active"); +// qWarning("QPainter::setWorldTransform: Painter not active"); return; } if (combine) d->state->worldMatrix = matrix * d->state->worldMatrix; // combines else d->state->worldMatrix = matrix; // set new matrix @@ -9158,34 +9158,34 @@ void QPainter::setWorldTransform(const QTransform &matrix, bool combine ) /*! Returns the world transformation matrix. */ const QTransform & QPainter::worldTransform() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::worldTransform: Painter not active"); +// qWarning("QPainter::worldTransform: Painter not active"); return d->fakeState()->transform; } return d->state->worldMatrix; } /*! Returns the transformation matrix combining the current window/viewport and world transformation. \sa setWorldTransform(), setWindow(), setViewport() */ QTransform QPainter::combinedTransform() const { Q_D(const QPainter); if (!d->engine) { - qWarning("QPainter::combinedTransform: Painter not active"); +// qWarning("QPainter::combinedTransform: Painter not active"); return QTransform(); } return d->state->worldMatrix * d->viewTransform(); } /*! \since 4.7