Logo Search packages:      
Sourcecode: kanagram version File versions  Download package

void Kanagram::drawHelpText ( QPainter &  p,
const QString &  text 
) [private]

draw given text in the helper element

Parameters:
ppainter to use to draw
texttext to write to the painter

Definition at line 476 of file kanagram.cpp.

References m_cornerFontSize, m_renderer, and m_xRatio.

Referenced by paintEvent().

{
    p.translate(700.582 * m_xRatio, 424.176 * m_yRatio);
    p.scale(256.582 / kWindowWidth, 101.150 / kWindowHeight);
    m_renderer->render(&p, "card");
    p.resetMatrix();

    p.save();
    QFont font = KGlobalSettings::generalFont();
    font.setPointSize(m_cornerFontSize);
    p.setFont(font);
    // translate to the same place as the folder plus a margin
    p.translate(720.582 * m_xRatio, 480 * m_yRatio);
    p.rotate(-3.29);
    p.setPen(Qt::black);

    // draw the first word
    p.drawText(0, 0, text.section(' ', 0, 0));
    // draw the second word under the first
    p.drawText(0, int(30 * m_yRatio), text.section(' ', 1));
    p.restore();
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index