在QOpenGLWindow之上添加QWidget
Add QWidget on top of QOpenGLWindow
我想在我的QOpenGLWindow上添加QWidget。例如:
在qmainwindow.cpp:QWidget *mywidget = new QWidget(this);
mywidget->hide();
QOpenGLWindow *glwindow = new QOpenGLWindow();
QWidget *container = QWidget::createWindowContainer(glwindow, this);
// ...
ui->tabWidget->addTab(container, "Container");
// then I want mywidget to be at the top of my tabWidget and container.
mywidget->show();
但是mywidget在容器后面。
我该如何解决这个问题?
如果您不按Z顺序创建小部件,Qt就无法判断您想要的Z顺序。您需要对小部件进行raise
。无论如何,整个隐藏的繁文缛节是完全不必要的。
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 如何在C++中从两个单独的for循环中添加两个数组
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 如何仅为一个函数添加延迟
- 如何防止 c++ 在从浮点型转换为双精度型(不适用于 IO)时添加额外的小数?
- 使用std::transform将一个范围的元素添加到另一个范围中
- 如何将更多文件夹添加到c++include路径
- 如何将元素添加到数组的线程安全函数?
- QT通过C++添加映射QML项目
- 在 QOpenGLWidget 上添加一些 QWidget
- 如何将 qwidget 添加到 qlist<qwidget>
- 在运行时添加自定义Qwidget
- 如何向 QWidget 添加插槽
- 将约束添加到Qwidget的CSS文件中
- 缩放QGraphicsView而不缩放已添加到其中的QWidget
- 将设计器中创建的 QWidget 添加到 QToolbar
- 如何将菜单栏添加到 QWidget
- Qt将"action"添加到动态添加的QWidget中
- 在QOpenGLWindow之上添加QWidget
- 为什么如果 QWidget 在屏幕上不可见,我只能在运行时向 QWidget 添加元素?