Skip to content

Commit 313c34c

Browse files
committed
[py3] Updates to sip files
1 parent 47543d9 commit 313c34c

File tree

10 files changed

+38
-20
lines changed

10 files changed

+38
-20
lines changed

python/CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ INCLUDE_DIRECTORIES(
103103
${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
104104
)
105105

106+
IF(NOT ENABLE_QT5)
107+
SET(SIP_DISABLE_FEATURES ${SIP_DISALE_FEATURES} QT5_SUPPORT)
108+
ENDIF(NOT ENABLE_QT5)
109+
106110
IF(NOT ANDROID)
107111
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ANDROID)
108112
ENDIF(NOT ANDROID)
@@ -124,10 +128,10 @@ IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
124128
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
125129
ENDIF(PYQT4_VERSION_NUM LESS 263680)
126130

127-
IF(NOT PYQT4_VERSION_NUM LESS 263941) # 0x040705
131+
IF(NOT PYQT4_VERSION_NUM LESS 263941 AND NOT ENABLE_QT5) # 0x040705
128132
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETINT_CONVERSION)
129-
ENDIF(NOT PYQT4_VERSION_NUM LESS 263941)
130-
133+
ENDIF(NOT PYQT4_VERSION_NUM LESS 263941 AND NOT ENABLE_QT5)
134+
#
131135
IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
132136
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION)
133137
ENDIF(NOT PYQT4_VERSION_NUM LESS 264194)

python/analysis/network/qgsgraphanalyzer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class QgsGraphAnalyzer
3232
int i;
3333
for ( i = 0; i < costResult.size(); ++i )
3434
{
35-
PyObject *Int = PyInt_FromLong( treeResult[i] );
35+
PyObject *Int = PyLong_FromLong( treeResult[i] );
3636
PyList_SET_ITEM( l1, i, Int );
3737
PyObject *Float = PyFloat_FromDouble( costResult[i] );
3838
PyList_SET_ITEM( l2, i, Float );

python/core/auth/qgsauthmanager.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class QgsAuthManager : QObject
4848

4949
bool resetMasterPassword( const QString& newpassword, const QString& oldpass, bool keepbackup, QString *backuppath /In,Out/ = 0 );
5050

51-
const QString authManTag() const;
51+
QString authManTag() const;
5252

5353
bool registerCoreAuthMethods();
5454

@@ -213,7 +213,7 @@ class QgsAuthManager : QObject
213213
QMutex *mutex();
214214

215215
signals:
216-
void messageOut( const QString& message, const QString& tag = smAuthManTag, QgsAuthManager::MessageLevel level = INFO ) const;
216+
void messageOut( const QString& message, const QString& tag, QgsAuthManager::MessageLevel level = INFO ) const;
217217

218218
void masterPasswordVerified( bool verified ) const;
219219

python/core/composer/qgscomposerattributetablemodel.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ class QgsComposerTableSortColumnsProxyModel : QSortFilterProxyModel
105105
*/
106106
enum ColumnFilterType
107107
{
108-
ShowSortedColumns, /*!< show only sorted columns */
109-
ShowUnsortedColumns/*!< show only unsorted columns */
108+
ShowSortedColumns, /*!< show only sorted columns */
109+
ShowUnsortedColumns /*!< show only unsorted columns */
110110
};
111111

112112
/** Constructor for QgsComposerTableSortColumnsProxyModel.
113113
* @param composerTable QgsComposerAttributeTable the model is attached to
114114
* @param filterType filter for columns, controls whether sorted or unsorted columns are shown
115115
* @param parent optional parent
116116
*/
117-
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, ColumnFilterType filterType, QObject *parent /TransferThis/ = 0 );
117+
QgsComposerTableSortColumnsProxyModel( QgsComposerAttributeTable *composerTable, QgsComposerTableSortColumnsProxyModel::ColumnFilterType filterType, QObject *parent /TransferThis/ = 0 );
118118

119119
virtual ~QgsComposerTableSortColumnsProxyModel();
120120

python/core/composer/qgscomposerscalebar.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ class QgsComposerScaleBar: QgsComposerItem
248248
@note python bindings not available on android
249249
*/
250250
%If (!ARM)
251+
%If (!QT5_SUPPORT)
251252
void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;
253+
%End
252254
%End
253255

