QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
QgsAlignmentComboBox Class Reference

A combo box which allows choice of alignment settings (e.g. More...

#include <qgsalignmentcombobox.h>

Inheritance diagram for QgsAlignmentComboBox:

Signals

void changed ()
 Emitted when the alignment is changed.

Public Member Functions

 QgsAlignmentComboBox (QWidget *parent=nullptr)
 Constructor for QgsAlignmentComboBox, with the specified parent widget.
Qt::Alignment currentAlignment () const
 Returns the current alignment choice.
void customizeAlignmentDisplay (Qt::Alignment alignment, const QString &text=QString(), const QIcon &icon=QIcon())
 Sets the text and icon to use for a particular alignment option, replacing the default text or icon.
Qgis::TextHorizontalAlignment horizontalAlignment () const
 Returns the current alignment choice as a QGIS horizontal text alignment enum.
void setAvailableAlignments (Qt::Alignment alignments)
 Sets the available alignment choices shown in the combo box.
void setCurrentAlignment (Qgis::TextHorizontalAlignment alignment)
 Sets the current alignment choice from a QGIS horizontal text alignment enum.
void setCurrentAlignment (Qgis::TextVerticalAlignment alignment)
 Sets the current alignment choice from a QGIS vertical text alignment enum.
void setCurrentAlignment (Qt::Alignment alignment)
 Sets the current alignment choice.
Qgis::TextVerticalAlignment verticalAlignment () const
 Returns the current alignment choice as a QGIS horizontal text alignment enum.

Detailed Description

A combo box which allows choice of alignment settings (e.g.

left, right, ...).

Available alignment choices can be manually specified by calling setAvailableAlignments(), which is useful when only a subset of Qt's alignment options should be exposed.

Since
QGIS 3.10

Definition at line 36 of file qgsalignmentcombobox.h.

Constructor & Destructor Documentation

◆ QgsAlignmentComboBox()

QgsAlignmentComboBox::QgsAlignmentComboBox ( QWidget * parent = nullptr)

Constructor for QgsAlignmentComboBox, with the specified parent widget.

Definition at line 27 of file qgsalignmentcombobox.cpp.

Member Function Documentation

◆ changed

void QgsAlignmentComboBox::changed ( )
signal

Emitted when the alignment is changed.

◆ currentAlignment()

Qt::Alignment QgsAlignmentComboBox::currentAlignment ( ) const

Returns the current alignment choice.

See also
setCurrentAlignment()

Definition at line 44 of file qgsalignmentcombobox.cpp.

◆ customizeAlignmentDisplay()

void QgsAlignmentComboBox::customizeAlignmentDisplay ( Qt::Alignment alignment,
const QString & text = QString(),
const QIcon & icon = QIcon() )

Sets the text and icon to use for a particular alignment option, replacing the default text or icon.

If text or icon is not specified, they will not be changed from the default.

Note
This must be called after first filtering the available alignment options via setAvailableAlignments().

Definition at line 134 of file qgsalignmentcombobox.cpp.

◆ horizontalAlignment()

Qgis::TextHorizontalAlignment QgsAlignmentComboBox::horizontalAlignment ( ) const

Returns the current alignment choice as a QGIS horizontal text alignment enum.

See also
verticalAlignment()
Since
QGIS 4.0

Definition at line 56 of file qgsalignmentcombobox.cpp.

◆ setAvailableAlignments()

void QgsAlignmentComboBox::setAvailableAlignments ( Qt::Alignment alignments)

Sets the available alignment choices shown in the combo box.

Definition at line 38 of file qgsalignmentcombobox.cpp.

◆ setCurrentAlignment() [1/3]

void QgsAlignmentComboBox::setCurrentAlignment ( Qgis::TextHorizontalAlignment alignment)

Sets the current alignment choice from a QGIS horizontal text alignment enum.

Since
QGIS 4.0

Definition at line 99 of file qgsalignmentcombobox.cpp.

◆ setCurrentAlignment() [2/3]

void QgsAlignmentComboBox::setCurrentAlignment ( Qgis::TextVerticalAlignment alignment)

Sets the current alignment choice from a QGIS vertical text alignment enum.

Since
QGIS 4.0

Definition at line 118 of file qgsalignmentcombobox.cpp.

◆ setCurrentAlignment() [3/3]

void QgsAlignmentComboBox::setCurrentAlignment ( Qt::Alignment alignment)

Sets the current alignment choice.

See also
currentAlignment()

Definition at line 49 of file qgsalignmentcombobox.cpp.

◆ verticalAlignment()

Qgis::TextVerticalAlignment QgsAlignmentComboBox::verticalAlignment ( ) const

Returns the current alignment choice as a QGIS horizontal text alignment enum.

See also
verticalAlignment()
Since
QGIS 4.0

Definition at line 79 of file qgsalignmentcombobox.cpp.


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