From 1abc4a8aaba0cb1d01492b60d655181814e67ac0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 17 Oct 2013 01:19:53 +0200 Subject: simplify color stuffies Signed-off-by: Stanislaw Halik --- qfunctionconfigurator/qfunctionconfigurator.cpp | 8 +++----- qfunctionconfigurator/qfunctionconfigurator.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'qfunctionconfigurator') 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 #include #include - #include - -#include +#include +#include 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); -- cgit v1.2.3