Skip to content

Commit

Permalink
better wording and dox
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 11, 2021
1 parent 700c16e commit 58dcd24
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 29 deletions.
13 changes: 6 additions & 7 deletions python/gui/auto_generated/qgsfilecontentsourcelineedit.sip.in
Expand Up @@ -97,13 +97,11 @@ Emitted whenever the file source is changed in the widget.



class QgsSvgOrImageSourceLineEdit : QgsAbstractFileContentSourceLineEdit
class QgsPictureSourceLineEditBase : QgsAbstractFileContentSourceLineEdit
{
%Docstring(signature="appended")
A line edit widget with toolbutton for setting a raster image path.

Designed for use with :py:class:`QgsImageCache`.

.. seealso:: :py:class:`QgsSvgSourceLineEdit`

.. versionadded:: 3.20
Expand All @@ -120,9 +118,10 @@ Designed for use with :py:class:`QgsImageCache`.
Image,
};

QgsSvgOrImageSourceLineEdit( QWidget *parent /TransferThis/ = 0 );
QgsPictureSourceLineEditBase( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for :py:class:`QgsImageSourceLineEdit`, with the specified ``parent`` widget.
The default format is SVG.
%End

void setMode( Format format );
Expand All @@ -132,15 +131,15 @@ Defines the mode of the source line edit

protected:

QgsSvgOrImageSourceLineEdit( Format format, QWidget *parent /TransferThis/ = 0 );
QgsPictureSourceLineEditBase( Format format, QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for :py:class:`QgsImageSourceLineEdit`, with the specified ``parent`` widget.
%End

};


class QgsSvgSourceLineEdit : QgsSvgOrImageSourceLineEdit
class QgsSvgSourceLineEdit : QgsPictureSourceLineEditBase
{
%Docstring(signature="appended")
A line edit widget with toolbutton for setting an SVG image path.
Expand All @@ -163,7 +162,7 @@ Constructor for QgsSvgSourceLineEdit, with the specified ``parent`` widget.
%End
};

class QgsImageSourceLineEdit : QgsSvgOrImageSourceLineEdit
class QgsImageSourceLineEdit : QgsPictureSourceLineEditBase
{
%Docstring(signature="appended")
A line edit widget with toolbutton for setting a raster image path.
Expand Down
Expand Up @@ -156,15 +156,15 @@ Returns if the SVG browser should be visible

void setAllowAnyImage( bool allowAnyImage );
%Docstring
Defines if the widget should allow any image
Defines if the widget should allow any raster or SVG image
or if the file chooser will be limited to open SVG files

.. versionadded:: 3.20
%End

bool allowAnyImage() const;
%Docstring
Returns if the widget should allow any image
Returns if the widget should allow any raster or SVG image
or if the file chooser will be limited to open SVG files

.. versionadded:: 3.20
Expand Down
14 changes: 7 additions & 7 deletions src/gui/qgsfilecontentsourcelineedit.cpp
Expand Up @@ -287,7 +287,7 @@ QgsMessageBar *QgsAbstractFileContentSourceLineEdit::messageBar() const

///@cond PRIVATE

QString QgsSvgOrImageSourceLineEdit::fileFilter() const
QString QgsPictureSourceLineEditBase::fileFilter() const
{
switch ( mFormat )
{
Expand All @@ -298,7 +298,7 @@ QString QgsSvgOrImageSourceLineEdit::fileFilter() const
}
}

QString QgsSvgOrImageSourceLineEdit::selectFileTitle() const
QString QgsPictureSourceLineEditBase::selectFileTitle() const
{
switch ( mFormat )
{
Expand All @@ -309,7 +309,7 @@ QString QgsSvgOrImageSourceLineEdit::selectFileTitle() const
}
}

QString QgsSvgOrImageSourceLineEdit::fileFromUrlTitle() const
QString QgsPictureSourceLineEditBase::fileFromUrlTitle() const
{
switch ( mFormat )
{
Expand All @@ -320,7 +320,7 @@ QString QgsSvgOrImageSourceLineEdit::fileFromUrlTitle() const
}
}

QString QgsSvgOrImageSourceLineEdit::fileFromUrlText() const
QString QgsPictureSourceLineEditBase::fileFromUrlText() const
{
switch ( mFormat )
{
Expand All @@ -331,7 +331,7 @@ QString QgsSvgOrImageSourceLineEdit::fileFromUrlText() const
}
}

QString QgsSvgOrImageSourceLineEdit::embedFileTitle() const
QString QgsPictureSourceLineEditBase::embedFileTitle() const
{
switch ( mFormat )
{
Expand All @@ -342,7 +342,7 @@ QString QgsSvgOrImageSourceLineEdit::embedFileTitle() const
}
}

QString QgsSvgOrImageSourceLineEdit::extractFileTitle() const
QString QgsPictureSourceLineEditBase::extractFileTitle() const
{
switch ( mFormat )
{
Expand All @@ -353,7 +353,7 @@ QString QgsSvgOrImageSourceLineEdit::extractFileTitle() const
}
}

QString QgsSvgOrImageSourceLineEdit::defaultSettingsKey() const
QString QgsPictureSourceLineEditBase::defaultSettingsKey() const
{
switch ( mFormat )
{
Expand Down
17 changes: 8 additions & 9 deletions src/gui/qgsfilecontentsourcelineedit.h
Expand Up @@ -183,13 +183,11 @@ class GUI_EXPORT QgsAbstractFileContentSourceLineEdit : public QWidget SIP_ABSTR
* \class QgsImageSourceLineEdit
* \brief A line edit widget with toolbutton for setting a raster image path.
*
* Designed for use with QgsImageCache.
*
* \see QgsSvgSourceLineEdit
*
* \since QGIS 3.20
*/
class GUI_EXPORT QgsSvgOrImageSourceLineEdit : public QgsAbstractFileContentSourceLineEdit
class GUI_EXPORT QgsPictureSourceLineEditBase : public QgsAbstractFileContentSourceLineEdit
{
Q_OBJECT
public:
Expand All @@ -205,8 +203,9 @@ class GUI_EXPORT QgsSvgOrImageSourceLineEdit : public QgsAbstractFileContentSour

/**
* Constructor for QgsImageSourceLineEdit, with the specified \a parent widget.
* The default format is SVG.
*/
QgsSvgOrImageSourceLineEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr )
QgsPictureSourceLineEditBase( QWidget *parent SIP_TRANSFERTHIS = nullptr )
: QgsAbstractFileContentSourceLineEdit( parent )
{}

Expand All @@ -218,7 +217,7 @@ class GUI_EXPORT QgsSvgOrImageSourceLineEdit : public QgsAbstractFileContentSour
/**
* Constructor for QgsImageSourceLineEdit, with the specified \a parent widget.
*/
QgsSvgOrImageSourceLineEdit( Format format, QWidget *parent SIP_TRANSFERTHIS = nullptr )
QgsPictureSourceLineEditBase( Format format, QWidget *parent SIP_TRANSFERTHIS = nullptr )
: QgsAbstractFileContentSourceLineEdit( parent )
, mFormat( format )
{}
Expand Down Expand Up @@ -251,7 +250,7 @@ class GUI_EXPORT QgsSvgOrImageSourceLineEdit : public QgsAbstractFileContentSour
*
* \since QGIS 3.4
*/
class GUI_EXPORT QgsSvgSourceLineEdit : public QgsSvgOrImageSourceLineEdit
class GUI_EXPORT QgsSvgSourceLineEdit : public QgsPictureSourceLineEditBase
{
Q_OBJECT
public:
Expand All @@ -260,7 +259,7 @@ class GUI_EXPORT QgsSvgSourceLineEdit : public QgsSvgOrImageSourceLineEdit
* Constructor for QgsSvgSourceLineEdit, with the specified \a parent widget.
*/
QgsSvgSourceLineEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr )
: QgsSvgOrImageSourceLineEdit( Svg, parent )
: QgsPictureSourceLineEditBase( Svg, parent )
{}
};

Expand All @@ -275,7 +274,7 @@ class GUI_EXPORT QgsSvgSourceLineEdit : public QgsSvgOrImageSourceLineEdit
*
* \since QGIS 3.6
*/
class GUI_EXPORT QgsImageSourceLineEdit : public QgsSvgOrImageSourceLineEdit
class GUI_EXPORT QgsImageSourceLineEdit : public QgsPictureSourceLineEditBase
{
Q_OBJECT
public:
Expand All @@ -284,7 +283,7 @@ class GUI_EXPORT QgsImageSourceLineEdit : public QgsSvgOrImageSourceLineEdit
* Constructor for QgsImageSourceLineEdit, with the specified \a parent widget.
*/
QgsImageSourceLineEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr )
: QgsSvgOrImageSourceLineEdit( Image, parent )
: QgsPictureSourceLineEditBase( Image, parent )
{}
};

Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology/qgssvgselectorwidget.cpp
Expand Up @@ -499,9 +499,9 @@ void QgsSvgSelectorWidget::setAllowAnyImage( bool allowAnyImage )
mAllowAnyImage = allowAnyImage;

if ( allowAnyImage )
mSourceLineEdit->setMode( QgsSvgOrImageSourceLineEdit::Image );
mSourceLineEdit->setMode( QgsPictureSourceLineEditBase::Image );
else
mSourceLineEdit->setMode( QgsSvgOrImageSourceLineEdit::Svg );
mSourceLineEdit->setMode( QgsPictureSourceLineEditBase::Svg );
}

QgsPropertyOverrideButton *QgsSvgSelectorWidget::propertyOverrideToolButton() const
Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology/qgssvgselectorwidget.h
Expand Up @@ -425,14 +425,14 @@ class GUI_EXPORT QgsSvgSelectorWidget : public QWidget, private Ui::WidgetSvgSel
bool browserVisible() const {return mBrowserVisible;}

/**
* Defines if the widget should allow any image
* Defines if the widget should allow any raster or SVG image
* or if the file chooser will be limited to open SVG files
* \since QGIS 3.20
*/
void setAllowAnyImage( bool allowAnyImage );

/**
* Returns if the widget should allow any image
* Returns if the widget should allow any raster or SVG image
* or if the file chooser will be limited to open SVG files
* \since QGIS 3.20
*/
Expand Down

0 comments on commit 58dcd24

Please sign in to comment.