Added explain functionality.
Uses json format with jsoncpp as a parser. Then show it in a QTreeView. Shows inclusive/exclusive times like explain.despesz does. Also a similar coloring scheme as applied.
This commit is contained in:
parent
0d30dc9080
commit
8af6bc4ac5
14 changed files with 9089 additions and 33 deletions
31
queryexplainmodel.h
Normal file
31
queryexplainmodel.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#pragma once
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <string>
|
||||
#include "explaintreemodelitem.h"
|
||||
|
||||
class QueryExplainModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QueryExplainModel(QObject *parent, std::unique_ptr<ExplainRoot> exp);
|
||||
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
// Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
|
||||
QVariant headerData(int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole) const override;
|
||||
|
||||
QModelIndex index(int row, int column,
|
||||
const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
QModelIndex parent(const QModelIndex &index) const override;
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<ExplainRoot> explain;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue