Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

bool QPainter::end (  ) [inherited]

Ends painting. Any resources used while painting are released. You don't normally need to call this since it is called by the destructor.

Returns true if the painter is no longer active; otherwise returns false.

See also:
begin(), isActive()

Definition at line 1834 of file qpainter.cpp.

Referenced by Window::addBlock(), QFontEngine::alphaMapForGlyph(), QPainter::begin(), QGraphicsItem::boundingRegion(), QPixmapColorizeFilter::draw(), QPixmapDropShadowFilter::draw(), QWindowsStyle::drawComplexControl(), QCleanlooksStyle::drawComplexControl(), QWindowsVistaStyle::drawControl(), QPlastiqueStyle::drawControl(), QGtkStyle::drawControl(), QMotifStyle::drawControl(), QWindowsStyle::drawControl(), QCommonStyle::drawControl(), QGraphicsScenePrivate::drawItemHelper(), QOpenGLPaintEngine::drawPixmap(), QPlastiqueStyle::drawPrimitive(), QWindowsStyle::drawPrimitive(), QPainter::drawTextItem(), Q3IconView::eventFilter(), QCommonStyle::generatedIconPixmap(), ImageComposer::loadImage(), ColorItem::mouseMoveEvent(), QColorShowLabel::mouseMoveEvent(), QColorWell::mouseMoveEvent(), Q3TableHeader::paintEvent(), PaintWidget::paintEvent(), SvgView::paintEvent(), ArthurFrame::paintEvent(), EmbedWidget::paintEvent(), Window::paintEvent(), PuzzleWidget::paintEvent(), Widget::paintEvent(), SearchButton::paintEvent(), QPixelTool::paintEvent(), QtGradientStopsWidget::paintEvent(), DisplayWidget::paintEvent(), QTipLabel::paintEvent(), GLWidget::paintEvent(), QGraphicsView::paintEvent(), Q3IconViewItem::paintItem(), QSvgIconEngine::pixmap(), NorwegianWoodStyle::polish(), Object::print(), QSvgIOHandler::read(), ImageComposer::recalculateResult(), QGLWidget::renderText(), Window::saveSvg(), QItemDelegate::selected(), QCleanlooksStyle::standardIconImplementation(), and QPainter::~QPainter().

{
#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");
        d->states.clear();
        delete d->state;
        d->state = 0;
        d->device = 0;
        return false;
    }

    if (d->refcount > 1) {
        d->detachPainterPrivate(this);
        return true;
    }

    if (d->states.size() > 1) {
        qWarning("QPainter::end: Painter ended with %d saved states",
                 d->states.size());
    }

    bool ended = true;

    if (d->engine->isActive()) {
        ended = d->engine->end();
        d->updateState(0);

        --d->device->painters;
        if (d->device->painters == 0) {
            d->engine->setPaintDevice(0);
            d->engine->setActive(false);
        }
    }

    if (d->engine->autoDestruct()) {
        delete d->engine;
    }

    d->engine = 0;

    if (d->emulationEngine) {
        delete d->emulationEngine;
        d->emulationEngine = 0;
    }

    if (d->extended) {
        d->extended = 0;
    }

    d->states.clear();
    delete d->state;
    d->state = 0;

    d->device = 0;
    return ended;
}

Generated by  Doxygen 1.6.0   Back to index