Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/PySide6-Qlementine/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[build-system]
requires = [
"scikit-build-core>=0.10",
"shiboken6-generator>=6.10,<6.11",
"PySide6>=6.10,<6.11",
"shiboken6-generator==6.10.2",
"PySide6==6.10.2",
"ruff>=0.4",
]
build-backend = "scikit_build_core.build"
Expand All @@ -15,7 +15,7 @@ description = "PySide6 bindings for Qlementine, a modern QStyle for desktop Qt6
license = "MIT"
license-files = ["LICENSE"]
readme = "../../README.md"
dependencies = ["PySide6>=6.10,<6.11"]
dependencies = ["PySide6==6.10.2"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down
44 changes: 38 additions & 6 deletions patches/161-fix-focus-frame-mapto-on-reparent.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
diff --git a/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp b/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp
index 1234567..abcdefg 100644
index 1722b4c..1582739 100644
--- a/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp
+++ b/lib/src/style/eventFilters/WidgetWithFocusFrameEventFilter.hpp
@@ -32,8 +32,16 @@ public:
@@ -5,6 +5,7 @@

#include <QAbstractScrollArea>
#include <QFocusFrame>
+#include <QPointer>
#include <QTimer>
#include <QEvent>

@@ -28,13 +29,27 @@ public:
if (type == QEvent::Paint && !_added) {
QTimer::singleShot(0, this, [this]() {
if (!_added) {
- _added = true;
- _focusFrame->setWidget(_widget);
+ if (_widget && _focusFrame) {
+ _added = true;
+ _focusFrame->setWidget(_widget);
+ }
}
});
} else if (type == QEvent::Show && _added) {
Expand All @@ -11,13 +28,28 @@ index 1234567..abcdefg 100644
+ // Defer to avoid mapTo() on a partially-connected hierarchy
+ // after reparenting (same pattern as the Paint path above).
+ QTimer::singleShot(0, this, [this]() {
+ _focusFrame->setWidget(nullptr);
+ _focusFrame->setWidget(_widget);
+ if (_widget && _focusFrame) {
+ _focusFrame->setWidget(nullptr);
+ _focusFrame->setWidget(_widget);
+ }
+ });
+ } else if (type == QEvent::Hide && _added) {
+ // Disconnect the focus frame when the widget is hidden (e.g.
+ // during reparenting) to prevent stale mapTo() calls.
+ _focusFrame->setWidget(nullptr);
+ if (_focusFrame) {
+ _focusFrame->setWidget(nullptr);
+ }
}
}


@@ -42,8 +57,8 @@ public:
}

private:
- QWidget* _widget{ nullptr };
- QFocusFrame* _focusFrame{ nullptr };
+ QPointer<QWidget> _widget;
+ QPointer<QFocusFrame> _focusFrame;
bool _added{ false };
};
} // namespace oclero::qlementine
Loading