QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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.
 
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 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 28 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 230 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 143 of file qgslegendpatchshapebutton.cpp.

◆ minimumSizeHint()

QSize QgsLegendPatchShapeButton::minimumSizeHint ( ) const
override

Definition at line 51 of file qgslegendpatchshapebutton.cpp.

◆ mousePressEvent()

void QgsLegendPatchShapeButton::mousePressEvent ( QMouseEvent *  e)
overrideprotected

Definition at line 177 of file qgslegendpatchshapebutton.cpp.

◆ resizeEvent()

void QgsLegendPatchShapeButton::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 245 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 138 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 93 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 148 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 61 of file qgslegendpatchshapebutton.cpp.

◆ setToDefault

void QgsLegendPatchShapeButton::setToDefault ( )
slot

Resets the shape to the default shape.

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

◆ sizeHint()

QSize QgsLegendPatchShapeButton::sizeHint ( ) const
override

Definition at line 56 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: