Skip to content

Commit 1675703

Browse files
committed
qt5 fixes
1 parent a6a2982 commit 1675703

21 files changed

+54
-38
lines changed

cmake/FindPyQt4.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ IF(EXISTS PYQT4_VERSION)
2727
SET(PYQT4_FOUND TRUE)
2828
ELSE(EXISTS PYQT4_VERSION)
2929

30-
FIND_FILE(_find_pyqt_py FindPyQt.py --version=4 PATHS ${CMAKE_MODULE_PATH})
30+
FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})
3131

32-
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
32+
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} --version=4 OUTPUT_VARIABLE pyqt_config)
3333
IF(pyqt_config)
3434
STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT4_VERSION ${pyqt_config})
3535
STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT4_VERSION_STR ${pyqt_config})

cmake/FindPyQt5.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ IF(EXISTS PYQT5_VERSION)
2727
SET(PYQT5_FOUND TRUE)
2828
ELSE(EXISTS PYQT5_VERSION)
2929

30-
FIND_FILE(_find_pyqt_py FindPyQt.py --version=5 PATHS ${CMAKE_MODULE_PATH})
30+
FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})
3131

32-
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
32+
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} --version=5 OUTPUT_VARIABLE pyqt_config)
3333
IF(pyqt_config)
3434
STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT5_VERSION ${pyqt_config})
3535
STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT5_VERSION_STR ${pyqt_config})

cmake/FindQsci.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ ELSE(EXISTS QSCI_MOD_VERSION_STR)
3131
ENDIF(qsci_ver)
3232

3333
IF(QSCI_FOUND)
34-
FIND_PATH(QSCI_SIP_DIR
35-
NAMES Qsci/qscimod4.sip
36-
PATHS ${PYQT4_SIP_DIR}
37-
)
34+
IF(ENABLE_QT5)
35+
FIND_PATH(QSCI_SIP_DIR
36+
NAMES Qsci/qscimod5.sip
37+
PATHS ${PYQT5_SIP_DIR}
38+
)
39+
ELSE(ENABLE_QT5)
40+
FIND_PATH(QSCI_SIP_DIR
41+
NAMES Qsci/qscimod4.sip
42+
PATHS ${PYQT4_SIP_DIR}
43+
)
44+
ENDIF(ENABLE_QT5)
3845

3946
IF(NOT QSCI_FIND_QUIETLY)
4047
MESSAGE(STATUS "Found QScintilla2 PyQt module: ${QSCI_MOD_VERSION_STR}")

python/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ INCLUDE_DIRECTORIES(
104104
)
105105

106106
IF(NOT ENABLE_QT5)
107-
SET(SIP_DISABLE_FEATURES ${SIP_DISALE_FEATURES} QT5_SUPPORT)
107+
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QT5_SUPPORT)
108108
ENDIF(NOT ENABLE_QT5)
109109

110110
IF(NOT ANDROID)

python/PyQt/__init__.py

Whitespace-only changes.

src/analysis/raster/qgsrelief.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString& file )
510510

511511
if ( !minOk || !maxOk )
512512
{
513-
GDALComputeRasterMinMax( elevationBand, TRUE, minMax );
513+
GDALComputeRasterMinMax( elevationBand, true, minMax );
514514
}
515515

516516
//2. go through raster cells and get frequency of classes
@@ -593,7 +593,7 @@ QList< QgsRelief::ReliefColor > QgsRelief::calculateOptimizedReliefClasses()
593593

594594
if ( !minOk || !maxOk )
595595
{
596-
GDALComputeRasterMinMax( elevationBand, TRUE, minMax );
596+
GDALComputeRasterMinMax( elevationBand, true, minMax );
597597
}
598598

599599
//2. go through raster cells and get frequency of classes

src/core/auth/qgsauthcertutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef QGSAUTHCERTUTILS_H
1919
#define QGSAUTHCERTUTILS_H
2020

21+
#include <QFile>
2122
#include <QtCrypto>
2223
#include <QSslCertificate>
2324
#include <QSslError>

src/core/auth/qgsauthcrypto.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef QGSAUTHCRYPTO_H
1818
#define QGSAUTHCRYPTO_H
1919

20+
#include <QFile>
2021
#include <QString>
2122

