diff --git a/components/slider.cpp b/components/slider.cpp index 97c4c0c..34447f5 100644 --- a/components/slider.cpp +++ b/components/slider.cpp @@ -1,4 +1,6 @@ #include "slider.h" +#include + #include "slider_p.h" Slider::Slider(QWidget *parent) @@ -10,3 +12,20 @@ Slider::Slider(QWidget *parent) Slider::~Slider() { } + +void Slider::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event) + + QPainter painter(this); + +#ifdef DEBUG_LAYOUT + QPen pen; + pen.setColor(Qt::red); + pen.setWidth(1); + painter.setOpacity(1); + painter.setPen(pen); + painter.setBrush(Qt::NoBrush); + painter.drawRect(rect().adjusted(0, 0, -1, -1)); +#endif +} diff --git a/components/slider.h b/components/slider.h index 4b03cb2..07ad1b7 100644 --- a/components/slider.h +++ b/components/slider.h @@ -15,6 +15,8 @@ public: ~Slider(); protected: + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + const QScopedPointer d_ptr; private: diff --git a/qt-material-widgets.pro b/qt-material-widgets.pro index b8e3d18..16b5899 100644 --- a/qt-material-widgets.pro +++ b/qt-material-widgets.pro @@ -5,7 +5,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qt-material-widgets TEMPLATE = app -#DEFINES += DEBUG_LAYOUT=1 +DEFINES += DEBUG_LAYOUT=1 SOURCES += main.cpp\ mainwindow.cpp \