const int y;
const char *text;
const int flags;
- DrawTextEvent(int x_, int y_, const char* text_, int flags_)
+ DrawTextEvent(int x_, int y_, const char *text_, int flags_)
: QEvent(static_cast<QEvent::Type>(DrawTextRequest))
, x(x_), y(y_), text(text_), flags(flags_)
{ }
setBgColor(QColor::fromRgbF(red, green, blue));
}
+//! Retourne la fonte courante utilisée pour dessiner du texte.
+/*!
+ * \see QFont, setFont
+ */
+const QFont &DrawingWindow::getFont() const
+{
+ return painter->font();
+}
+
+//! Applique une nouvelle font pour dessiner du texte.
+/*!
+ * \see QFont, getFont
+ */
+void DrawingWindow::setFont(const QFont &font)
+{
+ painter->setFont(font);
+}
+
//! Efface la fenêtre.
/*!
* La fenêtre est effacée avec la couleur de fond courante.
safeUnlock(imageMutex);
}
-//! Dessine un trianle plein.
+//! Dessine un triangle plein.
/*!
* Dessine un triangle plein défini par les coordonnées de ses
* sommets: (x1, y1), (x2, y2) et (x3, y3). Utilise la couleur de
painter->setBackgroundMode(Qt::TransparentMode);
}
-
//! Retourne la couleur d'un pixel.
/*!
* Retourne la couleur du pixel de coordonnées (x, y). La valeur
close();
break;
case DrawTextRequest:
- DrawTextEvent* tev = dynamic_cast<DrawTextEvent *>(ev);
+ DrawTextEvent *tev = dynamic_cast<DrawTextEvent *>(ev);
realDrawText(tev->x, tev->y, tev->text, tev->flags);
break;
}
* \param color couleur
*/
inline
-void DrawingWindow::setColor(const QColor& color)
+void DrawingWindow::setColor(const QColor &color)
{
QPen pen(painter->pen());
pen.setColor(color);
* \param color couleur
*/
inline
-void DrawingWindow::setBgColor(const QColor& color)
+void DrawingWindow::setBgColor(const QColor &color)
{
painter->setBackground(color);
}
r.setTop(y);
}
syncMutex.lock();
- painter->drawText(r, flags, text, &r);
+ painter->drawText(r, flags, QString::fromUtf8(text), &r);
dirty(r);
syncCondition.wakeAll();
syncMutex.unlock();