2223
/** \ingroup core

src/gui/auth/qgsauthcertificateinfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#ifndef QGSAUTHCERTIFICATEINFO_H
1919
#define QGSAUTHCERTIFICATEINFO_H
2020

21+
#include <QFile>
22+
2123
#ifndef QT_NO_OPENSSL
2224
#include <QtCrypto>
2325
#include <QSslCertificate>

src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
733733
NULL,
734734
myGdalMemDataset,
735735
NULL,
736-
FALSE, 0.0, 1
736+
false, 0.0, 1
737737
);
738738
#if 0
739739
myWarpOptions->pTransformerArg =
@@ -845,7 +845,7 @@ void QgsGdalProvider::computeMinMax( int theBandNo ) const
845845
adfMinMax[1] = GDALGetRasterMaximum( myGdalBand, &bGotMax );
846846
if ( !( bGotMin && bGotMax ) )
847847
{
848-
GDALComputeRasterMinMax( myGdalBand, TRUE, adfMinMax );
848+
GDALComputeRasterMinMax( myGdalBand, true, adfMinMax );
849849
}
850850
mMinimum[theBandNo-1] = adfMinMax[0];
851851
mMaximum[theBandNo-1] = adfMinMax[1];
@@ -1429,7 +1429,7 @@ QgsRasterHistogram QgsGdalProvider::histogram( int theBandNo,
14291429
{
14301430
CPLErr eErr = CE_Failure;
14311431
double dfHalfBucket = 0;
1432-
eErr = GDALGetRasterStatistics( myGdalBand, TRUE, TRUE, &myMinVal, &myMaxVal, NULL, NULL );
1432+
eErr = GDALGetRasterStatistics( myGdalBand, true, true, &myMinVal, &myMaxVal, NULL, NULL );
14331433
if ( eErr != CE_None )
14341434
{
14351435
delete [] myHistogramArray;
@@ -2878,7 +2878,7 @@ QGISEXTERN QString validateCreationOptionsFormat( const QStringList& createOptio
28782878
int ok = GDALValidateCreationOptions( myGdalDriver, papszOptions );
28792879
CSLDestroy( papszOptions );
28802880

2881-
if ( ok == FALSE )
2881+
if ( !ok )
28822882
return "Failed GDALValidateCreationOptions() test";
28832883
return QString();
28842884
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Keys": [ "QOCISPATIAL8", "QOCISPATIAL" ]
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"Keys": [ "QSPATIALITE" ]
3+
}

src/server/qgsconfigparserutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef QGSCONFIGPARSERUTILS_H
1919
#define QGSCONFIGPARSERUTILS_H
2020

21+
#include <QMap>
2122
#include <QStringList>
2223

2324
class QgsCoordinateReferenceSystem;

src/server/qgsgetrequesthandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class QgsGetRequestHandler: public QgsHttpRequestHandler
2626
{
2727
public:
28-
explicit QgsGetRequestHandler( const bool captureOutput = FALSE );
28+
explicit QgsGetRequestHandler( const bool captureOutput = false );
2929
void parseInput() override;
3030
};
3131

src/server/qgshttprequesthandler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "qgsrequesthandler.h"
2424
#include <QColor>
2525
#include <QPair>
26+
#include <QHash>
2627

2728
typedef QList< QPair<QRgb, int> > QgsColorBox; //Color / number of pixels
2829
typedef QMultiMap< int, QgsColorBox > QgsColorBoxMap; // sum of pixels / color box

src/server/qgspostrequesthandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class QgsPostRequestHandler: public QgsHttpRequestHandler
2525
{
2626
public:
27-
explicit QgsPostRequestHandler( const bool captureOutput = FALSE );
27+
explicit QgsPostRequestHandler( const bool captureOutput = false );
2828
~QgsPostRequestHandler();
2929

3030
/** Parses the input and creates a request neutral Parameter/Value map*/

src/server/qgsremotedatasourcebuilder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@
2727

2828
QgsRemoteDataSourceBuilder::QgsRemoteDataSourceBuilder(): QgsMSLayerBuilder()
2929
{
30-
3130
}
3231

3332
QgsRemoteDataSourceBuilder::~QgsRemoteDataSourceBuilder()
3433
{
35-
3634
}
3735

3836
QgsMapLayer* QgsRemoteDataSourceBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList<QTemporaryFile*>& filesToRemove, QList<QgsMapLayer*>& layersToRemove, bool allowCaching ) const

src/server/qgsserver.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@
5353

5454
// Static initialisers, default values for fcgi server
5555
QgsApplication* QgsServer::mQgsApplication = NULL;
56-
bool QgsServer::mInitialised = FALSE;
56+
bool QgsServer::mInitialised = false;
5757
QString QgsServer::mServerName( "qgis_server" );
58-
bool QgsServer::mCaptureOutput = FALSE;
58+
bool QgsServer::mCaptureOutput = false;
5959
char* QgsServer::mArgv[1];
6060
int QgsServer::mArgc = 1;
6161
QString QgsServer::mConfigFilePath;
6262
QgsMapRenderer* QgsServer::mMapRenderer = NULL;
6363
QgsCapabilitiesCache* QgsServer::mCapabilitiesCache;
6464

6565
#ifdef HAVE_SERVER_PYTHON_PLUGINS
66-
bool QgsServer::mInitPython = TRUE;
66+
bool QgsServer::mInitPython = true;
6767
QgsServerInterfaceImpl* QgsServer::mServerInterface = NULL;
6868
#endif
6969

