How to use widgets designed in UI designer?
-
wrote on 11 Jan 2019, 11:46 last edited by
Hi everyone,
I am new to QT and i cannot find an answer to my question.
I designed a custom dialog using "Add New">"Qt">"Qt Designer Form Class">"Dialog without Buttons".
This custom dialog should have interchangable sections which I designed as well using "Add New">"Qt">"Qt Designer Form">"Widget".Now I would like to place the widgets into the Dialog. How can I do that?
Thank you in advance,
Raoul -
Lifetime Qt Championwrote on 11 Jan 2019, 11:50 last edited by mrjj 1 Nov 2019, 11:51
Hi and welcome to the forums.
You can use the promotion feature.
http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgetsso in the Dialog, you place a plain widget and then right click and promote it.
when you then run the app, it will be your widget.promotion is basically just Replace function where you tell it the real class name and what .h file to use.
-
Hi and welcome to the forums.
You can use the promotion feature.
http://doc.qt.io/qt-5/designer-using-custom-widgets.html#promoting-widgetsso in the Dialog, you place a plain widget and then right click and promote it.
when you then run the app, it will be your widget.promotion is basically just Replace function where you tell it the real class name and what .h file to use.
-
@mrjj
Thank you for your quick anser.
So that means I should have used "Add New">"Qt">"Qt Designer Form Class">"Widget" instead of "Qt Designer Form"?Lifetime Qt Championwrote on 11 Jan 2019, 12:04 last edited by mrjj 1 Nov 2019, 12:31@incam
Yes if you want to use promotion, then you need the .h file.
(from Qt Designer Form Class)The stand alone UI file can be used with
http://doc.qt.io/qt-5/quiloader.htmlbut you can not visually add it in another form as promotion does.
1/4