Decided to use signal slot mechanism

The automatic cross thread activation  is probably worth it.
This commit is contained in:
eelke 2018-01-08 20:54:03 +01:00
parent 14ab400ccb
commit abd4020ddf
3 changed files with 34 additions and 63 deletions

View file

@ -32,11 +32,9 @@ QueryTab::QueryTab(MainWindow *win, QWidget *parent) :
{
ui->setupUi(this);
m_dbConnection.setStateChangeReceiver(
[this, win](auto s) { win->QueueTask([this, s]() { connectionStateChanged(s); }); });
m_dbConnection.setNoticeReceiver(
[this, win](auto n) { win->QueueTask([this, n]() { receiveNotice(n); }); });
connect(&m_dbConnection, &ASyncDBConnection::onStateChanged, this, &QueryTab::connectionStateChanged);
connect(&m_dbConnection, &ASyncDBConnection::onNotice, this, &QueryTab::receiveNotice);
QFont font;
font.setFamily("Source Code Pro");
font.setFixedPitch(true);