Added a Qt window for output
This commit is contained in:
parent
bc7521ac95
commit
9006032f27
8 changed files with 184 additions and 36 deletions
26
source/mainwindow.cpp
Normal file
26
source/mainwindow.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
#include "sniffthread.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
connect(ui->pushButton, &QPushButton::clicked, ui->listWidget, &QListWidget::clear);
|
||||
|
||||
SniffThread *sniffThread = new SniffThread();
|
||||
connect(sniffThread, &SniffThread::dataReceived, this, &MainWindow::dataReceived);
|
||||
sniffThread->start();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::dataReceived(QString data)
|
||||
{
|
||||
ui->listWidget->addItem(data);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue