Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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 ?

    BR
    Tomek

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


  • Moderators

    Hi,

    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 http://qt-project.org/doc/qt-5/qquickwindow.html#setDefaultAlphaBuffer



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



  • code:

    @ QQuickWindow::setDefaultAlphaBuffer(true);
    this->viewQML = new QQuickView();
    this->viewQML->setFlags(Qt::FramelessWindowHint);
    this->viewQML->setColor(QColor(0, 0, 0, 0));
    this->containerQML = QWidget::createWindowContainer( this->viewQML, this );
    this->containerQML->adjustSize();
    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