Skip to content

Commit

Permalink
[sip] handle Deprecated annotations
Browse files Browse the repository at this point in the history
some additional fixes in headers too
  • Loading branch information
3nids committed May 24, 2017
1 parent 694c811 commit 30a7e44
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 24 deletions.
1 change: 1 addition & 0 deletions cmake_templates/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,7 @@ EXPAND_AS_DEFINED = "SIP_ABSTRACT" \
"SIP_ARRAY" \
"SIP_ARRAYSIZE" \
"SIP_CONVERT_TO_SUBCLASS_CODE" \
"SIP_DEPRECATED" \
"SIP_END" \
"SIP_FACTORY" \
"SIP_FEATURE" \
Expand Down
3 changes: 1 addition & 2 deletions python/gui/qgisinterface.sip
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ Unregister a previously registered action. (e.g. when plugin is going to be unlo
%End


virtual void openURL( const QString &url, bool useQgisDocDirectory = true ) = 0;
virtual void openURL( const QString &url, bool useQgisDocDirectory = true ) = 0 /Deprecated/;
%Docstring
Open a url in the users browser. By default the QGIS doc directory is used
as the base for the URL. To open a URL that is not relative to the installed
Expand All @@ -554,7 +554,6 @@ Unregister a previously registered action. (e.g. when plugin is going to be unlo




virtual QMenu *projectMenu() = 0;
%Docstring
:rtype: QMenu
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsactionmenu.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class QgsActionMenu : QMenu
ActionData( const QgsAction &action, QgsFeatureId featureId, QgsMapLayer *mapLayer );
ActionData( QgsMapLayerAction *action, QgsFeatureId featureId, QgsMapLayer *mapLayer );

ActionType actionType;
QgsActionMenu::ActionType actionType;
QVariant actionData;
QgsFeatureId featureId;
QgsMapLayer *mapLayer;
Expand Down
17 changes: 4 additions & 13 deletions python/gui/qgsattributeform.sip
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ class QgsAttributeForm : QWidget
FilterOr,
};

explicit QgsAttributeForm( QgsVectorLayer *vl, const QgsFeature &feature = QgsFeature(),
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(), QWidget *parent = 0 );
explicit QgsAttributeForm( QgsVectorLayer *vl,
const QgsFeature &feature = QgsFeature(),
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
QWidget *parent /TransferThis/ = 0 );
~QgsAttributeForm();

const QgsFeature &feature();
Expand Down Expand Up @@ -131,17 +133,6 @@ class QgsAttributeForm : QWidget
\param value The new value of the attribute.
%End

void beforeSave( bool &ok );
%Docstring
Will be emitted before the feature is saved. Use this signal to perform sanity checks.
You can set the parameter ok to false to notify the form that you don't want it to be saved.
If you want the form to be saved, leave the parameter untouched.

\param ok Set this parameter to false if you don't want the form to be saved
.. note::

not available in Python bindings
%End

void featureSaved( const QgsFeature &feature );
%Docstring
Expand Down
11 changes: 11 additions & 0 deletions python/gui/qgsattributeformeditorwidget.sip
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ class QgsAttributeFormEditorWidget : QWidget

~QgsAttributeFormEditorWidget();

void createSearchWidgetWrappers( const QString &widgetId, int fieldIdx,
const QVariantMap &config );

%Docstring
Creates the search widget wrappers for the widget used when the form is in
search mode.
\param widgetId id of the widget type to create a search wrapper for
\param fieldIdx index of field associated with widget
\param config configuration which should be used for the widget creation
\param context editor context (not available in Python bindings)
%End

void setMode( Mode mode );
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsbusyindicatordialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class QgsBusyIndicatorDialog : QDialog
%End
public:

QgsBusyIndicatorDialog( const QString &message = "", QWidget *parent = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
QgsBusyIndicatorDialog( const QString &message = "", QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
%Docstring
Constructor
Modal busy indicator dialog with no buttons.
Expand Down
1 change: 1 addition & 0 deletions scripts/sipify.pl
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ ()
$line =~ s/\bSIP_ABSTRACT\b/\/Abstract\//;
$line =~ s/\bSIP_ARRAY\b/\/Array\//g;
$line =~ s/\bSIP_ARRAYSIZE\b/\/ArraySize\//g;
$line =~ s/\bSIP_DEPRECATED\b/\/Deprecated\//g;
$line =~ s/\bSIP_FACTORY\b/\/Factory\//;
$line =~ s/\bSIP_IN\b/\/In\//g;
$line =~ s/\bSIP_INOUT\b/\/In,Out\//g;
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgis_sip.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
*/
#define SIP_NODEFAULTCTORS

/*
* http://pyqt.sourceforge.net/Docs/sip4/annotations.html?highlight=deprecated#function-annotation-Deprecated
*/
#define SIP_DEPRECATED

/*
* discard line
*/
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgisinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class GUI_EXPORT QgisInterface : public QObject
#ifndef Q_MOC_RUN
Q_DECL_DEPRECATED
#endif
virtual void openURL( const QString &url, bool useQgisDocDirectory = true ) = 0;
virtual void openURL( const QString &url, bool useQgisDocDirectory = true ) = 0 SIP_DEPRECATED;


/** Accessors for inserting items into menus and toolbars.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsactionmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class GUI_EXPORT QgsActionMenu : public QMenu
ActionData( const QgsAction &action, QgsFeatureId featureId, QgsMapLayer *mapLayer );
ActionData( QgsMapLayerAction *action, QgsFeatureId featureId, QgsMapLayer *mapLayer );

ActionType actionType;
QgsActionMenu::ActionType actionType;
QVariant actionData;
QgsFeatureId featureId;
QgsMapLayer *mapLayer = nullptr;
Expand Down
8 changes: 5 additions & 3 deletions src/gui/qgsattributeform.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
FilterOr, //!< Filter should be combined using "OR"
};

explicit QgsAttributeForm( QgsVectorLayer *vl, const QgsFeature &feature = QgsFeature(),
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(), QWidget *parent = nullptr );
explicit QgsAttributeForm( QgsVectorLayer *vl,
const QgsFeature &feature = QgsFeature(),
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
QWidget *parent SIP_TRANSFERTHIS = nullptr );
~QgsAttributeForm();

const QgsFeature &feature() { return mFeature; }
Expand Down Expand Up @@ -169,7 +171,7 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
* \param ok Set this parameter to false if you don't want the form to be saved
* \note not available in Python bindings
*/
void beforeSave( bool &ok );
void beforeSave( bool &ok ) SIP_SKIP;

/**
* Is emitted, when a feature is changed or added
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsattributeformeditorwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class GUI_EXPORT QgsAttributeFormEditorWidget : public QWidget
*/
void createSearchWidgetWrappers( const QString &widgetId, int fieldIdx,
const QVariantMap &config,
const QgsAttributeEditorContext &context = QgsAttributeEditorContext() ) SIP_SKIP;
const QgsAttributeEditorContext &context SIP_PYARGREMOVE = QgsAttributeEditorContext() );

/** Sets the current mode for the widget. The widget will adapt its state and visible widgets to
* reflect the updated mode. For example, showing multi edit tool buttons if the mode is set to MultiEditMode.
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsbusyindicatordialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <QDialog>
#include <QLabel>
#include "qgis_gui.h"
#include "qgis_sip.h"


/** \ingroup gui
Expand All @@ -40,7 +41,7 @@ class GUI_EXPORT QgsBusyIndicatorDialog : public QDialog
* \param parent parent object (owner)
* \param fl widget flags
*/
QgsBusyIndicatorDialog( const QString &message = "", QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
QgsBusyIndicatorDialog( const QString &message = "", QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );

QString message() const { return mMessage; }
void setMessage( const QString &message );
Expand Down

0 comments on commit 30a7e44

Please sign in to comment.