Why is width important in tickers (solve)
-
code is in this link http://www.qtforum.org/article/26964/how-to-comprehend-this-example.html
i don't understand why width is tested here, why not use a timer?@
void Ticker::paintEvent(QPaintEvent * /* event */)
{
QPainter painter(this);int textWidth = fontMetrics().width(text()); if (textWidth < 1) return; int x = -offset; while (x < width()) { painter.drawText(x, 0, textWidth, height(), Qt::AlignLeft | Qt::AlignVCenter, text()); x += textWidth; }
@
[edit: added missing coding tags @ SGaist]