How to create a custom container (like QMainWindow) designable in Designer?
-
I want to create a custom widget with some predefined children, and a
centralWidget
for derived classes to put other widgets in.
I tried, but you can drag and drop child widget everywhere in the designer! How to make children dragable only in thecentralWidget
's aera? What's more, how if I want a moredockWidget
area?So, what's the solution? Help!
-
centralWidget
is only the pre-defined objectname for the default content (widget) of aQMainWindow
, which is aQWidget
itself.
What's wrong with using the basicQMainWindow
?!
Especially using QtDesigner only, it will be hard to implement your idea.I tried, but you can drag and drop child widget everywhere in the designer! How to make children dragable only in the centralWidget's aera?
That sounds like QtDesigner specific design-mode behavior and not how the widget behaves at runtime.
I'm thinking of a modified QtDesigner with a designer plugin for your widget... but why?!