How to import ui file containing frame to mainwindow?
-
wrote on 9 Nov 2016, 20:43 last edited by
Hi,
Id like to reduce lines of code in mainwindow by seperating it to frames via seperate ui files.
Is it correct way and is it possible to import those frames visibly to mainwindow ui file for positioning? -
Hi,
What exactly would you like to factor out of your main window ?
-
wrote on 10 Nov 2016, 07:10 last edited by
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.
-
wrote on 10 Nov 2016, 12:43 last edited by Q139 11 Oct 2016, 12:44
Easyest would be if other ui files coud be visually displayed and moved in mainwindow ui file while editing, but not sure if thats possible.
-
Lifetime Qt Championwrote on 10 Nov 2016, 21:12 last edited by SGaist 11 Oct 2016, 21:13
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.
wrote on 11 Nov 2016, 18:14 last edited by Q139 11 Nov 2016, 18:17@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.
1/8