The ASyncDBConnection class uses C++ std::function callbacks now for reporting notices and state changes.
While I like some aspects of Qt's signals and slots system I prefer to rely on more standard C++.
This commit is contained in:
parent
2705a3417b
commit
23e307f93a
4 changed files with 67 additions and 36 deletions
|
|
@ -11,8 +11,10 @@ DatabaseWindow::DatabaseWindow(QWidget *parent) :
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(&m_dbConnection, &ASyncDBConnection::onStateChanged, this, &DatabaseWindow::connectionStateChanged);
|
||||
connect(&m_dbConnection, &ASyncDBConnection::onNotice, this, &DatabaseWindow::receiveNotice);
|
||||
m_dbConnection.setStateChangeReceiver(
|
||||
[this](auto s) { QueueTask([this, s]() { connectionStateChanged(s); }); });
|
||||
m_dbConnection.setNoticeReceiver(
|
||||
[this](auto n) { QueueTask([this, n]() { receiveNotice(n); }); });
|
||||
}
|
||||
|
||||
DatabaseWindow::~DatabaseWindow()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue