qt5 fixes

This commit is contained in:
Juergen E. Fischer 2015-11-17 01:00:08 +01:00
parent a6a29825b6
commit 1675703ddb
21 changed files with 54 additions and 38 deletions

View File

@ -27,9 +27,9 @@ IF(EXISTS PYQT4_VERSION)
SET(PYQT4_FOUND TRUE)
ELSE(EXISTS PYQT4_VERSION)
FIND_FILE(_find_pyqt_py FindPyQt.py --version=4 PATHS ${CMAKE_MODULE_PATH})
FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} --version=4 OUTPUT_VARIABLE pyqt_config)
IF(pyqt_config)
STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT4_VERSION ${pyqt_config})
STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT4_VERSION_STR ${pyqt_config})

View File

@ -27,9 +27,9 @@ IF(EXISTS PYQT5_VERSION)
SET(PYQT5_FOUND TRUE)
ELSE(EXISTS PYQT5_VERSION)
FIND_FILE(_find_pyqt_py FindPyQt.py --version=5 PATHS ${CMAKE_MODULE_PATH})
FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} --version=5 OUTPUT_VARIABLE pyqt_config)
IF(pyqt_config)
STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT5_VERSION ${pyqt_config})
STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT5_VERSION_STR ${pyqt_config})

View File

@ -31,10 +31,17 @@ ELSE(EXISTS QSCI_MOD_VERSION_STR)
ENDIF(qsci_ver)
IF(QSCI_FOUND)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod4.sip
PATHS ${PYQT4_SIP_DIR}
)
IF(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod5.sip
PATHS ${PYQT5_SIP_DIR}
)
ELSE(ENABLE_QT5)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod4.sip
PATHS ${PYQT4_SIP_DIR}
)
ENDIF(ENABLE_QT5)
IF(NOT QSCI_FIND_QUIETLY)
MESSAGE(STATUS "Found QScintilla2 PyQt module: ${QSCI_MOD_VERSION_STR}")

View File

@ -104,7 +104,7 @@ INCLUDE_DIRECTORIES(
)
IF(NOT ENABLE_QT5)
SET(SIP_DISABLE_FEATURES ${SIP_DISALE_FEATURES} QT5_SUPPORT)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QT5_SUPPORT)
ENDIF(NOT ENABLE_QT5)
IF(NOT ANDROID)

0
python/PyQt/__init__.py Normal file
View File

View File

@ -510,7 +510,7 @@ bool QgsRelief::exportFrequencyDistributionToCsv( const QString& file )
if ( !minOk || !maxOk )
{
GDALComputeRasterMinMax( elevationBand, TRUE, minMax );
GDALComputeRasterMinMax( elevationBand, true, minMax );
}
//2. go through raster cells and get frequency of classes
@ -593,7 +593,7 @@ QList< QgsRelief::ReliefColor > QgsRelief::calculateOptimizedReliefClasses()
if ( !minOk || !maxOk )
{
GDALComputeRasterMinMax( elevationBand, TRUE, minMax );
GDALComputeRasterMinMax( elevationBand, true, minMax );
}
//2. go through raster cells and get frequency of classes

View File

@ -18,6 +18,7 @@
#ifndef QGSAUTHCERTUTILS_H
#define QGSAUTHCERTUTILS_H
#include <QFile>
#include <QtCrypto>
#include <QSslCertificate>
#include <QSslError>

View File

