Use then construct instead of future watcher for test connection.ConnectionConfigurationWidget
The QPointer is detect the window has been destroyed.
This commit is contained in:
parent
90851ef950
commit
521e5d7370
2 changed files with 18 additions and 24 deletions
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <QWidget>
|
||||
#include <QUuid>
|
||||
#include <QFutureWatcher>
|
||||
#include <tuple>
|
||||
#include "TestConnection.h"
|
||||
|
||||
|
|
@ -20,7 +19,6 @@ class QSpinBox;
|
|||
|
||||
class ConnectionTreeModel;
|
||||
|
||||
|
||||
class ConnectionConfigurationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -28,14 +26,15 @@ public:
|
|||
static void editExistingInWindow(ConnectionController *ctrl, const ConnectionConfig &cfg,
|
||||
std::function<void(ConnectionConfigurationWidget&)> save_func);
|
||||
|
||||
explicit ConnectionConfigurationWidget(ConnectionController *connection_controller, QWidget *parent = nullptr);
|
||||
explicit ConnectionConfigurationWidget(
|
||||
ConnectionController *connection_controller,
|
||||
QWidget *parent = nullptr);
|
||||
|
||||
void retranslateUi();
|
||||
void setData(const ConnectionConfig &cfg);
|
||||
ConnectionConfig data() const;
|
||||
QString group() const;
|
||||
bool savePassword() const;
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
void testConnection();
|
||||
|
|
@ -77,13 +76,7 @@ private:
|
|||
QLabel *lblResult;
|
||||
QFormLayout *formLayout;
|
||||
|
||||
|
||||
QFutureWatcher<TestConnectionResult> TestWatcher;
|
||||
|
||||
private slots:
|
||||
void handleTestResult();
|
||||
void handleTestResult(TestConnectionResult result);
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif // CONNECTIONCONFIGURATIONWIDGET_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue