[Interest] QOpenGLWindow inside QSplitter horizontal layout ?
Nicholas Yue
yue.nicholas at gmail.com
Fri May 21 06:02:57 CEST 2021
Hi,
I am learning about QOpenGLWindow
I saw examples which utilizes it via
QWidget::createWindowContainer()
I am wondering if there is a way to house it as a widget inside a layout ?
My current attempt is not working.
```
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow),
m_myWindow(new MyOpenGLWindow)
{
ui->setupUi(this);
connect(ui->actionQuit, &QAction::triggered, this,
&MainWindow::OnFileClose);
m_myWindow->create();
#ifdef ORIGINAL_WORKING_EXAMPLE
m_myWindow->setMainWindow(this);
QWidget *w = QWidget::createWindowContainer(m_myWindow);
takeCentralWidget();
setCentralWidget(w);
#else
m_myWindow->setMainWindow(this);
QWidget *w = QWidget::createWindowContainer(m_myWindow);
// delete ui->targetWidget;
// ui->targetWidget = QWidget::createWindowContainer(m_myWindow);
// ui->targetWidget->setMinimumSize(400,400);
w->setMinimumSize(200,200);
w->setMaximumSize(200,200);
// ui->targetWidget->createWindowContainer(m_myWindow);
// takeCentralWidget();
//setCentralWidget(ui->targetWidget);
ui->splitter->layout()->addWidget(w);
#endif
}
```
Cheers
--
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210520/0c6baa92/attachment.html>
More information about the Interest
mailing list