Skip to content
Permalink
Browse files

Add some missing SIP bindings, comment some classes as not available

in Python
  • Loading branch information
nyalldawson committed Nov 10, 2015
1 parent b1b20af commit 719ff408a5ebf91f4a82233282d961eb0fcaef27
Showing with 617 additions and 40 deletions.
  1. +8 −0 python/analysis/raster/qgsalignraster.sip
  2. +1 −0 python/core/composer/qgscomposerattributetablev2.sip
  3. +6 −0 python/core/composer/qgscomposerobject.sip
  4. +21 −0 python/core/geometry/qgsabstractgeometryv2.sip
  5. +8 −0 python/core/qgsapplication.sip
  6. +4 −0 python/core/qgsbrowsermodel.sip
  7. +42 −0 python/core/qgsdataitem.sip
  8. +3 −0 python/core/symbology-ng/qgsfillsymbollayerv2.sip
  9. +2 −0 python/core/symbology-ng/qgssymbolv2.sip
  10. +5 −0 python/gui/attributetable/qgsattributetablemodel.sip
  11. +15 −0 python/gui/effects/qgspainteffectwidget.sip
  12. +6 −0 python/gui/gui.sip
  13. +68 −0 python/gui/qgsactionmenu.sip
  14. +16 −0 python/gui/qgsadvanceddigitizingcanvasitem.sip
  15. +5 −0 python/gui/qgsattributeform.sip
  16. +29 −0 python/gui/qgsbrowsertreeview.sip
  17. +4 −0 python/gui/qgscomposerruler.sip
  18. +23 −0 python/gui/qgsdial.sip
  19. +26 −0 python/gui/qgsslider.sip
  20. +86 −0 python/gui/qgsunitselectionwidget.sip
  21. +1 −0 python/gui/symbology-ng/characterwidget.sip
  22. +1 −0 src/core/composer/qgscomposermousehandles.h
  23. +1 −1 src/core/composer/qgscomposerobject.h
  24. +1 −0 src/core/geometry/qgsabstractgeometryv2.h
  25. +5 −0 src/core/geometry/qgsgeos.cpp
  26. +1 −0 src/core/geometry/qgsgeos.h
  27. +8 −0 src/core/geometry/qgswkbptr.h
  28. +7 −5 src/core/qgsapplication.h
  29. +4 −2 src/core/qgsattributeaction.h
  30. +5 −0 src/core/qgsexpressioncontext.cpp
  31. +1 −1 src/core/symbology-ng/qgscptcityarchive.h
  32. +3 −0 src/core/symbology-ng/qgslinesymbollayerv2.cpp
  33. +3 −0 src/gui/editorwidgets/qgscheckboxconfigdlg.h
  34. +4 −0 src/gui/editorwidgets/qgscheckboxwidgetfactory.h
  35. +1 −0 src/gui/editorwidgets/qgscheckboxwidgetwrapper.h
  36. +4 −0 src/gui/editorwidgets/qgsclassificationwidgetwrapper.h
  37. +4 −0 src/gui/editorwidgets/qgsclassificationwidgetwrapperfactory.h
  38. +4 −0 src/gui/editorwidgets/qgscolorwidgetfactory.h
  39. +1 −1 src/gui/editorwidgets/qgscolorwidgetwrapper.h
  40. +4 −0 src/gui/editorwidgets/qgsdatetimeeditconfig.h
  41. +4 −0 src/gui/editorwidgets/qgsdatetimeeditfactory.h
  42. +1 −1 src/gui/editorwidgets/qgsdatetimeeditwrapper.h
  43. +4 −0 src/gui/editorwidgets/qgsenumerationwidgetfactory.h
  44. +4 −0 src/gui/editorwidgets/qgsenumerationwidgetwrapper.h
  45. +4 −0 src/gui/editorwidgets/qgsfilenamewidgetfactory.h
  46. +1 −1 src/gui/editorwidgets/qgsfilenamewidgetwrapper.h
  47. +4 −0 src/gui/editorwidgets/qgshiddenwidgetfactory.h
  48. +1 −1 src/gui/editorwidgets/qgshiddenwidgetwrapper.h
  49. +4 −0 src/gui/editorwidgets/qgsphotoconfigdlg.h
  50. +4 −0 src/gui/editorwidgets/qgsphotowidgetfactory.h
  51. +1 −1 src/gui/editorwidgets/qgsphotowidgetwrapper.h
  52. +4 −0 src/gui/editorwidgets/qgsrangeconfigdlg.h
  53. +4 −0 src/gui/editorwidgets/qgsrangewidgetfactory.h
  54. +1 −1 src/gui/editorwidgets/qgsrangewidgetwrapper.h
  55. +4 −0 src/gui/editorwidgets/qgsrelationreferenceconfigdlg.h
  56. +4 −0 src/gui/editorwidgets/qgsrelationreferencefactory.h
  57. +4 −0 src/gui/editorwidgets/qgsrelationwidgetwrapper.h
  58. +4 −0 src/gui/editorwidgets/qgstexteditconfigdlg.h
  59. +4 −0 src/gui/editorwidgets/qgstexteditwidgetfactory.h
  60. +1 −1 src/gui/editorwidgets/qgstexteditwrapper.h
  61. +4 −0 src/gui/editorwidgets/qgsuniquevaluesconfigdlg.h
  62. +4 −0 src/gui/editorwidgets/qgsuniquevaluewidgetfactory.h
  63. +1 −1 src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.h
  64. +4 −0 src/gui/editorwidgets/qgsuuidwidgetfactory.h
  65. +1 −2 src/gui/editorwidgets/qgsuuidwidgetwrapper.h
  66. +4 −0 src/gui/editorwidgets/qgsvaluemapconfigdlg.h
  67. +4 −0 src/gui/editorwidgets/qgsvaluemapwidgetfactory.h
  68. +1 −1 src/gui/editorwidgets/qgsvaluemapwidgetwrapper.h
  69. +4 −0 src/gui/editorwidgets/qgsvaluerelationconfigdlg.h
  70. +4 −0 src/gui/editorwidgets/qgsvaluerelationwidgetfactory.h
  71. +1 −1 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.h
  72. +4 −0 src/gui/editorwidgets/qgswebviewconfigdlg.h
  73. +4 −0 src/gui/editorwidgets/qgswebviewwidgetfactory.h
  74. +1 −1 src/gui/editorwidgets/qgswebviewwidgetwrapper.h
  75. +4 −0 src/gui/effects/qgseffectstackpropertieswidget.cpp
  76. +3 −1 src/gui/layertree/qgscustomlayerorderwidget.cpp
  77. +1 −7 src/gui/qgsactionmenu.h
  78. +1 −0 src/gui/qgsattributeformlegacyinterface.h
  79. +1 −1 src/gui/qgsbrowsertreeview.h
  80. +2 −1 src/gui/qgsunitselectionwidget.h
  81. +5 −0 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
  82. +5 −0 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.h
  83. +4 −0 src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
  84. +3 −0 src/gui/symbology-ng/qgsgraduatedhistogramwidget.cpp
  85. +2 −1 src/gui/symbology-ng/qgsgraduatedhistogramwidget.h
  86. +5 −0 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
  87. +5 −0 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.h
  88. +4 −0 src/gui/symbology-ng/qgssizescalewidget.cpp
  89. +5 −0 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
  90. +4 −3 src/gui/symbology-ng/qgssymbollayerv2widget.h
  91. +5 −0 src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp
  92. +5 −0 src/gui/symbology-ng/qgssymbolv2selectordialog.cpp
  93. +3 −0 src/gui/symbology-ng/qgssymbolv2selectordialog.h
  94. +1 −1 src/plugins/qgisplugin.h
  95. +3 −1 src/plugins/qgsapplydialog.h
  96. +1 −1 tests/src/python/test_qgsdoccoverage.py
  97. +1 −1 tests/src/python/test_qgssipcoverage.py
