I do I get QDialog geometry to expand in fullscreen?
I'm trying to get a fullscreen dialog to launch after clicking a button in my MainWindow using QT on Mac. I use showFullScreen() to display the dialog, and the whole screen does get taken up. The problem is that the widgets within the dialog are still constrained to the 1024px geometry set for the dialog in the designer, and positioned in the upper left corner of the screen. I can manually change the geometry in the ui file to match my desktop, but I can't get it to work programmatically. I have tried setting the geometry of the dialog to desktop()->geometry() and the running updateGeometry() and that did not work. I tried it both before and after running the showFullScreen() function.
I've tried setting the sizePolicy of the dialog to Expandable, Maximum, Preferred, and just about every oth开发者_Python百科er setting, and still no go. Right now it is an absolute bare bones project, show the only code to show would be the sessionscreen.showFullScreen() function in the button_clicked() slot.
I'm sure there is something I'm missing, but I have been at it for hours, scouring Google and Qt help forums and coming up empty. Hopefully someone can point out something very simple that I am missing.
Nevermind, I am indeed using layouts wrong, because the widgets don't move if i resize the layout in designer either. I thought I followed the tutorial videos exactly. This is why I prefer text based tutorials. Oh well, back to Youtube I go.
精彩评论