qt6: widgets fixes — replace QDesktopWidget, use QGuiApplication::primaryScreen; switch dialog button map to QMultiMap; fix QFlags init and layout API; QtConcurrent lambda wrappers

This commit is contained in:
torsten committed 2026-07-14 20:40:09 +02:00
1 parent f744a8c37a
commit 58f7124c49
15 files changed
+133 -17

No files matched your search

+6 -6
View File
@@ -12,7 +12,7 @@ NGLDialogButtonBox::NGLDialogButtonBox(Qt::Orientation orientation,
QWidget *parent)
: QWidget(parent)
, m_orientation(orientation)
, m_buttons(nullptr)
, m_buttons(NGLStandardButton::NoButton)
, m_line(nullptr)
, m_bSpacer2ContextAction(nullptr)
, m_bLineVisible(true)
@@ -57,8 +57,8 @@ void NGLDialogButtonBox::setStandardButtons(NGLStandardButton::StandardButtons b
{
m_buttons = buttons;
QMap<int, NGLStandardButton *>::const_iterator it = m_standardButtons.constBegin();
QMap<int, NGLStandardButton *>::const_iterator end = m_standardButtons.constEnd();
QMultiMap<int, NGLStandardButton *>::const_iterator it = m_standardButtons.constBegin();
QMultiMap<int, NGLStandardButton *>::const_iterator end = m_standardButtons.constEnd();
for (; it != end; ++it)
{
const QList<QAction *> actions = it.value()->actions();
@@ -111,8 +111,8 @@ NGLStandardButton *NGLDialogButtonBox::addButton(NGLStandardButton::StandardButt
NGLStandardButton *NGLDialogButtonBox::button(NGLStandardButton::StandardButton button)
{
QMap<int, NGLStandardButton *>::const_iterator it = m_standardButtons.constBegin();
QMap<int, NGLStandardButton *>::const_iterator end = m_standardButtons.constEnd();
QMultiMap<int, NGLStandardButton *>::const_iterator it = m_standardButtons.constBegin();
QMultiMap<int, NGLStandardButton *>::const_iterator end = m_standardButtons.constEnd();
for (; it != end; ++it)
{
if (it.value()->type() == button)
@@ -301,7 +301,7 @@ void NGLDialogButtonBox::init()
if (!bSpacer2Added)
addSpacer2(l, m_orientation);
QMapIterator<int, NGLStandardButton *> mapIt(m_standardButtons);
QMultiMapIterator<int, NGLStandardButton *> mapIt(m_standardButtons);
NGLStandardButton *prevButton = nullptr;
mapIt.toBack();
while (mapIt.hasPrevious())