QUiLoader Usage.
-
I have a .ui file ... I am trying to render the same using QUiLoader... the code is as below
@
#include <QtUiTools>
#include <QtGui>#include "mainwindow.h"
UI_from_UI::UI_from_UI(QWidget *parent)
: QWidget(parent)
{
QUiLoader loader;QFile file(":/form/mainwindow.ui"); file.open(QFile::ReadOnly); QWidget *formWidget = loader.load(&file, this); file.close(); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(formWidget); setLayout(layout); setWindowTitle(tr("UI_from_UI"));
}@
the main() is
@#include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(ui_from_ui);QApplication app(argc, argv); UI_from_UI ui; ui.show(); return app.exec();
}@
But the UI that I have created is not being rendered...
Somebody Help...
Thanks..
-
Could it be a problem with the .ui format or is it the usage??... my reference is the Calculator Builder Example...
-
Its reading the file properly.., no issues with that :-o