测试连接
This commit is contained in:
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.
Binary file not shown.
+22
-2
@@ -3,30 +3,50 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTcpSocket> //通信套接字
|
#include <QTcpSocket> //通信套接字
|
||||||
|
|
||||||
|
void Widget::tcp_connected()
|
||||||
|
{
|
||||||
|
//qDebug() << "connected";
|
||||||
|
}
|
||||||
|
|
||||||
void Widget::tray_scan()
|
void Widget::tray_scan()
|
||||||
{
|
{
|
||||||
qDebug()<< "try_scan";
|
qDebug()<< "try_scan";
|
||||||
qDebug()<< ui->IP_list->toPlainText();
|
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()
|
void Widget::auto_edit()
|
||||||
{
|
{
|
||||||
qDebug("%d",rand());
|
//qDebug("%d",rand());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Widget::Widget(QWidget *parent)
|
Widget::Widget(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, ui(new Ui::Widget)
|
, ui(new Ui::Widget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
qDebug("hello world");
|
//qDebug("hello world");
|
||||||
|
|
||||||
connect(ui->stard_scan,&QPushButton::pressed,this, &Widget::tray_scan);//扫描按钮被按下
|
connect(ui->stard_scan,&QPushButton::pressed,this, &Widget::tray_scan);//扫描按钮被按下
|
||||||
connect(ui->IP_list,&QTextEdit::textChanged,this, &Widget::auto_edit);
|
connect(ui->IP_list,&QTextEdit::textChanged,this, &Widget::auto_edit);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget::~Widget()
|
Widget::~Widget()
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public:
|
|||||||
|
|
||||||
void tray_scan();
|
void tray_scan();
|
||||||
void auto_edit();
|
void auto_edit();
|
||||||
|
void tcp_connected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::Widget *ui;
|
Ui::Widget *ui;
|
||||||
|
|||||||
Reference in New Issue
Block a user