diff --git a/share/qtcreator/gdbmacros/gdbmacros.py b/share/qtcreator/gdbmacros/gdbmacros.py index 533ce611ce4..42651561380 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.py +++ b/share/qtcreator/gdbmacros/gdbmacros.py @@ -799,6 +799,28 @@ def qdump__QObject(d, item): d.putType(" ") d.putValue(extractCString(metaStringData, offset)) + # Active connection + with SubItem(d): + d.putName("currentSender") + d.putType(" ") + sender = d_ptr["currentSender"] + d.putValue(cleanAddress(sender)) + if isNull(sender): + d.putNumChild(0) + else: + d.putNumChild(1) + iname = item.iname + ".currentSender" + if d.isExpandedIName(iname): + with Children(d): + # Sending object + d.putItem(Item(sender["sender"], iname, "object", "object")) + # Signal in sending object + with SubItem(d): + d.putName("signal") + d.putValue(sender["signal"]) + d.putType(" "); + d.putNumChild(0) + # QObject # static const uint qt_meta_data_QObject[] = { diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 26c02e1b2da..18a0a71cad5 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -260,6 +260,7 @@ void QmlEngine::startDebugger() return; } setState(AdapterStarted); + startSuccessful(); setState(InferiorStarting); //m_frameRate = new CanvasFrameRate(0); @@ -306,8 +307,8 @@ void QmlEngine::setupConnection() } qDebug() << "CONNECTION SUCCESSFUL"; + setState(InferiorRunningRequested); setState(InferiorRunning); - startSuccessful(); reloadEngines(); } diff --git a/tests/manual/gdbdebugger/simple/app.cpp b/tests/manual/gdbdebugger/simple/app.cpp index 3842c31d464..2c768ea5eff 100644 --- a/tests/manual/gdbdebugger/simple/app.cpp +++ b/tests/manual/gdbdebugger/simple/app.cpp @@ -791,6 +791,42 @@ void testQObject(int &argc, char *argv[]) #endif } +class Sender : public QObject +{ + Q_OBJECT +public: + Sender() { setObjectName("Sender"); } + void doEmit() { emit aSignal(); } +signals: + void aSignal(); +}; + +class Receiver : public QObject +{ + Q_OBJECT +public: + Receiver() { setObjectName("Receiver"); } +public slots: + void aSlot() { + QObject *s = sender(); + if (s) { + qDebug() << "SENDER: " << s; + } else { + qDebug() << "NO SENDER"; + } + } +}; + +void testSignalSlot(int &argc, char *argv[]) +{ + QApplication app(argc, argv); + Sender sender; + Receiver receiver; + QObject::connect(&sender, SIGNAL(aSignal()), &receiver, SLOT(aSlot())); + sender.doEmit(); +}; + + void testQPixmap() { QImage im(QSize(200, 200), QImage::Format_RGB32); @@ -1822,6 +1858,7 @@ int main(int argc, char *argv[]) testObject1(); testVector1(); testQHash1(); + testSignalSlot(argc, argv); QString hallo = "hallo"; QStringList list;