Black QQuickWidgets content when hide() and show() (Solved)



  • Hello Every one,

    I'm using QQuickWidget to embedded my Qml Component into it.

    @
    m_container = new QQuickWidget();
    m_container->setSource(QUrl( "qrc:/MyComponent.qml" ));
    m_container->setResizeMode( QQuickWidget::SizeRootObjectToView );
    m_container->setMinimumHeight( 40 );
    m_container->hide();
    ...........................................................
    m_container->show();
    @

    when @m_container->show();@
    m_container is black , I can't see my qml component and receive a message :
    "QQuickWidget: render scenegraph with no context"

    I used to use QWidget to embedded QmlComponent with show() and hide(), everything is OK .
    But now I encounter this error .

    Could you please help me ?

    Thank you!


  • Moderators

    Looks like a bug to me. Which version of Qt are you using? If this is present in 5.4 RC, I think the release team should be notified.



  • Hi sierdzio

    currently, I'm using 5.3.2. Is it possible for me to download 5.4 now ?


  • Moderators

    Of course. The snapshots for RC release are available here: "link":http://download.qt-project.org/snapshots/qt/5.4/5.4.0-rc/.



  • ok guy,

    I will test in new version and let you know the result!

    Thank you!



  • Hi sierdzio,

    It works ! Though there are still some problems.
    For example : In the qml components ( embedded in QQuickWidget)
    I have a button, when I hover on that button and move the mouse outsite the QQuickWidget "button.hovered" is still true . It's not correct ! Hope it will be fixed in the stable version.

    Anyways, thanks for your support!


  • Moderators

    OK, that is good news.

    Qt 5.4 is in final stages of development, so if this bug is not reported already, there is little change it will get fixed. But you can check on Qt bugtracker. This is definitely a bug and should be fixed.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.