1

I'm trying to get qtlocation running with the osm provider but for some reason when the application starts up it just hangs. Cannot even close it.

When I change it to use the "mapboxgl" provider it works fine. I've been using it for many years on ubuntu 20.04 but since I've switched to Ubuntu 22.04 (qt 5.15.3) I'm having issues. Am I missing parameters?

using gcc 11.3.0

Any help would be appreciated

I'm running Qt's test/example app qt's example code

main.cpp:

#include <QGuiApplication>
#include <QQmlApplicationEngine>


int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
    QGuiApplication app(argc, argv);
    
    QQmlApplicationEngine engine;
    const QUrl url(QStringLiteral("qrc:/main.qml"));
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                     &app, [url](QObject *obj, const QUrl &objUrl) {
        if (!obj && url == objUrl)
            QCoreApplication::exit(-1);
    }, Qt::QueuedConnection);
    engine.load(url);
    
    return app.exec();
}

main.qml:

import QtQuick 2.12
import QtQuick.Window 2.12
import QtLocation 5.12
import QtPositioning 5.12

Window {
    width: 512
    height: 512
    visible: true
    
    Plugin {
        id: osmPlugin
        name: "osm"
        // specify plugin parameters if necessary
        // PluginParameter {
        //     name:
        //     value:
        // }
    }
    
    Map {
        anchors.fill: parent
        plugin: osmPlugin
        center: QtPositioning.coordinate(59.91, 10.75) // Oslo
        zoomLevel: 10
    }
}

Then I also tried with qt 5.15.10. same result

Also noted that it stops as soon as it loads 1 tile. every time you run it again you see an extra tile showing(probably cached tiles).

Pibo
  • 11
  • 2
  • I've tested your code with Ubuntu 22.04.1 LTS, Qt 5.15.11 and gcc version 11.3.0. It works without any issues. – iam_peter Jan 24 '23 at 16:14
  • I can reproduce on 22.04.2 LTS Qt5.15 from git built with gcc11 and openssl 1.1.1 built from source and linked to Qt. – Pa_ Feb 19 '23 at 20:55

0 Answers0