Reputation:
I have a OpenGLWindow class that inherits QWindow and QOpenGLFunctions_3_3_Core, it's opening collada dae files (works fine in simple project).
Also i have a pdfViewer class that inherits from QWidgets.
I want to display this windows in MdiArea class:
void MainViewer::CreateSubWindow(QString &pathToFile)
{
if (pathToFile.endsWith(".pdf"))
{
PdfViewer *newViewer=new PdfViewer(&pathToFile);
m_LoadedFiles->insert(pathToFile,newViewer);//this qhash save inform of current opened docs, i need it
m_MainMdiArea->addSubWindow(static_cast<PdfViewer*>(m_LoadedFiles->value(pathToFile)))->show();
}
if (pathToFile.endsWith(".dae"))
{
DaeViewer *newViewer=new DaeViewer(pathToFile);
m_LoadedFiles->insert(pathToFile, newViewer);
m_MainMdiArea->addSubWindow(m_LoadedFiles->value(pathToFile))->show();
static_cast<DaeViewer*>(m_LoadedFiles->value(pathToFile))->OpenGLWindow::show();
newViewer->setAnimating(true);
}
mdiSubWindowsCount++;
}
Getting the same result:
I understood that show method of QWidget and QWindow is different.
I want to see my openGlWindow in myMdiArea but don't know how to call show method
Upvotes: 0
Views: 105
Reputation:
Solution:
DaeViewer *newViewer=new DaeViewer(pathToFile);
m_MainMdiArea->addSubWindow(QWidget::createWindowContainer(newViewer))->show();
Upvotes: 0