diff --git a/src/dialog/logdialog.cpp b/src/dialog/logdialog.cpp
index 759e294..fc5d40f 100644
--- a/src/dialog/logdialog.cpp
+++ b/src/dialog/logdialog.cpp
@@ -33,6 +33,12 @@ LogDialog::LogDialog(QWidget* parent)
 {
     ui->setupUi(this);
 
+    /* Qt4's QMetaObject::connectSlotsByName() only matches child widgets,
+     * not the receiver itself, so the on_LogDialog_rejected() autoconnect
+     * idiom (which relies on Qt5/6 matching the dialog's own objectName)
+     * never fires there. Wire it explicitly so it works on every Qt version. */
+    connect(this, SIGNAL(rejected()), this, SLOT(onRejected()));
+
     loadSettings();
     ui->listWidget->setSelectionMode(QAbstractItemView::ContiguousSelection);
 
@@ -155,7 +161,7 @@ void LogDialog::on_checkBox_autoScroll_toggled(bool checked)
     }
 }
 
-void LogDialog::on_LogDialog_rejected()
+void LogDialog::onRejected()
 {
     saveSettings();
 }
diff --git a/src/dialog/logdialog.h b/src/dialog/logdialog.h
index e7110e4..40b10c9 100644
--- a/src/dialog/logdialog.h
+++ b/src/dialog/logdialog.h
@@ -54,7 +54,7 @@ private slots:
 
     void on_checkBox_autoScroll_toggled(bool checked);
 
-    void on_LogDialog_rejected();
+    void onRejected();
 
 private:
     void loadSettings();
diff --git a/src/dialog/mainwindow.cpp b/src/dialog/mainwindow.cpp
index 28eca96..5b76c4f 100644
--- a/src/dialog/mainwindow.cpp
+++ b/src/dialog/mainwindow.cpp
@@ -154,13 +154,13 @@ MainWindow::MainWindow(QWidget* parent, bool useTray, const QString profileName)
         this, SLOT(request_update_stats()),
         Qt::QueuedConnection);
     connect(ui->serverList->lineEdit(), SIGNAL(returnPressed()),
-        this, SLOT(on_connectClicked()),
+        this, SLOT(connectClicked()),
         Qt::QueuedConnection);
     connect(this, SIGNAL(vpn_status_changed_sig(int)),
         this, SLOT(changeStatus(int)),
         Qt::QueuedConnection);
     connect(ui->connectionButton, SIGNAL(clicked()),
-        this, SLOT(on_connectClicked()),
+        this, SLOT(connectClicked()),
         Qt::QueuedConnection);
     connect(this, SIGNAL(stats_changed_sig(QString, QString, QString)),
         this, SLOT(statsChanged(QString, QString, QString)),
@@ -351,7 +351,7 @@ void MainWindow::onActionQuitTriggered()
     if (m_trayIcon && m_disconnectAction->isEnabled()) {
         connect(this, SIGNAL(readyToShutdown()),
             qApp, SLOT(quit()));
-        on_disconnectClicked();
+        disconnectClicked();
     } else {
         qApp->quit();
     }
@@ -367,7 +367,7 @@ void MainWindow::onStateMachineStarted()
         const int profileIndex = ui->serverList->findText(m_profileName);
         if (profileIndex != -1) {
             ui->serverList->setCurrentIndex(profileIndex);
-            emit on_connectClicked();
+            emit connectClicked();
             return;
         } else {
             QMessageBox::warning(this,
@@ -411,7 +411,7 @@ void MainWindow::onServerProfileTriggered()
     int idx = ui->serverList->findText(act->text());
     if (idx != -1) {
         ui->serverList->setCurrentIndex(idx);
-        on_connectClicked();
+        connectClicked();
     }
 }
 
@@ -680,9 +680,9 @@ void MainWindow::changeStatus(int val)
         blink_timer->start(1500);
 
         disconnect(ui->connectionButton, SIGNAL(clicked()),
-            this, SLOT(on_connectClicked()));
+            this, SLOT(connectClicked()));
         connect(ui->connectionButton, SIGNAL(clicked()),
-            this, SLOT(on_disconnectClicked()),
+            this, SLOT(disconnectClicked()),
             Qt::QueuedConnection);
     } else if (val == STATUS_DISCONNECTED) {
         blink_timer->stop();
@@ -723,9 +723,9 @@ void MainWindow::changeStatus(int val)
             m_trayIcon->setToolTip(QLatin1String("Disconnected"));
         }
         disconnect(ui->connectionButton, SIGNAL(clicked()),
-            this, SLOT(on_disconnectClicked()));
+            this, SLOT(disconnectClicked()));
         connect(ui->connectionButton, SIGNAL(clicked()),
-            this, SLOT(on_connectClicked()),
+            this, SLOT(connectClicked()),
             Qt::QueuedConnection);
 
         emit readyToShutdown();
