Commit 6c9c79d0 authored by hjk's avatar hjk
Browse files

Debugger: Make LocationMark draggable



Issue a DebuggerEngine::executeJumpToLine() in response.

Change-Id: I7be5738241ce91f61002d6f6b49c796824569024
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 63c5fc03
......@@ -134,6 +134,29 @@ Location::Location(const StackFrame &frame, bool marker)
}
class LocationMark : public TextMark
{
public:
LocationMark(DebuggerEngine *engine, const QString &file, int line)
: TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine)
{}
private:
bool isDraggable() const { return true; }
void dragToLine(int line)
{
if (m_engine) {
ContextData data;
data.fileName = fileName();
data.lineNumber = line;
m_engine->executeJumpToLine(data);
}
}
QPointer<DebuggerEngine> m_engine;
};
//////////////////////////////////////////////////////////////////////
//
// DebuggerEnginePrivate
......@@ -319,7 +342,7 @@ public:
DisassemblerAgent m_disassemblerAgent;
MemoryAgent m_memoryAgent;
QScopedPointer<TextMark> m_locationMark;
QScopedPointer<LocationMark> m_locationMark;
QTimer m_locationTimer;
bool m_isStateDebugging;
......@@ -610,7 +633,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
if (loc.needsMarker()) {
d->m_locationMark.reset(new TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION));
d->m_locationMark.reset(new LocationMark(this, file, line));
d->m_locationMark->setIcon(Internal::locationMarkIcon());
d->m_locationMark->setPriority(TextMark::HighPriority);
}
......
......@@ -65,6 +65,7 @@ class MemoryAgent;
class WatchData;
class WatchItem;
class BreakHandler;
class LocationMark;
class ModulesHandler;
class RegisterHandler;
class StackHandler;
......@@ -441,6 +442,7 @@ private:
virtual void setState(DebuggerState state, bool forced = false);
friend class DebuggerEnginePrivate;
friend class LocationMark;
DebuggerEnginePrivate *d;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment