Skip to content

Commit

Permalink
Minor api cleanups (use Maximum/Minimum instead of min/max), dox
Browse files Browse the repository at this point in the history
fixes (\command instead of @command)
  • Loading branch information
nyalldawson committed Jul 6, 2020
1 parent e2fe098 commit 3263211
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 60 deletions.
34 changes: 23 additions & 11 deletions python/core/auto_generated/layout/qgslayoutitemlegend.sip.in
Expand Up @@ -304,33 +304,45 @@ Sets the legend symbol ``width``.
.. seealso:: :py:func:`symbolWidth`
%End

double maxSymbolSize() const;
double maximumSymbolSize() const;
%Docstring
Returns the legend maximum symbol size (in mm). 0.0 means there is no maximum set
Returns the maximum symbol size (in mm). 0.0 means there is no maximum set.

.. seealso:: :py:func:`setMaximumSymbolSize`

.. versionadded:: 3.16
%End

void setMaxSymbolSize( double size );
void setMaximumSymbolSize( double size );
%Docstring
set maximum symbol size
Set the maximum symbol ``size`` for symbol (in millimeters).

A symbol size of 0.0 indicates no maximum is set.

:param size: maximum size (in mm) or 0.0 if no maximum
.. seealso:: :py:func:`maximumSymbolSize`

.. versionadded:: 3.16
%End

double minSymbolSize() const;
double minimumSymbolSize() const;
%Docstring
Returns the legend minimum symbol size (in mm). 0.0 means there is no minimum set
Returns the minimum symbol size (in mm). A value 0.0 means there is no minimum set.

.. seealso:: :py:func:`setMinimumSymbolSize`

.. versionadded:: 3.16
%End

void setMinSymbolSize( double size );
void setMinimumSymbolSize( double size );
%Docstring
set minimum symbol size for symbol
@param size inimum size (in mm) or 0.0 if no minimum
%End
Set the minimum symbol ``size`` for symbol (in millimeters).

A symbol size of 0.0 indicates no minimum is set.

.. seealso:: :py:func:`minimumSymbolSize`

.. versionadded:: 3.16
%End

void setSymbolAlignment( Qt::AlignmentFlag alignment );
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsbookmarkmanager.sip.in
Expand Up @@ -154,7 +154,7 @@ This constructor creates a bookmark manager which stores bookmarks in an XML fil

void initialize( const QString &filePath );
%Docstring
initialize
Initializes the bookmark manager.
%End

QString addBookmark( const QgsBookmark &bookmark, bool *ok /Out/ = 0 );
Expand Down
38 changes: 28 additions & 10 deletions python/core/auto_generated/qgslegendsettings.sip.in
Expand Up @@ -223,26 +223,44 @@ Sets the default symbol size (in millimeters) used for legend items.
.. seealso:: :py:func:`symbolSize`
%End

double maxSymbolSize() const;
double maximumSymbolSize() const;
%Docstring
Returns the maximum symbol size in mm
Returns the maximum symbol size (in mm). 0.0 means there is no maximum set.

.. seealso:: :py:func:`setMaximumSymbolSize`

.. versionadded:: 3.16
%End

void setMaxSymbolSize( double size );
void setMaximumSymbolSize( double size );
%Docstring
Sets the maximum marker size in mm
@param size maximum size in mm
Set the maximum symbol ``size`` for symbol (in millimeters).

A symbol size of 0.0 indicates no maximum is set.

.. seealso:: :py:func:`maximumSymbolSize`

.. versionadded:: 3.16
%End

double minSymbolSize() const;
double minimumSymbolSize() const;
%Docstring
Returns the minimum symbol size in mm
Returns the minimum symbol size (in mm). A value 0.0 means there is no minimum set.

.. seealso:: :py:func:`setMinimumSymbolSize`

.. versionadded:: 3.16
%End

void setMinSymbolSize( double size );
void setMinimumSymbolSize( double size );
%Docstring
Sets the minimum symbol size in mm
@param size minimum size in mm
Set the minimum symbol ``size`` for symbol (in millimeters).

A symbol size of 0.0 indicates no minimum is set.

.. seealso:: :py:func:`minimumSymbolSize`

.. versionadded:: 3.16
%End

void setSymbolAlignment( Qt::AlignmentFlag alignment );
Expand Down
Expand Up @@ -68,7 +68,7 @@ Start the download

void cancel();
%Docstring
Cancel the download operation
Cancel the download operation.
%End

signals:
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsgeometryvalidationdock.h
Expand Up @@ -28,7 +28,7 @@ class QgisApp;
class QgsVectorLayer;

