Query tab will now show multiple data tabs if it get's multiple results
with tuples.
This commit is contained in:
parent
424cbc9e2e
commit
b6d986051b
21 changed files with 349 additions and 113 deletions
25
querytab.h
25
querytab.h
|
|
@ -5,12 +5,13 @@
|
|||
#include "queryresultmodel.h"
|
||||
#include "queryexplainmodel.h"
|
||||
#include "stopwatch.h"
|
||||
#include "tuplesresultwidget.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class QueryTab;
|
||||
class QueryTab;
|
||||
}
|
||||
|
||||
class MainWindow;
|
||||
|
|
@ -38,11 +39,22 @@ public:
|
|||
void saveCopyAs();
|
||||
|
||||
void execute();
|
||||
void explainAnalyze();
|
||||
void explain(bool analyze);
|
||||
void cancel();
|
||||
|
||||
bool canClose();
|
||||
private:
|
||||
|
||||
// struct ResultTab {
|
||||
// public:
|
||||
// std::shared_ptr<QueryResultModel> resultModel;
|
||||
// std::shared_ptr<TuplesResultWidget> tuplesResult;
|
||||
//// ResultTab(std::shared_ptr<QueryResultModel> rm, Ui::TuplesResult *tr)
|
||||
//// : resultModel(rm), tuplesResult(tr)
|
||||
//// {}
|
||||
// };
|
||||
using ResultTabContainer = std::vector<TuplesResultWidget*>;
|
||||
|
||||
Ui::QueryTab *ui;
|
||||
MainWindow *m_win;
|
||||
std::unique_ptr<SqlHighlighter> highlighter;
|
||||
|
|
@ -58,17 +70,20 @@ private:
|
|||
QString promptUserForSaveSqlFilename();
|
||||
|
||||
|
||||
|
||||
|
||||
ASyncDBConnection m_dbConnection;
|
||||
std::unique_ptr<QueryResultModel> resultModel;
|
||||
|
||||
std::unique_ptr<QueryExplainModel> explainModel;
|
||||
ResultTabContainer resultList;
|
||||
|
||||
void addLog(QString s);
|
||||
|
||||
std::string getCommand() const;
|
||||
void explain_ready(ExplainRoot::SPtr explain);
|
||||
void query_ready(std::shared_ptr<Pgsql::Result> dbres);
|
||||
void query_ready(std::shared_ptr<Pgsql::Result> dbres, qint64 elapsedms);
|
||||
|
||||
void setTabCaption(const QString &caption);
|
||||
void setTabCaption(const QString &caption, const QString &tooltip);
|
||||
void clearResult();
|
||||
private slots:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue