From ba9d724a17e76bfe7981a69330334c612f52a769 Mon Sep 17 00:00:00 2001 From: jenli669 Date: Fri, 12 Jul 2019 19:31:10 +0200 Subject: [PATCH] refactor(widget): make contentDialog use swapItemsAt in Qt 5.13 --- src/widget/contentdialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/widget/contentdialog.cpp b/src/widget/contentdialog.cpp index 2476390df..da34e9e30 100644 --- a/src/widget/contentdialog.cpp +++ b/src/widget/contentdialog.cpp @@ -69,7 +69,11 @@ ContentDialog::ContentDialog(QWidget* parent) friendLayout->getLayoutOffline()}; if (s.getGroupchatPosition()) { +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + layouts.swapItemsAt(0, 1); +#else layouts.swap(0, 1); +#endif } QWidget* friendWidget = new QWidget(); @@ -399,7 +403,12 @@ void ContentDialog::reorderLayouts(bool newGroupOnTop) { bool oldGroupOnTop = layouts.first() == groupLayout.getLayout(); if (newGroupOnTop != oldGroupOnTop) { + // Kriby: Maintain backwards compatibility +#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)) + layouts.swapItemsAt(0, 1); +#else layouts.swap(0, 1); +#endif } }