@@ -160,5 +160,13 @@ class QgsAlignRaster
//! Return index of the layer which has smallest cell size (returns -1 on error)
int suggestedReferenceLayer() const;

protected:

//! Internal function for processing of one raster (1. create output, 2. do the alignment)
bool createAndWarp( const Item& raster );

//! Determine suggested output of raster warp to a different CRS. Returns true on success
static bool suggestedWarpOutput( const RasterInfo& info, const QString& destWkt, QSizeF* cellSize = 0, QPointF* gridOffset = 0, QgsRectangle* rect = 0 );

};

@@ -271,4 +271,5 @@ class QgsComposerAttributeTableV2 : QgsComposerTableV2
*/
bool getTableContents( QgsComposerTableContents &contents );

virtual QgsExpressionContext* createExpressionContext() const /Factory/;
};
@@ -135,6 +135,12 @@ class QgsComposerObject : QObject
*/
QStringList customProperties() const;

/** Creates an expression context relating to the objects' current state. The context includes
* scopes for global, project and composition properties.
* @note added in QGIS 2.12
*/
virtual QgsExpressionContext* createExpressionContext() const /Factory/;

public slots:

/** Triggers a redraw for the item*/
@@ -139,6 +139,10 @@ class QgsAbstractGeometryV2
/** Returns the centroid of the geometry*/
virtual QgsPointV2 centroid() const;

/** Returns true if the geometry is empty
*/
bool isEmpty() const;

virtual bool hasCurvedSegments() const;
/** Returns a geometry without curves. Caller takes ownership*/
virtual QgsAbstractGeometryV2* segmentize() const /Factory/;
@@ -166,4 +170,21 @@ class QgsAbstractGeometryV2
* @see addZValue
*/
virtual bool addMValue( double mValue = 0 ) = 0;

protected:

/** Updates the geometry type based on whether sub geometries contain z or m values.
*/
void setZMTypeFromSubGeometry( const QgsAbstractGeometryV2* subggeom, QgsWKBTypes::Type baseGeomType );

/** Reads a WKB header and tests its validity.
* @param wkbPtr
* @param wkbType destination for WKB type from header
* @param endianSwap will be set to true if endian from WKB must be swapped to match QGIS platform endianness
* @param expectedType expected WKB type
* @returns true if header is valid and matches expected type
* @note not available in Python bindings
*/
//static bool readWkbHeader( QgsConstWkbPtr& wkbPtr, QgsWKBTypes::Type& wkbType, bool& endianSwap, QgsWKBTypes::Type expectedType );

};
@@ -63,6 +63,11 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)


public:

static const char* QGIS_ORGANIZATION_NAME;
static const char* QGIS_ORGANIZATION_DOMAIN;
static const char* QGIS_APPLICATION_NAME;

//QgsApplication(int argc, char ** argv, bool GUIenabled);
QgsApplication(SIP_PYLIST argv, bool GUIenabled, QString customConfigPath = QString() ) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv, bool GUIenabled, const QString& customConfigPath = QString() )];
%MethodCode
@@ -88,6 +93,9 @@ static void qtgui_UpdatePyArgv(PyObject *argvlist, int argc, char **argv)

virtual ~QgsApplication();

//! Set the FileOpen event receiver
static void setFileOpenEventReceiver( QObject * receiver );

/** Set the active theme to the specified theme.
* The theme name should be a single word e.g. 'default','classic'.
* The theme search path usually will be pkgDataPath + "/themes/" + themName + "/"
@@ -78,6 +78,10 @@ class QgsBrowserModel : QAbstractItemModel
bool canFetchMore( const QModelIndex & parent ) const;
void fetchMore( const QModelIndex & parent );

signals:
/** Emitted when item children fetch was finished */
void stateChanged( const QModelIndex & index, QgsDataItem::State oldState );

public slots:
// Reload the whole model
void reload();
@@ -1,3 +1,33 @@
/** Animated icon is keeping an animation running if there are listeners connected to frameChanged */
class QgsAnimatedIcon : QObject
{
%TypeHeaderCode
#include <qgsdataitem.h>
%End
public:

/** Constructor
* @param iconPath path to a movie, e.g. animated GIF */
QgsAnimatedIcon( const QString & iconPath = QString::null );

QString iconPath() const;
void setIconPath( const QString & iconPath );
QIcon icon() const;

/** Connect listener to frameChanged() signal */
void connectFrameChanged( const QObject * receiver, const char * method );
/** Disconnect listener from frameChanged() signal */
void disconnectFrameChanged( const QObject * receiver, const char * method );

public slots:
void onFrameChanged();

signals:
/** Emitted when icon changed */
void frameChanged();

};

