mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 03:30:20 +00:00
Merge remote-tracking branch 'origin/Applications/18.08'
This commit is contained in:
commit
7c87174dde
|
@ -293,7 +293,6 @@ FormWidgetIface::FormWidgetIface( QWidget * w, Okular::FormField * ff )
|
|||
|
||||
FormWidgetIface::~FormWidgetIface()
|
||||
{
|
||||
m_ff = nullptr;
|
||||
}
|
||||
|
||||
Okular::NormalizedRect FormWidgetIface::rect() const
|
||||
|
@ -588,6 +587,14 @@ TextAreaEdit::TextAreaEdit( Okular::FormFieldText * text, QWidget * parent )
|
|||
setVisible( text->isVisible() );
|
||||
}
|
||||
|
||||
TextAreaEdit::~TextAreaEdit()
|
||||
{
|
||||
// We need this because otherwise on destruction we destruct the syntax highlighter
|
||||
// that ends up calling text changed but then we go to slotChanged and we're already
|
||||
// half destructed and all is bad
|
||||
disconnect( this, &QTextEdit::textChanged, this, &TextAreaEdit::slotChanged );
|
||||
}
|
||||
|
||||
bool TextAreaEdit::event( QEvent* e )
|
||||
{
|
||||
if ( e->type() == QEvent::KeyPress )
|
||||
|
@ -662,10 +669,6 @@ void TextAreaEdit::slotHandleTextChangedByUndoRedo( int pageNumber,
|
|||
|
||||
void TextAreaEdit::slotChanged()
|
||||
{
|
||||
// happens on destruction
|
||||
if (!m_ff)
|
||||
return;
|
||||
|
||||
Okular::FormFieldText *form = static_cast<Okular::FormFieldText *>(m_ff);
|
||||
QString contents = toPlainText();
|
||||
int cursorPos = textCursor().position();
|
||||
|
|
|
@ -253,6 +253,7 @@ class TextAreaEdit : public KTextEdit, public FormWidgetIface
|
|||
|
||||
public:
|
||||
explicit TextAreaEdit( Okular::FormFieldText * text, QWidget * parent = nullptr );
|
||||
~TextAreaEdit();
|
||||
void setFormWidgetsController( FormWidgetsController *controller ) override;
|
||||
bool event ( QEvent * e ) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue