Skip to content
Permalink
Browse files
[sipify] Replace :: with . during doxygen->docstring conversion
e.g.

You can use QgsXmlUtils::writeVariant to save it to an XML document
->
You can use QgsXmlUtils.writeVariant to load it from an XML document
  • Loading branch information
nyalldawson committed Apr 5, 2017
1 parent 3c4a9fd commit 4eeacb8fdfc97ab66bd9d312bd833ed76fb306e3
@@ -19,7 +19,7 @@ class QgsAnnotationManager : QObject

QgsAnnotationManager handles the storage, serializing and deserializing
of QgsAnnotations. Usually this class is not constructed directly, but
rather accessed through a QgsProject via QgsProject::annotationManager().
rather accessed through a QgsProject via QgsProject.annotationManager().

QgsAnnotationManager retains ownership of all the annotations contained
in the manager.
@@ -16,7 +16,7 @@ class QgsProcessingRegistry : QObject
and various parameters and outputs.

QgsProcessingRegistry is not usually directly created, but rather accessed through
QgsApplication::processingRegistry().
QgsApplication.processingRegistry().
.. versionadded:: 3.0
%End

@@ -18,7 +18,7 @@ class QgsActionScopeRegistry : QObject
To get access use the QgsApplication:

```
QgsApplication::actionScopeRegistry()
QgsApplication.actionScopeRegistry()
```

.. versionadded:: 3.0
@@ -34,7 +34,7 @@ class QgsActionScopeRegistry : QObject
%Docstring
Create a new QgsActionScopeRegistry.
QGIS already creates a central registry. You will normally
want to use QgsApplication::actionScopeRegistry() to get access
want to use QgsApplication.actionScopeRegistry() to get access
to that one instead.

.. versionadded:: 3.0
@@ -203,7 +203,7 @@ class QgsConditionalStyle
If no match is found a invalid QgsConditionalStyle is return.

\returns A condtional style that matches the value and feature.
Check with QgsConditionalStyle::isValid()
Check with QgsConditionalStyle.isValid()
%End

static QgsConditionalStyle matchingConditionalStyle( const QList<QgsConditionalStyle> &styles, const QVariant &value, QgsExpressionContext &context );
@@ -212,7 +212,7 @@ class QgsConditionalStyle
If no match is found a invalid QgsConditionalStyle is return.

\returns A condtional style that matches the value and feature.
Check with QgsConditionalStyle::isValid()
Check with QgsConditionalStyle.isValid()
%End

static QgsConditionalStyle compressStyles( const QList<QgsConditionalStyle> &styles );
@@ -98,15 +98,15 @@ class QgsCurveTransform
QVariant toVariant() const;
%Docstring
Saves this curve transformer to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils::writeVariant to save it to an XML document.
You can use QgsXmlUtils.writeVariant to save it to an XML document.

\see loadVariant()
%End

bool loadVariant( const QVariant &transformer );
%Docstring
Load this curve transformer from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils::writeVariant to load it from an XML document.
You can use QgsXmlUtils.writeVariant to load it from an XML document.

\see toVariant()
%End
@@ -179,15 +179,15 @@ class QgsPropertyTransformer
virtual bool loadVariant( const QVariant &transformer );
%Docstring
Loads this transformer from a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils::writeVariant to save it to an XML document.
You can use QgsXmlUtils.writeVariant to save it to an XML document.

\see loadVariant()
%End

virtual QVariant toVariant() const;
%Docstring
Saves this transformer to a QVariantMap, wrapped in a QVariant.
You can use QgsXmlUtils::writeVariant to save it to an XML document.
You can use QgsXmlUtils.writeVariant to save it to an XML document.

\see toVariant()
%End
@@ -69,11 +69,11 @@ class QgsSettings : QObject
%Docstring
Construct a QgsSettings object for accessing settings of the application called application
from the organization called organization, and with parent parent.
If scope is QSettings::UserScope, the QSettings object searches user-specific settings first,
before it searches system-wide settings as a fallback. If scope is QSettings::SystemScope,
If scope is QSettings.UserScope, the QSettings object searches user-specific settings first,
before it searches system-wide settings as a fallback. If scope is QSettings.SystemScope,
the QSettings object ignores user-specific settings and provides access to system-wide settings.