@@ -108,7 +108,7 @@ void QgsServer::setupNetworkAccessManager()
108108
* @param captureOutput
109109
* @return request instance
110110
*/
111-
QgsRequestHandler* QgsServer::createRequestHandler( const bool captureOutput /*= FALSE*/ )
111+
QgsRequestHandler* QgsServer::createRequestHandler( const bool captureOutput /*= false*/ )
112112
{
113113
QgsRequestHandler* requestHandler = 0;
114114
char* requestMethod = getenv( "REQUEST_METHOD" );
@@ -289,13 +289,13 @@ bool QgsServer::init()
289289
{
290290
if ( mInitialised )
291291
{
292-
return FALSE;
292+
return false;
293293
}
294294
mArgv[0] = mServerName.toUtf8( ).data( );
295295
mArgc = 1;
296-
mCaptureOutput = TRUE;
296+
mCaptureOutput = true;
297297
#ifdef HAVE_SERVER_PYTHON_PLUGINS
298-
mInitPython = FALSE;
298+
mInitPython = false;
299299
#endif
300300
return init( mArgc , mArgv );
301301
}
@@ -308,7 +308,7 @@ bool QgsServer::init( int & argc, char ** argv )
308308
{
309309
if ( mInitialised )
310310
{
311-
return FALSE;
311+
return false;
312312
}
313313

314314
#ifndef _MSC_VER
@@ -333,7 +333,7 @@ bool QgsServer::init( int & argc, char ** argv )
333333
QgsApplication::init();
334334
#if !defined(Q_OS_WIN)
335335
// init QGIS's paths - true means that all path will be inited from prefix
336-
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, TRUE );
336+
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, true );
337337
#endif
338338

339339
#if defined(SERVER_SKIP_ECW)
@@ -410,9 +410,9 @@ bool QgsServer::init( int & argc, char ** argv )
410410
QgsServerLogger::instance();
411411

412412
QgsEditorWidgetRegistry::initEditors();
413-
mInitialised = TRUE;
413+
mInitialised = true;
414414
QgsMessageLog::logMessage( "Server intialised", "Server", QgsMessageLog::INFO );
415-
return TRUE;
415+
return true;
416416
}
417417

418418

src/server/qgsserver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ class SERVER_EXPORT QgsServer
9696
static QFileInfo defaultAdminSLD();
9797
static void setupNetworkAccessManager();
9898
//! Create and return a request handler instance
99-
static QgsRequestHandler* createRequestHandler(
100-
const bool captureOutput = FALSE );
99+
static QgsRequestHandler* createRequestHandler( const bool captureOutput = false );
101100

102101
// Server status
103102
static QString mConfigFilePath;

src/server/qgsserverplugins.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
5858
if ( !pythonlib.load() )
5959
{
6060
QgsDebugMsg( QString( "Couldn't load Python support library: %1" ).arg( pythonlib.errorString() ) );
61-
return FALSE;
61+
return false;
6262
}
6363
}
6464

@@ -69,7 +69,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
6969
{
7070
//using stderr on purpose because we want end users to see this [TS]
7171
QgsDebugMsg( QString( "Couldn't resolve python support library's instance() symbol." ) );
72-
return FALSE;
72+
return false;
7373
}
7474

7575
QgsDebugMsg( "Python support library's instance() symbol resolved." );
@@ -83,13 +83,13 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
8383
else
8484
{
8585
QgsDebugMsg( "Python support FAILED :-(" );
86-
return FALSE;
86+
return false;
8787
}
8888

8989
//Init plugins: loads a list of installed plugins and filter them
9090
//for "server" metadata
9191
QListIterator<QString> plugins( mPythonUtils->pluginList() );
92-
bool atLeastOneEnabled = FALSE;
92+
bool atLeastOneEnabled = false;
9393
while ( plugins.hasNext() )
9494
{
9595
QString pluginName = plugins.next();
@@ -100,7 +100,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
100100
{
101101
if ( mPythonUtils->startServerPlugin( pluginName ) )
102102
{
103-
atLeastOneEnabled = TRUE;
103+
atLeastOneEnabled = true;
104104
mServerPlugins.append( pluginName );
105105
QgsMessageLog::logMessage( QString( "Server plugin %1 loaded!" ).arg( pluginName ), "Server", QgsMessageLog::INFO );
106106
}

src/server/qgssoaprequesthandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class QDomElement;
2626
class QgsSOAPRequestHandler: public QgsHttpRequestHandler
2727
{
2828
public:
29-
explicit QgsSOAPRequestHandler( const bool captureOutput = FALSE );
29+
explicit QgsSOAPRequestHandler( const bool captureOutput = false );
3030
~QgsSOAPRequestHandler();
3131
void parseInput() override;
3232
void setGetMapResponse( const QString& service, QImage* img );

0 commit comments

Comments
 (0)