The code to construct the UI has to exist somewhere. If you use Designer it exists in the generate ui_*.h file, in your case it exists in your class.
There is no perfect answer as to how you arrange it. You might like to improve maintainability by splitting the UI construction code into several private member functions you call from the constructor:
void createActions() {...}
void createMenus() {...}
void createToolBars() {...}
void createStatusBar() {...}
void createLayouts() {...}
// ... you get the picture. The break down should suit your UI.
void createActions() {...}
void createMenus() {...}
void createToolBars() {...}
void createStatusBar() {...}
void createLayouts() {...}
// ... you get the picture. The break down should suit your UI.
To copy to clipboard, switch view to plain text mode
If you are going to create the same widget several times (esp. from other classes) then you could create a dedicated sub class or just a private factory function.
Bookmarks