Skip to content

Conversation

@corranwebster
Copy link
Contributor

@corranwebster corranwebster commented Jan 14, 2026

This adds full support for all the basic dialogs in the Qt backend.

Qt dialogs don't support multiple selection of directories. Other than that, this PR is fairly straightforward.

I'm not fixing #4078 as part of this PR - it's not blocking, although the example will fail to exit without it, but a fix for #4078 shouldn't be tied up by fixing dialog PR stuff.

To Do:

Ref #3914
Fixes #4077

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@corranwebster corranwebster mentioned this pull request Jan 14, 2026
37 tasks
@corranwebster corranwebster marked this pull request as ready for review January 15, 2026 13:36
@corranwebster corranwebster changed the title [Qt] Support Dialogs [Qt] Add support for all dialogs Jan 15, 2026
@corranwebster
Copy link
Contributor Author

This should be ready for review.

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Looks great; one typo, and one minor styling question inline.

self.native.setWindowTitle(self.title)
self.native.setText(self.message)
if self.detail is not None:
self.native.setDetailedText(self.detail)
Copy link
Member

Choose a reason for hiding this comment

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

It looks like we're leaning on a Qt-native "more details" capability here. That's a different presentation to other platforms, which isn't inherently a problem; but is there any way to style that content? In particular, given it's a stack trace, it would be handy to have it in a monospaced font. That's not a dealbreaker - just checking what is (easily) possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The detail text is the only way to get scrolled content in the standard message dialog, so the choices are either to write a custom dialog or use the detail text. I would assume that on a KDE platform that the QMessageBox is the "native" way of displaying that sort of information.

There's no public API to set the font of the detail text, but we can rummage around in the guts of the dialog and find the QTextEdit that holds the detail and set its font to the system monospaced font reasonably easily. I've done this, and in a way that if Qt changes the implementation somehow then it shouldn't break, you just won't get the styling.

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Awesome - thanks for those fixes!

@freakboy3742 freakboy3742 merged commit 23d5bf6 into beeware:main Jan 19, 2026
57 checks passed
@freakboy3742
Copy link
Member

Side note - #4096 is a weird Qt button display issue I saw in the process of testing this. Not sure if you have any ideas on the cause of that problem.

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.

OpenFileDialog filters are not tested

2 participants