Debugger: Remove some uses of semi-global currentEngine()

Make use of recent TreeModel improvements in various
tool views, push more operations into the engine-
owned data models, specifically context menu creation.

Change-Id: I479c97102b9fb81611c6461c6df1cec59295179a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2016-07-18 12:36:31 +02:00
committed by hjk
parent 84f1466b01
commit 2d79bdc29c
36 changed files with 2636 additions and 3364 deletions

View File

@@ -31,12 +31,14 @@
namespace Debugger {
namespace Internal {
class DebuggerEngine;
class SourceFilesHandler : public QAbstractItemModel
{
Q_OBJECT
public:
SourceFilesHandler();
explicit SourceFilesHandler(DebuggerEngine *engine);
int columnCount(const QModelIndex &parent) const
{ return parent.isValid() ? 0 : 2; }
@@ -47,6 +49,7 @@ public:
{ return createIndex(row, column); }
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &idx, const QVariant &data, int role) override;
Qt::ItemFlags flags(const QModelIndex &index) const;
void clearModel();
@@ -57,6 +60,7 @@ public:
QAbstractItemModel *model() { return m_proxyModel; }
private:
DebuggerEngine *m_engine;
QStringList m_shortNames;
QStringList m_fullNames;
QAbstractItemModel *m_proxyModel;