Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Form compiler adds unneeded layout
I have a custom widget with a form attached to it. The form has a layout and is set up properly. I have set the aforementioned widget to be a central widget for a QMainWindow. The problem is that (I suppose) because QMainWindow has a form itself, the resource compiler generates a layout which it tries to attach to my central widget. Now my central widget already has a layout, so Qt is complaining: "QLayout: Attempting to add QLayout "" to ... "centralWidget", which already has a layout".
What is the proper way to resolve this? I could of course use a generic widget to be a container for my custom one, but I see no good reason to breed widgets unnecessarily ...
hi and welcome
well normally adding a placeholder widget is the way to to do it.
QMainWindow is a bit special with docking etc.
Thanks for taking the time to welcome me into the forums and write about my question. I will then make a placeholder widget, as you suggested, and take it from there.