Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Using Absolute Positioning of a QWidget inside a QMainWindow

$
0
0
Very new to QT and ask to be pointed in the right direction. Thanks! I have a QMainWindow that is roughly 1280×1024. QScreen *screen = qApp->screens().at(0); QMainWindow* display = new QMainWindow(); display->setGeometry(screen->geometry()); display->setWindowTitle(screen->name()); display->show(); This works as intended, I get a nice window that is the appropriate size. Life is Good. After this, I try to add a QWidget to the QMainWindow. QWidget *c = new QWidget(display); I then try to set the Geometry(top left coordinate, height, width) of the QWidget. c->setGeometry(100, 100, 200, 200); This did not work as intended. It set the size to 200×200, which is great. However, it put it in the top left corner of the window. So, I tried this, with the same result. c->resize(200,200); c->move(100,100); I added combinations of the following to no avail. display->repaint(); //and c->repaint(); I would appreciate any help. Thanks!

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images