71 changes: 69 additions & 2 deletions python/core/qgsanimatedicon.sip
Original file line number Diff line number Diff line change
@@ -1,21 +1,88 @@
/******************************************************************
* This file has been generated automatically by sipify.pl *
* Do not edit manually ! Edit header file and generate it again. *
*****************************************************************/



class QgsAnimatedIcon : QObject
{
%Docstring
\ingroup core
Animated icon is keeping an animation running if there are listeners connected to frameChanged
%End

%TypeHeaderCode
#include <qgsanimatedicon.h>
#include "qgsanimatedicon.h"
%End
public:

QgsAnimatedIcon( const QString &iconPath = QString::null );
QgsAnimatedIcon( const QString &iconPath = QString(), QObject *parent = 0 );
%Docstring
Create a new animated icon. Optionally, the \a iconPath can already be specified.
%End

QString iconPath() const;
%Docstring
Path to a movie, e.g. animated GIF
%End

void setIconPath( const QString &iconPath );
%Docstring
Path to a movie, e.g. animated GIF
%End

QIcon icon() const;
%Docstring
Get the icons representation in the current frame.
This will need to be called repeatedly, whenever a frameChanged()
signal is emitted.
%End


bool connectFrameChanged( const QObject *receiver, const char *method );
%Docstring
Connect a slot that will be notified repeatedly whenever a frame changes and which should
request the current icon and trigger UI updates.

Connect to the frame changed signal with this method and not directly. This method
makes sure the annimation is started.

@note Added in QGIS 3.0
%End

bool disconnectFrameChanged( const QObject *receiver, const char *method );
%Docstring
Convenience function to disconnect the same style that the frame change connection was established.

@note Added in QGIS 3.0
%End


int width() const;
%Docstring
The native width of the icon.

@note Added in QGIS 3.0
%End

int height() const;
%Docstring
The native height of the icon.

@note Added in QGIS 3.0
%End

signals:

void frameChanged();
%Docstring
Emitted when the icon changed. You should use connectFrameChanged instead of connecting
to this signal directly.
Connecting to this signal directly will cause the animation not to be started.

@see connectFrameChanged
%End

};

386 changes: 207 additions & 179 deletions python/core/qgssettings.sip

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions scripts/sipify.pl
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
$line =~ s/\bSIP_KEEPREFERENCE\b/\/KeepReference\//;
$line =~ s/\bSIP_TRANSFERTHIS\b/\/TransferThis\//;
$line =~ s/\bSIP_TRANSFERBACK\b/\/TransferBack\//;
$line =~ s/\bSIP_RELEASEGIL\b/\/ReleaseGIL\//;

$line =~ s/SIP_PYNAME\(\s*(\w+)\s*\)/\/PyName=$1\//;
$line =~ s/(\w+)(\<(?>[^<>]|(?2))*\>)?\s+SIP_PYTYPE\(\s*\'?([^()']+)(\(\s*(?:[^()]++|(?2))*\s*\))?\'?\s*\)/$3/g;
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgis.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,3 +447,8 @@ typedef unsigned long long qgssize;
* specify an alternative default value for SIP methods
*/
#define SIP_PYDEFAULTVALUE(value)

/**
* http://pyqt.sourceforge.net/Docs/sip4/annotations.html?highlight=keepreference#function-annotation-ReleaseGIL
*/
#define SIP_RELEASEGIL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put it maybe above with the other annotations (PYTYPE and PYDEFAUTVALUES are not)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, sounds good to me

3 changes: 1 addition & 2 deletions src/core/qgsactionscope.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
*
* @note Added in QGIS 3.0
*/

class CORE_EXPORT QgsActionScope
{
public:
Expand Down Expand Up @@ -125,6 +124,6 @@ class CORE_EXPORT QgsActionScope
QgsExpressionContextScope mExpressionContextScope;
};

CORE_EXPORT uint qHash( const QgsActionScope &key, uint seed = 0 );
CORE_EXPORT uint qHash( const QgsActionScope &key, uint seed = 0 ) SIP_SKIP;

#endif // QGSACTIONSCOPE_H
26 changes: 15 additions & 11 deletions src/core/qgsanimatedicon.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class CORE_EXPORT QgsAnimatedIcon : public QObject
*/
QIcon icon() const;

#ifndef SIP_RUN

/**
* Connect a slot that will be notified repeatedly whenever a frame changes and which should
* request the current icon and trigger UI updates.
Expand All @@ -76,17 +78,6 @@ class CORE_EXPORT QgsAnimatedIcon : public QObject
return false;
}

/**
* Connect a slot that will be notified repeatedly whenever a frame changes and which should
* request the current icon and trigger UI updates.
*
* Connect to the frame changed signal with this method and not directly. This method
* makes sure the annimation is started.
*
* @note Added in QGIS 3.0
*/
bool connectFrameChanged( const QObject *receiver, const char *method );

