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
|
|
@ -13,6 +13,7 @@
|
|||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtWidgets/QGridLayout>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
|
|
@ -20,9 +21,11 @@
|
|||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QSplitter>
|
||||
#include <QtWidgets/QStatusBar>
|
||||
#include <QtWidgets/QTabWidget>
|
||||
#include <QtWidgets/QTableView>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
#include <QtWidgets/QToolBar>
|
||||
#include <QtWidgets/QTreeView>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
|
|
@ -36,7 +39,16 @@ public:
|
|||
QLineEdit *connectionStringEdit;
|
||||
QSplitter *splitter;
|
||||
QTextEdit *queryEdit;
|
||||
QTabWidget *tabWidget;
|
||||
QWidget *messageTab;
|
||||
QGridLayout *gridLayout_2;
|
||||
QTextEdit *messagesEdit;
|
||||
QWidget *dataTab;
|
||||
QGridLayout *gridLayout;
|
||||
QTableView *ResultView;
|
||||
QWidget *explainTab;
|
||||
QGridLayout *gridLayout_3;
|
||||
QTreeView *explainTreeView;
|
||||
QMenuBar *menuBar;
|
||||
QMenu *menuTest;
|
||||
QToolBar *mainToolBar;
|
||||
|
|
@ -53,6 +65,7 @@ public:
|
|||
verticalLayout->setSpacing(6);
|
||||
verticalLayout->setContentsMargins(11, 11, 11, 11);
|
||||
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
|
||||
verticalLayout->setContentsMargins(8, 8, 8, 8);
|
||||
connectionStringEdit = new QLineEdit(centralWidget);
|
||||
connectionStringEdit->setObjectName(QStringLiteral("connectionStringEdit"));
|
||||
|
||||
|
|
@ -64,7 +77,30 @@ public:
|
|||
queryEdit = new QTextEdit(splitter);
|
||||
queryEdit->setObjectName(QStringLiteral("queryEdit"));
|
||||
splitter->addWidget(queryEdit);
|
||||
ResultView = new QTableView(splitter);
|
||||
tabWidget = new QTabWidget(splitter);
|
||||
tabWidget->setObjectName(QStringLiteral("tabWidget"));
|
||||
messageTab = new QWidget();
|
||||
messageTab->setObjectName(QStringLiteral("messageTab"));
|
||||
gridLayout_2 = new QGridLayout(messageTab);
|
||||
gridLayout_2->setSpacing(6);
|
||||
gridLayout_2->setContentsMargins(11, 11, 11, 11);
|
||||
gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
|
||||
gridLayout_2->setContentsMargins(4, 4, 4, 4);
|
||||
messagesEdit = new QTextEdit(messageTab);
|
||||
messagesEdit->setObjectName(QStringLiteral("messagesEdit"));
|
||||
messagesEdit->setReadOnly(true);
|
||||
|
||||
gridLayout_2->addWidget(messagesEdit, 0, 0, 1, 1);
|
||||
|
||||
tabWidget->addTab(messageTab, QString());
|
||||
dataTab = new QWidget();
|
||||
dataTab->setObjectName(QStringLiteral("dataTab"));
|
||||
gridLayout = new QGridLayout(dataTab);
|
||||
gridLayout->setSpacing(6);
|
||||
gridLayout->setContentsMargins(11, 11, 11, 11);
|
||||
gridLayout->setObjectName(QStringLiteral("gridLayout"));
|
||||
gridLayout->setContentsMargins(4, 4, 4, 4);
|
||||
ResultView = new QTableView(dataTab);
|
||||
ResultView->setObjectName(QStringLiteral("ResultView"));
|
||||
QFont font;
|
||||
font.setFamily(QStringLiteral("Source Sans Pro"));
|
||||
|
|
@ -72,7 +108,28 @@ public:
|
|||
ResultView->setFont(font);
|
||||
ResultView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ResultView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
splitter->addWidget(ResultView);
|
||||
|
||||
gridLayout->addWidget(ResultView, 0, 0, 1, 1);
|
||||
|
||||
tabWidget->addTab(dataTab, QString());
|
||||
explainTab = new QWidget();
|
||||
explainTab->setObjectName(QStringLiteral("explainTab"));
|
||||
gridLayout_3 = new QGridLayout(explainTab);
|
||||
gridLayout_3->setSpacing(6);
|
||||
gridLayout_3->setContentsMargins(11, 11, 11, 11);
|
||||
gridLayout_3->setObjectName(QStringLiteral("gridLayout_3"));
|
||||
gridLayout_3->setContentsMargins(2, 2, 2, 2);
|
||||
explainTreeView = new QTreeView(explainTab);
|
||||
explainTreeView->setObjectName(QStringLiteral("explainTreeView"));
|
||||
explainTreeView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
explainTreeView->setProperty("showDropIndicator", QVariant(false));
|
||||
explainTreeView->setIndentation(10);
|
||||
explainTreeView->header()->setStretchLastSection(false);
|
||||
|
||||
gridLayout_3->addWidget(explainTreeView, 0, 0, 1, 1);
|
||||
|
||||
tabWidget->addTab(explainTab, QString());
|
||||
splitter->addWidget(tabWidget);
|
||||
|
||||
verticalLayout->addWidget(splitter);
|
||||
|
||||
|
|
@ -94,12 +151,18 @@ public:
|
|||
|
||||
retranslateUi(MainWindow);
|
||||
|
||||
tabWidget->setCurrentIndex(2);
|
||||
|
||||
|
||||
QMetaObject::connectSlotsByName(MainWindow);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *MainWindow)
|
||||
{
|
||||
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", Q_NULLPTR));
|
||||
tabWidget->setTabText(tabWidget->indexOf(messageTab), QApplication::translate("MainWindow", "Messages", Q_NULLPTR));
|
||||
tabWidget->setTabText(tabWidget->indexOf(dataTab), QApplication::translate("MainWindow", "Data", Q_NULLPTR));
|
||||
tabWidget->setTabText(tabWidget->indexOf(explainTab), QApplication::translate("MainWindow", "Explain", Q_NULLPTR));
|
||||
menuTest->setTitle(QApplication::translate("MainWindow", "test", Q_NULLPTR));
|
||||
} // retranslateUi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue