QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
QgsLegendPatchShapeButton Class Reference

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

#include <qgslegendpatchshapebutton.h>

Inheritance diagram for QgsLegendPatchShapeButton:

Public Slots

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

Signals

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

Public Member Functions

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

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 38 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 30 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 231 of file qgslegendpatchshapebutton.cpp.

◆ dialogTitle()

QString QgsLegendPatchShapeButton::dialogTitle ( ) const

Returns the title for the symbol settings dialog window.

See also
setDialogTitle()

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

◆ minimumSizeHint()

QSize QgsLegendPatchShapeButton::minimumSizeHint ( ) const
override

Definition at line 53 of file qgslegendpatchshapebutton.cpp.

◆ mousePressEvent()

void QgsLegendPatchShapeButton::mousePressEvent ( QMouseEvent * e)
overrideprotected

Definition at line 178 of file qgslegendpatchshapebutton.cpp.

◆ resizeEvent()

void QgsLegendPatchShapeButton::resizeEvent ( QResizeEvent * event)
overrideprotected

Definition at line 246 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 308 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 139 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 95 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 149 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 63 of file qgslegendpatchshapebutton.cpp.

◆ setToDefault

void QgsLegendPatchShapeButton::setToDefault ( )
slot

Resets the shape to the default shape.

Definition at line 115 of file qgslegendpatchshapebutton.cpp.

◆ shape()

QgsLegendPatchShape QgsLegendPatchShapeButton::shape ( )

Returns the current shape defined by the button.

See also
setShape()
changed()

Definition at line 318 of file qgslegendpatchshapebutton.cpp.

◆ showEvent()

void QgsLegendPatchShapeButton::showEvent ( QShowEvent * e)
overrideprotected

Definition at line 240 of file qgslegendpatchshapebutton.cpp.

◆ sizeHint()

QSize QgsLegendPatchShapeButton::sizeHint ( ) const
override

Definition at line 58 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 66 of file qgslegendpatchshapebutton.h.


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