Update the canPaste property directly when changing the read-only
property instead of connecting to the readOnlyChanged signal.
Change-Id: Ic6f6ba66f6b94448045703f7d2a66218548190dd
Reviewed-by: Martin Jones <martin.jones@nokia.com>
if (!r)
d->control->moveCursor(QTextCursor::End);
+ q_canPasteChanged();
emit readOnlyChanged(r);
}
QObject::connect(control, SIGNAL(cursorRectangleChanged()), q, SLOT(moveCursorDelegate()));
QObject::connect(control, SIGNAL(linkActivated(QString)), q, SIGNAL(linkActivated(QString)));
#ifndef QT_NO_CLIPBOARD
- QObject::connect(q, SIGNAL(readOnlyChanged(bool)), q, SLOT(q_canPasteChanged()));
QObject::connect(QGuiApplication::clipboard(), SIGNAL(dataChanged()), q, SLOT(q_canPasteChanged()));
#endif
d->m_readOnly = ro;
if (!ro)
d->setCursorPosition(d->end());
-
+ q_canPasteChanged();
emit readOnlyChanged(ro);
}
q->setFlag(QQuickItem::ItemAcceptsInputMethod);
q->setFlag(QQuickItem::ItemHasContents);
#ifndef QT_NO_CLIPBOARD
- q->connect(q, SIGNAL(readOnlyChanged(bool)),
- q, SLOT(q_canPasteChanged()));
q->connect(QGuiApplication::clipboard(), SIGNAL(dataChanged()),
q, SLOT(q_canPasteChanged()));
#endif // QT_NO_CLIPBOARD