qt - QMainWindow::showMaximized() Doesn't Update Size -


i'm trying create qmainwindow encapsulate qgraphicsview i'm putting in it. want start out maximized, this:

qmainwindow *mainwindow = new qmainwindow(); mainwindow->setwindowstate(qt::windowmaximized); mainwindow->show(); qdebug() << mainwindow->size(); 

which says maximized window 200x100, incorrect.

am missing sort of update function? don't why wouldn't update size. i've tried using showmaximized() same result.

edit

my end-goal use qmainwindow container qgraphicsview containing qgraphicsscene. on top of this, want have qwebview @ 50% width , 100% height, centered on everything.

so, need width , height in order coordinates , sizes correct.

well, effect of setwindowstate() not immediate, gets executed asynchronously. when window state changes, widget receives changeevent(), should reimplement or resizeevent() width() , height() after maximization takes place.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -