summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJ-P Nurmi <j-p.nurmi@nokia.com>2012-08-17 10:49:36 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-18 10:58:37 +0200
commit468c22f6732b5755b68f658dbd7a9c4e9e9601d1 (patch)
treea7c3a24abd3d2589d5de4ae5b202b0e99e88a82f /src/gui
parent129c9842ce1f558e2b0ae6165107784b39139a13 (diff)
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>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp2
-rw-r--r--src/gui/text/qtextdocument_p.cpp2
2 files changed, 3 insertions, 1 deletions
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<QTextDocument *>(parent->property("document").value<QObject *>());
+ QTextDocument *doc = parent->property("document").value<QTextDocument *>();
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<QTextDocument *>();
}
void QTextDocumentPrivate::clear()