Skip to content

Fix initial script dialog sizing from its completed layout - #3700

Merged
hluk merged 1 commit into
hluk:masterfrom
wyf-777:fix/input-dialog-size-hint
Sep 10, 2026
Merged

hluk merged 1 commit into
hluk:masterfrom
wyf-777:fix/input-dialog-size-hint

Conversation

@wyf-777

@wyf-777 wyf-777 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Script dialogs without saved geometry can open at a narrow default width even when their labels need more space. In #3583, a short title leaves much of the form behind scrollbars. inputDialog() fills unspecified dimensions from the dialog's current size before it has adjusted to its contents, and adds the button box after sizing.

Create the button box and apply the stylesheet before calculating the default size with adjustSize(). Restore saved geometry and apply explicit .width / .height afterwards. This preserves user sizing and the scroll area's existing size limits for large forms.

Add integration tests for initial content fitting and for explicit dimensions followed by restoring a user-resized dialog. The test plugin exposes dialog geometry and a resize action to exercise these behaviors in the real application.

Related to #3583.

Validation on Windows 11 build 22631, MSVC 19.44, Qt 6.10.2, Debug:

  • New content-fitting test fails on 81c5c21b60a3bc81c242eb0625a827e68470ad55: horizontal scroll maximum is 124 instead of 0. It passes with the fix.
  • commandDialogFitsContents, commandDialogRestoreGeometry, commandDialog, and commandDialogCloseOnDisconnect pass (6 passed including suite setup/cleanup, 0 failed).
  • Running the form reconstructed from the issue attachment changes its initial size from 190×107 to 562×413 on this display. Large content remains scrollable.
  • git diff --check passes.

Optional encryption, keychain, audio, native notifications and regular plugins were disabled for this local build. The test plugin was built and loaded. Full upstream CI, Linux/macOS and Qt 6.10.3 (currently used by Windows CI) have not been run. Existing saved small geometry is intentionally retained.

@wyf-777
wyf-777 requested a review from hluk as a code owner September 9, 2026 10:53
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.17647% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.45%. Comparing base (81c5c21) to head (d094cec).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
src/tests/itemtests/itemtests.cpp 80.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3700      +/-   ##
==========================================
+ Coverage   74.41%   74.45%   +0.03%     
==========================================
  Files         256      256              
  Lines       38118    38146      +28     
  Branches     5139     5145       +6     
==========================================
+ Hits        28367    28400      +33     
+ Misses       9751     9746       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hluk
hluk merged commit e354d3f into hluk:master Sep 10, 2026
13 checks passed
@hluk

hluk commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Thanks for the fix!

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.

2 participants