Skip to content
Permalink
Browse files
mark static methods as such
  • Loading branch information
3nids authored and nyalldawson committed Sep 28, 2018
1 parent 94b1082 commit f58cc381153793e2b95b612adfe3ce436d8b449e
Showing with 18 additions and 18 deletions.
  1. +7 −7 src/quickgui/qgsquickutils.cpp
  2. +11 −11 src/quickgui/qgsquickutils.h
@@ -43,17 +43,17 @@ QgsCoordinateReferenceSystem QgsQuickUtils::coordinateReferenceSystemFromEpsgId(
return QgsCoordinateReferenceSystem::fromEpsgId( epsg );
}

QgsPointXY QgsQuickUtils::pointXY( double x, double y ) const
QgsPointXY QgsQuickUtils::pointXY( double x, double y )
{
return QgsPointXY( x, y );
}

QgsPoint QgsQuickUtils::point( double x, double y, double z, double m ) const
QgsPoint QgsQuickUtils::point( double x, double y, double z, double m )
{
return QgsPoint( x, y, z, m );
}

QgsPoint QgsQuickUtils::coordinateToPoint( const QGeoCoordinate &coor ) const
QgsPoint QgsQuickUtils::coordinateToPoint( const QGeoCoordinate &coor )
{
return QgsPoint( coor.longitude(), coor.latitude(), coor.altitude() );
}
@@ -85,14 +85,14 @@ double QgsQuickUtils::screenUnitsToMeters( QgsQuickMapSettings *mapSettings, int
return mDistanceArea.measureLine( p1, p2 );
}

bool QgsQuickUtils::fileExists( const QString &path ) const
bool QgsQuickUtils::fileExists( const QString &path )
{
QFileInfo check_file( path );
// check if file exists and if yes: Is it really a file and no directory?
return ( check_file.exists() && check_file.isFile() );
}

QString QgsQuickUtils::getFileName( const QString &path ) const
QString QgsQuickUtils::getFileName( const QString &path )
{
QFileInfo fileInfo( path );
QString filename( fileInfo.fileName() );
@@ -104,12 +104,12 @@ void QgsQuickUtils::logMessage( const QString &message, const QString &tag, Qgis
QgsMessageLog::logMessage( message, tag, level );
}

QgsQuickFeatureLayerPair QgsQuickUtils::featureFactory( const QgsFeature &feature, QgsVectorLayer *layer ) const
QgsQuickFeatureLayerPair QgsQuickUtils::featureFactory( const QgsFeature &feature, QgsVectorLayer *layer )
{
return QgsQuickFeatureLayerPair( feature, layer );
}

const QUrl QgsQuickUtils::getThemeIcon( const QString &name ) const
const QUrl QgsQuickUtils::getThemeIcon( const QString &name )
{
QString path = QStringLiteral( "qrc:/%1.svg" ).arg( name );
QgsDebugMsg( QStringLiteral( "Using icon %1 from %2" ).arg( name, path ) );
@@ -86,21 +86,21 @@ class QUICK_EXPORT QgsQuickUtils: public QObject
*
* \since QGIS 3.4
*/
Q_INVOKABLE QgsPointXY pointXY( double x, double y ) const;
Q_INVOKABLE static QgsPointXY pointXY( double x, double y );

/**
* Creates QgsPoint in QML
*
* \since QGIS 3.4
*/
Q_INVOKABLE QgsPoint point( double x, double y, double z = std::numeric_limits<double>::quiet_NaN(), double m = std::numeric_limits<double>::quiet_NaN() ) const;
Q_INVOKABLE static QgsPoint point( double x, double y, double z = std::numeric_limits<double>::quiet_NaN(), double m = std::numeric_limits<double>::quiet_NaN() );

/**
* Converts QGeoCoordinate to QgsPoint
*
* \since QGIS 3.4
*/
Q_INVOKABLE QgsPoint coordinateToPoint( const QGeoCoordinate &coor ) const;
Q_INVOKABLE static QgsPoint coordinateToPoint( const QGeoCoordinate &coor );

/**
* Transforms point between different crs from QML
@@ -121,20 +121,20 @@ class QUICK_EXPORT QgsQuickUtils: public QObject
* Returns whether file on path exists
* \since QGIS 3.4
*/
Q_INVOKABLE bool fileExists( const QString &path ) const;
Q_INVOKABLE static bool fileExists( const QString &path );

/**
* Extracts filename from path
* \since QGIS 3.4
*/
Q_INVOKABLE QString getFileName( const QString &path ) const;
Q_INVOKABLE static QString getFileName( const QString &path );

/**
* Log message in QgsMessageLog
*/
Q_INVOKABLE void logMessage( const QString &message,
const QString &tag = QString( "QgsQuick" ),
Qgis::MessageLevel level = Qgis::Warning );
Q_INVOKABLE static void logMessage( const QString &message,
const QString &tag = QString( "QgsQuick" ),
Qgis::MessageLevel level = Qgis::Warning );

/**
* QgsQuickFeatureLayerPair factory for tuple of QgsFeature and QgsVectorLayer used in QgsQUick library.
@@ -143,14 +143,14 @@ class QUICK_EXPORT QgsQuickUtils: public QObject
*
* \since QGIS 3.4
*/
Q_INVOKABLE QgsQuickFeatureLayerPair featureFactory( const QgsFeature &feature, QgsVectorLayer *layer = nullptr ) const;
Q_INVOKABLE static QgsQuickFeatureLayerPair featureFactory( const QgsFeature &feature, QgsVectorLayer *layer = nullptr );

/**
* Returns QUrl to image from library's /images folder.
*
* \since QGIS 3.4
*/
Q_INVOKABLE const QUrl getThemeIcon( const QString &name ) const;
Q_INVOKABLE static const QUrl getThemeIcon( const QString &name );

/**
* Returns url to field editor component for a feature form.
@@ -159,7 +159,7 @@ class QUICK_EXPORT QgsQuickUtils: public QObject
*
* \since QGIS 3.4
*/
Q_INVOKABLE const QUrl getEditorComponentSource( const QString &widgetName );
Q_INVOKABLE static const QUrl getEditorComponentSource( const QString &widgetName );

/**
* \copydoc QgsCoordinateFormatter::format()

0 comments on commit f58cc38

Please sign in to comment.