← Back to team overview

ubuntu-phone team mailing list archive

How to reset QML WebView?

 

Hello.

I have a web browser's window maked by QML from WebView.

And in C++ I create window:

if(_socialWindow == NULL)
    {
        _socialWindow= new QQuickView();
        _socialWindow->setFlags(Qt::Tool);
        _socialWindow->setResizeMode(QQuickView::SizeRootObjectToView);
        _socialWindow->setMinimumWidth(640);
        _socialWindow->setMinimumHeight(300);
    }

    _socialWindow->engine()->clearComponentCache();
    _socialWindow->setSource(QUrl(source)); // source is a patch to QML file

then I post to twitter and then I destroy window:

if(_socialWindow != NULL)
    {
        _socialWindow->deleteLater();
        _socialWindow = NULL;
    }

First time all is OK: I authorize and share. But second time browser opens
with logged user. How to clear window? Why did it not reset after delete
and create new?


Best regards,

Nick

Follow ups