Important: Please read the Qt Code of Conduct -

How to overly a transparent QWidget on a QWindow?

  • In the following code, scadeWindow is a instance of customized class ScadeWindow which is a subclass of QWindow. Now I want to put a transparent QLabel on scadeWindow, but failed.
    request for a solution for this problem.

    ScadeWidget::ScadeWidget(QWidget *parent):QWidget(parent)
    QSurfaceFormat format;
    scadeWindow = new ScadeWindow(format);

    // Combining Qt Widgets and QML with QWidget::createWindowContainer()
    // OpenGL in Qt 5.1 – Part 5
    // OpenGL Window Example
    container = QWidget::createWindowContainer(scadeWindow, this);
    container->setMinimumSize(scadeWindow->width(), scadeWindow->height());
    auto label = new QLabel("Hello, the world!", this);
    label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);

    I use this

  • what if add:



Log in to reply