Maps in QtQuick (Qt 5.3)



  • Hi,

    I would like to write QtQuick application that contains among others maps. It is desktop application, it doesn't get location from anywhere, it should draw map on area that I wants, be able to include markers (would be great with custom markers), draw route (lines of many colors) on coordinates that I provide.

    I've written such application in C# already but my goal is to do this in Qt because of beautyness and portability. I used GMap.NET and OpenStreetMaps that looks great for me so if it would be possible to use OSM it would be great.

    Unfortunately I can't find any up-to-date information and sample codes that I download even for older Qt versions are unable to compile.



  • Hi,
    Did you try a webview with an API like googlemap ?



  • I tried simple use of WebView and nothing except white screen appears.

    @import QtQuick 2.2
    import QtQuick.Window 2.1
    import QtWebKit 3.0

    Window {
    visible: true
    width: 600
    height: 600

    Rectangle {
        anchors.fill: parent
    
        WebView {
            id: webview
            url: "http://qt-project.org"
        }
    }
    

    }@

    I get warning Using Qt Quick code model 1 instead of Qt Quick 2. (M324)

    Such warnings I get during debug:

    QSslSocket: cannot resolve TLSv1_1_client_method
    QSslSocket: cannot resolve TLSv1_2_client_method
    QSslSocket: cannot resolve TLSv1_1_server_method
    QSslSocket: cannot resolve TLSv1_2_server_method
    QSslSocket: cannot resolve SSL_select_next_proto
    QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
    QSslSocket: cannot call unresolved function SSL_get0_next_proto_negotiated
    QSslSocket: cannot call unresolved function SSL_get0_next_proto_negotiated

    When I copy some ssl binaries (libeay32.dll and ssleay32.dll) to .../mingw/bin/ folder these errors dissappears but still screen goes white.


  • Moderators

    You can remove the Rectangle, and you need to add this to WebView:
    @
    anchors.fill: parent
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.