Skip to content

Prevent QGIS window resize when switching between plugin #39#131

Merged
antoniolocandro merged 1 commit intoFLYGHT7:mainfrom
andures:feature/dock-complaints-39
Mar 29, 2026
Merged

Prevent QGIS window resize when switching between plugin #39#131
antoniolocandro merged 1 commit intoFLYGHT7:mainfrom
andures:feature/dock-complaints-39

Conversation

@andures
Copy link
Copy Markdown
Collaborator

@andures andures commented Jan 10, 2026

Summary

Resolves issue #39 where QGIS main window would resize unexpectedly and display geometry errors when switching between plugin dockwidgets. The fix implements QScrollArea wrappers for all dockwidgets, aggressive size constraints, optimized timing delays, and improved geometry pre-calculation. All dockwidgets now open smoothly without resizing the QGIS window, even on first use.

- Updated minimum sizes for various dock widgets to allow for more flexible resizing.
- Removed hardcoded minimum height settings in `qpansopy_omnidirectional_dockwidget.py` and `qpansopy_sid_initial_dockwidget.py` to prevent QGIS window resizing.
- Adjusted UI files for multiple dock widgets to set minimum sizes to 250x200 and maximum sizes to unlimited.
- Enhanced log panel configurations in several dock widgets to improve usability and prevent layout issues.
- Implemented scroll area wrappers for docks lacking them to avoid excessive height requests on first opening.
- Added detailed comments and documentation throughout the code for better maintainability and understanding.
@antoniolocandro antoniolocandro merged commit 26a6dc7 into FLYGHT7:main Mar 29, 2026
@andures andures self-assigned this Mar 31, 2026
@andures andures added the bug Something isn't working label Mar 31, 2026
@andures andures linked an issue Mar 31, 2026 that may be closed by this pull request
@andures andures mentioned this pull request Apr 22, 2026
9 tasks
antoniolocandro pushed a commit that referenced this pull request Apr 27, 2026
Added to qt_compat.py:
- QFrame_NoFrame (QFrame.Shape compat)
- QSizePolicy_Preferred/Fixed/Expanding/Minimum/Maximum (QSizePolicy.Policy compat)
- QFormLayout_AllNonFixedFieldsGrow (QFormLayout.FieldGrowthPolicy compat)
- QTextEdit_WidgetWidth/NoWrap (QTextEdit.LineWrapMode compat)
- QLayout_SetDefaultConstraint (QLayout.SizeConstraint compat)
- Added QFrame, QSizePolicy, QLayout to all three backend import blocks

Fixed qpansopy.py (PR #131 dock size constraint code):
- Qt.ScrollBarAsNeeded -> Qt_ScrollBarAsNeeded
- QSizePolicy.Preferred/Fixed/Expanding/Minimum -> QSizePolicy_Preferred/...
- QFrame.NoFrame -> QFrame_NoFrame
- QFormLayout.AllNonFixedFieldsGrow -> QFormLayout_AllNonFixedFieldsGrow
- QTextEdit.WidgetWidth -> QTextEdit_WidgetWidth
- QLayout.SetDefaultConstraint -> QLayout_SetDefaultConstraint

All other PR changes already correctly integrated:
- utils.py: as_html param in format_parameters_table
- holding/vss/wind_spiral/ils/oas_ils dockwidgets: QMimeData HTML+text copy
- holding.py: summary dict + summary_text + QgsField attributes + _offset_by_angle
- feature_merge.py: Qgis import (uses qgis.PyQt.QtCore for QVariant)
- conv_initial_approach.py: area_side field + routing name check removed
- lnav_dockwidget.py: missed/SID approach routing simplified
- wind_spiral.py: as_html param forwarded

Tests: 45 passed, 1 skipped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QGIS complains about the dock

2 participants