class QgsDataItem : QObject
{
%TypeHeaderCode
@@ -143,6 +173,16 @@ class QgsDataItem : QObject
/** Move object and all its descendants to thread */
void moveToThread( QThread * targetThread );

protected:
virtual void populate( const QVector<QgsDataItem*>& children );
virtual void refresh( QVector<QgsDataItem*> children );
/** The item is scheduled to be deleted. E.g. if deleteLater() is called when
* item is in Populating state (createChildren() running in another thread),
* the deferredDelete() returns true and item will be deleted once Populating finished.
* Items with slow reateChildren() (for example network or database based) may
* check during createChildren() if deferredDelete() returns true and return from
* createChildren() immediately because result will be useless. */
bool deferredDelete();

public slots:

@@ -168,6 +208,8 @@ class QgsDataItem : QObject
void endInsertItems();
void beginRemoveItems( QgsDataItem* parent, int first, int last );
void endRemoveItems();
void dataChanged( QgsDataItem * item );
void stateChanged( QgsDataItem * item, QgsDataItem::State oldState );
};

QFlags<QgsDataItem::Capability> operator|(QgsDataItem::Capability f1, QFlags<QgsDataItem::Capability> f2);
@@ -886,4 +886,7 @@ class QgsCentroidFillSymbolLayerV2 : QgsFillSymbolLayerV2
QgsMapUnitScale mapUnitScale() const;

virtual QSet<QString> usedAttributes() const;

void setPointOnSurface( bool pointOnSurface );
bool pointOnSurface() const;
};
@@ -27,6 +27,8 @@ class QgsSymbolV2
Pixel
};

typedef QList<QgsSymbolV2::OutputUnit> OutputUnitList;

