Skip to content
Permalink
Browse files

- updated const variables on the qgsvector header.

- Removed dataItem_t pointer from qgsdataitem bindings.
- Put back qobject_cast.
  • Loading branch information
doublebyte1 committed Apr 30, 2017
1 parent 2d7b2ec commit 1287a64eb2e35c5e0ae3c12b17f589dcd2262013
Showing with 39 additions and 40 deletions.
  1. +16 −17 python/core/qgsdataitem.sip
  2. +3 −3 python/core/qgsvector.sip
  3. +17 −17 src/core/qgsdataitem.h
  4. +3 −3 src/core/qgsvector.h
@@ -11,7 +11,6 @@



typedef QgsDataItem *dataItem_t( QString, QgsDataItem * );

class QgsDataItem : QObject
{
@@ -25,22 +24,22 @@ class QgsDataItem : QObject
%End

%ConvertToSubClassCode
if ( sipCpp->inherits( "QgsLayerItem" ) )
sipType = sipType_QgsLayerItem;
if ( sipCpp->inherits( "QgsErrorItem" ) )
sipType = sipType_QgsErrorItem;
if ( sipCpp->inherits( "QgsDirectoryItem" ) )
sipType = sipType_QgsDirectoryItem;
if ( sipCpp->inherits( "QgsFavoritesItem" ) )
sipType = sipType_QgsFavoritesItem;
if ( sipCpp->inherits( "QgsZipItem" ) )
sipType = sipType_QgsZipItem;
if ( sipCpp->inherits( "QgsDataCollectionItem" ) )
sipType = sipType_QgsDataCollectionItem;
if ( sipCpp->inherits( "QgsProjectItem" ) )
sipType = sipType_QgsProjectItem;
else
sipType = 0;
if (qobject_cast<QgsLayerItem*>(sipCpp))
sipType = sipType_QgsLayerItem;
else if (qobject_cast<QgsErrorItem*>(sipCpp))
sipType = sipType_QgsErrorItem;
else if (qobject_cast<QgsDirectoryItem*>(sipCpp))
sipType = sipType_QgsDirectoryItem;
else if (qobject_cast<QgsFavoritesItem*>(sipCpp))
sipType = sipType_QgsFavoritesItem;
else if (qobject_cast<QgsZipItem*>(sipCpp))
sipType = sipType_QgsZipItem;
else if (qobject_cast<QgsDataCollectionItem*>(sipCpp))
sipType = sipType_QgsDataCollectionItem;
else if (qobject_cast<QgsProjectItem*>(sipCpp))
sipType = sipType_QgsProjectItem;
else
sipType = 0;
%End
public:
enum Type
@@ -67,21 +67,21 @@ Swaps the sign of the x and y components of the vector.
:rtype: QgsVector
%End

QgsVector &operator+=( QgsVector other );
QgsVector &operator+=( const QgsVector other );
%Docstring
Adds another vector to this vector in place.
.. versionadded:: 3.0
:rtype: QgsVector
%End

QgsVector operator-( QgsVector other ) const;
QgsVector operator-( const QgsVector other ) const;
%Docstring
Subtracts another vector to this vector.
.. versionadded:: 3.0
:rtype: QgsVector
%End

QgsVector &operator-=( QgsVector other );
QgsVector &operator-=( const QgsVector other );
%Docstring
Subtracts another vector to this vector in place.
.. versionadded:: 3.0
@@ -37,7 +37,7 @@ class QgsDataProvider;
class QgsDataItem;
class QgsAnimatedIcon;

typedef QgsDataItem *dataItem_t( QString, QgsDataItem * );
typedef QgsDataItem *dataItem_t( QString, QgsDataItem * ) SIP_SKIP;

/** \ingroup core
* Base class for all items in the model.
@@ -48,22 +48,22 @@ class CORE_EXPORT QgsDataItem : public QObject

#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( sipCpp->inherits( "QgsLayerItem" ) )
sipType = sipType_QgsLayerItem;
if ( sipCpp->inherits( "QgsErrorItem" ) )
sipType = sipType_QgsErrorItem;
if ( sipCpp->inherits( "QgsDirectoryItem" ) )
sipType = sipType_QgsDirectoryItem;
if ( sipCpp->inherits( "QgsFavoritesItem" ) )
sipType = sipType_QgsFavoritesItem;
if ( sipCpp->inherits( "QgsZipItem" ) )
sipType = sipType_QgsZipItem;
if ( sipCpp->inherits( "QgsDataCollectionItem" ) )
sipType = sipType_QgsDataCollectionItem;
if ( sipCpp->inherits( "QgsProjectItem" ) )
sipType = sipType_QgsProjectItem;
else
sipType = 0;
if (qobject_cast<QgsLayerItem*>(sipCpp))
sipType = sipType_QgsLayerItem;
else if (qobject_cast<QgsErrorItem*>(sipCpp))
sipType = sipType_QgsErrorItem;
else if (qobject_cast<QgsDirectoryItem*>(sipCpp))
sipType = sipType_QgsDirectoryItem;
else if (qobject_cast<QgsFavoritesItem*>(sipCpp))
sipType = sipType_QgsFavoritesItem;
else if (qobject_cast<QgsZipItem*>(sipCpp))
sipType = sipType_QgsZipItem;
else if (qobject_cast<QgsDataCollectionItem*>(sipCpp))
sipType = sipType_QgsDataCollectionItem;
else if (qobject_cast<QgsProjectItem*>(sipCpp))
sipType = sipType_QgsProjectItem;
else
sipType = 0;
SIP_END
#endif

@@ -67,19 +67,19 @@ class CORE_EXPORT QgsVector
* Adds another vector to this vector in place.
* \since QGIS 3.0
*/
QgsVector &operator+=( QgsVector other );
QgsVector &operator+=( const QgsVector other );

/**
* Subtracts another vector to this vector.
* \since QGIS 3.0
*/
QgsVector operator-( QgsVector other ) const;
QgsVector operator-( const QgsVector other ) const;

/**
* Subtracts another vector to this vector in place.
* \since QGIS 3.0
*/
QgsVector &operator-=( QgsVector other );
QgsVector &operator-=( const QgsVector other );

/** Returns the length of the vector.
*/

0 comments on commit 1287a64

Please sign in to comment.