How to build widgets from any .ui files created by QtDesigner
I would like to make something like GUI creator which takes an ui file and creates widgets in it, and show in a window. So I have created a button on click I use QFileDialog to get a file. And then I would like to use the ui file from QFileDialog to create that gui/widgets and show in a window.
I have tried QFormbuilder, but it always gives me compile error “undefined reference to `QFormBuilder::QFormBuilder()’”
Is there a way to do it in qt5?
Any help appreciated
From documentation of QUiLoader:
QUiLoader loader; QFile file(":/forms/myform.ui"); file.open(QFile::ReadOnly); QWidget *myWidget = loader.load(&file, this); file.close();
I have solved the problem. Actually I was missing QFormbuilder module in my .pro file. So I have just added them, and it is working fine.