1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

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

This commit is contained in:
jenli669 2019-07-12 19:31:10 +02:00
parent 24811d1042
commit ba9d724a17
No known key found for this signature in database
GPG Key ID: 8267F9F7C2BF7E5E

View File

@ -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
}
}