[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: QGIS 2.14 & Qt5



On 11-03-16 18:28, Matthias Kuhn wrote:
> On 03/11/2016 06:00 PM, Sebastiaan Couwenberg wrote:
>> On 11-03-16 16:01, Dmitry Shachnev wrote:
>>> On Sat, Feb 27, 2016 at 05:13:37PM +0100, Sebastiaan Couwenberg wrote:
>>>> The first build of 2.14 with Qt5 failed due to errors in the
>>>> spatialite provider ('DetachFromResultSet' is not a member of
>>>> 'QSqlResult'), this looks like an incompatibility with
>>>> libqt5sql5(-sqlite).
>>>
>>> That's https://code.qt.io/cgit/qt/qtbase.git/commit/?id=fc15a1d5e2cb064d.
>>>
>>> You may steal the changes to qsql_sqlite.{cpp,h} from that commit and
>>> apply them to your qsql_spatialite.{cpp,h} files — they are very small.
>>
>> It looks like that switches to the new Qt5 method losing backwards
>> compatibility with Qt4. Since QGIS 2.16 will support dual Qt4/Qt5, we
>> should ifdef that to support both. For Debian we need that too for the
>> backports which will keep using Qt4 in jessie, otherwise we'll need a
>> bunch of Qt5 backports.

I've added a patch with the suggested changes for qsql_spatialite.{cpp,h}.

Beside the fix for the DetachFromResultSet error, the patch additionally
uses Q_DECLARE_OPAQUE_POINTER() [0] to fix the incomplete type errors
for sqlite3 & sqlite3_stmt which according to the comments in sqlite3.h
are opaque pointers.

[0] http://doc.qt.io/qt-5/qmetatype.html#Q_DECLARE_METATYPE

The provider still failed to build, now with:

 error: expected constructor, destructor, or type conversion before
 'static_assert'

This should be fixed by using Q_PLUGIN_METADATA() instead of
Q_EXPORT_PLUGIN2() [1].

[1] http://doc.qt.io/qt-5/qtquick-porting-qt5.html#qml-plugins

I've forwarded the patch in https://github.com/qgis/QGIS/pull/2903

> Hmm... I wonder why I didn't run into that. I have built several Qt5
> builds already (it's in our continuous integration setup for the last
> couple of hours even) and I didn't run into that. Maybe because of some
> different cmake flags...

Most probably because of different CMake flags, yes. The Debian packages
builds use -DWITH_QSPATIALITE=TRUE & -DWITH_GLOBE=TRUE among others, the
travis configuration for qt5 does not enable these options (yet). With
the fix for the globe plugin in master, adding -DWITH_GLOBE=TRUE to
ensure it doesn't regress is probably a good idea.

> If you have any compatibility patches, please make a pull request, I'll
> be happy to merge them. I've already included some #ifdef's and I don't
> mind adding some more.

Thanks for merging the globe plugin fix. The fix for qspatialite
involves some ifdefs and is reasonably straight forward too.

>>>> The second build failed due to errors in the globe plugin because
>>>> it doesn't have /usr/include/x86_64-linux-gnu/qt5/QtOpenGL in its
>>>> include path for QGLWidget, the Globe plugin has likewise been
>>>> disabled. The third build failed due to errors in QGIS server because
>>>> QtNetwork/QFtp is no longer available in Qt5, also disabled for now.
>>>> These changes allow the build to succeed with Qt5.
>>> If we package https://code.qt.io/cgit/qt/qtftp.git/, will it help you?
>>
>> I think it will help.
>>
>> I've added Matthias Kuhn to the CC who has been doing a lot of Qt5 work
>> in QGIS upstream. I hope he can give a better answer what they need from
>> Qt5 packagers.
> 
> I noticed the same and mentioned it here, but there has been no response
> yet.
> https://github.com/qgis/QGIS/pull/2896
> 
> I hope Alessandro Pasotti or Marco Hugentobler (in CC) who are more
> involved and author of that code can shed some light here. We will have
> to find a cross-platform method of fixing this code. So either we will
> have to replace it with another functionality than QFtp or ship it
> within our code.

Just disabling FTP support is not sufficient, the server also relies on
QHttp which has also been removed from Qt5. QgsHttpTransaction needs to
be ported to use QNetworkAccessManager for Qt5. [2]

[2] http://doc.qt.io/qt-5/qnetworkaccessmanager.html

I'm keeping the server disabled for the Qt5 builds for now, and will
investigate what we breaks when the bindings are enabled again.

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1


Reply to: