diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-17 01:19:53 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-10-17 03:16:11 +0200 |
commit | 1abc4a8aaba0cb1d01492b60d655181814e67ac0 (patch) | |
tree | c6e1642de69fc4c77b1d513f0c445f7fcf13fe80 | |
parent | 1889d02d28d31ce45783c30d90479d17e7f021bb (diff) |
simplify color stuffies
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
-rw-r--r-- | qfunctionconfigurator/qfunctionconfigurator.cpp | 8 | ||||
-rw-r--r-- | qfunctionconfigurator/qfunctionconfigurator.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/qfunctionconfigurator/qfunctionconfigurator.cpp b/qfunctionconfigurator/qfunctionconfigurator.cpp index bad06f8a..a068a53c 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.cpp +++ b/qfunctionconfigurator/qfunctionconfigurator.cpp @@ -17,10 +17,9 @@ #include <QImage> #include <QPixmap> #include <QTimer> - #include <QtDebug> - -#include <math.h> +#include <cmath> +#include <QTabWidget> static const int pointSize = 5; @@ -111,9 +110,8 @@ void QFunctionConfigurator::drawBackground(const QRectF &fullRect) { int i; QRect scale; - _background = QPixmap(fullRect.width(), fullRect.height()); - QColor bgColor = palette().color(QPalette::Normal, QPalette::Background); + auto bgColor = palette().button(); QPainter painter(&_background); painter.fillRect(fullRect, bgColor); painter.setRenderHint(QPainter::Antialiasing); diff --git a/qfunctionconfigurator/qfunctionconfigurator.h b/qfunctionconfigurator/qfunctionconfigurator.h index fa72fb72..1ac919fe 100644 --- a/qfunctionconfigurator/qfunctionconfigurator.h +++ b/qfunctionconfigurator/qfunctionconfigurator.h @@ -112,7 +112,7 @@ protected slots: void mouseReleaseEvent(QMouseEvent *e); protected: - void drawBackground(const QRectF &rect); + void drawBackground(const QRectF &); void drawFunction(); void drawPoint(QPainter *painter, const QPointF &pt, QColor colBG ); void drawLine(QPainter *painter, const QPointF &start, const QPointF &end, QPen pen); |