Skip to content

Commit

Permalink
Sipify QgsFieldFormatterRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan authored and 3nids committed May 1, 2017
1 parent 1fb7855 commit b399ee5
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 26 deletions.
1 change: 0 additions & 1 deletion python/auto_sip.blacklist
Expand Up @@ -13,7 +13,6 @@ core/qgsexpressioncontextgenerator.sip
core/qgsfeaturefilterprovider.sip
core/qgsfeatureiterator.sip
core/qgsfeaturerequest.sip
core/qgsfieldformatterregistry.sip
core/qgsgeometrysimplifier.sip
core/qgsgeometryvalidator.sip
core/qgsgml.sip
Expand Down
99 changes: 76 additions & 23 deletions python/core/qgsfieldformatterregistry.sip
@@ -1,35 +1,88 @@
/***************************************************************************
qgsfieldformatterregistry.sip - QgsFieldFormatterRegistry

---------------------
begin : 2.12.2016
copyright : (C) 2016 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfieldformatterregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




class QgsFieldFormatterRegistry : QObject
{
%Docstring
The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter.
A reference to the QgsFieldFormatterRegistry can be obtained from
QgsApplication.fieldFormatterRegistry().

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsfieldformatterregistry.h"
%End
public:

QgsFieldFormatterRegistry( QObject* parent /TransferThis/ );
explicit QgsFieldFormatterRegistry( QObject *parent /TransferThis/ = 0 );
%Docstring
You should not normally need to create your own field formatter registry.

Use the one provided by `QgsApplication.fieldFormatterRegistry()` instead.
%End
~QgsFieldFormatterRegistry();

void addFieldFormatter( QgsFieldFormatter* formatter /Transfer/ );
void addFieldFormatter( QgsFieldFormatter *formatter /Transfer/ );
%Docstring
They will take precedence in order of adding them.
The later they are added, the more weight they have.

Ownership is transferred to the registry.
%End

void removeFieldFormatter( QgsFieldFormatter *formatter );
%Docstring
Remove a field formatter from the registry.
The field formatter will be deleted.
%End

void removeFieldFormatter( const QString &id );
%Docstring
Remove the field formatter with the specified id.
%End

QgsFieldFormatter *fieldFormatter( const QString &id ) const;
%Docstring
Get a field formatter by its id. If there is no such id registered,
a default QgsFallbackFieldFormatter with a null id will be returned instead.
:rtype: QgsFieldFormatter
%End

QgsFieldFormatter *fallbackFieldFormatter() const;
%Docstring
Returns a basic fallback field formatter which can be used
to represent any field in an unspectacular manner.
:rtype: QgsFieldFormatter
%End

void removeFieldFormatter( QgsFieldFormatter* formatter );
void removeFieldFormatter( const QString& id );
QgsFieldFormatter* fieldFormatter( const QString& id ) const;
QgsFieldFormatter* fallbackFieldFormatter() const;
signals:
void fieldFormatterAdded( QgsFieldFormatter* formatter );
void fieldFormatterRemoved( QgsFieldFormatter* formatter );

void fieldFormatterAdded( QgsFieldFormatter *formatter );
%Docstring
Will be emitted after a new field formatter has been added.
%End

void fieldFormatterRemoved( QgsFieldFormatter *formatter );
%Docstring
Will be emitted just before a field formatter is removed and deleted.
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsfieldformatterregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
5 changes: 3 additions & 2 deletions src/core/qgsfieldformatterregistry.h
Expand Up @@ -20,6 +20,7 @@
#include <QString>
#include <QObject>

#include "qgis.h"
#include "qgis_core.h"

class QgsFieldFormatter;
Expand All @@ -43,7 +44,7 @@ class CORE_EXPORT QgsFieldFormatterRegistry : public QObject
*
* Use the one provided by `QgsApplication::fieldFormatterRegistry()` instead.
*/
explicit QgsFieldFormatterRegistry( QObject *parent = nullptr );
explicit QgsFieldFormatterRegistry( QObject *parent SIP_TRANSFERTHIS = nullptr );
~QgsFieldFormatterRegistry();

/**
Expand All @@ -52,7 +53,7 @@ class CORE_EXPORT QgsFieldFormatterRegistry : public QObject
*
* Ownership is transferred to the registry.
*/
void addFieldFormatter( QgsFieldFormatter *formatter );
void addFieldFormatter( QgsFieldFormatter *formatter SIP_TRANSFER );

/**
* Remove a field formatter from the registry.
Expand Down

0 comments on commit b399ee5

Please sign in to comment.