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 --- tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp index c78989ebcb..8d4238b553 100644 --- a/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp +++ b/tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp @@ -296,7 +296,6 @@ void tst_QTextBrowser::anchors() void tst_QTextBrowser::resourceAutoDetection() { browser->setHtml(""); -QEXPECT_FAIL("", "FIXME: Resource detection broken", Continue); QCOMPARE(browser->lastResource.toString(), QString("qrc:/some/resource")); } @@ -451,8 +450,7 @@ void tst_QTextBrowser::sourceInsideLoadResource() { QUrl url = QUrl::fromLocalFile("pagewithimage.html"); browser->setSource(url); -QEXPECT_FAIL("", "FIXME: Resource detection broken", Continue); - QCOMPARE(browser->lastResource.toLocalFile(), QUrl::fromLocalFile(QDir::current().filePath("foobar.png")).toString()); + QCOMPARE(browser->lastResource, QUrl::fromLocalFile(QDir::current().filePath("foobar.png"))); QEXPECT_FAIL("", "This is currently not supported", Continue); QCOMPARE(browser->sourceInsideLoadResource.toString(), url.toString()); } -- cgit v1.2.3