From 3c4f46dc799c372ac0cf04724ec1030f0922cfd3 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Tue, 20 Sep 2016 11:11:53 +1000 Subject: [PATCH] Remove more code disabled under Qt5 Add todo note for QgsHttpTransaction and disable under docs and sip bindings --- CMakeLists.txt | 1 - python/core/composer/qgscomposerscalebar.sip | 8 ++------ python/core/core.sip | 13 ++++--------- python/core/geometry/qgsgeometry.sip | 6 ------ python/core/qgsmaplayermodel.sip | 4 ++-- python/core/qgsproviderregistry.sip | 12 +++++------- python/gui/gui.sip | 7 +------ src/core/CMakeLists.txt | 18 ++++++++---------- src/core/composer/qgscomposerscalebar.h | 2 +- src/core/qgshttptransaction.cpp | 4 ++++ src/core/qgshttptransaction.h | 5 +++++ src/customwidgets/CMakeLists.txt | 6 ++---- src/providers/wms/CMakeLists.txt | 4 +--- 13 files changed, 35 insertions(+), 55 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17eeda9e89f..60656ca2801 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,7 +265,6 @@ FIND_PACKAGE(Qt5Test REQUIRED) FIND_PACKAGE(Qt5UiTools REQUIRED) FIND_PACKAGE(Qt5Script REQUIRED) FIND_PACKAGE(Qt5Sql REQUIRED) -SET(QT5_BUILD TRUE) INCLUDE("cmake/modules/ECMQt4To5Porting.cmake") MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}") diff --git a/python/core/composer/qgscomposerscalebar.sip b/python/core/composer/qgscomposerscalebar.sip index 3c9e6734025..7cff2addd36 100644 --- a/python/core/composer/qgscomposerscalebar.sip +++ b/python/core/composer/qgscomposerscalebar.sip @@ -245,13 +245,9 @@ class QgsComposerScaleBar: QgsComposerItem /** Returns the x - positions of the segment borders (in item coordinates) and the width * of the segment - * @note python bindings not available on android + * @note not available in Python bindings */ -%If (!ARM) -%If (!QT5_SUPPORT) - void segmentPositions( QList >& posWidthList ) const; -%End -%End + // void segmentPositions( QList >& posWidthList ) const; /** Sets box size suitable to content*/ void adjustBoxSize(); diff --git a/python/core/core.sip b/python/core/core.sip index c80edf62ff7..1b9f4cfe25e 100644 --- a/python/core/core.sip +++ b/python/core/core.sip @@ -2,16 +2,12 @@ version=0, keyword_arguments="Optional") -%Feature QT5_SUPPORT - %Import QtXml/QtXmlmod.sip %Import QtNetwork/QtNetworkmod.sip %Import QtSql/QtSqlmod.sip -%If (QT5_SUPPORT) - %Import QtPrintSupport/QtPrintSupportmod.sip - %Import QtWidgets/QtWidgetsmod.sip -%End +%Import QtPrintSupport/QtPrintSupportmod.sip +%Import QtWidgets/QtWidgetsmod.sip %Include conversions.sip %Include qgsexception.sip @@ -69,9 +65,8 @@ %Include qgsmaptopixelgeometrysimplifier.sip %Include qgstransaction.sip %Include qgstransactiongroup.sip -%If(!QT5_SUPPORT) - %Include qgshttptransaction.sip -%End +// TODO - update for Qt5 +// %Include qgshttptransaction.sip %Include qgsdartmeasurement.sip %Include qgsexpressionfieldbuffer.sip %Include qgsfontutils.sip diff --git a/python/core/geometry/qgsgeometry.sip b/python/core/geometry/qgsgeometry.sip index 7f30122e1bf..ce35c94f73f 100644 --- a/python/core/geometry/qgsgeometry.sip +++ b/python/core/geometry/qgsgeometry.sip @@ -323,9 +323,6 @@ class QgsGeometry * not disjoint with existing polygons of the feature */ // TODO QGIS 3.0 returns an enum instead of a magic constant -%If (!QT5_SUPPORT) - int addPart( const QList &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ); -%End int addPart( const QList &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry )/PyName=addPoints/; /** Adds a new part to a the geometry. @@ -335,9 +332,6 @@ class QgsGeometry * not disjoint with existing polygons of the feature */ // TODO QGIS 3.0 returns an enum instead of a magic constant -%If (!QT5_SUPPORT) - int addPart( const QList &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry ); -%End int addPart( const QList &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry )/PyName=addPointsV2/; /** Adds a new part to this geometry. diff --git a/python/core/qgsmaplayermodel.sip b/python/core/qgsmaplayermodel.sip index 7a3d3494bd5..3ea7faa7587 100644 --- a/python/core/qgsmaplayermodel.sip +++ b/python/core/qgsmaplayermodel.sip @@ -62,14 +62,14 @@ class QgsMapLayerModel : QAbstractItemModel int rowCount( const QModelIndex &parent ) const; int columnCount( const QModelIndex &parent ) const; QVariant data( const QModelIndex &index, int role ) const; -%If (QT5_SUPPORT) + /** * Returns strings for all roles supported by this model. * * @note Available only with Qt5 (python and c++) */ QHash roleNames() const; -%End + bool setData( const QModelIndex &index, const QVariant &value, int role ); Qt::ItemFlags flags( const QModelIndex &index ) const; }; diff --git a/python/core/qgsproviderregistry.sip b/python/core/qgsproviderregistry.sip index 1a3543a670e..0ad4e92a97b 100644 --- a/python/core/qgsproviderregistry.sip +++ b/python/core/qgsproviderregistry.sip @@ -53,15 +53,13 @@ class QgsProviderRegistry QWidget *selectWidget( const QString & providerKey, QWidget * parent = 0, const Qt::WindowFlags& fl = 0 ); -%If (!QT5_SUPPORT) /** Get pointer to provider function - * @param providerKey identificator of the provider - * @param functionName name of function - * @return pointer to function or NULL on error + @param providerKey identificator of the provider + @param functionName name of function + @return pointer to function or NULL on error */ - void *function( const QString & providerKey, - const QString & functionName ); -%End + QFunctionPointer function( const QString & providerKey, + const QString & functionName ); QLibrary *providerLibrary( const QString & providerKey ) const; diff --git a/python/gui/gui.sip b/python/gui/gui.sip index 36fd2afeee2..27b73be6bd6 100644 --- a/python/gui/gui.sip +++ b/python/gui/gui.sip @@ -11,12 +11,7 @@ %Import QtXml/QtXmlmod.sip %If (HAVE_QSCI_SIP) - %If (!QT5_SUPPORT) - %Import Qsci/qscimod4.sip - %End - %If (QT5_SUPPORT) - %Import Qsci/qscimod5.sip - %End + %Import Qsci/qscimod5.sip %End %Include qgsblendmodecombobox.sip diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6f252550ac0..eaef1eb5583 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -394,11 +394,10 @@ IF(ENABLE_MODELTEST) ) ENDIF(ENABLE_MODELTEST) -IF (NOT QT5_BUILD) - SET(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} - qgshttptransaction.cpp - ) -ENDIF (NOT QT5_BUILD) +# TODO - update for Qt5 +#SET(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} +# qgshttptransaction.cpp +#) IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # spatialindex headers produce warnings @@ -560,11 +559,10 @@ IF (NOT WITH_QTWEBKIT) ) ENDIF(NOT WITH_QTWEBKIT) -IF (NOT QT5_BUILD) - SET(QGIS_CORE_MOC_HDRS ${QGIS_CORE_MOC_HDRS} - qgshttptransaction.h - ) -ENDIF (NOT QT5_BUILD) +# TODO - update for Qt5 +#SET(QGIS_CORE_MOC_HDRS ${QGIS_CORE_MOC_HDRS} +# qgshttptransaction.h +#) IF (WITH_INTERNAL_QEXTSERIALPORT) SET(QGIS_CORE_MOC_HDRS ${QGIS_CORE_MOC_HDRS} diff --git a/src/core/composer/qgscomposerscalebar.h b/src/core/composer/qgscomposerscalebar.h index ee57d675ca0..4b4bf8840ce 100644 --- a/src/core/composer/qgscomposerscalebar.h +++ b/src/core/composer/qgscomposerscalebar.h @@ -268,7 +268,7 @@ class CORE_EXPORT QgsComposerScaleBar: public QgsComposerItem /** Returns the x - positions of the segment borders (in item coordinates) and the width * of the segment - * @note python bindings not available on android + * @note not available in Python bindings */ void segmentPositions( QList >& posWidthList ) const; diff --git a/src/core/qgshttptransaction.cpp b/src/core/qgshttptransaction.cpp index 087511f3bb3..2348971e335 100644 --- a/src/core/qgshttptransaction.cpp +++ b/src/core/qgshttptransaction.cpp @@ -17,6 +17,7 @@ * * ***************************************************************************/ +///@cond PRIVATE #include @@ -29,6 +30,7 @@ #include #include + static int HTTP_PORT_DEFAULT = 80; //XXX Set the connection name when creating the provider instance @@ -568,4 +570,6 @@ void QgsHttpTransaction::abort() } } +/// @endcond + // ENDS diff --git a/src/core/qgshttptransaction.h b/src/core/qgshttptransaction.h index c65f97f942f..ef52620bec2 100644 --- a/src/core/qgshttptransaction.h +++ b/src/core/qgshttptransaction.h @@ -27,6 +27,9 @@ class QTimer; +// needs porting to Qt5 - until then don't include in api docs +///@cond PRIVATE + /** \ingroup core * HTTP request/response manager that is redirect-aware. * This class extends the Qt QHttp concept by being able to recognise @@ -214,6 +217,8 @@ class CORE_EXPORT QgsHttpTransaction : public QObject int mNetworkTimeoutMsec; }; +///@endcond + #endif // ENDS diff --git a/src/customwidgets/CMakeLists.txt b/src/customwidgets/CMakeLists.txt index 0c5c3886d94..acdb1c7a0ed 100644 --- a/src/customwidgets/CMakeLists.txt +++ b/src/customwidgets/CMakeLists.txt @@ -2,10 +2,8 @@ ADD_DEFINITIONS(-DQT_PLUGIN) ADD_DEFINITIONS(-DQT_NO_DEBUG) ADD_DEFINITIONS(-DQT_SHARED) -IF (QT5_BUILD) - FIND_PACKAGE(Qt5UiPlugin REQUIRED) - FIND_PACKAGE(Qt5Designer REQUIRED) -ENDIF (QT5_BUILD) +FIND_PACKAGE(Qt5UiPlugin REQUIRED) +FIND_PACKAGE(Qt5Designer REQUIRED) SET(QT_USE_QTDESIGNER ON) diff --git a/src/providers/wms/CMakeLists.txt b/src/providers/wms/CMakeLists.txt index 7a57c85773d..1519392e062 100644 --- a/src/providers/wms/CMakeLists.txt +++ b/src/providers/wms/CMakeLists.txt @@ -1,6 +1,4 @@ -IF (QT5_BUILD) - FIND_PACKAGE(Qt5XmlPatterns REQUIRED) -ENDIF() +FIND_PACKAGE(Qt5XmlPatterns REQUIRED) SET (WMS_SRCS