sipify batch

* QgsBearingUtils
    * QgsBrowserModel
    * QgsColorScheme, QgsColorSchemeRegistry
    * QgsContextHelp
    * QgsCoordinateReferenceSystem
    * QgsCoordinateTransform
    * QgsFeedback
This commit is contained in:
Denis Rouzaud 2017-04-24 08:48:57 +02:00
parent 6e7b753ceb
commit 10d34ece02
16 changed files with 1383 additions and 994 deletions

View File

@ -2,13 +2,6 @@ core/conversions.sip
core/qgsexception.sip
core/qgis.sip
core/qgsapplication.sip
core/qgsbearingutils.sip
core/qgsbrowsermodel.sip
core/qgscolorscheme.sip
core/qgscolorschemeregistry.sip
core/qgscontexthelp.sip
core/qgscoordinatereferencesystem.sip
core/qgscoordinatetransform.sip
core/qgscredentials.sip
core/qgscrscache.sip
core/qgsdataitem.sip
@ -28,7 +21,6 @@ core/qgsexpressioncontextgenerator.sip
core/qgsfeaturefilterprovider.sip
core/qgsfeatureiterator.sip
core/qgsfeaturerequest.sip
core/qgsfeedback.sip
core/qgsfield.sip
core/qgsfieldconstraints.sip
core/qgsfields.sip

View File

