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:
parent
24811d1042
commit
ba9d724a17
|
@ -69,7 +69,11 @@ ContentDialog::ContentDialog(QWidget* parent)
|
||||||
friendLayout->getLayoutOffline()};
|
friendLayout->getLayoutOffline()};
|
||||||
|
|
||||||
if (s.getGroupchatPosition()) {
|
if (s.getGroupchatPosition()) {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
|
||||||
|
layouts.swapItemsAt(0, 1);
|
||||||
|
#else
|
||||||
layouts.swap(0, 1);
|
layouts.swap(0, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget* friendWidget = new QWidget();
|
QWidget* friendWidget = new QWidget();
|
||||||
|
@ -399,7 +403,12 @@ void ContentDialog::reorderLayouts(bool newGroupOnTop)
|
||||||
{
|
{
|
||||||
bool oldGroupOnTop = layouts.first() == groupLayout.getLayout();
|
bool oldGroupOnTop = layouts.first() == groupLayout.getLayout();
|
||||||
if (newGroupOnTop != oldGroupOnTop) {
|
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);
|
layouts.swap(0, 1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user