Important: Please read the Qt Code of Conduct -

QtLocation examples running with exceptions

  • Hi there,

    I'm on Windows 10 64bit desktop and know how to write Qt C++ Widgets code. But Qt QML is completely new to me - the same is QtLocation.

    I like to include OSM maps into my Qt C++ programm. So I tried the QtLocation examples Qt came with to see how it works using Qt 5.12.3 and MSVC2017 64bit compiler.

    In the QtLocation documentation I read that I have to install OpenSSL first to be able to use QtLocation. And learned it must be OpenSLL 1.0.2x if the prebuild Qt Libraries are used as I do. So I installed the latest OpenSLL v1.0.2r libraries and set the Windows enviroment PATH variable to that folder.

    Now if I try to run the QtLocation examples:

    Places (QML)
    Map Viewer (QML)

    Both programs show the OSM maps. Map zooming in and out works also flawlessly. Also the map type can be changed without problems in Map Viewer (QML). But if some of the menus are used for example in

    Map Viewer (QML): Tools / Geocode, Reverse Geocode, Route with coordinates or Route with address etc...
    Places (QML): Settings / Search Center, Search Bounding Box, Search Bounding Circle or Search Options - or if a place search is done

    An exception happens:
    "Exception at 0x0, code: 0x0c0000005: write access violation at: 0x0".

    I have no idea what the reason for this exception might be. Is it possible that there is something wrong with my OpenSSL installation? Or do I have to install additional libraries or plugins to run the QtLocation example code without problems? Never had any trouble before running any (normal) Qt C++ Widgets examples.

    Again Qt QML and QtLocation is completely new to me. So I might miss some very basic stuff. Can someone please help me running these QtLocation examples?

  • Lifetime Qt Champion


    Did you try to run a debug build and check what the backtrace tells you what is happening ?

  • Hi SGaist,

    the exception happens inside the file stackView.qml and its function stackView.push(...). For example:

    stackView.push({ item: Qt.resolvedUrl("forms/SearchCenter.qml") ,
    properties: { "coordinate":}});

    Inside stackView.push(..) the function __performTransition(transition) is called. And in that function __performTransition(transition) the exception happens when __loadElement(transition.inElement) is called.

    Before __loadElement(transition.inElement) is called. The debugger shows the local vaiables:

    transition object
    immediate undefined undefined
    inElement object
    index 1 number
    itemComponent object
    item "qrc:/forms/SearchCenter.qml" string
    properties object
    coordinate object
    altitude NaN number
    isValid true boolean
    latitude 59.9485 number
    longitude 10.7686 number

    Do you have an idea what the problem might be?

  • Lifetime Qt Champion

    Not from the top of my head.

    Can you check if you have the same problem with an previous version like the latest 5.11 ?

  • Problem solved! Your presumption was right that it might be a bug. And it is a regression bug in Qt 5.12.3.
    I didn't expect a bug because Qt 5.12.3 is alrealy the third release of Qt 5.12.

    With all prior Qt releases I tested the QtLocation example code runs without any problem:
    Qt 5.9.7
    Qt 5.9.8
    Qt 5.11.3
    Qt 5.12.0
    Qt 5.12.1
    Qt 5.12.2

    So I have to write another Qt bug report and say thank you for your help SGaist!

  • Lifetime Qt Champion

    Thanks for the report.

    Fixing a bug sometimes unveils a new / old one.

Log in to reply