Ejemplo n.º 1
0
void MiniStatusWindow::draw(gcn::Graphics *graphics)
{
    Graphics *g = static_cast<Graphics*>(graphics);

    drawChildren(graphics);
    drawIcons(g);
}
Ejemplo n.º 2
0
void KisNodeDelegate::paint(QPainter *p, const QStyleOptionViewItem &o, const QModelIndex &index) const
{
    p->save();

    {
	QStyleOptionViewItemV4 option = getOptions(o, index);
        QStyle *style = option.widget ? option.widget->style() : QApplication::style();
        style->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, p, option.widget);

        bool shouldGrayOut = index.data(KisNodeModel::ShouldGrayOutRole).toBool();
        if (shouldGrayOut) {
            option.state &= ~QStyle::State_Enabled;
        }

        p->setFont(option.font);

        drawColorLabel(p, option, index);
        drawFrame(p, option, index);
        drawThumbnail(p, option, index);
        drawText(p, option, index);
        drawIcons(p, option, index);
        drawVisibilityIconHijack(p, option, index);
        drawDecoration(p, option, index);
        drawExpandButton(p, option, index);

        drawProgressBar(p, option, index);
    }
    p->restore();
}
void KoDocumentSectionDelegate::paint(QPainter *p, const QStyleOptionViewItem &o, const QModelIndex &index) const
{
    p->save();
    {
        QStyleOptionViewItemV4 option = getOptions(o, index);
        QStyle *style = option.widget ? option.widget->style() : QApplication::style();
        style->drawPrimitive(QStyle::PE_PanelItemViewItem, &option, p, option.widget);

        p->setFont(option.font);

        drawText(p, option, index);
        drawIcons(p, option, index);
        drawThumbnail(p, option, index);
        drawDecoration(p, option, index);
        drawProgressBar(p, option, index);
    }
    p->restore();
}
Ejemplo n.º 4
0
void DemoQPItem::paint(QPainter *painter)
{
    m_painter = painter;

    qreal w = boundingRect().width();
    qreal h = boundingRect().height();
    qreal t = m_animationTime;

    // These painting commands are identical with both renderers
    for (int i=0 ; i < m_testCount ; i++) {
        // Paint ruler
        if (m_enabledTests & 1) {
            drawRuler(0, h*0.02, w, h*0.05, t);
        }
        // Paint circles
        if (m_enabledTests & 2) {
            drawGraphCircles(w*0.15, h*0.1, w*0.7, w*0.7, 10, t*2);
            drawGraphCircles(w*0.05, h*0.55, w*0.25, w*0.25, 8, t*3);
            drawGraphCircles(w*0.70, h*0.55, w*0.25, w*0.25, 3, t);
        }
        // Paint lines
        if (m_enabledTests & 4) {
            drawGraphLine(0, h, w, -h, 4, t);
            drawGraphLine(0, h, w, -h*0.8, 6,  t+10);
            drawGraphLine(0, h, w, -h*0.6, 12, t/2);
        }
        // Paint bars
        if (m_enabledTests & 8) {
            drawGraphBars(0, h, w, -h*0.8, 6, t*3);
            drawGraphBars(0, h, w, -h*0.4, 10, t+2);
            drawGraphBars(0, h, w, -h*0.3, 20, t*2+2);
            drawGraphBars(0, h, w, -h*0.2, 40, t*3+2);
        }
        // Paint icons
        int icons = 50;
        if (m_enabledTests & 16) {
            drawIcons(0, h*0.2, w, h*0.2, icons, t);
        }

        // Increase animation time when m_testCount > 1
        t += 0.3;
    }
}