Important: Please read the Qt Code of Conduct -

Cannot make QQuickView transparent

  • I have additional problem with QQuickView(),
    namely I couldn't set transparency for it.
    If I set ->setColor(QColor(0,0,0,0)) it's starting to be black.

    setColor(Qt::transprarent) also dosn't help.

    Anyone know smth about ?


    [EDIT: Split into a new thread. Please start new threads for new questions. --JKSH]

  • Moderators


    In the future, please start a new thread for new questions.

    Anyway, you need to call QQuickWindow::setDefaultAlphaBuffer(true) before you create your QQuickView. See

  • It doesn't help.
    The window still starting to be completly black...

  • code:

    @ QQuickWindow::setDefaultAlphaBuffer(true);
    this->viewQML = new QQuickView();
    this->viewQML->setColor(QColor(0, 0, 0, 0));
    this->containerQML = QWidget::createWindowContainer( this->viewQML, this );
    this->containerQML->setFocusPolicy( Qt::TabFocus );
    this->containerQML->setMinimumSize( 75, 75 );


    [edit: please wrap your code in @tags, Eddy]

  • I would expect to use this in your main before any qml file is loaded.

    Hope it helps

Log in to reply