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

fix(chatform): add hack to avoid Qt bug on chat show

Fix #5570
This commit is contained in:
Anthony Bilinski 2019-06-28 02:32:48 -07:00
parent fae9066be6
commit e8d48e8788
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -52,6 +52,7 @@
#include <QMessageBox>
#include <QRegularExpression>
#include <QStringBuilder>
#include <QtGlobal>
#ifdef SPELL_CHECKING
#include <KF5/SonnetUi/sonnet/spellcheckdecorator.h>
@ -450,10 +451,19 @@ void GenericChatForm::setName(const QString& newName)
void GenericChatForm::show(ContentLayout* contentLayout)
{
contentLayout->mainContent->layout()->addWidget(this);
contentLayout->mainHead->layout()->addWidget(headWidget);
headWidget->show();
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 4) && QT_VERSION > QT_VERSION_CHECK(5, 11, 0)
// HACK: switching order happens to avoid a Qt bug causing segfault, present between these versions.
// this could cause flickering if our form is shown before added to the layout
// https://github.com/qTox/qTox/issues/5570
QWidget::show();
contentLayout->mainContent->layout()->addWidget(this);
#else
contentLayout->mainContent->layout()->addWidget(this);
QWidget::show();
#endif
}
void GenericChatForm::showEvent(QShowEvent*)