Neculoiu Vlad
Neculoiu Vlad

Reputation: 35

Is it possible to include multiple .ui files in one main.ui file?

I have a Qt app with multiple QWidgets. I would like to create for each QWidget an .ui file to be able to reuse the same .ui file in different places and to have a simple structure for main.ui. Because now I have a big .cpp file with all slots and signals for all QWidgets and it is not so easy to work. I have not found a solution yet and I would like to know if it's possible. Thank you!

enter image description here

Upvotes: 1

Views: 1402

Answers (1)

rbaleksandar
rbaleksandar

Reputation: 9701

As far as I know including one such file into another is not supported but I might be mistaken.

If you want to use multiple .ui files the general practice is to use QUILoader, which allows loading different such files at runtime.

Frankly I would just go for implementing all this by hand. You can then separate/group the different widgets in whichever way you want.

Upvotes: 1

Related Questions