Skip to content

Conversation

@erikjv
Copy link
Contributor

@erikjv erikjv commented Mar 11, 2024

Fixes: #11531

@erikjv erikjv requested a review from TheOneRing March 11, 2024 10:38
@erikjv erikjv self-assigned this Mar 11, 2024
@TheOneRing
Copy link
Contributor

The ui tests have multiple crashes in the tls dialog, please have a look.

@TheOneRing TheOneRing added this to the Desktop 6.0 milestone Mar 12, 2024
Copy link
Contributor

@TheOneRing TheOneRing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

@erikjv erikjv force-pushed the work/default-no-button branch from 3e35089 to f0c7f3e Compare March 15, 2024 14:28
@erikjv erikjv requested a review from TheOneRing March 15, 2024 15:18

// Try to set the No-button (the reject button) as the default
if (QPushButton *noButton = _ui->buttonBox->button(QDialogButtonBox::No)) {
Q_ASSERT(_ui->buttonBox->buttonRole(noButton) == QDialogButtonBox::RejectRole || _ui->buttonBox->buttonRole(noButton) == QDialogButtonBox::NoRole);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm according to https://doc.qt.io/qt-6/qdialogbuttonbox.html#ButtonRole-enum it is supposed to always be NoRole?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But how can clicking the "No" button then reject the dialog?

Copy link
Contributor Author

@erikjv erikjv Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, in QDialogButtonBoxPrivate::_q_handleButtonClicked():

        case QPlatformDialogHelper::RejectRole:
        case QPlatformDialogHelper::NoRole:
            emit q->rejected();
            break;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the assert, it's superfluous to check the NoRole on the "No" button.

@erikjv erikjv force-pushed the work/default-no-button branch from f0c7f3e to a5763ec Compare March 15, 2024 16:33
@erikjv erikjv requested a review from TheOneRing March 15, 2024 16:35
@TheOneRing TheOneRing merged commit 0dad3ff into master Mar 15, 2024
@delete-merged-branch delete-merged-branch bot deleted the work/default-no-button branch March 15, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select 'No' button by default in the unknown certificate dialog, and show the dialog above the main window

3 participants