diff options
Diffstat (limited to 'pose-widget/pose-widget.cpp')
-rw-r--r-- | pose-widget/pose-widget.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp index 7c1f19c0..51d86609 100644 --- a/pose-widget/pose-widget.cpp +++ b/pose-widget/pose-widget.cpp @@ -22,6 +22,7 @@ namespace pose_widget_impl { pose_widget::pose_widget(QWidget* parent) : QWidget(parent) { QPainter p; + p.setRenderHint(QPainter::SmoothPixmapTransform); #ifdef TEST //draw rectangle frame around of Octopus, only if TEST defined p.begin(&front); @@ -56,6 +57,14 @@ pose_widget::pose_widget(QWidget* parent) : QWidget(parent) #endif } +void pose_widget::set_grid_background(bool dark_theme) +{ + if (dark_theme) + background = QImage(":/images/grid-dark.png"); + else + background = QImage(":/images/grid-light.png"); +} + void pose_widget::present(double yaw, double pitch, double roll, double x, double y, double z) { T = { x, y, z }; @@ -94,6 +103,8 @@ void pose_widget::paintEvent(QPaintEvent*) { p.fillRect(rect(), palette().brush(backgroundRole())); + if (!background.isNull()) + p.drawImage(rect(), background); // draw axes p.save(); p.setPen(QPen(Qt::gray, 1, Qt::SolidLine)); |