Skip to content

Commit b399ee5

Browse files
arnaud-morvan3nids
authored andcommitted
Sipify QgsFieldFormatterRegistry
1 parent 1fb7855 commit b399ee5

File tree

3 files changed

+79
-26
lines changed

3 files changed

+79
-26
lines changed

python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ core/qgsexpressioncontextgenerator.sip
1313
core/qgsfeaturefilterprovider.sip
1414
core/qgsfeatureiterator.sip
1515
core/qgsfeaturerequest.sip
16-
core/qgsfieldformatterregistry.sip
1716
core/qgsgeometrysimplifier.sip
1817
core/qgsgeometryvalidator.sip
1918
core/qgsgml.sip
Lines changed: 76 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,88 @@
1-
/***************************************************************************
2-
qgsfieldformatterregistry.sip - QgsFieldFormatterRegistry
3-
4-
---------------------
5-
begin : 2.12.2016
6-
copyright : (C) 2016 by Matthias Kuhn
7-
email : matthias@opengis.ch
8-
***************************************************************************
9-
* *
10-
* This program is free software; you can redistribute it and/or modify *
11-
* it under the terms of the GNU General Public License as published by *
12-
* the Free Software Foundation; either version 2 of the License, or *
13-
* (at your option) any later version. *
14-
* *
15-
***************************************************************************/
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/qgsfieldformatterregistry.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
1612
class QgsFieldFormatterRegistry : QObject
1713
{
14+
%Docstring
15+
The QgsFieldFormatterRegistry manages registered classes of QgsFieldFormatter.
16+
A reference to the QgsFieldFormatterRegistry can be obtained from
17+
QgsApplication.fieldFormatterRegistry().
18+
19+
.. versionadded:: 3.0
20+
%End
21+
1822
%TypeHeaderCode
1923
#include "qgsfieldformatterregistry.h"
2024
%End
2125
public:
2226

23-
QgsFieldFormatterRegistry( QObject* parent /TransferThis/ );
27+
explicit QgsFieldFormatterRegistry( QObject *parent /TransferThis/ = 0 );
28+
%Docstring
29+
You should not normally need to create your own field formatter registry.
30+
31+
Use the one provided by `QgsApplication.fieldFormatterRegistry()` instead.
32+
%End
2433
~QgsFieldFormatterRegistry();
2534

26-
void addFieldFormatter( QgsFieldFormatter* formatter /Transfer/ );
35+
void addFieldFormatter( QgsFieldFormatter *formatter /Transfer/ );
36+
%Docstring
37+
They will take precedence in order of adding them.
38+
The later they are added, the more weight they have.
39+
40+
Ownership is transferred to the registry.
41+
%End
42+
43+
void removeFieldFormatter( QgsFieldFormatter *formatter );
44+
%Docstring
45+
Remove a field formatter from the registry.
46+
The field formatter will be deleted.
47+
%End
48+
49+
void removeFieldFormatter( const QString &id );
50+
%Docstring
51+
Remove the field formatter with the specified id.
52+
%End
53+
54+
QgsFieldFormatter *fieldFormatter( const QString &id ) const;
55+
%Docstring
56+
Get a field formatter by its id. If there is no such id registered,
57+
a default QgsFallbackFieldFormatter with a null id will be returned instead.
58+
:rtype: QgsFieldFormatter
59+
%End
60+
61+
QgsFieldFormatter *fallbackFieldFormatter() const;
62+
%Docstring
63+
Returns a basic fallback field formatter which can be used
64+
to represent any field in an unspectacular manner.
65+
:rtype: QgsFieldFormatter
66+
%End
2767

28-
void removeFieldFormatter( QgsFieldFormatter* formatter );
29-
void removeFieldFormatter( const QString& id );
30-
QgsFieldFormatter* fieldFormatter( const QString& id ) const;
31-
QgsFieldFormatter* fallbackFieldFormatter() const;
3268
signals:
33-
void fieldFormatterAdded( QgsFieldFormatter* formatter );
34-
void fieldFormatterRemoved( QgsFieldFormatter* formatter );
69+
70+
void fieldFormatterAdded( QgsFieldFormatter *formatter );
71+
%Docstring
72+
Will be emitted after a new field formatter has been added.
73+
%End
74+
75+
void fieldFormatterRemoved( QgsFieldFormatter *formatter );
76+
%Docstring
77+
Will be emitted just before a field formatter is removed and deleted.
78+
%End
79+
3580
};
81+
82+
/************************************************************************
83+
* This file has been generated automatically from *
84+
* *
85+
* src/core/qgsfieldformatterregistry.h *
86+
* *
87+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
88+
************************************************************************/

src/core/qgsfieldformatterregistry.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <QString>
2121
#include <QObject>
2222

23+
#include "qgis.h"
2324
#include "qgis_core.h"
2425

2526
class QgsFieldFormatter;
@@ -43,7 +44,7 @@ class CORE_EXPORT QgsFieldFormatterRegistry : public QObject
4344
*
4445
* Use the one provided by `QgsApplication::fieldFormatterRegistry()` instead.
4546
*/
46-
explicit QgsFieldFormatterRegistry( QObject *parent = nullptr );
47+
explicit QgsFieldFormatterRegistry( QObject *parent SIP_TRANSFERTHIS = nullptr );
4748
~QgsFieldFormatterRegistry();
4849

4950
/**
@@ -52,7 +53,7 @@ class CORE_EXPORT QgsFieldFormatterRegistry : public QObject
5253
*
5354
* Ownership is transferred to the registry.
5455
*/
55-
void addFieldFormatter( QgsFieldFormatter *formatter );
56+
void addFieldFormatter( QgsFieldFormatter *formatter SIP_TRANSFER );
5657

5758
/**
5859
* Remove a field formatter from the registry.

0 commit comments

Comments
 (0)