@ -17,6 +17,7 @@
#ifndef QGSAUTHCRYPTO_H
#define QGSAUTHCRYPTO_H
#include <QFile>
#include <QString>
/** \ingroup core

View File

@ -18,6 +18,8 @@
#ifndef QGSAUTHCERTIFICATEINFO_H
#define QGSAUTHCERTIFICATEINFO_H
#include <QFile>
#ifndef QT_NO_OPENSSL
#include <QtCrypto>
#include <QSslCertificate>

View File

@ -733,7 +733,7 @@ void QgsGdalProvider::readBlock( int theBandNo, QgsRectangle const & theExtent,
NULL,
myGdalMemDataset,
NULL,
FALSE, 0.0, 1
false, 0.0, 1
);
#if 0
myWarpOptions->pTransformerArg =
@ -845,7 +845,7 @@ void QgsGdalProvider::computeMinMax( int theBandNo ) const
adfMinMax[1] = GDALGetRasterMaximum( myGdalBand, &bGotMax );
if ( !( bGotMin && bGotMax ) )
{
GDALComputeRasterMinMax( myGdalBand, TRUE, adfMinMax );
GDALComputeRasterMinMax( myGdalBand, true, adfMinMax );
}
mMinimum[theBandNo-1] = adfMinMax[0];
mMaximum[theBandNo-1] = adfMinMax[1];
@ -1429,7 +1429,7 @@ QgsRasterHistogram QgsGdalProvider::histogram( int theBandNo,
{
CPLErr eErr = CE_Failure;
double dfHalfBucket = 0;
eErr = GDALGetRasterStatistics( myGdalBand, TRUE, TRUE, &myMinVal, &myMaxVal, NULL, NULL );
eErr = GDALGetRasterStatistics( myGdalBand, true, true, &myMinVal, &myMaxVal, NULL, NULL );
if ( eErr != CE_None )
{
delete [] myHistogramArray;
@ -2878,7 +2878,7 @@ QGISEXTERN QString validateCreationOptionsFormat( const QStringList& createOptio
int ok = GDALValidateCreationOptions( myGdalDriver, papszOptions );
CSLDestroy( papszOptions );
if ( ok == FALSE )
if ( !ok )
return "Failed GDALValidateCreationOptions() test";
return QString();
}

View File

@ -0,0 +1,3 @@
{
"Keys": [ "QOCISPATIAL8", "QOCISPATIAL" ]
}

View File

@ -0,0 +1,3 @@
{
"Keys": [ "QSPATIALITE" ]
}

View File

@ -18,6 +18,7 @@
#ifndef QGSCONFIGPARSERUTILS_H
#define QGSCONFIGPARSERUTILS_H
#include <QMap>
#include <QStringList>
class QgsCoordinateReferenceSystem;

View File

@ -25,7 +25,7 @@
class QgsGetRequestHandler: public QgsHttpRequestHandler
{
public:
explicit QgsGetRequestHandler( const bool captureOutput = FALSE );
explicit QgsGetRequestHandler( const bool captureOutput = false );
void parseInput() override;
};

View File

@ -23,6 +23,7 @@
#include "qgsrequesthandler.h"
#include <QColor>
#include <QPair>
#include <QHash>
typedef QList< QPair<QRgb, int> > QgsColorBox; //Color / number of pixels
typedef QMultiMap< int, QgsColorBox > QgsColorBoxMap; // sum of pixels / color box

View File

@ -24,7 +24,7 @@
class QgsPostRequestHandler: public QgsHttpRequestHandler
{
public:
explicit QgsPostRequestHandler( const bool captureOutput = FALSE );
explicit QgsPostRequestHandler( const bool captureOutput = false );
~QgsPostRequestHandler();
/** Parses the input and creates a request neutral Parameter/Value map*/

View File

@ -27,12 +27,10 @@
QgsRemoteDataSourceBuilder::QgsRemoteDataSourceBuilder(): QgsMSLayerBuilder()
{
}
QgsRemoteDataSourceBuilder::~QgsRemoteDataSourceBuilder()
{
}
QgsMapLayer* QgsRemoteDataSourceBuilder::createMapLayer( const QDomElement& elem, const QString& layerName, QList<QTemporaryFile*>& filesToRemove, QList<QgsMapLayer*>& layersToRemove, bool allowCaching ) const

View File

