So far I've only had my main window pop up other windows that were QDialogs and I'm not getting it to work with a QWidget. The other window I want to display was designed with the Form Editor, then wrapped in a class called ResultViewer which extends QWidget (as opposed to QDialog). What I want is to have the ResultViewer show its ui in a seperate window. Now when I try to display it the ResultViewer ui just pops up in the main window on top of the mainwindow ui.
The code I'm using to display it is this (in my mainwindow.cpp file)
ResultViewer * rv = new ResultView(this);
rv->show();
The constructor for the ResultViewer looks like this
ResultViewer::ResultViewer(QWidget * parent) :
QWidget(parent),
ui(new Ui::ResultViewer)
{
ui->setupUi(this);
}
I've looked through the QWidget documentation a bit but the only thing I can find that may be related is the QWidget::window()
function, but the explanation isn't very clear, it just gives an example of changing the title of a window.