Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE][layouts] Allow configuring legend patch shapes by
double-clicking on legend items Allows users to set custom legend patch shapes for items by entering a WKT string representing the patch geometry
- Loading branch information
1 parent
3d7e5d6
commit ddbcb1f
Showing
17 changed files
with
1,139 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
python/gui/auto_generated/qgslegendpatchshapebutton.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgslegendpatchshapebutton.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsLegendPatchShapeButton : QToolButton | ||
{ | ||
%Docstring | ||
A button for creating and modifying QgsLegendPatchShape settings. | ||
|
||
.. versionadded:: 3.14 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslegendpatchshapebutton.h" | ||
%End | ||
public: | ||
|
||
QgsLegendPatchShapeButton( QWidget *parent /TransferThis/ = 0, const QString &dialogTitle = QString() ); | ||
%Docstring | ||
Construct a new patch shape button with the specified ``parent`` widget. | ||
Use ``dialogTitle`` string to define the title to show in the legend patch shape widget. | ||
%End | ||
|
||
virtual QSize minimumSizeHint() const; | ||
|
||
virtual QSize sizeHint() const; | ||
|
||
|
||
void setSymbolType( QgsSymbol::SymbolType type ); | ||
%Docstring | ||
Sets the symbol ``type`` which the button requires. | ||
If the type differs from the current symbol type, the symbol will be reset | ||
to a default symbol style of the new type. | ||
|
||
.. seealso:: :py:func:`symbolType` | ||
%End | ||
|
||
QgsSymbol::SymbolType symbolType() const; | ||
%Docstring | ||
Returns the symbol type which the button requires. | ||
|
||
.. seealso:: :py:func:`setSymbolType` | ||
%End | ||
|
||
void setPreviewSymbol( QgsSymbol *symbol /Transfer/ ); | ||
%Docstring | ||
Sets the symbol to use for previewing the legend patch shape. | ||
|
||
Ownership is transferred to the button. It is the caller's responsiblity | ||
to ensure that the symbol type matches the button's symbolType() | ||
%End | ||
|
||
void setDialogTitle( const QString &title ); | ||
%Docstring | ||
Sets the ``title`` for the symbol settings dialog window. | ||
|
||
.. seealso:: :py:func:`dialogTitle` | ||
%End | ||
|
||
QString dialogTitle() const; | ||
%Docstring | ||
Returns the title for the symbol settings dialog window. | ||
|
||
.. seealso:: :py:func:`setDialogTitle` | ||
%End | ||
|
||
QgsLegendPatchShape shape(); | ||
%Docstring | ||
Returns the current shape defined by the button. | ||
|
||
.. seealso:: :py:func:`setShape` | ||
|
||
.. seealso:: :py:func:`changed` | ||
%End | ||
|
||
void setMessageBar( QgsMessageBar *bar ); | ||
%Docstring | ||
Sets the message ``bar`` associated with the widget. This allows the widget to push feedback messages | ||
to the appropriate message bar. | ||
|
||
.. seealso:: :py:func:`messageBar` | ||
|
||
.. versionadded:: 3.6 | ||
%End | ||
|
||
QgsMessageBar *messageBar() const; | ||
%Docstring | ||
Returns the message bar associated with the widget. | ||
|
||
.. seealso:: :py:func:`setMessageBar` | ||
|
||
.. versionadded:: 3.6 | ||
%End | ||
|
||
public slots: | ||
|
||
void setShape( const QgsLegendPatchShape &shape ); | ||
%Docstring | ||
Sets the ``shape`` for the button. | ||
|
||
.. seealso:: :py:func:`shape` | ||
|
||
.. seealso:: :py:func:`changed` | ||
%End | ||
|
||
void setToDefault(); | ||
%Docstring | ||
Resets the shape to the default shape. | ||
%End | ||
|
||
signals: | ||
|
||
void changed(); | ||
%Docstring | ||
Emitted when the shape's settings are changed. | ||
|
||
.. seealso:: :py:func:`shape` | ||
|
||
.. seealso:: :py:func:`setShape` | ||
%End | ||
|
||
protected: | ||
|
||
virtual void changeEvent( QEvent *e ); | ||
|
||
virtual void showEvent( QShowEvent *e ); | ||
|
||
virtual void resizeEvent( QResizeEvent *event ); | ||
|
||
|
||
virtual void mousePressEvent( QMouseEvent *e ); | ||
|
||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgslegendpatchshapebutton.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
58 changes: 58 additions & 0 deletions
58
python/gui/auto_generated/qgslegendpatchshapewidget.sip.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgslegendpatchshapewidget.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsLegendPatchShapeWidget : QgsPanelWidget | ||
{ | ||
%Docstring | ||
Widget for configuring a custom legend patch shape. | ||
|
||
.. versionadded:: 3.14 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslegendpatchshapewidget.h" | ||
%End | ||
public: | ||
|
||
QgsLegendPatchShapeWidget( QWidget *parent /TransferThis/ = 0, const QgsLegendPatchShape &shape = QgsLegendPatchShape() ); | ||
%Docstring | ||
Constructor for QgsLegendPatchShapeWidget, with the specified ``parent`` widget. | ||
%End | ||
|
||
QgsLegendPatchShape shape() const; | ||
%Docstring | ||
Returns the legend patch shape as currently defined by the widget. | ||
|
||
.. seealso:: :py:func:`setShape` | ||
%End | ||
|
||
void setShape( const QgsLegendPatchShape &shape ); | ||
%Docstring | ||
Sets the shape to show in the widget. | ||
|
||
.. seealso:: :py:func:`shape` | ||
%End | ||
|
||
signals: | ||
|
||
void changed(); | ||
%Docstring | ||
Emitted whenever the patch shape defined by the widget is changed. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgslegendpatchshapewidget.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.