X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/graphlib.git/blobdiff_plain/fa4e18f5aa1e0f787885f5860a5f36af2db4cd39..49b1adec952c57fc84dceea41933b7a3cad97ec3:/DrawingWindow.cpp diff --git a/DrawingWindow.cpp b/DrawingWindow.cpp index dac4246..ad74339 100644 --- a/DrawingWindow.cpp +++ b/DrawingWindow.cpp @@ -142,7 +142,7 @@ public: { } }; -//! Demande de tracé de texte. +//! Demande de tracé de texte. class DrawTextEvent: public QEvent { public: const int x; @@ -345,6 +345,19 @@ void DrawingWindow::setBgColor(float red, float green, float blue) setBgColor(QColor::fromRgbF(red, green, blue)); } +//! Change l'épaisseur du pinceau +/*! + * Le pinceau à une épaisseur de 1 par défaut. + * + * \param width épaisseur du pinceau + */ +void DrawingWindow::setPenWidth(int width) +{ + QPen pen(painter->pen()); + pen.setWidth(width); + painter->setPen(pen); +} + //! Retourne la fonte courante utilisée pour dessiner du texte. /*! * \see QFont, setFont @@ -363,6 +376,20 @@ void DrawingWindow::setFont(const QFont &font) painter->setFont(font); } +//! Active ou non l'antialiasing. +/*! + * Permet de lisser le dessin. + * Fonctionnalité désactivée par défaut. + * + * \param state état de l'antialiasing + * + * \bug expérimental + */ +void DrawingWindow::setAntialiasing(bool state) +{ + painter->setRenderHint(QPainter::Antialiasing, state); +} + //! Efface la fenêtre. /*! * La fenêtre est effacée avec la couleur de fond courante.