QQuickMapboxGL::QQuickMapboxGL(QQuickItem *parent_)
    : QQuickFramebufferObject(parent_)
{
#if QT_VERSION >= 0x050600
    // FIXME: https://github.com/mapbox/mapbox-gl-native/issues/4866
    setMirrorVertically(true);
#endif
}
Exemple #2
0
bool EnhancedPathShape::loadOdf(const KXmlElement & element, KShapeLoadingContext &context)
{
    reset();
    loadOdfAttributes(element, context, OdfAdditionalAttributes | OdfCommonChildElements);

    const KXmlElement enhancedGeometry(KoXml::namedItemNS(element, KOdfXmlNS::draw, "enhanced-geometry" ) );
    if (!enhancedGeometry.isNull()) {
        // load the modifiers
        QString modifiers = enhancedGeometry.attributeNS(KOdfXmlNS::draw, "modifiers");
        if (!modifiers.isEmpty()) {
            addModifiers(modifiers);
        }

        KXmlElement grandChild;
        forEachElement(grandChild, enhancedGeometry) {
            if (grandChild.namespaceURI() != KOdfXmlNS::draw)
                continue;
            if (grandChild.localName() == "equation") {
                QString name = grandChild.attributeNS(KOdfXmlNS::draw, "name");
                QString formula = grandChild.attributeNS(KOdfXmlNS::draw, "formula");
                addFormula(name, formula);
            } else if (grandChild.localName() == "handle") {
                EnhancedPathHandle * handle = new EnhancedPathHandle(this);
                if (handle->loadOdf(grandChild, context)) {
                    m_enhancedHandles.append(handle);
                    evaluateHandles();
                } else {
                    delete handle;
                }
            }
        }

        setMirrorHorizontally(enhancedGeometry.attributeNS(KOdfXmlNS::draw, "mirror-horizontal") == "true");
        setMirrorVertically(enhancedGeometry.attributeNS(KOdfXmlNS::draw, "mirror-vertical") == "true");

        // load the enhanced path data
        QString path = enhancedGeometry.attributeNS(KOdfXmlNS::draw, "enhanced-path");
#ifndef NWORKAROUND_ODF_BUGS
        KOdfWorkaround::fixEnhancedPath(path, enhancedGeometry, context);
#endif
        if (!path.isEmpty()) {
            parsePathData(path);
        }

        // load the viewbox
        QRectF viewBox = loadOdfViewbox(enhancedGeometry);
        if (! viewBox.isEmpty()) {
            m_viewBox = viewBox;
        } else {
            // if there is no view box defined make it is big as the path.
            m_viewBox = m_viewBound;
        }

        QString gluePoints(enhancedGeometry.attributeNS(KOdfXmlNS::draw, "glue-points"));
        if (!gluePoints.isEmpty()) {
            qreal x = -1;
            foreach (const QString &token, gluePoints.split(' ')) {
                if (x == -1) { // processing 'x'
                    x = token.toInt();
                } else {
                    addConnectionPoint(QPointF(x, token.toInt()));
                    x = -1;
                }
            }
        }