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

@@ -29,6 +29,8 @@
#include <QAbstractItemModel>
namespace Utils { class ItemViewEvent; }
namespace Debugger {
namespace Internal {
@@ -77,20 +79,25 @@ signals:
void currentIndexChanged();
private:
// QAbstractTableModel
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
bool setData(const QModelIndex &idx, const QVariant &data, int role) override;
bool contextMenuEvent(const Utils::ItemViewEvent &event);
void resetModel() { beginResetModel(); endResetModel(); }
void reloadFullStack();
void copyContentsToClipboard();
void saveTaskFile();
DebuggerEngine *m_engine;
StackFrames m_stackFrames;
int m_currentIndex;
bool m_canExpand;
bool m_resetLocationScheduled;
bool m_contentsValid;
int m_currentIndex = -1;
bool m_canExpand = false;
bool m_resetLocationScheduled = false;
bool m_contentsValid = false;
};
} // namespace Internal