Browse Source

refactor(widget): make contentDialog use swapItemsAt in Qt 5.13

reviewable/pr5745/r1
jenli669 6 years ago
parent
commit
ba9d724a17
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E
  1. 9
      src/widget/contentdialog.cpp

9
src/widget/contentdialog.cpp

@ -69,7 +69,11 @@ ContentDialog::ContentDialog(QWidget* parent) @@ -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) @@ -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
}
}

Loading…
Cancel
Save