From 0733a70dd40b0d48cf5d8c08cfe276e7b3413f31 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Wed, 21 Apr 2010 19:25:09 +0200 Subject: [PATCH] debugger: add simple QUrl dumper --- share/qtcreator/gdbmacros/gdbmacros.py | 9 +++++++++ tests/manual/gdbdebugger/simple/app.cpp | 3 +++ 2 files changed, 12 insertions(+) diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index 605c6187b91..6aa0e995de2 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -1440,6 +1440,15 @@ def qdump__QTextCodec(d, item): d.putCallItem("name", item, "name()") d.putCallItem("mibEnum", item, "mibEnum()") +def qdump__QUrl(d, item): + d_ptr = item.value["d"].dereference() + d.putStringValue(d_ptr["encodedOriginal"]) + d.putNumChild(1) + if d.isExpanded(item): + with Children(d): + d.putItem(Item(d_ptr, item.iname, "d", "d")) + + def qdumpHelper__QVariant(d, value): #warn("VARIANT TYPE: %s : " % variantType) data = value["d"]["data"] diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 68bdcfb2ebe..1705327ffa5 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -47,6 +47,7 @@ #include <QtCore/QThread> #include <QtCore/QVariant> #include <QtCore/QVector> +#include <QtCore/QUrl> #if QT_VERSION >= 0x040500 #include <QtCore/QSharedPointer> #endif @@ -1165,6 +1166,8 @@ void testQStack() void testQString() { + QUrl url(QString("http://www.nokia.com")); + QString str = "Hello "; str += " big, "; str += " fat "; -- GitLab