Beispiel #1
0
void QmlRemoteImage::updateImageFromTile()
{
	if (preferredWidth() > 0 && preferredHeight() > 0) {
		QImage image = Helper::createImageFromTile(m_tile, preferredWidth(), preferredHeight());
		setImage(Helper::convertImage(image));
	}
}
Beispiel #2
0
void QDeclarativeWebView::init()
{
    d = new QDeclarativeWebViewPrivate(this);

    if (QWebSettings::iconDatabasePath().isNull() &&
        QWebSettings::globalSettings()->localStoragePath().isNull() &&
        QWebSettings::offlineStoragePath().isNull() &&
        QWebSettings::offlineWebApplicationCachePath().isNull())
        QWebSettings::enablePersistentStorage();

    setAcceptedMouseButtons(Qt::LeftButton);
    setFlag(QGraphicsItem::ItemHasNoContents, true);
    setFlag(QGraphicsItem::ItemIsFocusScope, true);
    setClip(true);

    d->view = new GraphicsWebView(this);
    d->view->setResizesToContents(true);
    d->view->setFocus();
    QWebPage* wp = new QDeclarativeWebPage(this);
    setPage(wp);
    if (!preferredWidth())
        setPreferredWidth(d->view->preferredWidth());
    if (!preferredHeight())
        setPreferredHeight(d->view->preferredHeight());
    connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize()));
    connect(d->view, SIGNAL(doubleClick(int,int)), this, SIGNAL(doubleClick(int,int)));
    connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged()));
}
MidpError Item::minimumHeight(int *h) {
    // The smallest height could be if we use all the width
    // available or should we allow clipping 
    // if clipping is allowed setSize will be complex
    preferredHeight(h, -1);

    return KNI_OK;
}
void
QDeclarativeMozView::init()
{
    setAcceptedMouseButtons(Qt::LeftButton);
    setFlag(QGraphicsItem::ItemHasNoContents, true);
    setFlag(QGraphicsItem::ItemIsFocusScope, true);
    setClip(true);

    d->view = new GraphicsMozView(this);
    d->view->setFocus();
    if (!preferredWidth())
        setPreferredWidth(d->view->preferredWidth());
    if (!preferredHeight())
        setPreferredHeight(d->view->preferredHeight());
}
Beispiel #5
0
bool
Context::Applet::isCollapsed() const
{
    return m_heightCollapseOn == preferredHeight();
}