QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
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...
 
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 (QgsSymbol::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
 
QgsSymbol::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 23 of file qgslegendpatchshapebutton.cpp.

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 223 of file qgslegendpatchshapebutton.cpp.

◆ dialogTitle()

QString QgsLegendPatchShapeButton::dialogTitle ( ) const

Returns the title for the symbol settings dialog window.

See also
setDialogTitle()

Definition at line 310 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 136 of file qgslegendpatchshapebutton.cpp.

◆ minimumSizeHint()

QSize QgsLegendPatchShapeButton::minimumSizeHint ( ) const
override

Definition at line 44 of file qgslegendpatchshapebutton.cpp.

◆ mousePressEvent()

void QgsLegendPatchShapeButton::mousePressEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 170 of file qgslegendpatchshapebutton.cpp.

◆ resizeEvent()

void QgsLegendPatchShapeButton::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 238 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 305 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 131 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 86 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 141 of file qgslegendpatchshapebutton.cpp.

◆ setSymbolType()

void QgsLegendPatchShapeButton::setSymbolType ( QgsSymbol::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 54 of file qgslegendpatchshapebutton.cpp.

◆ setToDefault

void QgsLegendPatchShapeButton::setToDefault ( )
slot

Resets the shape to the default shape.

Definition at line 107 of file qgslegendpatchshapebutton.cpp.

◆ shape()

QgsLegendPatchShape QgsLegendPatchShapeButton::shape ( )

Returns the current shape defined by the button.

See also
setShape()
changed()

Definition at line 315 of file qgslegendpatchshapebutton.cpp.

◆ showEvent()

void QgsLegendPatchShapeButton::showEvent ( QShowEvent *  e)
overrideprotected

Definition at line 232 of file qgslegendpatchshapebutton.cpp.

◆ sizeHint()

QSize QgsLegendPatchShapeButton::sizeHint ( ) const
override

Definition at line 49 of file qgslegendpatchshapebutton.cpp.

◆ symbolType()

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

Returns the symbol type which the button requires.

See also
setSymbolType()

Definition at line 63 of file qgslegendpatchshapebutton.h.


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