InfoBar: Always order buttons in the same order

Change-Id: Ic95aa15ba770b6c75eb3a48bdfabdb7420f8d6ae
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-12-02 15:14:20 +01:00
parent 8c8f3e30b5
commit c5a27770f4

View File

@@ -361,27 +361,22 @@ void InfoBarDisplay::update()
});
}
if (info.m_cancelButtonText.isEmpty()) {
if (infoWidgetCloseButton) {
if (infoWidgetCloseButton) {
if (info.m_cancelButtonText.isEmpty()) {
infoWidgetCloseButton->setAutoRaise(true);
infoWidgetCloseButton->setIcon(Icons::CLOSE_FOREGROUND.icon());
infoWidgetCloseButton->setToolTip(tr("Close"));
}
if (infoWidgetSuppressButton)
hbox->addWidget(infoWidgetSuppressButton);
if (infoWidgetCloseButton)
hbox->addWidget(infoWidgetCloseButton);
} else {
if (infoWidgetCloseButton) {
} else {
infoWidgetCloseButton->setText(info.m_cancelButtonText);
hbox->addWidget(infoWidgetCloseButton);
}
if (infoWidgetSuppressButton)
hbox->addWidget(infoWidgetSuppressButton);
}
if (infoWidgetSuppressButton)
hbox->addWidget(infoWidgetSuppressButton);
if (infoWidgetCloseButton)
hbox->addWidget(infoWidgetCloseButton);
connect(infoWidget, &QObject::destroyed, this, [this, infoWidget] {
m_infoWidgets.removeOne(infoWidget);
});