Skip to content

Lazy creation of CDockWidgetTab to accomodate a factory defined in Python#848

Merged
githubuser0xFFFF merged 5 commits into
githubuser0xFFFF:masterfrom
pylessard:tabwidget-lazy-load
Jun 30, 2026
Merged

Lazy creation of CDockWidgetTab to accomodate a factory defined in Python#848
githubuser0xFFFF merged 5 commits into
githubuser0xFFFF:masterfrom
pylessard:tabwidget-lazy-load

Conversation

@pylessard

@pylessard pylessard commented Jun 28, 2026

Copy link
Copy Markdown

Would fix #847
I tested the MREs referred to in the issue
I also ran my app (Scrutiny Debugger) with the fixed version and it behaves well.

@pylessard pylessard marked this pull request as ready for review June 28, 2026 21:30
@mliberty1

Copy link
Copy Markdown

Can you keep the API as const still? If I am reading this correctly, that returned object never changes. The PR just defers creation until the method call. Keeping the API unchanged would make this PR much easier to accept as a patch release rather than a major release.

@pylessard

pylessard commented Jun 29, 2026

Copy link
Copy Markdown
Author

I can, that implies a const_cast that lies about tabWidget() being const. Not sure which one is the best

@mliberty1

Copy link
Copy Markdown

TabWidget is a const single instance per CDockWidget from an API perspective, right? If I understand correctly, this PR just defers creation (TabWidget is NULL initially), but still keeps the returned objects conceptually const. const_cast doesn't lie since the code has that if guard to ensure that only one TabWidget is ever created.

My opinion is to keep the API the same to make merging easier. I am also not the maintainer, so just an option 😉

This reverts commit 364a83c.
@pylessard

Copy link
Copy Markdown
Author

I have reverted the const qualifier changes. will let @githubuser0xFFFF call the shot on this.

@mliberty1 mliberty1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me, and low risk with the const API change removed.

@githubuser0xFFFF

Copy link
Copy Markdown
Owner

@mliberty1 Thank you for the review.

@githubuser0xFFFF githubuser0xFFFF merged commit 29f9084 into githubuser0xFFFF:master Jun 30, 2026
ksylvan added a commit to story-wizard/Qt-Advanced-Docking-System that referenced this pull request Jul 3, 2026
…ory)

Brings in 14 upstream commits incl. dark mode support (githubuser0xFFFF#842), Wayland
drag-and-drop with in-window preview (githubuser0xFFFF#844), auto-hide title bar fix
(githubuser0xFFFF#843), Linux floating-raise fix (githubuser0xFFFF#840), LP360 double-removal fix
(githubuser0xFFFF#838), and lazy CDockWidgetTab creation for Python factories (githubuser0xFFFF#848).

Conflict resolutions:
- DockManager.cpp: keep both new includes (QTimer ours, QStyleHints upstream)
- DockOverlay.cpp: keep fork's AutoHideFeatureEnabled guard structure and
  half-panel edge-band fall-throughs; adopt upstream's GlobalPos parameter
  (new dropAreaUnderCursor(QPoint) overload) instead of QCursor::pos()
- FloatingDockContainer.cpp: line-ending false conflict (fork stores LF,
  upstream CRLF) re-merged content-wise; kept macOS escape-key polling,
  took upstream's Wayland ctor (isWayland() null-parent) + comment
- FloatingDragPreview.cpp: kept fork's dropOverlaysEnabled() early-out;
  adopted upstream's SourceContainer/Wayland container-picking loop

Validated: full build clean; QuadrantHitTestTest + OverlayGateTest pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CDockWidgetTab created in CDockWidget constructor causes issue with python bindings

3 participants