26 connect(
this,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, [ = ]
35 mAlignments = alignments;
41 return static_cast< Qt::Alignment
>( currentData().toInt() );
46 const int index = findData( QVariant( alignment ) );
48 setCurrentIndex( index );
53 const int index = findData( QVariant( alignment ) );
56 if ( !text.isEmpty() )
57 setItemText( index, text );
59 setItemIcon( index, icon );
63 void QgsAlignmentComboBox::populate()
70 if ( mAlignments & Qt::AlignLeft )
72 if ( mAlignments & Qt::AlignHCenter )
74 if ( mAlignments & Qt::AlignRight )
76 if ( mAlignments & Qt::AlignJustify )
79 if ( mAlignments & Qt::AlignTop )
81 if ( mAlignments & Qt::AlignVCenter )
83 if ( mAlignments & Qt::AlignBottom )
86 const int index = findData( QVariant( prevAlign ) );
88 setCurrentIndex( index );
90 mBlockChanged =
false;