vladest / googlemaps

QtLocation plugin for Google maps tile API
MIT License
137 stars 61 forks source link

Compatibility with Qt 5.12 #28

Closed dlautz314 closed 5 years ago

dlautz314 commented 5 years ago

I am seeing issues using plugin with Qt 5.12.0 (plugin does build) on macOS High Sierra. I was wondering if anyone has tried using plugin with Qt 5.12? Plugin was working fine, same exact code on Qt 5.10.1

I have tested with standard location plugins (i.e. "osm", "esri"), and they work fine. I have not attempted to debug the plugin in detail yet, but I see no obvious errors (no debug logging) when used with QML Map component.

Regards, David

neolit123 commented 5 years ago

hi @dlautz314 ~can you please post any build logs of the errors you are seeing?~

edit: should have read your message properly. can you post a screenshot or explain what you are seeing?

dlautz314 commented 5 years ago

Ok, not much to look at so I am showing screenshot comparison of plugin running on QT 5.10.1 vs. QT 5.12.0 (macOS - High Sierra), same map coordinates.

ON QT 5.10.1 :

plugin on qt 5 10 1 macos

ON QT 5.12.0 :

plugin on qt 5 12 0 macos
neolit123 commented 5 years ago

just had a look the project where we are using this plugin. so we are at 5.12 on macos and nobody has reported map plugin issues yet.

this tells me that the problem might be only on your side (for now).

some things you can try is enabling debugging rules: https://doc.qt.io/qt-5/qloggingcategory.html

this page outlines the usage of the QT_LOGGING_RULES environment variable.

e.g. QT_LOGGING_RULES=qt.positioning.*=true

if this gives no hints i would debug the plugin itself by adding some qDebug() calls and see if we have a failure point where an error is ignored transparently.

there is also the guide on QML debugging: https://doc.qt.io/qtcreator/creator-debugging-qml.html#setting-up-qml-debugging

dlautz314 commented 5 years ago

Ok, will do.

But as I said in my original post, all the standard QT plugins work fine (i.e. osm, esri, etc.). Simply substituted the googlemaps plugin (which is using an API key).

Thanks.

dlautz314 commented 5 years ago

Well, nothing is being logged because as far as I can tell the plugin is not being loaded. As I said before, with the logging rules enabled, I do see logging for the other plugins (i.e. osm). I have also confirmed the googlemaps plugin is present in the plugins path in the app bundle.

I am not familiar with the plugin entry point, is there a key method I should insert a qDebug() to determine it is being loaded properly?

At the moment, I am doubting this is my issue as the build and bundle is exactly the same for QT 5.10.1, and this works fine. I'll try to build one of the QT examples (i.e. minimal map) using the googlemaps plugin, see if that works.

vladest commented 5 years ago

Hi

just checked on Linux with 5.12.1 - everything works just fine did you made install step?

dlautz314 commented 5 years ago

Well, I'm on macOS, and the project file builds and installs the plugin correctly I believe (same place when building against Qt 5.10.1):

.../MyApp.app/Contents/PlugIns/geoservices/libqtgeoservices_googlemaps_debug.dylib

Ok, I set QT_DEBUG_PLUGINS=1, and confirmed the plugin is not being loaded, even though it's installed in the same path as the other plugins in the bundle location above.

So just trying to determine if I'm doing something wrong, just what that is?

vladest commented 5 years ago
  1. try to install to Qt's install first
  2. what if rename libqtgeoservices_googlemaps_debug.dylib to libqtgeoservices_googlemaps.dylib ? or make release builds and check
  3. How you setup your extra plugins folder? qt.conf?
dlautz314 commented 5 years ago

Ok, very odd, when I renamed the plugin (your step 2.), it was able to load correctly, and it now works.

Not sure why this naming is required, when it works fine for Qt 5.10.1. Any ideas or suggestions?

I can pursue with QT support, and investigate on my own from here. Your plugin is working fine from my tests, thanks for your help.

NOTE: I am running this initially in QT Creator, so I am wondering if there is an issue there?

dlautz314 commented 5 years ago

So I guess something changed on the debug side, on how plugins are loaded (at least from QT 5.10.1 to 5.12.0), it used to permit a "_debug" suffix on the plugin library name. I rename to remove suffix, and it works for 5.10.1 and 5.12.0.

All good, thanks again.