Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(chatform): add hack to avoid Qt bug on chat show
Browse files Browse the repository at this point in the history
Fix #5570
  • Loading branch information
anthonybilinski committed Jun 28, 2019
1 parent fae9066 commit e8d48e8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/widget/form/genericchatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <QMessageBox>
#include <QRegularExpression>
#include <QStringBuilder>
#include <QtGlobal>

#ifdef SPELL_CHECKING
#include <KF5/SonnetUi/sonnet/spellcheckdecorator.h>
Expand Down Expand Up @@ -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*)
Expand Down

0 comments on commit e8d48e8

Please sign in to comment.