Discussion:
[Interest] Geoposition and Ubuntu 18.04
Sérgio Martins
2018-12-10 16:26:51 UTC
Permalink
On Mon, Dec 10, 2018 at 2:35 PM <***@logikalsolutions.com> wrote:
>
> Thank you Alex, but, Qt stopped compiling under C++11 with version
> 5.11 and I haven't heard of that changing.

Please fix these kind of bugs when you bump into them, it's unlikely
someone will do it for you.
If you use the opensource license you can't just act like a
spectator/consumer and complain when your odd configurations don't
work.

Regards,
Sergio
Denis Shienkov
2018-12-09 20:02:41 UTC
Permalink
Hi,

That patch adds the support for Geoclue v2 only, which should be
available since Qt 5.12 (but not since Qt 5.9.7, AFAIK).
You can try to check it with lookup the 'qtposition_geoclue2.so' file in
the installed Qt's plugins path.
* Also, make sure that your distro has geoclue2 installed.
* Also it is unnecessary to use the QT_GEOCLUE_APP_DESKTOP_ID variable,
it is enough to specify the
QCoreApplication::applicationName() property instead.
* Besides, I'm not sure that this
QGeoPositionInfoSource::createDefaultSource(this) will work, because it
may be not 'default' plugin.
Just try to use availableSources() && createSource() instead.

Denis.

