We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 24ee2d0 commit 6bd16e2Copy full SHA for 6bd16e2
QtCollider/widgets/BasicWidgets.h
@@ -25,11 +25,13 @@
25
#include "QcCanvas.h"
26
#include "../layouts/classic_layouts.hpp"
27
#include "image_painter.h"
28
+#include <QBackingStore>
29
30
class QcSimpleWidget : public QWidget
31
{
32
Q_OBJECT
33
Q_PROPERTY( QColor background READ background WRITE setBackground );
34
+ Q_PROPERTY( float devicePixelRatio READ devicePixelRatio );
35
36
public:
37
const QColor & background() const { return _bkg; }
@@ -39,6 +41,8 @@ class QcSimpleWidget : public QWidget
39
41
int tileMode, double opacity );
40
42
Q_INVOKABLE
43
void removeBackgroundImage() { _bkg_image.clear(); update(); }
44
+
45
+ float devicePixelRatio() const { return backingStore()->window()->devicePixelRatio(); }
46
47
protected:
48
virtual void paintEvent( QPaintEvent * );
0 commit comments