From ac300a166f801a6f6c0b15278e6893720a5726f8 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 27 Apr 2012 22:05:32 +0200 Subject: Load resources in in QTextDocument correctly In Qt 4, we loaded resources through the QTextEdit or QTextControl if they were the parent of the document. Modularization for Qt 5 broke this, as we can't cast the parent to a QTextEdit anymore. The fix is to make the loadResource() methods in QTextControl and QTextEdit invokable and discover and invoke them at runtime on the parent object. Task-number: QTBUG-25116 Change-Id: Iba04bc16849b0c5ddcd275f12d1a386a8fe591bf Reviewed-by: Girish Ramakrishnan --- src/widgets/widgets/qtextedit.h | 2 +- src/widgets/widgets/qwidgettextcontrol_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h index 3148c7a0cf..bc2cd49d8a 100644 --- a/src/widgets/widgets/qtextedit.h +++ b/src/widgets/widgets/qtextedit.h @@ -168,7 +168,7 @@ public: void ensureCursorVisible(); - virtual QVariant loadResource(int type, const QUrl &name); + Q_INVOKABLE virtual QVariant loadResource(int type, const QUrl &name); #ifndef QT_NO_CONTEXTMENU QMenu *createStandardContextMenu(); QMenu *createStandardContextMenu(const QPoint &position); diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h index f153267386..d6e4d87c96 100644 --- a/src/widgets/widgets/qwidgettextcontrol_p.h +++ b/src/widgets/widgets/qwidgettextcontrol_p.h @@ -120,7 +120,7 @@ public: virtual void ensureCursorVisible(); - virtual QVariant loadResource(int type, const QUrl &name); + Q_INVOKABLE virtual QVariant loadResource(int type, const QUrl &name); #ifndef QT_NO_CONTEXTMENU QMenu *createStandardContextMenu(const QPointF &pos, QWidget *parent); #endif -- cgit v1.2.3