@@ -803,7 +803,7 @@ fail: // LCA: drop this 'goto' and optimize values...
     delete vpninfo;
 }
 
-void MainWindow::on_disconnectClicked()
+void MainWindow::disconnectClicked()
 {
     if (this->timer->isActive()) {
         this->timer->stop();
@@ -812,7 +812,7 @@ void MainWindow::on_disconnectClicked()
     term_thread(this, &this->cmd_fd);
 }
 
-void MainWindow::on_connectClicked()
+void MainWindow::connectClicked()
 {
     VpnInfo* vpninfo = nullptr;
     StoredServer* ss = nullptr;
@@ -964,7 +964,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
         if (m_trayIcon && m_disconnectAction->isEnabled()) {
             connect(this, SIGNAL(readyToShutdown()),
                 qApp, SLOT(quit()));
-            on_disconnectClicked();
+            disconnectClicked();
         } else {
             qApp->quit();
         }
@@ -1075,7 +1075,7 @@ void MainWindow::createTrayIcon()
     m_disconnectAction = new QAction(tr("Disconnect"), this);
     m_trayIconMenu->addAction(m_disconnectAction);
     connect(m_disconnectAction, SIGNAL(triggered()),
-        this, SLOT(on_disconnectClicked()));
+        this, SLOT(disconnectClicked()));
 
     m_trayIconMenu->addSeparator();
     m_trayIconMenu->addAction(ui->actionLogWindow);
@@ -1113,7 +1113,7 @@ void MainWindow::on_actionNewProfile_triggered()
 {
     NewProfileDialog dialog(this);
     connect(&dialog, SIGNAL(connect()),
-        this, SLOT(on_connectClicked()),
+        this, SLOT(connectClicked()),
         Qt::QueuedConnection);
     if (dialog.exec() != QDialog::Accepted) {
         return;
diff --git a/src/dialog/mainwindow.h b/src/dialog/mainwindow.h
index 7567b99..18dbb15 100644
--- a/src/dialog/mainwindow.h
+++ b/src/dialog/mainwindow.h
@@ -85,8 +85,8 @@ public slots:
 
     void request_update_stats();
 
-    void on_connectClicked();
-    void on_disconnectClicked();
+    void connectClicked();
+    void disconnectClicked();
 
     void closeEvent(QCloseEvent* event) override;
 
diff --git a/src/dialog/mainwindow.ui b/src/dialog/mainwindow.ui
index 54dfad8..7105ea7 100644
--- a/src/dialog/mainwindow.ui
+++ b/src/dialog/mainwindow.ui
@@ -625,6 +625,6 @@
   </connection>
  </connections>
  <slots>
-  <slot>on_connectClicked()</slot>
+  <slot>connectClicked()</slot>
  </slots>
 </ui>
diff --git a/src/vpninfo.cpp b/src/vpninfo.cpp
index 7e01b51..c7c5559 100644
--- a/src/vpninfo.cpp
+++ b/src/vpninfo.cpp
@@ -707,7 +707,7 @@ void VpnInfo::logVpncScriptOutput()
                 QString("Accept"));
             msgBox.show();
             if (msgBox.result() == false) {
-                this->m->on_disconnectClicked();
+                this->m->disconnectClicked();
             }
         }
     } else {