The storage format is set to QSettings::NativeFormat (i.e. calling setDefaultFormat() before
The storage format is set to QSettings.NativeFormat (i.e. calling setDefaultFormat() before
calling this constructor has no effect).

If no application name is given, the QSettings object will only access the organization-wide
@@ -85,11 +85,11 @@ class QgsSettings : QObject
%Docstring
Construct a QgsSettings object for accessing settings of the application called application
from the organization called organization, and with parent parent.
If scope is QSettings::UserScope, the QSettings object searches user-specific settings first,
before it searches system-wide settings as a fallback. If scope is QSettings::SystemScope,
If scope is QSettings.UserScope, the QSettings object searches user-specific settings first,
before it searches system-wide settings as a fallback. If scope is QSettings.SystemScope,
the QSettings object ignores user-specific settings and provides access to system-wide settings.
If format is QSettings::NativeFormat, the native API is used for storing settings. If format
is QSettings::IniFormat, the INI format is used.
If format is QSettings.NativeFormat, the native API is used for storing settings. If format
is QSettings.IniFormat, the INI format is used.

If no application name is given, the QSettings object will only access the organization-wide
locations.
@@ -100,11 +100,11 @@ class QgsSettings : QObject
Construct a QgsSettings object for accessing the settings stored in the file called fileName,
with parent parent. If the file doesn't already exist, it is created.

If format is QSettings::NativeFormat, the meaning of fileName depends on the platform. On Unix,
If format is QSettings.NativeFormat, the meaning of fileName depends on the platform. On Unix,
fileName is the name of an INI file. On macOS and iOS, fileName is the name of a .plist file.
On Windows, fileName is a path in the system registry.

If format is QSettings::IniFormat, fileName is the name of an INI file.
If format is QSettings.IniFormat, fileName is the name of an INI file.

Warning: This function is provided for convenience. It works well for accessing INI or .plist
files generated by Qt, but might fail on some syntaxes found in such files originated by
@@ -119,10 +119,10 @@ class QgsSettings : QObject
explicit QgsSettings( QObject *parent = 0 );
%Docstring
Constructs a QgsSettings object for accessing settings of the application and organization
set previously with a call to QCoreApplication::setOrganizationName(),
QCoreApplication::setOrganizationDomain(), and QCoreApplication::setApplicationName().
set previously with a call to QCoreApplication.setOrganizationName(),
QCoreApplication.setOrganizationDomain(), and QCoreApplication.setApplicationName().

The scope is QSettings::UserScope and the format is defaultFormat() (QSettings::NativeFormat
The scope is QSettings.UserScope and the format is defaultFormat() (QSettings.NativeFormat
by default). Use setDefaultFormat() before calling this constructor to change the default
format used by this constructor.
%End
@@ -55,7 +55,7 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator

- crs=definition
Defines the coordinate reference system to use for the layer.
definition is any string accepted by QgsCoordinateReferenceSystem::createFromString()
definition is any string accepted by QgsCoordinateReferenceSystem.createFromString()

- index=yes
Specifies that the layer will be constructed with a spatial index
@@ -257,7 +257,7 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
- crs=crsstring

Defines the coordinate reference system used for the layer. This can be
any string accepted by QgsCoordinateReferenceSystem::createFromString()
any string accepted by QgsCoordinateReferenceSystem.createFromString()

-subsetIndex=(yes|no)

@@ -663,15 +663,15 @@ Return the provider type for this layer
Reads vector layer specific state from project file Dom node.
.. note::

Called by QgsMapLayer::readXml().
Called by QgsMapLayer.readXml().
%End

virtual bool writeXml( QDomNode &layer_node, QDomDocument &doc ) const;
%Docstring
Write vector layer specific state to project file Dom node.
.. note::

Called by QgsMapLayer::writeXml().
Called by QgsMapLayer.writeXml().
%End

void resolveReferences( QgsProject *project );
@@ -815,7 +815,7 @@ Return the provider type for this layer
virtual QString subsetString() const;
%Docstring
Get the string (typically sql) used to define a subset of the layer
\returns The subset string or QString::null if not implemented by the provider
\returns The subset string or QString.null if not implemented by the provider
%End

QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;
@@ -1711,7 +1711,7 @@ Is emitted, before changes are rolled back
void attributeAdded( int idx );
%Docstring
Will be emitted, when a new attribute has been added to this vector layer.
Applies only to types QgsFields::OriginEdit, QgsFields::OriginProvider and QgsFields::OriginExpression
Applies only to types QgsFields.OriginEdit, QgsFields.OriginProvider and QgsFields.OriginExpression

\param idx The index of the new attribute

@@ -1721,15 +1721,15 @@ Is emitted, before changes are rolled back
void beforeAddingExpressionField( const QString &fieldName );
%Docstring
Will be emitted, when an expression field is going to be added to this vector layer.
Applies only to types QgsFields::OriginExpression
Applies only to types QgsFields.OriginExpression

\param fieldName The name of the attribute to be added
%End

void attributeDeleted( int idx );
%Docstring
Will be emitted, when an attribute has been deleted from this vector layer.
Applies only to types QgsFields::OriginEdit, QgsFields::OriginProvider and QgsFields::OriginExpression
Applies only to types QgsFields.OriginEdit, QgsFields.OriginProvider and QgsFields.OriginExpression

\param idx The index of the deleted attribute

@@ -1739,7 +1739,7 @@ Is emitted, before changes are rolled back
void beforeRemovingExpressionField( int idx );
%Docstring
Will be emitted, when an expression field is going to be deleted from this vector layer.
Applies only to types QgsFields::OriginExpression
Applies only to types QgsFields.OriginExpression

\param idx The index of the attribute to be deleted
%End
@@ -12,6 +12,8 @@ sub processDoxygenLine
my $line = $_[0];
# remove \a formatting
$line =~ s/\\a //g;
# replace :: with . (changes c++ style namespace/class directives to Python style)
$line =~ s/::/./g;
if ( $line =~ m/[\\@](ingroup|class)/ ) {
return ""
}
@@ -40,6 +40,8 @@ class QgsSipifyHeader : QtClass<QVariant>
{
%Docstring
Documentation goes here

Here's some comment mentioning another class QgsAutoAwesomemater.makeAwesome.
.. versionadded:: 3.0
.. note::

@@ -126,6 +128,7 @@ Factory annotation
some brief
My long doc string
is not very interesting!
Here's some comment mentioning another class QgsAutoAwesomemater.makeLessAwesome.
%End

bool isOKwithErrMesg( QString &ErrMsg /Out/ );
@@ -77,6 +77,8 @@ typedef QVector<QVariant> QgsSuperClass;

/** \ingroup core
* Documentation goes here
*
* Here's some comment mentioning another class QgsAutoAwesomemater::makeAwesome.
* \since QGIS 3.0
* \note some other note
*/
@@ -157,6 +159,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private QgsBaseCla
* \brief some brief
* My long doc \a string
* is not very interesting!
* Here's some comment mentioning another class QgsAutoAwesomemater::makeLessAwesome.
*/
void LongDocStringMethodWithBrief();

0 comments on commit 4eeacb8

Please sign in to comment.