From 468c22f6732b5755b68f658dbd7a9c4e9e9601d1 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 17 Aug 2012 10:49:36 +0200 Subject: Register QTextDocument* as a meta type to fix QTextEdit::document type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I666845049749bfa6f88b764eefaefb0dcf05cb3f Reviewed-by: Jędrzej Nowacki Reviewed-by: Lars Knoll --- src/gui/text/qsyntaxhighlighter.cpp | 2 +- src/gui/text/qtextdocument_p.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp index f76bb51ce1..fb02ad6686 100644 --- a/src/gui/text/qsyntaxhighlighter.cpp +++ b/src/gui/text/qsyntaxhighlighter.cpp @@ -320,7 +320,7 @@ QSyntaxHighlighter::QSyntaxHighlighter(QObject *parent) : QObject(*new QSyntaxHighlighterPrivate, parent) { if (parent->inherits("QTextEdit")) { - QTextDocument *doc = qobject_cast(parent->property("document").value()); + QTextDocument *doc = parent->property("document").value(); if (doc) setDocument(doc); } diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index d4ea9827ce..991ede3c6b 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -231,6 +231,8 @@ void QTextDocumentPrivate::init() undoEnabled = undoState; modified = false; modifiedState = 0; + + qRegisterMetaType(); } void QTextDocumentPrivate::clear() -- cgit v1.2.3