说明:在登录时,为了避免每次打开软件都要重新输入账号和密码,可以用QSettings来实现记录功能。
本例子中记录的是ip和port号。
#ifndef PERFORMANCETESTING_H
#define PERFORMANCETESTING_H
#include <QtWidgets/QMainWindow>
#include "ui_performancetesting.h"
class PerformanceTesting : public QMainWindow
{
Q_OBJECT
public:
PerformanceTesting(QWidget *parent = 0);
~PerformanceTesting();
private slots:
void PushButton();
void WriteInit(QString key, QString value);
void ReadInit(QString key, QString &value);
private:
Ui::PerformanceTestingClass ui;
};
#endif // PERFORMANCETESTING_H
#include "performancetesting.h"
#include "handlethreadandtest.h"
#include <QDebug>
#include <QMessageBox>
#include <QSettings>
PerformanceTesting::PerformanceTesting(QWidget *parent)
: QMainWindow(parent)
{
ui.setupUi(this);
QStr