Hi, I tried to use the qWarning() function but just had:
printed each time on the console.
Could my problem be caused because I am trying to call the UI from a button click within an existing QWindow. I have got the code to load the form in the end by changing the following:
file.
open(QFile::ReadOnly);
QWidget *myWidget
= builder.
load(&file,
this);
layout->addWidget(myWidget);
setLayout(layout);
QUiLoader builder;
QFile file("form.ui");
file.open(QFile::ReadOnly);
QWidget *myWidget = builder.load(&file, this);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(myWidget);
setLayout(layout);
To copy to clipboard, switch view to plain text mode
to
QFile file("../form.ui");
file.
open(QFile::ReadOnly);
QWidget *myWidget
= builder.
load(&file
);
myWidget->show();
file.close();
QUiLoader builder;
QFile file("../form.ui");
file.open(QFile::ReadOnly);
QWidget *myWidget = builder.load(&file);
myWidget->show();
file.close();
To copy to clipboard, switch view to plain text mode
Is there anything wrong with the new code or can I settle on it?
Bookmarks