QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
QgsLegendPatchShapeButton Class Reference

A button for creating and modifying QgsLegendPatchShape settings. More...

#include <qgslegendpatchshapebutton.h>

Inheritance diagram for QgsLegendPatchShapeButton:
Inheritance graph
[legend]

Public Slots

void setShape (const QgsLegendPatchShape &shape)
 Sets the shape for the button. More...
 
void setToDefault ()
 Resets the shape to the default shape. More...
 

Signals

void changed ()
 Emitted when the shape's settings are changed. More...
 

Public Member Functions

 QgsLegendPatchShapeButton (QWidget *parent=nullptr, const QString &dialogTitle=QString())
 Construct a new patch shape button with the specified parent widget. More...
 
 ~QgsLegendPatchShapeButton () override
 
QString dialogTitle () const
 Returns the title for the symbol settings dialog window. More...
 
QgsMessageBarmessageBar () const
 Returns the message bar associated with the widget. More...
 
QSize minimumSizeHint () const override
 
void setDialogTitle (const QString &title)
 Sets the title for the symbol settings dialog window. More...
 
void setMessageBar (QgsMessageBar *bar)
 Sets the message bar associated with the widget. More...
 
void setPreviewSymbol (QgsSymbol *symbol)
 Sets the symbol to use for previewing the legend patch shape. More...
 
void setSymbolType (Qgis::SymbolType type)
 Sets the symbol type which the button requires. More...
 
QgsLegendPatchShape shape ()
 Returns the current shape defined by the button. More...
 
QSize sizeHint () const override
 
Qgis::SymbolType symbolType () const
 Returns the symbol type which the button requires. More...
 

Protected Member Functions

void changeEvent (QEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void resizeEvent (QResizeEvent *event) override
 
void showEvent (QShowEvent *e) override
 

Detailed Description

A button for creating and modifying QgsLegendPatchShape settings.

Since
QGIS 3.14

Definition at line 36 of file qgslegendpatchshapebutton.h.

Constructor & Destructor Documentation

◆ QgsLegendPatchShapeButton()

QgsLegendPatchShapeButton::QgsLegendPatchShapeButton ( QWidget *  parent = nullptr,
const QString &  dialogTitle = QString() 
)

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.

Definition at line 27 of file qgslegendpatchshapebutton.cpp.

◆ ~QgsLegendPatchShapeButton()

QgsLegendPatchShapeButton::~QgsLegendPatchShapeButton ( )
overridedefault

Member Function Documentation

◆ changed

void QgsLegendPatchShapeButton::changed ( )
signal

Emitted when the shape's settings are changed.

See also
shape()
setShape()

◆ changeEvent()

void QgsLegendPatchShapeButton::changeEvent ( QEvent *  e)
overrideprotected

Definition at line 229 of file qgslegendpatchshapebutton.cpp.

◆ dialogTitle()

QString QgsLegendPatchShapeButton::dialogTitle ( ) const

Returns the title for the symbol settings dialog window.

See also
setDialogTitle()

Definition at line 312 of file qgslegendpatchshapebutton.cpp.

◆ messageBar()

QgsMessageBar * QgsLegendPatchShapeButton::messageBar ( ) const

Returns the message bar associated with the widget.

See also
setMessageBar()
Since
QGIS 3.6

Definition at line 142 of file qgslegendpatchshapebutton.cpp.

◆ minimumSizeHint()

QSize QgsLegendPatchShapeButton::minimumSizeHint ( ) const
override

Definition at line 50 of file qgslegendpatchshapebutton.cpp.

◆ mousePressEvent()

void QgsLegendPatchShapeButton::mousePressEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 176 of file qgslegendpatchshapebutton.cpp.

◆ resizeEvent()

void QgsLegendPatchShapeButton::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 244 of file qgslegendpatchshapebutton.cpp.

◆ setDialogTitle()

void QgsLegendPatchShapeButton::setDialogTitle ( const QString &  title)

Sets the title for the symbol settings dialog window.

See also
dialogTitle()

Definition at line 307 of file qgslegendpatchshapebutton.cpp.

◆ setMessageBar()

void QgsLegendPatchShapeButton::setMessageBar ( QgsMessageBar bar)

Sets the message bar associated with the widget.

This allows the widget to push feedback messages to the appropriate message bar.

See also
messageBar()
Since
QGIS 3.6

Definition at line 137 of file qgslegendpatchshapebutton.cpp.

◆ setPreviewSymbol()

void QgsLegendPatchShapeButton::setPreviewSymbol ( QgsSymbol symbol)

Sets the symbol to use for previewing the legend patch shape.

Ownership is transferred to the button. It is the caller's responsibility to ensure that the symbol type matches the button's symbolType()

Definition at line 92 of file qgslegendpatchshapebutton.cpp.

◆ setShape

void QgsLegendPatchShapeButton::setShape ( const QgsLegendPatchShape shape)
slot

Sets the shape for the button.

See also
shape()
changed()

Definition at line 147 of file qgslegendpatchshapebutton.cpp.

◆ setSymbolType()

void QgsLegendPatchShapeButton::setSymbolType ( Qgis::SymbolType  type)

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.

See also
symbolType()

Definition at line 60 of file qgslegendpatchshapebutton.cpp.

◆ setToDefault

void QgsLegendPatchShapeButton::setToDefault ( )
slot

Resets the shape to the default shape.

Definition at line 113 of file qgslegendpatchshapebutton.cpp.

◆ shape()

QgsLegendPatchShape QgsLegendPatchShapeButton::shape ( )

Returns the current shape defined by the button.

See also
setShape()
changed()

Definition at line 317 of file qgslegendpatchshapebutton.cpp.

◆ showEvent()

void QgsLegendPatchShapeButton::showEvent ( QShowEvent *  e)
overrideprotected

Definition at line 238 of file qgslegendpatchshapebutton.cpp.

◆ sizeHint()

QSize QgsLegendPatchShapeButton::sizeHint ( ) const
override

Definition at line 55 of file qgslegendpatchshapebutton.cpp.

◆ symbolType()

Qgis::SymbolType QgsLegendPatchShapeButton::symbolType ( ) const
inline

Returns the symbol type which the button requires.

See also
setSymbolType()

Definition at line 64 of file qgslegendpatchshapebutton.h.


The documentation for this class was generated from the following files: