diff options
| author | Yuya Nishihara <yuya.nishihara@qt.io> | 2020-11-02 17:00:36 +0900 |
|---|---|---|
| committer | Yuya Nishihara <yuya.nishihara@qt.io> | 2020-12-03 14:43:42 +0900 |
| commit | d9a651707646722915c5f20b64804252dd041a16 (patch) | |
| tree | 8f79fe7d6ab4a9244b441e2384bd8b6657c1a0cb /src/tools/uic/cpp/cppwriteinitialization.cpp | |
| parent | d6dcf508a6a751c8c32273112957607b062899e8 (diff) | |
Dialog: Fall back to transient parent to make dialog window get centered
Unlike QWidget-based application, a dialog displayed in QML app doesn't
have QWidget parent, so it would be centered in the current screen.
Let's fall back to transient parent window if widgetParent() is missing.
It's tempting to rewrite adjustPosition() to not depend on QWidget at all,
but that seems not easy. Lookup path of window() and transientParentWindow()
is slightly different for example, and QWidget::pos() is used instead of
mapToGlobal({0, 0}) if the widget is embedded into a native window.
Fixes: QTBUG-63406
Change-Id: If72d90aee8d972240243184de4d3c09d77f704ff
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.cpp')
0 files changed, 0 insertions, 0 deletions