254256
/** Sets box size suitable to content*/

python/core/core.sip

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@
22
version=0,
33
keyword_arguments="Optional")
44

5-
%Import QtCore/QtCoremod.sip
6-
%Import QtGui/QtGuimod.sip
5+
%Feature QT5_SUPPORT
6+
77
%Import QtXml/QtXmlmod.sip
88
%Import QtNetwork/QtNetworkmod.sip
99
%Import QtSql/QtSqlmod.sip
1010

11+
%If (QT5_SUPPORT)
12+
%Import QtPrintSupport/QtPrintSupportmod.sip
13+
%Import QtWidgets/QtWidgetsmod.sip
14+
%End
15+
1116
%Include conversions.sip
1217
%Include qgsexception.sip
1318

@@ -49,7 +54,9 @@
4954
%Include qgsmaptopixelgeometrysimplifier.sip
5055
%Include qgsgml.sip
5156
%Include qgsgmlschema.sip
52-
%Include qgshttptransaction.sip
57+
%If(!QT5_SUPPORT)
58+
%Include qgshttptransaction.sip
59+
%End
5360
%Include qgslabel.sip
5461
%Include qgslabelattributes.sip
5562
%Include qgslabelsearchtree.sip

python/core/qgsapplication.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static char **qtgui_ArgvToC(PyObject *argvlist, int &argc)
3030
(argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL)
3131
return NULL;
3232
#else
33-
if ((arg = PyUnicode_AsString(PyList_GET_ITEM(argvlist, a))) == NULL ||
33+
if ((arg = PyBytes_AsString(PyList_GET_ITEM(argvlist, a))) == NULL ||
3434
(argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL)
3535
return NULL;
3636
#endif

python/core/qgsproviderregistry.sip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@ class QgsProviderRegistry
4848
QWidget *selectWidget( const QString & providerKey,
4949
QWidget * parent = 0, const Qt::WindowFlags& fl = 0 );
5050

51+
%If (!QT5_SUPPORT)
5152
/** Get pointer to provider function
5253
@param providerKey identificator of the provider
5354
@param functionName name of function
5455
@return pointer to function or NULL on error
5556
*/
5657
void *function( const QString & providerKey,
5758
const QString & functionName );
59+
%End
5860

5961
QLibrary *providerLibrary( const QString & providerKey ) const;
6062

python/gui/gui.sip

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44

55
%Feature HAVE_QSCI_SIP
66

7+
%Import core/core.sip
8+
79
%Import QtCore/QtCoremod.sip
810
%Import QtGui/QtGuimod.sip
911
%Import QtXml/QtXmlmod.sip
1012

1113
%If (HAVE_QSCI_SIP)
12-
%Import Qsci/qscimod4.sip
14+
%If (!QT5_SUPPORT)
15+
%Import Qsci/qscimod4.sip
16+
%End
17+
%If (QT5_SUPPORT)
18+
%Import Qsci/qscimod5.sip
19+
%End
1320
%End
1421

15-
%Import core/core.sip
16-
1722
%Include qgsblendmodecombobox.sip
1823

1924
%Include qgisinterface.sip

python/gui/qgsfieldvalidator.sip

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ class QgsFieldValidator : QValidator
99
QgsFieldValidator( QObject *parent, const QgsField &field, const QString& defaultValue, const QString& dateFormat = "yyyy-MM-dd" );
1010
~QgsFieldValidator();
1111

12-
virtual State validate(QString & /In,Out/, int & /In,Out/) const = 0 /API=QString:2 - /;
13-
virtual void fixup(QString &input /In,Out/) const /API=QString:2 - /;
1412

1513
QString dateFormat() const;
1614

17-
virtual State validate(QString & /Constrained/, int & /In,Out/) const = 0 /API=QString: - 2/;
18-
virtual void fixup(QString & /Constrained/) const /API=QString: - 2/;
15+
virtual State validate(QString & /Constrained/, int & /In,Out/) const = 0;
16+
virtual void fixup(QString & /Constrained/) const;
1917
};

0 commit comments

Comments
 (0)