5 ms·
I prefer writing UI by hand, rather than using Qt Designer. In C++, I figured out a few simple macros to automatically redefine `auto w` and `auto l` to refer t
by jimbo1qaz 7y ago
I prefer writing UI by hand, rather than using Qt Designer. In C++, I figured out a few simple macros to automatically redefine `auto w` and `auto l` to refer to the parent widget and layout.
Is there a reason Qt Designer generates .cpp files which append a child to the parent after the child is fully fleshed out, rather than when the child is first constructed? Does the latter approach create too many relayouts, or did it do that in the past? I tried to replicate that design quirk in my code, and had to use RAII to "add child to parent at end of scope", even though I don't want the destructors to run if an exception occurs during UI layout.
- slavik81 7y agoI doubt order matters much. Typically you call setupUI() and then show(), so the widget is hidden during initialization. I don't think any layout work actually occurs until the widget becomes visible.