Don't use centerIn on popup on Qt < 5.12

This commit is contained in:
Nicolas Werner 2021-01-12 15:55:36 +01:00
parent 826a5cfb14
commit 14cb3bfe10
1 changed files with 7 additions and 1 deletions

View File

@ -5,9 +5,15 @@ import im.nheko 1.0
Popup {
modal: true
anchors.centerIn: parent
palette: colors
// only set the anchors on Qt 5.12 or higher
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop
Component.onCompleted: {
if (anchors)
anchors.centerIn = parent;
}
ColumnLayout {
spacing: 16