Skip to content

Commit 6bd16e2

Browse files
committed
sclang: devicePixelRatio primitive
1 parent 24ee2d0 commit 6bd16e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

QtCollider/widgets/BasicWidgets.h

+4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
#include "QcCanvas.h"
2626
#include "../layouts/classic_layouts.hpp"
2727
#include "image_painter.h"
28+
#include <QBackingStore>
2829

2930
class QcSimpleWidget : public QWidget
3031
{
3132
Q_OBJECT
3233
Q_PROPERTY( QColor background READ background WRITE setBackground );
34+
Q_PROPERTY( float devicePixelRatio READ devicePixelRatio );
3335

3436
public:
3537
const QColor & background() const { return _bkg; }
@@ -39,6 +41,8 @@ class QcSimpleWidget : public QWidget
3941
int tileMode, double opacity );
4042
Q_INVOKABLE
4143
void removeBackgroundImage() { _bkg_image.clear(); update(); }
44+
45+
float devicePixelRatio() const { return backingStore()->window()->devicePixelRatio(); }
4246

4347
protected:
4448
virtual void paintEvent( QPaintEvent * );

0 commit comments

Comments
 (0)