Exemplo n.º 1
0
void QWebViewPrivate::detachCurrentPage()
{
    if (!page)
        return;

    page->d->view.clear();

    // if the page client is the special client constructed for
    // delegating the responsibilities to a QWidget, we need
    // to destroy it.

    if (page->d->client && page->d->client->isQWidgetClient())
        page->d->client.clear();

    page->d->client.release();

    // if the page was created by us, we own it and need to
    // destroy it as well.

    if (page->parent() == view)
        delete page;
    else
        page->disconnect(view);

    page = 0;
}
Exemplo n.º 2
0
void QWebViewPrivate::unsetPageIfExists()
{
    if (!page)
        return;

    // if the page client is the special client constructed for
    // delegating the responsibilities to a QWidget, we need
    // to destroy it.

    if (page->d->client && page->d->client->isQWidgetClient())
        delete page->d->client;

    page->d->client = 0;

    // if the page was created by us, we own it and need to
    // destroy it as well.

    if (page->parent() == view)
        delete page;
    else
        page->disconnect(view);
}