测试连接

This commit is contained in:
2022-01-02 01:47:50 +08:00
parent bceec91eb5
commit 0a1505b9fd
13 changed files with 23 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+22 -2
View File
@@ -3,30 +3,50 @@
#include <QDebug>
#include <QTcpSocket> //通信套接字
void Widget::tcp_connected()
{
//qDebug() << "connected";
}
void Widget::tray_scan()
{
qDebug()<< "try_scan";
qDebug()<< ui->IP_list->toPlainText();
//QString text = ui->IP_list->toPlainText();
QStringList number_list = ui->IP_list->toPlainText().split("\n");
for (int i = 0; i < number_list.size(); ++i)
{
qDebug() << number_list.at(i);
}
//QTcpSocket* m_socket = new QTcpSocket;
//m_socket->connectToHost("127.0.0.1", 58888, QTcpSocket::ReadWrite);
//connect(m_socket, &QTcpSocket::connected, this, &Widget::tcp_connected);
}
void Widget::auto_edit()
{
qDebug("%d",rand());
//qDebug("%d",rand());
}
Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
qDebug("hello world");
//qDebug("hello world");
connect(ui->stard_scan,&QPushButton::pressed,this, &Widget::tray_scan);//扫描按钮被按下
connect(ui->IP_list,&QTextEdit::textChanged,this, &Widget::auto_edit);
}
Widget::~Widget()
+1
View File
@@ -17,6 +17,7 @@ public:
void tray_scan();
void auto_edit();
void tcp_connected();
private:
Ui::Widget *ui;