Description
To my surprise, the following program draws a line which starts from top left hand corner of screen but never fully reaches the bottom right hand corner. i am trying this on an Android tablet.
The reason is that the screen height is not correctly returned from the call "app.primaryScreen()->size();". See code below. This looks like a bug in Qt.
#include <QApplication> #include <QGraphicsScene> #include <QGraphicsView> #include <QScreen> #include <QDesktopWidget> int main(int argc, char *argv[]) { QApplication app(argc, argv); QSize rec = app.primaryScreen()->size(); int height = rec.height(); int width = rec.width(); QGraphicsScene scene; QGraphicsView view(&scene); view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setAlignment(Qt::AlignLeft | Qt::AlignTop); view.showFullScreen(); scene.addLine(0, 0, width, height); return(app.exec()); }