gongjianbo / MyQtLocation

Qt5 Location custom plugin,map tiles can be loaded.(Keyword:qtlocation,qtmap)
MIT License
48 stars 27 forks source link

Code does not work out of the box on macOS #2

Open kubark42 opened 2 years ago

kubark42 commented 2 years ago

Background

Qt Version: Qt 5.15.2 Platform: MacOS 11.6

Problem

Opening the project in Qt Creator, and then building and running the code results in an empty screen.

Screen Shot 2021-10-19 at 20 08 15

Workaround

The line value: applicationDirPath+"/dianzi_gaode_ArcgisServerTiles/_alllayers" points to the wrong directory on macOS, as it is looking inside the application bundle. However, the bundle does not have the files copied into the app directory.

As a workaround, I set

value: "/Users/foo/Downloads/MyQtLocation-master/bin/dianzi_gaode_ArcgisServerTiles/_alllayers"

and it works fine.

Thanks a lot for publishing this project, it's a perfect example of an offline map plugin!

gongjianbo commented 2 years ago

Thank you for your valuable feedback. But I don't have an Mac development environment to test. I don't know how Mac gets the relative path of the executable(谢谢你的反馈. 不过我没有苹果开发环境,无法进行测试. 也不知道苹果怎么获取可执行程序相对路径.)