enum SymbolType
{
Marker,
@@ -157,6 +157,11 @@ class QgsAttributeTableModel : QAbstractTableModel
*/
void setRequest( const QgsFeatureRequest& request );

/**
* Get the the feature request
*/
const QgsFeatureRequest &request() const;

/**
* Sets the context in which this table is shown.
* Will be forwarded to any editor widget created when editing data on this model.
@@ -106,4 +106,19 @@ class QgsTransformWidget : QgsPaintEffectWidget

};

class QgsColorEffectWidget : QgsPaintEffectWidget
{
%TypeHeaderCode
#include <qgspainteffectwidget.h>
%End

public:
QgsColorEffectWidget( QWidget* parent /TransferThis/ = NULL );

static QgsPaintEffectWidget* create() /Factory/;

virtual void setPaintEffect( QgsPaintEffect* effect );

};


@@ -17,13 +17,16 @@
%Include qgsblendmodecombobox.sip

%Include qgisinterface.sip
%Include qgsactionmenu.sip
%Include qgsannotationitem.sip
%Include qgsadvanceddigitizingcanvasitem.sip
%Include qgsadvanceddigitizingdockwidget.sip
%Include qgsattributeeditor.sip
%Include qgsattributeeditorcontext.sip
%Include qgsattributedialog.sip
%Include qgsattributeform.sip
%Include qgsattributeforminterface.sip
%Include qgsbrowsertreeview.sip
%Include qgsbusyindicatordialog.sip
%Include qgscollapsiblegroupbox.sip
%If (HAVE_QSCI_SIP)
@@ -47,6 +50,7 @@
%Include qgsdetaileditemdata.sip
%Include qgsdetaileditemdelegate.sip
%Include qgsdetaileditemwidget.sip
%Include qgsdial.sip
%Include qgsdialog.sip
%Include qgsencodingfiledialog.sip
%Include qgserrordialog.sip
@@ -122,9 +126,11 @@
%Include qgsscalevisibilitydialog.sip
%Include qgsscalewidget.sip
%Include qgssearchquerybuilder.sip
%Include qgsslider.sip
%Include qgssublayersdialog.sip
%Include qgssvgannotationitem.sip
%Include qgstextannotationitem.sip
%Include qgsunitselectionwidget.sip
%Include qgsuserinputdockwidget.sip
%Include qgsvariableeditorwidget.sip
%Include qgsvectorlayertools.sip
@@ -0,0 +1,68 @@
/**
* This class is a menu that is populated automatically with the actions defined for a given layer.
*/

class QgsActionMenu : QMenu
{
%TypeHeaderCode
#include <qgsactionmenu.h>
%End

public:
enum ActionType
{
Invalid, //!< Invalid
MapLayerAction, //!< Standard actions (defined by core or plugins)
AttributeAction //!< Custom actions (manually defined in layer properties)
};

struct ActionData
{
ActionData();

ActionData( int actionId, QgsFeatureId featureId, QgsMapLayer* mapLayer );

ActionData( QgsMapLayerAction* action, QgsFeatureId featureId, QgsMapLayer* mapLayer );

QgsActionMenu::ActionType actionType;

QgsFeatureId featureId;
QgsMapLayer* mapLayer;
};

/**
* Constructs a new QgsActionMenu
*
* @param layer The layer that this action will be run upon.
* @param feature The feature that this action will be run upon. Make sure that this feature is available
* for the lifetime of this object.
* @param parent The usual QWidget parent.
*/
explicit QgsActionMenu( QgsVectorLayer* layer, const QgsFeature* feature, QWidget* parent /TransferThis/ = 0 );

/**
* Constructs a new QgsActionMenu
*
* @param layer The layer that this action will be run upon.
* @param fid The feature id of the feature for which this action will be run.
* @param parent The usual QWidget parent.
*/
explicit QgsActionMenu( QgsVectorLayer* layer, const QgsFeatureId fid, QWidget* parent /TransferThis/ = 0 );

/**
* Destructor
*/
~QgsActionMenu();

/**
* Change the feature on which actions are performed
*
* @param feature A feature. Will not take ownership. It's the callers responsibility to keep the feature
* as long as the menu is displayed and the action is running.
*/
void setFeature( QgsFeature* feature );

signals:
void reinit();

};
@@ -0,0 +1,16 @@
/**
* @brief The QgsAdvancedDigitizingCanvasItem class draws the graphical elements of the CAD tools (@see QgsAdvancedDigitizingDock) on the map canvas.
*/

class QgsAdvancedDigitizingCanvasItem : QgsMapCanvasItem
{
%TypeHeaderCode
#include <qgsadvanceddigitizingcanvasitem.h>
%End
public:

explicit QgsAdvancedDigitizingCanvasItem( QgsMapCanvas* canvas, QgsAdvancedDigitizingDockWidget* cadDockWidget );
~QgsAdvancedDigitizingCanvasItem();

void paint( QPainter *painter );
};
@@ -152,4 +152,9 @@ class QgsAttributeForm : QWidget
* Sets all values to the values of the current feature
*/
void resetValues();

/**
* reload current feature
*/
void refreshFeature();
};
@@ -0,0 +1,29 @@
/**
* The QgsBrowserTreeView class extends QTreeView with save/restore tree state functionality.
*
* @see QgsBrowserModel
* @note added in 2.8
*/
class QgsBrowserTreeView: QTreeView
{
%TypeHeaderCode
#include <qgsbrowsertreeview.h>
%End

public:
QgsBrowserTreeView( QWidget *parent /TransferThis/ = 0 );
~QgsBrowserTreeView();

virtual void setModel( QAbstractItemModel* model );
virtual void showEvent( QShowEvent * e );
virtual void hideEvent( QHideEvent * e );

// returns true if at least one descendat is expanded, used in refresh
bool hasExpandedDescendant( const QModelIndex& index ) const;

// Set section where to store settings (because we have 2 browser dock widgets)
void setSettingsSection( const QString & section );

protected slots:
virtual void rowsInserted( const QModelIndex & parentIndex, int start, int end );
};
@@ -28,4 +28,8 @@ class QgsComposerRuler : QWidget
void mouseMoveEvent( QMouseEvent* event );
void mouseReleaseEvent( QMouseEvent* event );
void mousePressEvent( QMouseEvent* event );

signals:
/** Is emitted when mouse cursor coordinates change*/
void cursorPosChanged( QPointF );
};

0 comments on commit 719ff40

Please sign in to comment.
You can’t perform that action at this time.