QVTKOpenGLStereoWidget question

Hi. I have a QFrame and an OpenGLWidget which has promoted to QVTKOpenGLStereoWidget.well i can bring my QFrame in front of my QVTKOpenGLStereoWidget in Qt Creator software but when I run my code in Visual Studio, the frame goes under the QVTKOpenGLStereoWidget. I searched a lot to solve my problem but I couldn’t bring my frame to front(I tried using “lower” and “raise” methods but they weren’t useful). Could you please help me?
@mwestphal

This a Qt question, not a VTK question.

i asked it here because when i have an openGLWidget it’s ok but when it turns to QVTKOpenGLStereoWidget, the problem occurs
anyway, thanks for your response

Maybe there is an issue then. Please provide code to reproduce.

this code works true when i make a new openGLWidget.

#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QOpenGLWidget* pOpenGL = new QOpenGLWidget(this);
    QFrame* pFrame = new QFrame(pOpenGL);
    pFrame->setStyleSheet("background-color: Red;");
    pOpenGL->setGeometry(400, 400, 400, 400);
    pFrame->raise();
    pFrame->setGeometry(10, 10, 200, 200);
    pFrame->setVisible(1);

}

MainWindow::~MainWindow()
{
    delete ui;
}

but when I promote it to QVTKOpenGLStereoWidget,the problem occures

This is not possible with the stereo widget because it is actually a QOpenGLWindow subclass. Try using the QVTKOpenGLNativeWidget instead.

1 Like

Thank you so much!
finally my problem solved :grinning: