diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 06:20:17 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 07:49:13 +0100 |
commit | d4fbad4d2931aa45308270eb995567314390e334 (patch) | |
tree | 927ea207ec81bb959fa72e95ed5d90ea43e3d479 /pose-widget/pose-widget.cpp | |
parent | 07b45ca4578ccaed91f7f3c70e82dc7ffbdf47ab (diff) |
pose-widget: enable hidpi
Diffstat (limited to 'pose-widget/pose-widget.cpp')
-rw-r--r-- | pose-widget/pose-widget.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pose-widget/pose-widget.cpp b/pose-widget/pose-widget.cpp index 9a097340..ff65d43a 100644 --- a/pose-widget/pose-widget.cpp +++ b/pose-widget/pose-widget.cpp @@ -24,14 +24,11 @@ using namespace pose_widget_impl; -pose_transform::pose_transform(QWidget* dst) : - dst(dst), - front(QImage{":/images/side1.png"}.convertToFormat(QImage::Format_ARGB32)), - back(QImage{":/images/side6.png"}.convertToFormat(QImage::Format_ARGB32)), - image(w, h, QImage::Format_ARGB32), - image2(w, h, QImage::Format_ARGB32), - fresh(false) +pose_transform::pose_transform(QWidget* dst, double dpr) : dst(dst) { + for (QImage* img : { &image, &image2, &front, &back }) + img->setDevicePixelRatio(dpr); + image.fill(Qt::transparent); image2.fill(Qt::transparent); } @@ -79,7 +76,7 @@ end: } } -pose_widget::pose_widget(QWidget* parent) : QWidget(parent), xform(this) +pose_widget::pose_widget(QWidget* parent) : QWidget(parent), xform{this, devicePixelRatioF()} { rotate_sync(0,0,0, 0,0,0); } |