Commit fc5ef5ef authored by Yuchen Deng's avatar Yuchen Deng Committed by Tobias Hunger

Git: Fix crash of wrappedText

It's a Qt-Bug, and fixed in Qt5.
The patch can avoiding the crash when use Qt4.

Task-number: QTCREATORBUG-5633
Task-number: QTCREATORBUG-6082

Change-Id: I1c284b7558e77e03e26ad966376860cde0501833
Reviewed-by: default avatarTobias Hunger <tobias.hunger@nokia.com>
parent 8d5f7d07
......@@ -204,7 +204,7 @@ SubmitEditorWidget::SubmitEditorWidget(QWidget *parent) :
connect(d->m_ui.description, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(editorCustomContextMenuRequested(QPoint)));
connect(d->m_ui.description, SIGNAL(textChanged()),
this, SLOT(updateSubmitAction()));
this, SLOT(descriptionTextChanged()));
// File List
d->m_ui.fileView->setContextMenuPolicy(Qt::CustomContextMenu);
......@@ -576,6 +576,19 @@ void SubmitEditorWidget::insertTopWidget(QWidget *w)
d->m_ui.vboxLayout->insertWidget(0, w);
}
void SubmitEditorWidget::descriptionTextChanged()
{
#if QT_VERSION < 0x050000 // Fix Qt-Bug, see QTCREATORBUG-5633 && QTCREATORBUG-6082
static QString lastText;
const QString text = d->m_ui.description->toPlainText();
if (lastText != text)
lastText = text;
else
return;
#endif
updateSubmitAction();
}
bool SubmitEditorWidget::canSubmit() const
{
if (cleanupDescription(descriptionText()).trimmed().isEmpty())
......
......@@ -131,6 +131,7 @@ protected:
void insertTopWidget(QWidget *w);
protected slots:
void descriptionTextChanged();
void updateSubmitAction();
private slots:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment