vladest / googlemaps

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

No member named 'errorOccurred' #42

Open arrmo opened 1 year ago

arrmo commented 1 year ago

First off - apologies if this me. Not saying I don't have this messed up ... but I am trying not to 😆. If it is, please just clarify the error of my ways, and we can close this out. But in case, reporting it.

I am trying to build an application that makes use of googlemaps (subsurface). So first I built qtlocation (v6.3.0),

git clone --branch 6.3.0 https://code.qt.io/qt/qtlocation.gitcd qtlocation
cd qtlocation
mkdir build
cd build
~/Qt/6.3.0/macos/bin/qt-cmake ..
make -j16
make install

That all seems to go OK, and installs (to ~/Qt). So then,

git clone https://github.com/vladest/googlemaps.git
cd googlemaps
mkdir build
cd build
~/Qt/6.3.0/macos/bin/qmake ..
make -j16

But, I end up with (a bunch of) errors like,

qplacecategoriesreplygooglemaps.cpp:21:10: error: use of undeclared identifier 'errorOccurred'
    emit errorOccurred(errorCode, errorString);
qgeocodingmanagerenginegooglemaps.cpp:113:53: error: no member named 'errorOccurred' in 'QGeoCodeReplyGooglemaps'
    connect(geocodeReply, &QGeoCodeReplyGooglemaps::errorOccurred, this, &QGeoCodingManagerEngineGooglemaps::replyError);

Thoughts?

Thanks!!

arrmo commented 1 year ago

OK, I see what is going on - some functions, names, etc. are different in Qt6. I can try to update them if you want.

arrmo commented 1 year ago

OK, was able to make most of the code changes (still fighting with one type cast 🤣), but if I remove that one for now, then I see,

Undefined symbols for architecture arm64:
  "QGeoRouteReplyGooglemaps::QGeoRouteReplyGooglemaps(QObject*)", referenced from:
      QtPrivate::QMetaTypeForType<QGeoRouteReplyGooglemaps>::getDefaultCtr()::'lambda'(QtPrivate::QMetaTypeInterface const*, void*)::__invoke(QtPrivate::QMetaTypeInterface const*, void*) in moc_qgeoroutereplygooglemaps.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any suggestions?

Thanks!

arrmo commented 1 year ago

BTW, some of the changes I'm referring to, for example,

The QGeoLocation::boundingBox() and QGeoLocation::setBoundingBox() are replaced by [QGeoLocation::boundingShape](https://doc.qt.io/qt-6/qgeolocation.html#boundingShape)() and [QGeoLocation::setBoundingShape](https://doc.qt.io/qt-6/qgeolocation.html#setBoundingShape)() respectively. A [QGeoShape](https://doc.qt.io/qt-6/qgeoshape.html) object is now used as an underlying data storage.

From here.

arrmo commented 1 year ago

Sorry, got tanged up in different clones - my bad! Back to errorOccurred though ... does seem to be an issue.

Thanks!

arrmo commented 1 year ago

OK, I "think" I know what is going on ... 😆. I get this error when trying to build,

googlemaps/qgeocodingmanagerenginegooglemaps.cpp:87:53: error: no member named 'errorOccurred' in 'QGeoCodeReplyGooglemaps'
    connect(geocodeReply, &QGeoCodeReplyGooglemaps::errorOccurred, this, &QGeoCodingManagerEngineGooglemaps::replyError);

And, if I check the class QGeoCodeReplyGooglemaps,

class QGeoCodeReplyGooglemaps : public QGeoCodeReply

So it's base class is QGeoCodeReply. But, checking that one, from Qt , and also the latest qtlocation code ... I see the signals,

void    aborted()
void    error(QGeoCodeReply::Error error, const QString &errorString = QString())
void    finished()

So there is no errorOccurred, rather error ... right? I admit, not sure how this built before?

Thanks!