#include #include #include #include #include int main(int argc, char *argv[]) { // non-integer device-pixel ratio causes problems QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); // application QApplication app(argc,argv); // tested on 4K screen under Windows 10 with a device pixel ratio 1.5 QFrame *frame = new QFrame(); frame->setLineWidth(1); frame->setFrameShape(QFrame::Box); QGridLayout *layout = new QGridLayout(); layout->addWidget(frame,0,0); // resize this widget to see the inconsistent line widths of the frame when // shown on screen with non-integer device pixel ratio QWidget widget; widget.setLayout(layout); widget.setMinimumSize(200,201); widget.show(); return QApplication::exec(); }