Register QTextDocument* as a meta type to fix QTextEdit::document type
Change-Id: I666845049749bfa6f88b764eefaefb0dcf05cb3f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
parent
129c9842ce
commit
468c22f673
@ -320,7 +320,7 @@ QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent)
|
||||
: QObject(*new QSyntaxHighlighterPrivate, parent)
|
||||
{
|
||||
if (parent->inherits("QTextEdit")) {
|
||||
QTextDocument *doc = qobject_cast<QTextDocument *>(parent->property("document").value<QObject *>());
|
||||
QTextDocument *doc = parent->property("document").value<QTextDocument *>();
|
||||
if (doc)
|
||||
setDocument(doc);
|
||||
}
|
||||
|
@ -231,6 +231,8 @@ void QTextDocumentPrivate::init()
|
||||
undoEnabled = undoState;
|
||||
modified = false;
|
||||
modifiedState = 0;
|
||||
|
||||
qRegisterMetaType<QTextDocument *>();
|
||||
}
|
||||
|
||||
void QTextDocumentPrivate::clear()
|
||||
|
@ -86,7 +86,7 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea
|
||||
Q_PROPERTY(bool acceptRichText READ acceptRichText WRITE setAcceptRichText)
|
||||
Q_PROPERTY(int cursorWidth READ cursorWidth WRITE setCursorWidth)
|
||||
Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags)
|
||||
Q_PROPERTY(QObject *document READ document)
|
||||
Q_PROPERTY(QTextDocument *document READ document WRITE setDocument)
|
||||
public:
|
||||
enum LineWrapMode {
|
||||
NoWrap,
|
||||
|
Loading…
Reference in New Issue
Block a user