62 const double r = qEnvironmentVariable(
"QT_SCALE_FACTOR").toDouble();
63 return r > 0.1 ? 1. / r : 1.;
69 const double dpr = w.devicePixelRatioF();
70 return dpr > 0.1 ? 1. / dpr : 1.;
75 Steinberg::IPlugView& view,
const Steinberg::ViewRect& r,
76 QDialog& parentWindow)
const
80 int h = r.getHeight();
81 int qw = r.getWidth() * scale;
82 int qh = r.getHeight() * scale;
86 return std::make_pair(w, h);
89 if(view.canResize() == Steinberg::kResultTrue)
91 parentWindow.resize(QSize{qw, qh});
95 parentWindow.setFixedSize(QSize{qw, qh});
99 qwindow->resize(qw, qh);
103 container->move(0, 0);
104 container->setFixedSize(qw, qh);
107 return std::make_pair(w, h);
111 setSizeFromUser(Steinberg::IPlugView& view,
const QSize& sz, QDialog& parentWindow)
113 if(view.canResize() != Steinberg::kResultTrue)
119 int qh = sz.height();
120 Steinberg::ViewRect r;
123 r.right = sz.width() / scale;
124 r.bottom = sz.height() / scale;
125 view.checkSizeConstraint(&r);
127 parentWindow.resize(QSize(qw, qh));
131 qwindow->resize(qw, qh);
136 container->move(0, 0);
137 container->setFixedSize(qw, qh);
144 Steinberg::IPlugView& view, Steinberg::ViewRect& r, QDialog& parentWindow)
147 int w = r.getWidth();
148 int h = r.getHeight();
149 int qw = r.getWidth() * scale;
150 int qh = r.getHeight() * scale;
155 return std::make_pair(qw, qh);
158 if(view.canResize() == Steinberg::kResultTrue)
160 parentWindow.resize(QSize{qw, qh});
164 parentWindow.setFixedSize(QSize{qw, qh});
169 qwindow->resize(qw, qh);
173 container->move(0, 0);
174 container->setFixedSize(qw, qh);
179 return std::make_pair(qw, qh);