@ -53,9 +53,9 @@
// Static initialisers, default values for fcgi server
QgsApplication* QgsServer::mQgsApplication = NULL;
bool QgsServer::mInitialised = FALSE;
bool QgsServer::mInitialised = false;
QString QgsServer::mServerName( "qgis_server" );
bool QgsServer::mCaptureOutput = FALSE;
bool QgsServer::mCaptureOutput = false;
char* QgsServer::mArgv[1];
int QgsServer::mArgc = 1;
QString QgsServer::mConfigFilePath;
@ -63,7 +63,7 @@ QgsMapRenderer* QgsServer::mMapRenderer = NULL;
QgsCapabilitiesCache* QgsServer::mCapabilitiesCache;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
bool QgsServer::mInitPython = TRUE;
bool QgsServer::mInitPython = true;
QgsServerInterfaceImpl* QgsServer::mServerInterface = NULL;
#endif
@ -108,7 +108,7 @@ void QgsServer::setupNetworkAccessManager()
* @param captureOutput
* @return request instance
*/
QgsRequestHandler* QgsServer::createRequestHandler( const bool captureOutput /*= FALSE*/ )
QgsRequestHandler* QgsServer::createRequestHandler( const bool captureOutput /*= false*/ )
{
QgsRequestHandler* requestHandler = 0;
char* requestMethod = getenv( "REQUEST_METHOD" );
@ -289,13 +289,13 @@ bool QgsServer::init()
{
if ( mInitialised )
{
return FALSE;
return false;
}
mArgv[0] = mServerName.toUtf8( ).data( );
mArgc = 1;
mCaptureOutput = TRUE;
mCaptureOutput = true;
#ifdef HAVE_SERVER_PYTHON_PLUGINS
mInitPython = FALSE;
mInitPython = false;
#endif
return init( mArgc , mArgv );
}
@ -308,7 +308,7 @@ bool QgsServer::init( int & argc, char ** argv )
{
if ( mInitialised )
{
return FALSE;
return false;
}
#ifndef _MSC_VER
@ -333,7 +333,7 @@ bool QgsServer::init( int & argc, char ** argv )
QgsApplication::init();
#if !defined(Q_OS_WIN)
// init QGIS's paths - true means that all path will be inited from prefix
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, TRUE );
QgsApplication::setPrefixPath( CMAKE_INSTALL_PREFIX, true );
#endif
#if defined(SERVER_SKIP_ECW)
@ -410,9 +410,9 @@ bool QgsServer::init( int & argc, char ** argv )
QgsServerLogger::instance();
QgsEditorWidgetRegistry::initEditors();
mInitialised = TRUE;
mInitialised = true;
QgsMessageLog::logMessage( "Server intialised", "Server", QgsMessageLog::INFO );
return TRUE;
return true;
}

View File

@ -96,8 +96,7 @@ class SERVER_EXPORT QgsServer
static QFileInfo defaultAdminSLD();
static void setupNetworkAccessManager();
//! Create and return a request handler instance
static QgsRequestHandler* createRequestHandler(
const bool captureOutput = FALSE );
static QgsRequestHandler* createRequestHandler( const bool captureOutput = false );
// Server status
static QString mConfigFilePath;

View File

@ -58,7 +58,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
if ( !pythonlib.load() )
{
QgsDebugMsg( QString( "Couldn't load Python support library: %1" ).arg( pythonlib.errorString() ) );
return FALSE;
return false;
}
}
@ -69,7 +69,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
{
//using stderr on purpose because we want end users to see this [TS]
QgsDebugMsg( QString( "Couldn't resolve python support library's instance() symbol." ) );
return FALSE;
return false;
}
QgsDebugMsg( "Python support library's instance() symbol resolved." );
@ -83,13 +83,13 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
else
{
QgsDebugMsg( "Python support FAILED :-(" );
return FALSE;
return false;
}
//Init plugins: loads a list of installed plugins and filter them
//for "server" metadata
QListIterator<QString> plugins( mPythonUtils->pluginList() );
bool atLeastOneEnabled = FALSE;
bool atLeastOneEnabled = false;
while ( plugins.hasNext() )
{
QString pluginName = plugins.next();
@ -100,7 +100,7 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
{
if ( mPythonUtils->startServerPlugin( pluginName ) )
{
atLeastOneEnabled = TRUE;
atLeastOneEnabled = true;
mServerPlugins.append( pluginName );
QgsMessageLog::logMessage( QString( "Server plugin %1 loaded!" ).arg( pluginName ), "Server", QgsMessageLog::INFO );
}

View File

@ -26,7 +26,7 @@ class QDomElement;
class QgsSOAPRequestHandler: public QgsHttpRequestHandler
{
public:
explicit QgsSOAPRequestHandler( const bool captureOutput = FALSE );
explicit QgsSOAPRequestHandler( const bool captureOutput = false );
~QgsSOAPRequestHandler();
void parseInput() override;
void setGetMapResponse( const QString& service, QImage* img );