Search code examples
c++qtuser-interfaceqt5qt-designer

QT resizing layout with QT Designer?


I'm quite new to QT and i want a layout to be resized as the window is resized, resizing it's parents elements.

Can I do it only using QT Designer? If not, how can I do it?

I currently have a WebView inside of a GridLayout inside of a Widget.

I already tried to mess with elements properties, but can't find a reference on it.

EDIT: The Grid Layout object isn't shown on the UI object, but everything else does, it also has a red background on QT Design, while everything else is green.

EDIT²: I've reseted the ui file, and added some more elements, the elements aren't being show on the app after being compiled, but they appear at ui preview, and resizing works there.

.ui file source code: http://pastebin.com/r3KYvvwj

OBS: the UI file generation seems messy, some elements aren't shown at QT Design(gridLayout_2).

Thanks in advance.


Solution

  • You need to specify a layout to the window. You can specify a suitable layout to the window by relevant toolbar icons in the Qt Creator. First select the window and then click on a suitable layout toolbar button to specify a layout to the window.

    enter image description here