Commit b6a8cc3c authored by Laurent Montel's avatar Laurent Montel 😁

Add isEmpty method. We don't want to rely on toPlainText().isEmpty()

(cherry picked from commit a9361d56)
parent d2975557
......@@ -85,6 +85,12 @@ void PlainTextEditorWidget::setPlainText(const QString &text)
d->mEditor->setPlainText(text);
}
bool PlainTextEditorWidget::isEmpty() const
{
return d->mEditor->document()->isEmpty();
}
QString PlainTextEditorWidget::toPlainText() const
{
return d->mEditor->toPlainText();
......
......@@ -47,6 +47,7 @@ public:
void clear();
void setSpellCheckingConfigFileName(const QString &_fileName);
bool isEmpty() const;
private Q_SLOTS:
void slotFind();
void slotReplace();
......
......@@ -106,6 +106,11 @@ void RichTextEditorWidget::setPlainText(const QString &text)
d->mEditor->setPlainText(text);
}
bool RichTextEditorWidget::isEmpty() const
{
return d->mEditor->document()->isEmpty();
}
QString RichTextEditorWidget::toPlainText() const
{
return d->mEditor->toPlainText();
......
......@@ -55,6 +55,7 @@ public:
void setSpellCheckingConfigFileName(const QString &_fileName);
bool isEmpty() const;
public Q_SLOTS:
void slotFindNext();
void slotFind();
......
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