Het maken van de DB connectie gebeurd nu asynchroon.
This commit is contained in:
parent
27abce5a11
commit
3a8cc3d7f0
5 changed files with 207 additions and 18 deletions
18
mainwindow.h
18
mainwindow.h
|
|
@ -2,7 +2,9 @@
|
|||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSocketNotifier>
|
||||
#include <memory>
|
||||
#include "PgsqlConn.h"
|
||||
|
||||
class QueryResultModel;
|
||||
class SqlHighlighter;
|
||||
|
|
@ -11,6 +13,12 @@ namespace Ui {
|
|||
class MainWindow;
|
||||
}
|
||||
|
||||
namespace Pgsql {
|
||||
|
||||
class Connection;
|
||||
|
||||
}
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -23,10 +31,20 @@ private:
|
|||
std::unique_ptr<Ui::MainWindow> ui;
|
||||
std::unique_ptr<SqlHighlighter> highlighter;
|
||||
|
||||
std::unique_ptr<Pgsql::Connection> connection;
|
||||
std::unique_ptr<QueryResultModel> resultModel;
|
||||
|
||||
struct {
|
||||
std::unique_ptr<QSocketNotifier> notifier;
|
||||
PostgresPollingStatusType poll_state;
|
||||
} connectingState;
|
||||
|
||||
private slots:
|
||||
|
||||
void startConnect();
|
||||
|
||||
void performQuery();
|
||||
void socket_activate_connect(int socket);
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue