Skip to content

Commit

Permalink
Remove more code disabled under Qt5
Browse files Browse the repository at this point in the history
Add todo note for QgsHttpTransaction and disable under docs and
sip bindings
  • Loading branch information
nyalldawson committed Sep 20, 2016
1 parent 0666fdb commit 3c4f46d
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 55 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -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}")

Expand Down
8 changes: 2 additions & 6 deletions python/core/composer/qgscomposerscalebar.sip
Expand Up @@ -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<QPair<double, double> >& posWidthList ) const;
%End
%End
// void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;

/** Sets box size suitable to content*/
void adjustBoxSize();
Expand Down
13 changes: 4 additions & 9 deletions python/core/core.sip
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions python/core/geometry/qgsgeometry.sip
Expand Up @@ -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<QgsPoint> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry );
%End
int addPart( const QList<QgsPoint> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry )/PyName=addPoints/;

/** Adds a new part to a the geometry.
Expand All @@ -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<QgsPointV2> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry );
%End
int addPart( const QList<QgsPointV2> &points, QgsWkbTypes::GeometryType geomType = QgsWkbTypes::UnknownGeometry )/PyName=addPointsV2/;

/** Adds a new part to this geometry.
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsmaplayermodel.sip
Expand Up @@ -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<int, QByteArray> roleNames() const;
%End

bool setData( const QModelIndex &index, const QVariant &value, int role );
Qt::ItemFlags flags( const QModelIndex &index ) const;
};
12 changes: 5 additions & 7 deletions python/core/qgsproviderregistry.sip
Expand Up @@ -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;

Expand Down
7 changes: 1 addition & 6 deletions python/gui/gui.sip
Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions src/core/CMakeLists.txt
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerscalebar.h
Expand Up @@ -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<QPair<double, double> >& posWidthList ) const;

Expand Down
4 changes: 4 additions & 0 deletions src/core/qgshttptransaction.cpp
Expand Up @@ -17,6 +17,7 @@
* *
***************************************************************************/

///@cond PRIVATE

#include <fstream>

Expand All @@ -29,6 +30,7 @@
#include <QSettings>
#include <QTimer>


static int HTTP_PORT_DEFAULT = 80;

//XXX Set the connection name when creating the provider instance
Expand Down Expand Up @@ -568,4 +570,6 @@ void QgsHttpTransaction::abort()
}
}

/// @endcond

// ENDS
5 changes: 5 additions & 0 deletions src/core/qgshttptransaction.h
Expand Up @@ -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
Expand Down Expand Up @@ -214,6 +217,8 @@ class CORE_EXPORT QgsHttpTransaction : public QObject
int mNetworkTimeoutMsec;
};

///@endcond

#endif

// ENDS
6 changes: 2 additions & 4 deletions src/customwidgets/CMakeLists.txt
Expand Up @@ -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)

Expand Down
4 changes: 1 addition & 3 deletions src/providers/wms/CMakeLists.txt
@@ -1,6 +1,4 @@
IF (QT5_BUILD)
FIND_PACKAGE(Qt5XmlPatterns REQUIRED)
ENDIF()
FIND_PACKAGE(Qt5XmlPatterns REQUIRED)


SET (WMS_SRCS
Expand Down

0 comments on commit 3c4f46d

Please sign in to comment.