09.12.2018 22:23, ***@logikalsolutions.com пОшет:
>
> All,
>
> I've just started poking around with the GeopositionInfo stuff now
> that Ubuntu 18.04 has location services. Can't find good C++ examples.
> Everyone seems to focus on worthless QML.
>
> First off:  Huge serious kudos to Denis Shienkov for
> https://codereview.qt-project.org/#/c/229911/
> That bug report was better than any of the documentation. Well worth a
> read.
>
>
> For purposes of this discussion we will call the application Fred to
> protect the guilty.
>
> The application has the following snippet of code.
>
>     syslog( LOG_MAKEPRI(LOG_USER, LOG_INFO), "%s", "Trying to create
> default GeoPositionInfoSource");
>     qDebug() << "Trying to create default GeoPositionInfoSource";
>
>     m_geoSource = QGeoPositionInfoSource::createDefaultSource(this);
>
>     if (m_geoSource)
>     {
>         syslog( LOG_MAKEPRI(LOG_USER, LOG_INFO), "%s", "successfully
> created default GeopositionInfoSource");
>         qDebug() << "successfully created default GeopositionInfoSource";
>         connect(m_geoSource, SIGNAL(positionUpdated(QGeoPositionInfo)),
>                 this, SLOT(positionUpdated(QGeoPositionInfo)));
> #ifdef QT_DEBUG
>         m_geoSource->setUpdateInterval( 1000 * 60 * 2);  // 1000ms in
> a second
> #else
>         m_geoSource->setUpdateInterval( 1000 * 60 * 45);  // 1000ms in
> a second
> #endif
>         m_geoSource->startUpdates();
>     }
>     else
>     {
>         syslog( LOG_MAKEPRI(LOG_USER, LOG_ERR), "%s", "Unable to
> create default GeopositionInfoSource");
>         qDebug() << "Unable to create default GeopositionInfoSource";
>     }
>
> I have enabled location services in Ubuntu 18.04 and am debugging
> inside of QtCreator. The .profile for my account contains:
>
> export QT_GEOCLUE_APP_DESKTOP_ID=ipos
>
> and I've added fred to /etc/geoclue/geoclue.conf
>
> [fred]
> allowed=true
> system=false
> users=
>
> When I compiled 5.9.7 from source the following snippet is from the
> configuration summary.
>
> Qt Positioning:
>   Gypsy GPS Daemon ....................... no
>   WinRT Geolocation API .................. no
> Qt Location:
>   Geoservice plugins:
>     OpenStreetMap ........................ yes
>     HERE ................................. yes
>     Esri ................................. yes
>     Mapbox ............................... yes
>     MapboxGL ............................. no
>     Itemsoverlay ......................... yes
>
>
> When I step through in the debugger I see the following:
>
> Debugging starts
> QML debugging is enabled. Only use this in a safe environment.
> Trying to create default GeoPositionInfoSource
> successfully created default GeopositionInfoSource
> Failed to set Geoclue positioning requirements. Geoclue error:
> org.qtproject.QtDBus.Error.InvalidObjectPath
>
> My question here is: Have I skipped something stupid (quite possible
> as there are no good examples, the one C++ example reads from a file
> to emit a signal so is totally worthless) _or_ does the geoposition
> stuff not communicate with Ubuntu 18.04's version of geoclue?
>
> Should I just install
>
> geoclue-examples_0.12.99-4_amd64.deb     GeoClue example clients
>
> and roll my own using the dbus interface?
>
> Thanks,
Alex Blasche
2018-12-10 08:44:45 UTC
Permalink
Hi,

Indeed the GeoClue 2 plugin was added to 5.12. However it is a plugin and the interfaces to plugins have not changed. You could simply build the plugin (src/plugins/position/geoclue2/) in your 5.9.x tree.

--
Alex

________________________________________
From: Interest <interest-***@lists.qt-project.org> on behalf of Denis Shienkov <***@gmail.com>
Sent: Sunday, 9 December 2018 9:02:41 PM
To: ***@lists.qt-project.org
Subject: Re: [Interest] Geoposition and Ubuntu 18.04

Hi,

That patch adds the support for Geoclue v2 only, which should be available since Qt 5.12 (but not since Qt 5.9.7, AFAIK).
You can try to check it with lookup the 'qtposition_geoclue2.so' file in the installed Qt's plugins path.
* Also, make sure that your distro has geoclue2 installed.
* Also it is unnecessary to use the QT_GEOCLUE_APP_DESKTOP_ID variable, it is enough to specify the
QCoreApplication::applicationName() property instead.
* Besides, I'm not sure that this QGeoPositionInfoSource::createDefaultSource(this) will work, because it may be not 'default' plugin.
Just try to use availableSources() && createSource() instead.

Denis.

09.12.2018 22:23, ***@logikalsolutions.com<mailto:***@logikalsolutions.com> пишет:

All,

I've just started poking around with the GeopositionInfo stuff now that Ubuntu 18.04 has location services. Can't find good C++ examples. Everyone seems to focus on worthless QML.

First off: Huge serious kudos to Denis Shienkov for https://codereview.qt-project.org/#/c/229911/
That bug report was better than any of the documentation. Well worth a read.


For purposes of this discussion we will call the application Fred to protect the guilty.

The application has the following snippet of code.

syslog( LOG_MAKEPRI(LOG_USER, LOG_INFO), "%s", "Trying to create default GeoPositionInfoSource");
qDebug() << "Trying to create default GeoPositionInfoSource";

m_geoSource = QGeoPositionInfoSource::createDefaultSource(this);

if (m_geoSource)
{
syslog( LOG_MAKEPRI(LOG_USER, LOG_INFO), "%s", "successfully created default GeopositionInfoSource");
qDebug() << "successfully created default GeopositionInfoSource";
connect(m_geoSource, SIGNAL(positionUpdated(QGeoPositionInfo)),
this, SLOT(positionUpdated(QGeoPositionInfo)));
#ifdef QT_DEBUG
m_geoSource->setUpdateInterval( 1000 * 60 * 2); // 1000ms in a second
#else
m_geoSource->setUpdateInterval( 1000 * 60 * 45); // 1000ms in a second
#endif
m_geoSource->startUpdates();
}
else
{
syslog( LOG_MAKEPRI(LOG_USER, LOG_ERR), "%s", "Unable to create default GeopositionInfoSource");
qDebug() << "Unable to create default GeopositionInfoSource";
}

I have enabled location services in Ubuntu 18.04 and am debugging inside of QtCreator. The .profile for my account contains:

export QT_GEOCLUE_APP_DESKTOP_ID=ipos

and I've added fred to /etc/geoclue/geoclue.conf

[fred]
allowed=true
system=false
users=

When I compiled 5.9.7 from source the following snippet is from the configuration summary.

Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Geoservice plugins:
OpenStreetMap ........................ yes
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. no
Itemsoverlay ......................... yes


When I step through in the debugger I see the following:

Debugging starts
QML debugging is enabled. Only use this in a safe environment.
Trying to create default GeoPositionInfoSource
successfully created default GeopositionInfoSource
Failed to set Geoclue positioning requirements. Geoclue error: org.qtproject.QtDBus.Error.InvalidObjectPath

My question here is: Have I skipped something stupid (quite possible as there are no good examples, the one C++ example reads from a file to emit a signal so is totally worthless) _or_ does the geoposition stuff not communicate with Ubuntu 18.04's version of geoclue?

Should I just install

geoclue-examples_0.12.99-4_amd64.deb GeoClue example clients

and roll my own using the dbus interface?

Thanks,
r***@logikalsolutions.com
2018-12-10 16:49:52 UTC
Permalink
You know Sergio, I gave up trying to "fix" anything in Qt. The
submission and build process was beyond a nightmare. Many, many, many
good fixes were lost over the years because many many many people had
fixes lost in that process. Probably still are being lost because so
many of us who tried over the years simply gave up. Even if there is a
new process, most of us just won't bother.

This particular bug identifies the complete falacy of automated
testing. If being able to compile under C++11 really is a requirement
then the automated test build should be forcing C++11 and this
shouldn't have made it out. If abandoning C++11, which appears to be
the direction, really is the direction, then it is not a bug, but
death of a standard. At some point, as younger developers want to play
with all of the new toys, that will happen.


Quoting Sérgio Martins <***@gmail.com>:

> On Mon, Dec 10, 2018 at 2:35 PM <***@logikalsolutions.com> wrote:
>>
>> Thank you Alex, but, Qt stopped compiling under C++11 with version
>> 5.11 and I haven't heard of that changing.
>
> Please fix these kind of bugs when you bump into them, it's unlikely
> someone will do it for you.
> If you use the opensource license you can't just act like a
> spectator/consumer and complain when your odd configurations don't
> work.
>
> Regards,
> Sergio


--
Roland Hughes, President
Logikal Solutions
(630) 205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog
http://lesedi.us
r***@logikalsolutions.com
2018-12-10 13:11:58 UTC
Permalink
Quoting Denis Shienkov:

>
> That patch adds the support for Geoclue v2 only, which should be
> available since Qt 5.12 (but not since Qt 5.9.7, AFAIK).
> You can try to check it with lookup the 'qtposition_geoclue2.so' file in
> the installed Qt's plugins path.

Thanks, you are correct, the library does not exist with 5.9.7. It's a
DBus path for me.
--
Roland Hughes, President
Logikal Solutions
(630) 205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog
http://lesedi.us
Loading...