Lazy creation of CDockWidgetTab to accomodate a factory defined in Python#848
Conversation
|
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. |
|
I can, that implies a const_cast that lies about tabWidget() being const. Not sure which one is the best |
|
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 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.
|
I have reverted the const qualifier changes. will let @githubuser0xFFFF call the shot on this. |
mliberty1
left a comment
There was a problem hiding this comment.
Looks good to me, and low risk with the const API change removed.
|
@mliberty1 Thank you for the review. |
…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.
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.