/**
* @brief The QgsGeometryValidationDock class
* \brief The QgsGeometryValidationDock class
*/
class QgsGeometryValidationDock : public QgsDockWidget, public Ui_QgsGeometryValidationDockBase
{
Expand Down
6 changes: 3 additions & 3 deletions src/auth/oauth2/qgsauthoauth2config.h
Expand Up @@ -68,9 +68,9 @@ class QgsAuthOAuth2Config : public QObject
//! OAuth2 grant flow
enum GrantFlow
{
AuthCode, //!< @see http://tools.ietf.org/html/rfc6749#section-4.1
Implicit, //!< @see http://tools.ietf.org/html/rfc6749#section-4.2
ResourceOwner, //!< @see http://tools.ietf.org/html/rfc6749#section-4.3
AuthCode, //!< See http://tools.ietf.org/html/rfc6749#section-4.1
Implicit, //!< See http://tools.ietf.org/html/rfc6749#section-4.2
ResourceOwner, //!< See http://tools.ietf.org/html/rfc6749#section-4.3
};

//! Configuration format for serialize/unserialize operations
Expand Down
4 changes: 2 additions & 2 deletions src/core/layertree/qgslayertreemodellegendnode.cpp
Expand Up @@ -557,8 +557,8 @@ QSizeF QgsSymbolLegendNode::drawSymbol( const QgsLegendSettings &settings, ItemC
double widthOffset = 0;
double heightOffset = 0;

double maxSymbolSize = settings.maxSymbolSize();
double minSymbolSize = settings.minSymbolSize();
double maxSymbolSize = settings.maximumSymbolSize();
double minSymbolSize = settings.minimumSymbolSize();

if ( QgsMarkerSymbol *markerSymbol = dynamic_cast<QgsMarkerSymbol *>( s ) )
{
Expand Down
8 changes: 4 additions & 4 deletions src/core/layout/qgslayoutitemlegend.cpp
Expand Up @@ -392,22 +392,22 @@ void QgsLayoutItemLegend::setSymbolWidth( double w )
mSettings.setSymbolSize( QSizeF( w, mSettings.symbolSize().height() ) );
}

double QgsLayoutItemLegend::maxSymbolSize() const
double QgsLayoutItemLegend::maximumSymbolSize() const
{
return mSettings.maxSymbolSize();
}

void QgsLayoutItemLegend::setMaxSymbolSize( double size )
void QgsLayoutItemLegend::setMaximumSymbolSize( double size )
{
mSettings.setMaxSymbolSize( size );
}

double QgsLayoutItemLegend::minSymbolSize() const
double QgsLayoutItemLegend::minimumSymbolSize() const
{
return mSettings.minSymbolSize();
}

void QgsLayoutItemLegend::setMinSymbolSize( double size )
void QgsLayoutItemLegend::setMinimumSymbolSize( double size )
{
mSettings.setMinSymbolSize( size );
}
Expand Down
33 changes: 22 additions & 11 deletions src/core/layout/qgslayoutitemlegend.h
Expand Up @@ -319,29 +319,40 @@ class CORE_EXPORT QgsLayoutItemLegend : public QgsLayoutItem
void setSymbolWidth( double width );

/**
* Returns the legend maximum symbol size (in mm). 0.0 means there is no maximum set
* Returns the maximum symbol size (in mm). 0.0 means there is no maximum set.
*
* \see setMaximumSymbolSize()
* \since QGIS 3.16
*/
double maxSymbolSize() const;
double maximumSymbolSize() const;

/**
* \brief set maximum symbol size
* \param size maximum size (in mm) or 0.0 if no maximum
* Set the maximum symbol \a size for symbol (in millimeters).
*
* A symbol size of 0.0 indicates no maximum is set.
*
* \see maximumSymbolSize()
* \since QGIS 3.16
*/
void setMaxSymbolSize( double size );
void setMaximumSymbolSize( double size );

/**
* Returns the legend minimum symbol size (in mm). 0.0 means there is no minimum set
* Returns the minimum symbol size (in mm). A value 0.0 means there is no minimum set.
*
* \see setMinimumSymbolSize
* \since QGIS 3.16
*/
double minSymbolSize() const;
double minimumSymbolSize() const;

/**
* @brief set minimum symbol size for symbol
* @param size inimum size (in mm) or 0.0 if no minimum
* Set the minimum symbol \a size for symbol (in millimeters).
*
* A symbol size of 0.0 indicates no minimum is set.
*
* \see minimumSymbolSize()
* \since QGIS 3.16
*/
void setMinSymbolSize( double size );

void setMinimumSymbolSize( double size );

/**
* Sets the \a alignment for placement of legend symbols.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsbookmarkmanager.h
Expand Up @@ -165,7 +165,7 @@ class CORE_EXPORT QgsBookmarkManager : public QObject
~QgsBookmarkManager() override;

/**
* @brief initialize
* Initializes the bookmark manager.
*/
void initialize( const QString &filePath );

Expand Down
34 changes: 24 additions & 10 deletions src/core/qgslegendsettings.h
Expand Up @@ -235,26 +235,40 @@ class CORE_EXPORT QgsLegendSettings
void setSymbolSize( QSizeF s ) {mSymbolSize = s;}

/**
* Returns the maximum symbol size in mm
* Returns the maximum symbol size (in mm). 0.0 means there is no maximum set.
*
* \see setMaximumSymbolSize()
* \since QGIS 3.16
*/
double maxSymbolSize() const {return mMaxSymbolSize; }
double maximumSymbolSize() const {return mMaxSymbolSize; }

/**
* Sets the maximum marker size in mm
* @param size maximum size in mm
* Set the maximum symbol \a size for symbol (in millimeters).
*
* A symbol size of 0.0 indicates no maximum is set.
*
* \see maximumSymbolSize()
* \since QGIS 3.16
*/
void setMaxSymbolSize( double size ) { mMaxSymbolSize = size;}
void setMaximumSymbolSize( double size ) { mMaxSymbolSize = size;}

/**
* Returns the minimum symbol size in mm
* Returns the minimum symbol size (in mm). A value 0.0 means there is no minimum set.
*
* \see setMinimumSymbolSize
* \since QGIS 3.16
*/
double minSymbolSize() const {return mMinSymbolSize; }
double minimumSymbolSize() const {return mMinSymbolSize; }

/**
* Sets the minimum symbol size in mm
* @param size minimum size in mm
* Set the minimum symbol \a size for symbol (in millimeters).
*
* A symbol size of 0.0 indicates no minimum is set.
*
* \see minimumSymbolSize()
* \since QGIS 3.16
*/
void setMinSymbolSize( double size ) { mMinSymbolSize = size;}
void setMinimumSymbolSize( double size ) { mMinSymbolSize = size;}

/**
* Sets the \a alignment for placement of legend symbols.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsnetworkcontentfetcherregistry.h
Expand Up @@ -88,7 +88,7 @@ class CORE_EXPORT QgsFetchedContent : public QObject
void download( bool redownload = false );

/**
* @brief Cancel the download operation
* Cancel the download operation.
*/
void cancel();

Expand Down
8 changes: 4 additions & 4 deletions src/gui/layout/qgslayoutlegendwidget.cpp
Expand Up @@ -232,8 +232,8 @@ void QgsLayoutLegendWidget::setGuiElements()
mEqualColumnWidthCheckBox->setChecked( mLegend->equalColumnWidth() );
mSymbolWidthSpinBox->setValue( mLegend->symbolWidth() );
mSymbolHeightSpinBox->setValue( mLegend->symbolHeight() );
mMaxSymbolSizeSpinBox->setValue( mLegend->maxSymbolSize() );
mMinSymbolSizeSpinBox->setValue( mLegend->minSymbolSize() );
mMaxSymbolSizeSpinBox->setValue( mLegend->maximumSymbolSize() );
mMinSymbolSizeSpinBox->setValue( mLegend->minimumSymbolSize() );
mWmsLegendWidthSpinBox->setValue( mLegend->wmsLegendWidth() );
mWmsLegendHeightSpinBox->setValue( mLegend->wmsLegendHeight() );
mTitleSpaceBottomSpinBox->setValue( mLegend->style( QgsLegendStyle::Title ).margin( QgsLegendStyle::Bottom ) );
Expand Down Expand Up @@ -412,7 +412,7 @@ void QgsLayoutLegendWidget::mMaxSymbolSizeSpinBox_valueChanged( double d )
if ( mLegend )
{
mLegend->beginCommand( tr( "Change Legend Maximum Symbol Size" ), QgsLayoutItem::UndoLegendMaxSymbolSize );
mLegend->setMaxSymbolSize( d );
mLegend->setMaximumSymbolSize( d );
mLegend->adjustBoxSize();
mLegend->update();
mLegend->endCommand();
Expand All @@ -424,7 +424,7 @@ void QgsLayoutLegendWidget::mMinSymbolSizeSpinBox_valueChanged( double d )
if ( mLegend )
{
mLegend->beginCommand( tr( "Change Legend Minimum Symbol Size" ), QgsLayoutItem::UndoLegendMinSymbolSize );
mLegend->setMinSymbolSize( d );
mLegend->setMinimumSymbolSize( d );
mLegend->adjustBoxSize();
mLegend->update();
mLegend->endCommand();
Expand Down

0 comments on commit 3263211

Please sign in to comment.