Make text alignment buttons mutually exclusive (#1981)

This commit is contained in:
Giancarlo França
2021-10-16 05:19:17 -03:00
committed by GitHub
parent dabc596566
commit d446f13cc8

View File

@@ -77,6 +77,7 @@ TextConfig::TextConfig(QWidget* parent)
m_leftAlignButton =
new QPushButton(QIcon(iconPrefix + "leftalign.svg"), QLatin1String(""));
m_leftAlignButton->setCheckable(true);
m_leftAlignButton->setAutoExclusive(true);
connect(m_leftAlignButton, &QPushButton::clicked, this, [this] {
alignmentChanged(Qt::AlignLeft);
});
@@ -85,6 +86,7 @@ TextConfig::TextConfig(QWidget* parent)
m_centerAlignButton =
new QPushButton(QIcon(iconPrefix + "centeralign.svg"), QLatin1String(""));
m_centerAlignButton->setCheckable(true);
m_centerAlignButton->setAutoExclusive(true);
connect(m_centerAlignButton, &QPushButton::clicked, this, [this] {
alignmentChanged(Qt::AlignCenter);
});
@@ -93,6 +95,7 @@ TextConfig::TextConfig(QWidget* parent)
m_rightAlignButton =
new QPushButton(QIcon(iconPrefix + "rightalign.svg"), QLatin1String(""));
m_rightAlignButton->setCheckable(true);
m_rightAlignButton->setAutoExclusive(true);
connect(m_rightAlignButton, &QPushButton::clicked, this, [this] {
alignmentChanged(Qt::AlignRight);
});