@ -1,21 +1,42 @@
/**
* \class QgsBearingUtils
* \ingroup core
* Utilities for calculating bearings and directions.
* \note Added in version 2.18
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsbearingutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsBearingUtils
{
%Docstring
Utilities for calculating bearings and directions.
.. versionadded:: 2.18
%End
%TypeHeaderCode
#include <qgsbearingutils.h>
#include "qgsbearingutils.h"
%End
public:
/**
* Returns the direction to true north from a specified point and for a specified
* coordinate reference system. The returned value is in degrees clockwise from
* vertical. An exception will be thrown if the bearing could not be calculated.
*/
static double bearingTrueNorth( const QgsCoordinateReferenceSystem& crs,
const QgsPoint& point );
static double bearingTrueNorth( const QgsCoordinateReferenceSystem &crs,
const QgsPoint &point );
%Docstring
Returns the direction to true north from a specified point and for a specified
coordinate reference system. The returned value is in degrees clockwise from
vertical. An exception will be thrown if the bearing could not be calculated.
:rtype: float
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsbearingutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,121 +1,191 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsbrowsermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsBrowserModel : QAbstractItemModel
{
%TypeHeaderCode
#include <qgsbrowsermodel.h>
%End
%TypeHeaderCode
#include "qgsbrowsermodel.h"
%End
public:
explicit QgsBrowserModel( QObject *parent = 0 );
~QgsBrowserModel();
enum ItemDataRole
{
PathRole, /*!< Item path used to access path in the tree, see QgsDataItem::mPath */
CommentRole, /*!< Item comment */
PathRole
CommentRole
};
// implemented methods from QAbstractItemModel for read-only access
/** Used by other components to obtain information about each item provided by the model.
In many models, the combination of flags should include Qt::ItemIsEnabled and Qt::ItemIsSelectable. */
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
%Docstring
Used by other components to obtain information about each item provided by the model.
In many models, the combination of flags should include Qt.ItemIsEnabled and Qt.ItemIsSelectable. *
:rtype: Qt.ItemFlags
%End
/** Used to supply item data to views and delegates. Generally, models only need to supply data
for Qt::DisplayRole and any application-specific user roles, but it is also good practice
to provide data for Qt::ToolTipRole, Qt::AccessibleTextRole, and Qt::AccessibleDescriptionRole.
See the Qt::ItemDataRole enum documentation for information about the types associated with each role. */
virtual QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const;
%Docstring
Used to supply item data to views and delegates. Generally, models only need to supply data
for Qt.DisplayRole and any application-specific user roles, but it is also good practice
to provide data for Qt.ToolTipRole, Qt.AccessibleTextRole, and Qt.AccessibleDescriptionRole.
See the Qt.ItemDataRole enum documentation for information about the types associated with each role. *
:rtype: QVariant
%End
/** Provides views with information to show in their headers. The information is only retrieved
by views that can display header information. */
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
%Docstring
Provides views with information to show in their headers. The information is only retrieved
by views that can display header information. *
:rtype: QVariant
%End
/** Provides the number of rows of data exposed by the model. */
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
%Docstring
Provides the number of rows of data exposed by the model.
:rtype: int
%End
/** Provides the number of columns of data exposed by the model. List models do not provide this function
because it is already implemented in QAbstractListModel. */
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
%Docstring
Provides the number of columns of data exposed by the model. List models do not provide this function
because it is already implemented in QAbstractListModel. *
:rtype: int
%End
/** Returns the index of the item in the model specified by the given row, column and parent index. */
virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
%Docstring
Returns the index of the item in the model specified by the given row, column and parent index.
:rtype: QModelIndex
%End
QModelIndex findItem( QgsDataItem *item, QgsDataItem *parent = 0 ) const;
%Docstring
:rtype: QModelIndex
%End
/** Returns the parent of the model item with the given index.
* If the item has no parent, an invalid QModelIndex is returned.
*/
virtual QModelIndex parent( const QModelIndex &index ) const;
%Docstring
Returns the parent of the model item with the given index.
If the item has no parent, an invalid QModelIndex is returned.
:rtype: QModelIndex
%End
/** Returns a list of mime that can describe model indexes */
virtual QStringList mimeTypes() const;
%Docstring
Returns a list of mime that can describe model indexes
:rtype: list of str
%End
/** Returns an object that contains serialized items of data corresponding to the list of indexes specified */
virtual QMimeData * mimeData( const QModelIndexList &indexes ) const;
virtual QMimeData *mimeData( const QModelIndexList &indexes ) const;
%Docstring
Returns an object that contains serialized items of data corresponding to the list of indexes specified
:rtype: QMimeData
%End
/** Handles the data supplied by a drag and drop operation that ended with the given action */
virtual bool dropMimeData( const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent );
virtual bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent );
%Docstring
Handles the data supplied by a drag and drop operation that ended with the given action
:rtype: bool
%End
QgsDataItem *dataItem( const QModelIndex &idx ) const;
%Docstring
:rtype: QgsDataItem
%End
bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
virtual bool hasChildren( const QModelIndex &parent = QModelIndex() ) const;
//! Refresh item specified by path
void refresh( const QString& path );
//! Refresh item children
void refresh( const QString &path );
%Docstring
Refresh item specified by path
%End
void refresh( const QModelIndex &index = QModelIndex() );
%Docstring
Refresh item children
%End
/** Return index of item with given path. It only searches in currently fetched
* items, i.e. it does not fetch children.
* @param path item path
* @param matchFlag supported is Qt::MatchExactly and Qt::MatchStartsWith which has reverse meaning, i.e. find
* item with the longest match from start with path (to get as close/deep as possible to deleted item).
* @return model index, invalid if item not found */
QModelIndex findPath( const QString& path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
QModelIndex findPath( const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
%Docstring
Return index of item with given path. It only searches in currently fetched
items, i.e. it does not fetch children.
\param path item path
\param matchFlag supported is Qt.MatchExactly and Qt.MatchStartsWith which has reverse meaning, i.e. find
item with the longest match from start with path (to get as close/deep as possible to deleted item).
:return: model index, invalid if item not found *
:rtype: QModelIndex
%End
//! @note not available in python bindings
// static QModelIndex findPath( QAbstractItemModel *model, const QString& path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
void connectItem( QgsDataItem *item );
bool canFetchMore( const QModelIndex & parent ) const;
void fetchMore( const QModelIndex & parent );
virtual bool canFetchMore( const QModelIndex &parent ) const;
virtual void fetchMore( const QModelIndex &parent );
signals:
/** Emitted when item children fetch was finished */
void stateChanged( const QModelIndex & index, QgsDataItem::State oldState );
void stateChanged( const QModelIndex &index, QgsDataItem::State oldState );
%Docstring
Emitted when item children fetch was finished
%End
public slots:
//! Reload the whole model
void reload();
%Docstring
Reload the whole model
%End
void beginInsertItems( QgsDataItem *parent, int first, int last );
void endInsertItems();
void beginRemoveItems( QgsDataItem *parent, int first, int last );
void endRemoveItems();
void itemDataChanged( QgsDataItem * item );
void itemStateChanged( QgsDataItem * item, QgsDataItem::State oldState );
void itemDataChanged( QgsDataItem *item );
void itemStateChanged( QgsDataItem *item, QgsDataItem::State oldState );
/**
* Adds a directory to the favorites group.
* @note added in QGIS 3.0
* @see removeFavorite()
*/
void addFavoriteDirectory( const QString& directory );
void addFavoriteDirectory( const QString &directory );
%Docstring
Adds a directory to the favorites group.
.. versionadded:: 3.0
\see removeFavorite()
%End
/**
* Removes a favorite directory from its corresponding model index.
* @note added in QGIS 3.0
* @see addFavoriteDirectory()
*/
void removeFavorite( const QModelIndex &index );
%Docstring
Removes a favorite directory from its corresponding model index.
.. versionadded:: 3.0
\see addFavoriteDirectory()
%End
void updateProjectHome();
/** Hide the given path in the browser model */
void hidePath( QgsDataItem *item );
%Docstring
Hide the given path in the browser model
%End
protected:
//! Populates the model
void addRootItems();
%Docstring
Populates the model
%End
void removeRootItems();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsbrowsermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,115 +1,137 @@
/** List of colors paired with a friendly display name identifying the color*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscolorscheme.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
typedef QList< QPair< QColor, QString > > QgsNamedColorList;
/** \ingroup core
* \class QgsColorScheme
* \brief Abstract base class for color schemes
*
* A color scheme for display in QgsColorButton. Color schemes return lists
* of colors with an optional associated color name. The colors returned
* can be generated using an optional base color.
* \note Added in version 2.5
*/
class QgsColorScheme
{
%Docstring
Abstract base class for color schemes
A color scheme for display in QgsColorButton. Color schemes return lists
of colors with an optional associated color name. The colors returned
can be generated using an optional base color.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include <qgscolorscheme.h>
#include "qgscolorscheme.h"
%End
%ConvertToSubClassCode
if (dynamic_cast<QgsUserColorScheme*>(sipCpp) != NULL)
sipType = sipType_QgsUserColorScheme;
else if (dynamic_cast<QgsRecentColorScheme*>(sipCpp) != NULL)
sipType = sipType_QgsRecentColorScheme;
else if (dynamic_cast<QgsCustomColorScheme*>(sipCpp) != NULL)
sipType = sipType_QgsCustomColorScheme;
else if (dynamic_cast<QgsProjectColorScheme*>(sipCpp) != NULL)
sipType = sipType_QgsProjectColorScheme;
else if (dynamic_cast<QgsGplColorScheme*>(sipCpp) != NULL)
sipType = sipType_QgsGplColorScheme;
else
sipType = sipType_QgsColorScheme;
if ( dynamic_cast<QgsUserColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsUserColorScheme;
else if ( dynamic_cast<QgsRecentColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsRecentColorScheme;
else if ( dynamic_cast<QgsCustomColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsCustomColorScheme;
else if ( dynamic_cast<QgsProjectColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsProjectColorScheme;
else if ( dynamic_cast<QgsGplColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsGplColorScheme;
else
sipType = sipType_QgsColorScheme;
%End
public:
/** Flags for controlling behavior of color scheme
*/
enum SchemeFlag
{
ShowInColorDialog, /*!< show scheme in color picker dialog */
ShowInColorButtonMenu, /*!< show scheme in color button drop down menu */
ShowInAllContexts /*!< show scheme in all contexts */
ShowInColorDialog,
ShowInColorButtonMenu,
ShowInAllContexts
};
typedef QFlags<QgsColorScheme::SchemeFlag> SchemeFlags;
QgsColorScheme();
%Docstring
Constructor for QgsColorScheme.
%End
virtual ~QgsColorScheme();
/** Gets the name for the color scheme
* @returns color scheme name
*/
virtual QString schemeName() const = 0;
%Docstring
Gets the name for the color scheme
:return: color scheme name
:rtype: str
%End
/** Returns the current flags for the color scheme.
* @returns current flags
*/
virtual SchemeFlags flags() const;
%Docstring
Returns the current flags for the color scheme.
:return: current flags
:rtype: SchemeFlags
%End
/** Gets a list of colors from the scheme. The colors can optionally
* be generated using the supplied context and base color.
* @param context string specifying an optional context for the returned
* colors. For instance, a "recent colors" scheme may filter returned colors
* by context so that colors used only in a "composer" context are returned.
* @param baseColor base color for the scheme's colors. Some color schemes
* may take advantage of this to filter or modify their returned colors
* to colors related to the base color.
* @returns a list of QPairs of color and color name
*/
virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor &baseColor = QColor() ) = 0;
%Docstring
Gets a list of colors from the scheme. The colors can optionally
be generated using the supplied context and base color.
\param context string specifying an optional context for the returned
colors. For instance, a "recent colors" scheme may filter returned colors
by context so that colors used only in a "composer" context are returned.
\param baseColor base color for the scheme's colors. Some color schemes
may take advantage of this to filter or modify their returned colors
to colors related to the base color.
:return: a list of QPairs of color and color name
:rtype: QgsNamedColorList
%End
/** Returns whether the color scheme is editable
* @returns true if scheme is editable
* @see setColors
*/
virtual bool isEditable() const;
%Docstring
Returns whether the color scheme is editable
:return: true if scheme is editable
\see setColors
:rtype: bool
%End
/** Sets the colors for the scheme. This method is only valid for editable color schemes.
* @param colors list of colors for the scheme
* @param context to set colors for
* @param baseColor base color to set colors for
* @returns true if colors were set successfully
* @see isEditable
*/
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
%Docstring
Sets the colors for the scheme. This method is only valid for editable color schemes.
\param colors list of colors for the scheme
\param context to set colors for
\param baseColor base color to set colors for
:return: true if colors were set successfully
\see isEditable
:rtype: bool
%End
/** Clones a color scheme
* @returns copy of color scheme
*/
virtual QgsColorScheme* clone() const = 0 /Factory/;
}; // class QgsColorScheme
virtual QgsColorScheme *clone() const = 0 /Factory/;
%Docstring
Clones a color scheme
:return: copy of color scheme
:rtype: QgsColorScheme
%End
};
QFlags<QgsColorScheme::SchemeFlag> operator|(QgsColorScheme::SchemeFlag f1, QFlags<QgsColorScheme::SchemeFlag> f2);
/** \ingroup core
* \class QgsGplColorScheme
* \brief A color scheme which stores its colors in a gpl palette file.
* \note Added in version 2.5
*/
class QgsGplColorScheme : QgsColorScheme
{
%TypeHeaderCode
#include <qgscolorscheme.h>
%Docstring
A color scheme which stores its colors in a gpl palette file.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include "qgscolorscheme.h"
%End
public:
QgsGplColorScheme();
virtual ~QgsGplColorScheme();
virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor &baseColor = QColor() );
@ -117,81 +139,84 @@ class QgsGplColorScheme : QgsColorScheme
protected:
/** Returns the file path for the associated gpl palette file
* @returns gpl file path
*/
virtual QString gplFilePath() = 0;
%Docstring
Returns the file path for the associated gpl palette file
:return: gpl file path
:rtype: str
%End
};
/** \ingroup core
* \class QgsUserColorScheme
* \brief A color scheme which stores its colors in a gpl palette file within the "palettes"
* subfolder off the user's QGIS settings folder.
* \note Added in version 2.5
*/
class QgsUserColorScheme : QgsGplColorScheme
{
%TypeHeaderCode
#include <qgscolorscheme.h>
%Docstring
A color scheme which stores its colors in a gpl palette file within the "palettes"
subfolder off the user's QGIS settings folder.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include "qgscolorscheme.h"
%End
public:
/** Constructs a new user color scheme, using a specified gpl palette file
* @param filename filename of gpl palette file stored in the users "palettes" folder
*/
QgsUserColorScheme( const QString &filename );
virtual ~QgsUserColorScheme();
%Docstring
Constructs a new user color scheme, using a specified gpl palette file
\param filename filename of gpl palette file stored in the users "palettes" folder
%End
virtual QString schemeName() const;
virtual QgsUserColorScheme* clone() const /Factory/;
virtual QgsUserColorScheme *clone() const /Factory/;
virtual bool isEditable() const;
virtual QgsColorScheme::SchemeFlags flags() const;
/** Sets the name for the scheme
* @param name new name
*/
void setName( const QString &name );
%Docstring
Sets the name for the scheme
\param name new name
%End
/** Erases the associated gpl palette file from the users "palettes" folder
* @returns true if erase was successful
*/
bool erase();
%Docstring
Erases the associated gpl palette file from the users "palettes" folder
:return: true if erase was successful
:rtype: bool
%End
/** Sets whether a this scheme should be shown in color button menus.
* @param show set to true to show in color button menus, or false to hide from menus
* @note added in QGIS 3.0
*/
void setShowSchemeInMenu( bool show );
%Docstring
Sets whether a this scheme should be shown in color button menus.
\param show set to true to show in color button menus, or false to hide from menus
.. versionadded:: 3.0
%End
protected:
virtual QString gplFilePath();
};
/** \ingroup core
* \class QgsRecentColorScheme
* \brief A color scheme which contains the most recently used colors.
* \note Added in version 2.5
*/
class QgsRecentColorScheme : QgsColorScheme
{
%TypeHeaderCode
#include <qgscolorscheme.h>
%Docstring
A color scheme which contains the most recently used colors.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include "qgscolorscheme.h"
%End
public:
QgsRecentColorScheme();
virtual ~QgsRecentColorScheme();
virtual QString schemeName() const;
virtual SchemeFlags flags() const;
@ -199,39 +224,40 @@ class QgsRecentColorScheme : QgsColorScheme
virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor &baseColor = QColor() );
virtual QgsRecentColorScheme* clone() const /Factory/;
virtual QgsRecentColorScheme *clone() const /Factory/;
/** Adds a color to the list of recent colors.
* @param color color to add
* @note added in QGIS 2.14
* @see lastUsedColor()
*/
static void addRecentColor( const QColor& color );
/** Returns the most recently used color.
* @note added in QGIS 3.0
* @see addRecentColor()
*/
static QColor lastUsedColor();
};
/** \ingroup core
* \class QgsCustomColorScheme
* \brief A color scheme which contains custom colors set through QGIS app options dialog.
* \note Added in version 2.5
*/
class QgsCustomColorScheme : QgsColorScheme
{
%TypeHeaderCode
#include <qgscolorscheme.h>
static void addRecentColor( const QColor &color );
%Docstring
Adds a color to the list of recent colors.
\param color color to add
.. versionadded:: 2.14
\see lastUsedColor()
%End
static QColor lastUsedColor();
%Docstring
Returns the most recently used color.
.. versionadded:: 3.0
\see addRecentColor()
:rtype: QColor
%End
};
class QgsCustomColorScheme : QgsColorScheme
{
%Docstring
A color scheme which contains custom colors set through QGIS app options dialog.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include "qgscolorscheme.h"
%End
public:
QgsCustomColorScheme();
virtual ~QgsCustomColorScheme();
virtual QString schemeName() const;
virtual SchemeFlags flags() const;
@ -243,25 +269,24 @@ class QgsCustomColorScheme : QgsColorScheme
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
virtual QgsCustomColorScheme* clone() const /Factory/;
virtual QgsCustomColorScheme *clone() const /Factory/;
};
/** \ingroup core
* \class QgsProjectColorScheme
* \brief A color scheme which contains project specific colors set through project properties dialog.
* \note Added in version 2.5
*/
class QgsProjectColorScheme : QgsColorScheme
{
%Docstring
A color scheme which contains project specific colors set through project properties dialog.
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include <qgscolorscheme.h>
#include "qgscolorscheme.h"
%End
public:
QgsProjectColorScheme();
virtual ~QgsProjectColorScheme();
virtual QString schemeName() const;
virtual SchemeFlags flags() const;
@ -273,5 +298,14 @@ class QgsProjectColorScheme : QgsColorScheme
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() );
virtual QgsProjectColorScheme* clone() const /Factory/;
virtual QgsProjectColorScheme *clone() const /Factory/;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscolorscheme.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,74 +1,102 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscolorschemeregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** \ingroup core
* \class QgsColorSchemeRegistry
* \brief Registry of color schemes
*
* A registry of QgsColorScheme color schemes. This class can be created directly, or
* accessed via a global instance.
* \note Added in version 2.5
*/
class QgsColorSchemeRegistry
{
%Docstring
Registry of color schemes
A registry of QgsColorScheme color schemes. This class can be created directly, or
accessed via a QgsApplication.colorSchemeRegistry().
.. versionadded:: 2.5
%End
%TypeHeaderCode
#include <qgscolorschemeregistry.h>
#include "qgscolorschemeregistry.h"
%End
public:
/** Constructor for an empty color scheme registry
*/
QgsColorSchemeRegistry();
%Docstring
Constructor for an empty color scheme registry
%End
virtual ~QgsColorSchemeRegistry();
/** Adds all color schemes from the global instance to this color scheme.
* @see addDefaultSchemes
* @see addColorScheme
*/
void populateFromInstance();
%Docstring
Adds all color schemes from the global instance to this color scheme.
\see addDefaultSchemes
\see addColorScheme
%End
/** Adds all default color schemes to this color scheme.
* @see populateFromInstance
* @see addColorScheme
* @see addUserSchemes
*/
void addDefaultSchemes();
%Docstring
Adds all default color schemes to this color scheme.
\see populateFromInstance
\see addColorScheme
\see addUserSchemes
%End
/** Creates schemes for all gpl palettes in the user's palettes folder.
* @see populateFromInstance
* @see addDefaultSchemes
* @see addColorScheme
*/
void addUserSchemes();
%Docstring
Creates schemes for all gpl palettes in the user's palettes folder.
\see populateFromInstance
\see addDefaultSchemes
\see addColorScheme
%End
/** Adds a color scheme to the registry. Ownership of the scheme is transferred
* to the registry.
* @param scheme color scheme to add
* @see populateFromInstance
* @see removeColorScheme
*/
void addColorScheme( QgsColorScheme* scheme /Transfer/ );
void addColorScheme( QgsColorScheme *scheme /Transfer/ );
%Docstring
Adds a color scheme to the registry. Ownership of the scheme is transferred
to the registry.
\param scheme color scheme to add
\see populateFromInstance
\see removeColorScheme
%End
/** Removes all matching color schemes from the registry
* @param scheme color scheme to remove
* @returns true if scheme was found and removed
* @see addColorScheme
*/
bool removeColorScheme( QgsColorScheme* scheme );
bool removeColorScheme( QgsColorScheme *scheme );
%Docstring
Removes all matching color schemes from the registry
\param scheme color scheme to remove
:return: true if scheme was found and removed
\see addColorScheme
:rtype: bool
%End
/** Returns all color schemes in the registry
* @returns list of color schemes
*/
QList<QgsColorScheme *> schemes() const;
%Docstring
Returns all color schemes in the registry
:return: list of color schemes
:rtype: list of QgsColorScheme
%End
/** Returns all color schemes in the registry which have a specified flag set
* @param flag flag to match
* @returns list of color schemes with flag set
*/
QList<QgsColorScheme *> schemes( const QgsColorScheme::SchemeFlag flag ) const;
%Docstring
Returns all color schemes in the registry which have a specified flag set
\param flag flag to match
:return: list of color schemes with flag set
:rtype: list of QgsColorScheme
%End
/** Return color schemes of a specific type
* @param schemeList destination list for matching schemes
* @note not available in python bindings
*/
// template<class T> void schemes( QList<T*>& schemeList );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscolorschemeregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,23 +1,41 @@
/** \ingroup core
* Provides a context based help browser for a dialog.
*
* The help text is stored in SQLite and accessed by a context identifier
* unique to each dialog. This is a singleton class which invokes the help
* viewer using QProcess and ensures that only one viewer is open.
* The viewer will be terminated if open when the main application quits.
*
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscontexthelp.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsContextHelp : QObject
{
%Docstring
Provides a context based help browser for a dialog.
The help text is stored in SQLite and accessed by a context identifier
unique to each dialog. This is a singleton class which invokes the help
viewer using QProcess and ensures that only one viewer is open.
The viewer will be terminated if open when the main application quits.
%End
%TypeHeaderCode
#include <qgscontexthelp.h>
#include "qgscontexthelp.h"
%End
public:
static void run( const QString& context );
static void run( const QString &context );
private:
//! Constructor
QgsContextHelp();
//! Destructor
~QgsContextHelp();
QgsContextHelp() ;
private:
~QgsContextHelp() ;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscontexthelp.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

File diff suppressed because it is too large Load Diff

View File

@ -1,240 +1,248 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinatetransform.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** \ingroup core
* Class for doing transforms between two map coordinate systems.
*
* This class can convert map coordinates to a different coordinate reference system.
* It is normally associated with a map layer and is used to transform between the
* layer's coordinate system and the coordinate system of the map canvas, although
* it can be used in a more general sense to transform coordinates.
*
* When used to transform between a layer and the map canvas, all references to source
* and destination coordinate systems refer to layer and map canvas respectively. All
* operations are from the perspective of the layer. For example, a forward transformation
* transforms coordinates from the layer's coordinate system to the map canvas.
* \note Since QGIS 3.0 QgsCoordinateReferenceSystem objects are implicitly shared.
*/
class QgsCoordinateTransform
{
%TypeHeaderCode
#include <qgscoordinatetransform.h>
%Docstring
Class for doing transforms between two map coordinate systems.
This class can convert map coordinates to a different coordinate reference system.
It is normally associated with a map layer and is used to transform between the
layer's coordinate system and the coordinate system of the map canvas, although
it can be used in a more general sense to transform coordinates.
When used to transform between a layer and the map canvas, all references to source
and destination coordinate systems refer to layer and map canvas respectively. All
operations are from the perspective of the layer. For example, a forward transformation
transforms coordinates from the layer's coordinate system to the map canvas.
.. note::
Since QGIS 3.0 QgsCoordinateReferenceSystem objects are implicitly shared.
%End
%TypeHeaderCode
#include "qgscoordinatetransform.h"
%End
public:
//! Enum used to indicate the direction (forward or inverse) of the transform
enum TransformDirection
{
ForwardTransform, /*!< Transform from source to destination CRS. */
ReverseTransform /*!< Transform from destination to source CRS. */
ForwardTransform,
ReverseTransform
};
/** Default constructor, creates an invalid QgsCoordinateTransform. */
QgsCoordinateTransform();
%Docstring
Default constructor, creates an invalid QgsCoordinateTransform.
%End
/** Constructs a QgsCoordinateTransform using QgsCoordinateReferenceSystem objects.
* @param source source CRS, typically of the layer's coordinate system
* @param destination CRS, typically of the map canvas coordinate system
*/
QgsCoordinateTransform( const QgsCoordinateReferenceSystem& source,
const QgsCoordinateReferenceSystem& destination );
QgsCoordinateTransform( const QgsCoordinateReferenceSystem &source,
const QgsCoordinateReferenceSystem &destination );
%Docstring
Constructs a QgsCoordinateTransform using QgsCoordinateReferenceSystem objects.
\param source source CRS, typically of the layer's coordinate system
\param destination CRS, typically of the map canvas coordinate system
%End
QgsCoordinateTransform( const QgsCoordinateTransform &o );
%Docstring
Copy constructor
%End
// QgsCoordinateTransform &operator=( const QgsCoordinateTransform &o );
~QgsCoordinateTransform();
%Docstring
Assignment operator
%End
/*!
* Returns true if the coordinate transform is valid, ie both the source and destination
* CRS have been set and are valid.
* @note added in QGIS 3.0
*/
bool isValid() const;
%Docstring
Returns true if the coordinate transform is valid, ie both the source and destination
CRS have been set and are valid.
.. versionadded:: 3.0
:rtype: bool
%End
/*!
* Sets the source coordinate reference system.
* @param crs CRS to transform coordinates from
* @see sourceCrs()
* @see setDestinationCrs()
*/
void setSourceCrs( const QgsCoordinateReferenceSystem& crs );
void setSourceCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
Sets the source coordinate reference system.
\param crs CRS to transform coordinates from
\see sourceCrs()
\see setDestinationCrs()
%End
/*!
* Sets the destination coordinate reference system.
* @param crs CRS to transform coordinates to
* @see destinationCrs()
* @see setSourceCrs()
*/
void setDestinationCrs( const QgsCoordinateReferenceSystem& crs );
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
Sets the destination coordinate reference system.
\param crs CRS to transform coordinates to
\see destinationCrs()
\see setSourceCrs()
%End
/** Returns the source coordinate reference system, which the transform will
* transform coordinates from.
* @see setSourceCrs()
* @see destinationCrs()
*/
QgsCoordinateReferenceSystem sourceCrs() const;
%Docstring
Returns the source coordinate reference system, which the transform will
transform coordinates from.
\see setSourceCrs()
\see destinationCrs()
:rtype: QgsCoordinateReferenceSystem
%End
/** Returns the destination coordinate reference system, which the transform will
* transform coordinates to.
* @see setDestinationCrs()
* @see sourceCrs()
*/
QgsCoordinateReferenceSystem destinationCrs() const;
%Docstring
Returns the destination coordinate reference system, which the transform will
transform coordinates to.
\see setDestinationCrs()
\see sourceCrs()
:rtype: QgsCoordinateReferenceSystem
%End
/** Transform the point from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param point point to transform
* @param direction transform direction (defaults to ForwardTransform)
* @return transformed point
*/
QgsPoint transform( const QgsPoint& point, TransformDirection direction = ForwardTransform ) const;
QgsPoint transform( const QgsPoint &point, TransformDirection direction = ForwardTransform ) const;
%Docstring
Transform the point from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
otherwise points are transformed from destination to source CRS.
\param point point to transform
\param direction transform direction (defaults to ForwardTransform)
:return: transformed point
:rtype: QgsPoint
%End
/** Transform the point specified by x,y from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param x x coordinate of point to transform
* @param y y coordinate of point to transform
* @param direction transform direction (defaults to ForwardTransform)
* @return transformed point
*/
QgsPoint transform( const double x, const double y, TransformDirection direction = ForwardTransform ) const;
%Docstring
Transform the point specified by x,y from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
otherwise points are transformed from destination to source CRS.
\param x x coordinate of point to transform
\param y y coordinate of point to transform
\param direction transform direction (defaults to ForwardTransform)
:return: transformed point
:rtype: QgsPoint
%End
/** Transforms a rectangle from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* This method assumes that the rectangle is a bounding box, and creates a bounding box
* in the projected CRS, such that all points from the source rectangle are within
* the returned rectangle.
* @param rectangle rectangle to transform
* @param direction transform direction (defaults to ForwardTransform)
* @param handle180Crossover set to true if destination CRS is geographic and handling of extents
* crossing the 180 degree longitude line is required
* @return rectangle in destination CRS
*/
QgsRectangle transformBoundingBox( const QgsRectangle& rectangle, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const;
QgsRectangle transformBoundingBox( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform, const bool handle180Crossover = false ) const;
%Docstring
Transforms a rectangle from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
otherwise points are transformed from destination to source CRS.
This method assumes that the rectangle is a bounding box, and creates a bounding box
in the projected CRS, such that all points from the source rectangle are within
the returned rectangle.
\param rectangle rectangle to transform
\param direction transform direction (defaults to ForwardTransform)
\param handle180Crossover set to true if destination CRS is geographic and handling of extents
crossing the 180 degree longitude line is required
:return: rectangle in destination CRS
:rtype: QgsRectangle
%End
/** Transforms an array of x, y and z double coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param x array of x coordinates of points to transform
* @param y array of y coordinates of points to transform
* @param z array of z coordinates of points to transform. The z coordinates of the points
* must represent height relative to the vertical datum of the source CRS (generally ellipsoidal
* heights) and must be expressed in its vertical units (generally meters)
* @param direction transform direction (defaults to ForwardTransform)
*/
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform ) const;
void transformInPlace( double &x, double &y, double &z, TransformDirection direction = ForwardTransform ) const;
%Docstring
Transforms an array of x, y and z double coordinates in place, from the source CRS to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
otherwise points are transformed from destination to source CRS.
\param x array of x coordinates of points to transform
\param y array of y coordinates of points to transform
\param z array of z coordinates of points to transform. The z coordinates of the points
must represent height relative to the vertical datum of the source CRS (generally ellipsoidal
heights) and must be expressed in its vertical units (generally meters)
\param direction transform direction (defaults to ForwardTransform)
%End
/** Transforms an array of x, y and z float coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param x array of x coordinates of points to transform
* @param y array of y coordinates of points to transform
* @param z array of z coordinates of points to transform. The z coordinates of the points
* must represent height relative to the vertical datum of the source CRS (generally ellipsoidal
* heights) and must be expressed in its vertical units (generally meters)
* @param direction transform direction (defaults to ForwardTransform)
* @note not available in python bindings
*/
//void transformInPlace( float& x, float& y, double &z, TransformDirection direction = ForwardTransform ) const;
/** Transforms an array of x, y and z float coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param x array of x coordinates of points to transform
* @param y array of y coordinates of points to transform
* @param z array of z coordinates of points to transform. The z coordinates of the points
* must represent height relative to the vertical datum of the source CRS (generally ellipsoidal
* heights) and must be expressed in its vertical units (generally meters)
* @param direction transform direction (defaults to ForwardTransform)
* @note not available in python bindings
*/
// void transformInPlace( float& x, float& y, float& z, TransformDirection direction = ForwardTransform ) const;
/** Transforms a vector of x, y and z float coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param x vector of x coordinates of points to transform
* @param y vector of y coordinates of points to transform
* @param z vector of z coordinates of points to transform. The z coordinates of the points
* must represent height relative to the vertical datum of the source CRS (generally ellipsoidal
* heights) and must be expressed in its vertical units (generally meters)
* @param direction transform direction (defaults to ForwardTransform)
* @note not available in python bindings
*/
//void transformInPlace( QVector<float>& x, QVector<float>& y, QVector<float>& z,
// TransformDirection direction = ForwardTransform ) const;
/** Transforms a vector of x, y and z double coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param x vector of x coordinates of points to transform
* @param y vector of y coordinates of points to transform
* @param z vector of z coordinates of points to transform. The z coordinates of the points
* must represent height relative to the vertical datum of the source CRS (generally ellipsoidal
* heights) and must be expressed in its vertical units (generally meters)
* @param direction transform direction (defaults to ForwardTransform)
* @note not available in python bindings
*/
//void transformInPlace( QVector<double>& x, QVector<double>& y, QVector<double>& z,
// TransformDirection direction = ForwardTransform ) const;
/** Transforms a polygon to the destination coordinate system.
* @param polygon polygon to transform (occurs in place)
* @param direction transform direction (defaults to forward transformation)
*/
void transformPolygon( QPolygonF& polygon, TransformDirection direction = ForwardTransform ) const;
void transformPolygon( QPolygonF &polygon, TransformDirection direction = ForwardTransform ) const;
%Docstring
Transforms a polygon to the destination coordinate system.
\param polygon polygon to transform (occurs in place)
\param direction transform direction (defaults to forward transformation)
%End
/** Transforms a rectangle to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param rectangle rectangle to transform
* @param direction transform direction (defaults to ForwardTransform)
* @return transformed rectangle
*/
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const;
/** Transform an array of coordinates to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
* otherwise points are transformed from destination to source CRS.
* @param numPoint number of coordinates in arrays
* @param x array of x coordinates to transform
* @param y array of y coordinates to transform
* @param z array of z coordinates to transform
* @param direction transform direction (defaults to ForwardTransform)
*/
void transformCoords( int numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const;
%Docstring
Transform an array of coordinates to the destination CRS.
If the direction is ForwardTransform then coordinates are transformed from source to destination,
otherwise points are transformed from destination to source CRS.
\param numPoint number of coordinates in arrays
\param x array of x coordinates to transform
\param y array of y coordinates to transform
\param z array of z coordinates to transform
\param direction transform direction (defaults to ForwardTransform)
%End
/** Returns true if the transform short circuits because the source and destination are equivalent.
*/
bool isShortCircuited() const;
%Docstring
Returns true if the transform short circuits because the source and destination are equivalent.
:rtype: bool
%End
/** Returns list of datum transformations for the given src and dest CRS
* @note not available in python bindings
*/
// static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem& srcCRS, const QgsCoordinateReferenceSystem& destCRS );
static QString datumTransformString( int datumTransform );
/** Gets name of source and dest geographical CRS (to show in a tooltip)
@return epsgNr epsg code of the transformation (or 0 if not in epsg db)*/
static bool datumTransformCrsInfo( int datumTransform, int& epsgNr, QString& srcProjection, QString& dstProjection, QString &remarks, QString &scope, bool &preferred, bool &deprecated );
%Docstring
:rtype: str
%End
static bool datumTransformCrsInfo( int datumTransform, int &epsgNr, QString &srcProjection, QString &dstProjection, QString &remarks, QString &scope, bool &preferred, bool &deprecated );
%Docstring
Gets name of source and dest geographical CRS (to show in a tooltip)
:return: epsgNr epsg code of the transformation (or 0 if not in epsg db)*
:rtype: bool
%End
int sourceDatumTransform() const;
%Docstring
:rtype: int
%End
void setSourceDatumTransform( int dt );
int destinationDatumTransform() const;
%Docstring
:rtype: int
%End
void setDestinationDatumTransform( int dt );
//!initialize is used to actually create the Transformer instance
void initialize();
%Docstring
initialize is used to actually create the Transformer instance
%End
/** Restores state from the given Dom node.
* @param node The node from which state will be restored
* @return bool True on success, False on failure
* @see writeXml()
*/
bool readXml( const QDomNode& node );
bool readXml( const QDomNode &node );
%Docstring
Restores state from the given Dom node.
\param node The node from which state will be restored
:return: bool True on success, False on failure
\see writeXml()
:rtype: bool
%End
/** Stores state to the given Dom node in the given document
* @param node The node in which state will be restored
* @param document The document in which state will be stored
* @return bool True on success, False on failure
* @see readXml()
*/
bool writeXml( QDomNode & node, QDomDocument & document ) const;
bool writeXml( QDomNode &node, QDomDocument &document ) const;
%Docstring
Stores state to the given Dom node in the given document
\param node The node in which state will be restored
\param document The document in which state will be stored
:return: bool True on success, False on failure
\see readXml()
:rtype: bool
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscoordinatetransform.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,50 +1,97 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeedback.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** \ingroup core
* Base class for feedback objects to be used for cancelation of something running in a worker thread.
* The class may be used as is or it may be subclassed for extended functionality
* for a particular operation (e.g. report progress or pass some data for preview).
*
* When cancel() is called, the internal code has two options to check for cancelation state:
* - if the worker thread uses an event loop (e.g. for network communication), the code can
* make a queued connection to canceled() signal and handle the cancelation in its slot.
* - if the worker thread does not use an event loop, it can poll isCanceled() method regularly
* to see if the operation should be canceled.
*
* The class is meant to be created and destroyed in the main thread.
*
* For map rendering, the object may be created in constructor of a QgsMapLayerRenderer
* subclass and available with QgsMapLayerRenderer::feedback() method. When a map rendering job
* gets canceled, the cancel() method is called on the feedback object of all layers.
*
* @note added in QGIS 3.0
*/
class QgsFeedback : QObject
{
%TypeHeaderCode
#include <qgsfeedback.h>
%Docstring
Base class for feedback objects to be used for cancelation of something running in a worker thread.
The class may be used as is or it may be subclassed for extended functionality
for a particular operation (e.g. report progress or pass some data for preview).
When cancel() is called, the internal code has two options to check for cancelation state:
- if the worker thread uses an event loop (e.g. for network communication), the code can
make a queued connection to canceled() signal and handle the cancelation in its slot.
- if the worker thread does not use an event loop, it can poll isCanceled() method regularly
to see if the operation should be canceled.
The class is meant to be created and destroyed in the main thread.
For map rendering, the object may be created in constructor of a QgsMapLayerRenderer
subclass and available with QgsMapLayerRenderer.feedback() method. When a map rendering job
gets canceled, the cancel() method is called on the feedback object of all layers.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsfeedback.h"
%End
public:
//! Construct a feedback object
QgsFeedback( QObject* parent /TransferThis/ = nullptr );
virtual ~QgsFeedback();
//! Tells the internal routines that the current operation should be canceled. This should be run by the main thread
QgsFeedback( QObject *parent /TransferThis/ = 0 );
%Docstring
Construct a feedback object
%End
void cancel();
%Docstring
Tells the internal routines that the current operation should be canceled. This should be run by the main thread
%End
//! Tells whether the operation has been canceled already
bool isCanceled() const;
%Docstring
Tells whether the operation has been canceled already
:rtype: bool
%End
void setProgress( double progress );
%Docstring
Sets the current progress for the feedback object. The ``progress``
argument is in percentage and valid values range from 0-100.
\see progress()
\see progressChanged()
.. versionadded:: 3.0
%End
double progress() const;
%Docstring
Returns the current progress reported by the feedback object. Depending on how the
feedback object is used progress reporting may not be supported. The returned value
is in percentage and ranges from 0-100.
\see setProgress()
\see progressChanged()
.. versionadded:: 3.0
:rtype: float
%End
signals:
//! Internal routines can connect to this signal if they use event loop
void canceled();
%Docstring
Internal routines can connect to this signal if they use event loop
%End
void progressChanged( double progress );
%Docstring
Emitted when the feedback object reports a progress change. Depending on how the
feedback object is used progress reporting may not be supported. The ``progress``
argument is in percentage and ranges from 0-100.
.. versionadded:: 3.0
\see setProgress()
\see progress()
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfeedback.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -29,6 +29,7 @@
* \class QgsBrowserWatcher
* \note not available in Python bindings
*/
#ifndef SIP_RUN
class CORE_EXPORT QgsBrowserWatcher : public QFutureWatcher<QVector <QgsDataItem *> >
{
Q_OBJECT
@ -44,6 +45,7 @@ class CORE_EXPORT QgsBrowserWatcher : public QFutureWatcher<QVector <QgsDataItem
private:
QgsDataItem *mItem = nullptr;
};
#endif
/** \ingroup core
* \class QgsBrowserModel
@ -122,7 +124,7 @@ class CORE_EXPORT QgsBrowserModel : public QAbstractItemModel
QModelIndex findPath( const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
//! \note not available in Python bindings
static QModelIndex findPath( QAbstractItemModel *model, const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly );
static QModelIndex findPath( QAbstractItemModel *model, const QString &path, Qt::MatchFlag matchFlag = Qt::MatchExactly ) SIP_SKIP;
void connectItem( QgsDataItem *item );

View File

@ -24,6 +24,7 @@
#include <QObject>
#include "qgis_core.h"
#include "qgis.h"
/** \ingroup core
* List of colors paired with a friendly display name identifying the color
@ -42,6 +43,24 @@ typedef QList< QPair< QColor, QString > > QgsNamedColorList;
*/
class CORE_EXPORT QgsColorScheme
{
#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( dynamic_cast<QgsUserColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsUserColorScheme;
else if ( dynamic_cast<QgsRecentColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsRecentColorScheme;
else if ( dynamic_cast<QgsCustomColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsCustomColorScheme;
else if ( dynamic_cast<QgsProjectColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsProjectColorScheme;
else if ( dynamic_cast<QgsGplColorScheme *>( sipCpp ) != NULL )
sipType = sipType_QgsGplColorScheme;
else
sipType = sipType_QgsColorScheme;
SIP_END
#endif
public:
/** Flags for controlling behavior of color scheme
@ -102,7 +121,7 @@ class CORE_EXPORT QgsColorScheme
/** Clones a color scheme
* \returns copy of color scheme
*/
virtual QgsColorScheme *clone() const = 0;
virtual QgsColorScheme *clone() const = 0 SIP_FACTORY;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsColorScheme::SchemeFlags )
@ -149,7 +168,7 @@ class CORE_EXPORT QgsUserColorScheme : public QgsGplColorScheme
virtual QString schemeName() const override;
virtual QgsUserColorScheme *clone() const override;
virtual QgsUserColorScheme *clone() const override SIP_FACTORY;
virtual bool isEditable() const override { return true; }
@ -199,7 +218,7 @@ class CORE_EXPORT QgsRecentColorScheme : public QgsColorScheme
virtual QgsNamedColorList fetchColors( const QString &context = QString(),
const QColor &baseColor = QColor() ) override;
QgsRecentColorScheme *clone() const override;
QgsRecentColorScheme *clone() const override SIP_FACTORY;
/** Adds a color to the list of recent colors.
* \param color color to add
@ -237,7 +256,7 @@ class CORE_EXPORT QgsCustomColorScheme : public QgsColorScheme
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() ) override;
QgsCustomColorScheme *clone() const override;
QgsCustomColorScheme *clone() const override SIP_FACTORY;
};
/** \ingroup core
@ -262,7 +281,7 @@ class CORE_EXPORT QgsProjectColorScheme : public QgsColorScheme
virtual bool setColors( const QgsNamedColorList &colors, const QString &context = QString(), const QColor &baseColor = QColor() ) override;
QgsProjectColorScheme *clone() const override;
QgsProjectColorScheme *clone() const override SIP_FACTORY;
};
#endif

View File

@ -67,7 +67,7 @@ class CORE_EXPORT QgsColorSchemeRegistry
* \see populateFromInstance
* \see removeColorScheme
*/
void addColorScheme( QgsColorScheme *scheme );
void addColorScheme( QgsColorScheme *scheme SIP_TRANSFER );
/** Removes all matching color schemes from the registry
* \param scheme color scheme to remove
@ -87,11 +87,27 @@ class CORE_EXPORT QgsColorSchemeRegistry
*/
QList<QgsColorScheme *> schemes( const QgsColorScheme::SchemeFlag flag ) const;
/** Return color schemes of a specific type
* \param schemeList destination list for matching schemes
* \note not available in Python bindings
*/
template<class T> void schemes( QList<T *> &schemeList );
#ifndef SIP_RUN
template<class T> void schemes( QList<T *> &schemeList )
{
schemeList.clear();
QList<QgsColorScheme *> schemeInstanceList = schemes();
QList<QgsColorScheme *>::iterator schemeIt = schemeInstanceList.begin();
for ( ; schemeIt != schemeInstanceList.end(); ++schemeIt )
{
T *scheme = dynamic_cast<T *>( *schemeIt );
if ( scheme )
{
schemeList.push_back( scheme );
}
}
}
#endif
private:
@ -99,19 +115,6 @@ class CORE_EXPORT QgsColorSchemeRegistry
};
template<class T> void QgsColorSchemeRegistry::schemes( QList<T *> &schemeList )
{
schemeList.clear();
QList<QgsColorScheme *> schemeInstanceList = schemes();
QList<QgsColorScheme *>::iterator schemeIt = schemeInstanceList.begin();
for ( ; schemeIt != schemeInstanceList.end(); ++schemeIt )
{
T *scheme = dynamic_cast<T *>( *schemeIt );
if ( scheme )
{
schemeList.push_back( scheme );
}
}
}
#endif

View File

@ -24,6 +24,7 @@
#include <QProcess>
#include "qgis_core.h"
#include "qgis.h"
/** \ingroup core
* Provides a context based help browser for a dialog.
@ -46,9 +47,9 @@ class CORE_EXPORT QgsContextHelp : public QObject
private:
//! Constructor
QgsContextHelp();
QgsContextHelp() SIP_FORCE;
~QgsContextHelp();
~QgsContextHelp() SIP_FORCE;
QProcess *start();
void showContext( const QString &context );

View File

@ -28,25 +28,25 @@
#include <QHash>
#include <QReadWriteLock>
//qgis includes
#include "qgis.h"
#include "qgsunittypes.h"
class QDomNode;
class QDomDocument;
class QgsCoordinateReferenceSystemPrivate;
// forward declaration for sqlite3
typedef struct sqlite3 sqlite3;
//qgis includes
#include "qgis.h"
#include "qgsunittypes.h"
typedef struct sqlite3 sqlite3 SIP_SKIP;
#ifdef DEBUG
typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH;
typedef struct OGRSpatialReferenceHS *OGRSpatialReferenceH SIP_SKIP;
#else
typedef void *OGRSpatialReferenceH;
typedef void *OGRSpatialReferenceH SIP_SKIP;
#endif
class QgsCoordinateReferenceSystem;
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem & );
typedef void ( *CUSTOM_CRS_VALIDATION )( QgsCoordinateReferenceSystem & ) SIP_SKIP;
/** \ingroup core
* This class represents a coordinate reference system (CRS).
@ -217,8 +217,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* If no prefix is specified, WKT definition is assumed.
* \param definition A String containing a coordinate reference system definition.
* \see createFromString()
*/
// TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
*/ // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
explicit QgsCoordinateReferenceSystem( const QString &definition );
/** Constructor a CRS object using a postgis SRID, an EPSG code or an internal QGIS CRS ID.
@ -226,8 +225,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
* \param id The ID valid for the chosen CRS ID type
* \param type One of the types described in CrsType
*/
// TODO QGIS 3: remove type and always use EPSG code
*/ // TODO QGIS 3: remove type and always use EPSG code
explicit QgsCoordinateReferenceSystem( const long id, CrsType type = PostgisCrsId );
//! Copy constructor
@ -300,8 +298,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
* wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
* \returns True on success else false
*/
// TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
*/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
bool createFromId( const long id, CrsType type = PostgisCrsId );
/**
@ -313,15 +310,13 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* \note this method uses an internal cache. Call invalidateCache() to clear the cache.
* \returns True on success else false
* \see fromOgcWmsCrs()
*/
// TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
*/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
bool createFromOgcWmsCrs( const QString &crs );
/** Sets this CRS by lookup of the given PostGIS SRID in the CRS database.
* \param srid The postgis SRID for the desired spatial reference system.
* \returns True on success else false
*/
// TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
*/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
bool createFromSrid( const long srid );
/** Sets this CRS using a WKT definition.
@ -401,8 +396,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* passes it to createFromWkt() function.
* \param definition A String containing a coordinate reference system definition.
* \returns True on success else false
*/
// TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend
*/ // TODO QGIS3: rename to createFromStringOGR so it is clear it's similar to createFromString, just different backend
bool createFromUserInput( const QString &definition );
/** Make sure that ESRI WKT import is done properly.
@ -435,8 +429,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* pieces of information about CRS.
* \note The ellipsoid and projection acronyms must be set as well as the proj4string!
* \returns long the SrsId of the matched CRS, zero if no match was found
*/
// TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
*/ // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
long findMatchingProj();
/** Overloaded == operator used to compare to CRS's.
@ -469,12 +462,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
* QGIS uses implementation in QgisGui::customSrsValidation
* \note not available in Python bindings
*/
static void setCustomCrsValidation( CUSTOM_CRS_VALIDATION f );
static void setCustomCrsValidation( CUSTOM_CRS_VALIDATION f ) SIP_SKIP;
/** Gets custom function
* \note not available in Python bindings
*/
static CUSTOM_CRS_VALIDATION customCrsValidation();
static CUSTOM_CRS_VALIDATION customCrsValidation() SIP_SKIP;
// Accessors -----------------------------------
@ -485,8 +478,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
/** Returns PostGIS SRID for the CRS.
* \returns the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0)
*/
// TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
*/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
long postgisSrid() const;
/** Returns the authority identifier for the CRS.
@ -722,6 +714,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
Q_DECLARE_METATYPE( QgsCoordinateReferenceSystem )
//! Output stream operator
#ifndef SIP_RUN
inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateReferenceSystem &r )
{
QString mySummary( QStringLiteral( "\n\tSpatial Reference System:" ) );
@ -766,5 +759,6 @@ inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateReferenc
// Using streams we need to use local 8 Bit
return os << mySummary.toLocal8Bit().data() << std::endl;
}
#endif
#endif // QGSCOORDINATEREFERENCESYSTEM_H

View File

@ -167,7 +167,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param direction transform direction (defaults to ForwardTransform)
* \note not available in Python bindings
*/
void transformInPlace( float &x, float &y, double &z, TransformDirection direction = ForwardTransform ) const;
void transformInPlace( float &x, float &y, double &z, TransformDirection direction = ForwardTransform ) const SIP_SKIP;
/** Transforms an array of x, y and z float coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@ -180,7 +180,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param direction transform direction (defaults to ForwardTransform)
* \note not available in Python bindings
*/
void transformInPlace( float &x, float &y, float &z, TransformDirection direction = ForwardTransform ) const;
void transformInPlace( float &x, float &y, float &z, TransformDirection direction = ForwardTransform ) const SIP_SKIP;
/** Transforms a vector of x, y and z float coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@ -194,7 +194,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \note not available in Python bindings
*/
void transformInPlace( QVector<float> &x, QVector<float> &y, QVector<float> &z,
TransformDirection direction = ForwardTransform ) const;
TransformDirection direction = ForwardTransform ) const SIP_SKIP;
/** Transforms a vector of x, y and z double coordinates in place, from the source CRS to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@ -208,7 +208,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \note not available in Python bindings
*/
void transformInPlace( QVector<double> &x, QVector<double> &y, QVector<double> &z,
TransformDirection direction = ForwardTransform ) const;
TransformDirection direction = ForwardTransform ) const SIP_SKIP;
/** Transforms a polygon to the destination coordinate system.
* \param polygon polygon to transform (occurs in place)
@ -223,7 +223,7 @@ class CORE_EXPORT QgsCoordinateTransform
* \param direction transform direction (defaults to ForwardTransform)
* \returns transformed rectangle
*/
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const;
QgsRectangle transform( const QgsRectangle &rectangle, TransformDirection direction = ForwardTransform ) const SIP_SKIP;
/** Transform an array of coordinates to the destination CRS.
* If the direction is ForwardTransform then coordinates are transformed from source to destination,
@ -243,7 +243,8 @@ class CORE_EXPORT QgsCoordinateTransform
/** Returns list of datum transformations for the given src and dest CRS
* \note not available in Python bindings
*/
static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem &srcCRS, const QgsCoordinateReferenceSystem &destinationCrs );
static QList< QList< int > > datumTransformations( const QgsCoordinateReferenceSystem &srcCRS, const QgsCoordinateReferenceSystem &destinationCrs ) SIP_SKIP;
static QString datumTransformString( int datumTransform );
/** Gets name of source and dest geographical CRS (to show in a tooltip)
@ -281,6 +282,7 @@ class CORE_EXPORT QgsCoordinateTransform
};
//! Output stream operator
#ifndef SIP_RUN
inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateTransform &r )
{
QString mySummary( QStringLiteral( "\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ) );
@ -334,6 +336,7 @@ inline std::ostream &operator << ( std::ostream &os, const QgsCoordinateTransfor
mySummary += QLatin1String( "\nCoordinate Transform def ends \n%%%%%%%%%%%%%%%%%%%%%%%%\n" );
return os << mySummary.toLocal8Bit().data() << std::endl;
}
#endif
#endif // QGSCOORDINATETRANSFORM_H

View File

@ -19,6 +19,7 @@
#include <QObject>
#include "qgis_core.h"
#include "qgis.h"
/** \ingroup core
* Base class for feedback objects to be used for cancelation of something running in a worker thread.
@ -44,7 +45,7 @@ class CORE_EXPORT QgsFeedback : public QObject
Q_OBJECT
public:
//! Construct a feedback object
QgsFeedback( QObject *parent = nullptr )
QgsFeedback( QObject *parent SIP_TRANSFERTHIS = nullptr )
: QObject( parent )
, mCanceled( false )
{}