QRect QGraphicsWebViewPrivate::geometryRelativeToOwnerWidget() const
{
    if (!q->scene())
        return QRect();

    QList<QGraphicsView*> views = q->scene()->views();
    if (views.isEmpty())
        return QRect();

    QGraphicsView* view = views.at(0);
    return view->mapFromScene(q->boundingRect()).boundingRect();
}
QWidget* QGraphicsWebViewPrivate::ownerWidget() const
{
    if (QGraphicsScene* scene = q->scene()) {
        const QList<QGraphicsView*> views = scene->views();
        return views.value(0);
    }
    return 0;
}
WId QGraphicsWebViewPrivate::winId() const
{
    const QList<QGraphicsView*> views = q->scene()->views();

    if (!views.isEmpty())
        return views.at(0)->winId();

    return 0;
}
int QGraphicsWebViewPrivate::screenNumber() const
{
#if defined(Q_WS_X11)
    const QList<QGraphicsView*> views = q->scene()->views();

    if (!views.isEmpty())
        return views.at(0)->x11Info().screen();
#endif

    return 0;
}
Exemple #5
0
void QGraphicsWebViewPrivate::_q_updateMicroFocus()
{
    // Ideally, this should be handled by a common call to an updateMicroFocus function
    // in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578.
    QList<QGraphicsView*> views = q->scene()->views();
    for (int c = 0; c < views.size(); ++c) {
        QInputContext* ic = views.at(c)->inputContext();
        if (ic)
            ic->update();
    }
}
Exemple #6
0
void QGraphicsWebViewPrivate::_q_updateMicroFocus()
{
#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
    // Ideally, this should be handled by a common call to an updateMicroFocus function
    // in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578.
    QList<QGraphicsView*> views = q->scene()->views();
    for (int c = 0; c < views.size(); ++c) {
        QInputContext* ic = views.at(c)->inputContext();
        if (ic)
            ic->update();
    }
#endif
}
void QGraphicsWebViewPrivate::setRootGraphicsLayer(QGraphicsItem* layer)
{
    if (rootGraphicsLayer) {
        rootGraphicsLayer.data()->setParentItem(0);
        q->scene()->removeItem(rootGraphicsLayer.data());
        QWebFramePrivate::core(q->page()->mainFrame())->view()->syncCompositingStateRecursive();
    }

    rootGraphicsLayer = layer ? layer->toGraphicsObject() : 0;

    if (layer) {
        layer->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
        layer->setParentItem(q);
        layer->setZValue(RootGraphicsLayerZValue);
        updateCompositingScrollPosition();
    }
    createOrDeleteOverlay();
}
Exemple #8
0
QWidget* QGraphicsWebViewPrivate::ownerWidget() const
{
    const QList<QGraphicsView*> views = q->scene()->views();
    return views.value(0);
}