How to import ui file containing frame to mainwindow?
-
Hi,
What exactly would you like to factor out of your main window ?
-
To seperate lines of code that are created via ui designer to multiple files for improving readability.
So far i already have very long speghtti code mainwindow , but i am planning to add even more code.
Most is created by by clicking "go to slot..." button in ui designer. -
Depending on what your are putting in your main window, you should design custom widgets properly. Just loading ui files is possible but it's likely not what you want to do.
-
If you want that, two possibilities:
- Designer plugin
- Widget promotion
Easiest is the second option but you won't have the exact visual of your widget on screen.
-
If you want that, two possibilities:
- Designer plugin
- Widget promotion
Easiest is the second option but you won't have the exact visual of your widget on screen.
@SGaist Yes promotion work flawlessly but is it possible to also visualize while editing ui or il have to use my wetware to visuzlize it?
Is it also possible to direct the auto generated code of "go to slot..." to cpp file other than mainwindow in order to reduce lines of code in single file? -
If you want all the visual support then write a plugin for designer.
If your slot only makes sense in your custom widgets then implement the slots in them.