/**
* Convenience function to disconnect the same style that the frame change connection was established.
*
Expand All @@ -100,6 +91,19 @@ class CORE_EXPORT QgsAnimatedIcon : public QObject
return disconnect( this, &QgsAnimatedIcon::frameChanged, receiver, slot );
}

#endif

/**
* Connect a slot that will be notified repeatedly whenever a frame changes and which should
* request the current icon and trigger UI updates.
*
* Connect to the frame changed signal with this method and not directly. This method
* makes sure the annimation is started.
*
* @note Added in QGIS 3.0
*/
bool connectFrameChanged( const QObject *receiver, const char *method );

/**
* Convenience function to disconnect the same style that the frame change connection was established.
*
Expand Down
13 changes: 0 additions & 13 deletions src/core/qgsapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ class QgsAnnotationRegistry;
* as theme paths, database paths etc.
*/

#ifdef ANDROID
typedef void XEvent;
#endif

class CORE_EXPORT QgsApplication : public QApplication
{
Q_OBJECT
Expand Down Expand Up @@ -471,15 +467,6 @@ class CORE_EXPORT QgsApplication : public QApplication
*/
static QgsAnnotationRegistry *annotationRegistry();

#ifdef ANDROID
//dummy method to workaround sip generation issue issue
bool x11EventFilter( XEvent *event )
{
Q_UNUSED( event );
return 0;
}
#endif

/**
* Returns the action scope registry.
*
Expand Down
29 changes: 25 additions & 4 deletions src/core/qgssettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <QSettings>
#include "qgis_core.h"
#include "qgis.h"

/** \ingroup core
* \class QgsSettings
Expand Down Expand Up @@ -160,18 +161,38 @@ class CORE_EXPORT QgsSettings : public QObject
void setArrayIndex( int i );
//! Sets the value of setting key to value. If the key already exists, the previous value is overwritten.
//! An optional Section argument can be used to set a value to a specific Section.
void setValue( const QString &key, const QVariant &value, const Section section = Section::NoSection );
void setValue( const QString &key, const QVariant &value, const QgsSettings::Section section = QgsSettings::NoSection );

/** Returns the value for setting key. If the setting doesn't exist, it will be
* searched in the Global Settings and if not found, returns defaultValue.
* If no default value is specified, a default QVariant is returned.
* An optional Section argument can be used to get a value from a specific Section.
*/
#ifndef SIP_RUN
QVariant value( const QString &key, const QVariant &defaultValue = QVariant(),
const Section section = Section::NoSection ) const;
const Section section = NoSection ) const;
#else
SIP_PYOBJECT value( const QString &key, const QVariant &defaultValue = QVariant(),
SIP_PYOBJECT type = 0,
QgsSettings::Section section = QgsSettings::NoSection ) const / ReleaseGIL /;
% MethodCode
typedef PyObject *( *pyqt5_from_qvariant_by_type )( QVariant &value, PyObject *type );
QVariant value;

// QSettings has an internal mutex so release the GIL to avoid the possibility of deadlocks.
Py_BEGIN_ALLOW_THREADS
value = sipCpp->value( *a0, *a1, a3 );
Py_END_ALLOW_THREADS

pyqt5_from_qvariant_by_type f = ( pyqt5_from_qvariant_by_type ) sipImportSymbol( "pyqt5_from_qvariant_by_type" );
sipRes = f( value, a2 );

sipIsErr = !sipRes;
% End
#endif
//! Returns true if there exists a setting called key; returns false otherwise.
//! If a group is set using beginGroup(), key is taken to be relative to that group.
bool contains( const QString &key, const Section section = Section::NoSection ) const;
bool contains( const QString &key, const QgsSettings::Section section = QgsSettings::NoSection ) const;
//! Returns the path where settings written using this QSettings object are stored.
QString fileName() const;
//! Writes any unsaved changes to permanent storage, and reloads any settings that have been
Expand All @@ -182,7 +203,7 @@ class CORE_EXPORT QgsSettings : public QObject
//! Removes the setting key and any sub-settings of key.
void remove( const QString &key );
//! Return the sanitized and prefixed key
QString prefixedKey( const QString &key, const Section section ) const;
QString prefixedKey( const QString &key, const QgsSettings::Section section ) const;
//! Removes all entries in the user settings
void clear();

Expand Down