23,120
社区成员
发帖
与我相关
我的任务
分享
#include "mainwindow.h"
#include "ui_mainwindow.h"
extern QString strOfReci;
extern QString strOfSend;
extern bool isReady;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
recieveThread * r_thread = new recieveThread();
connect(r_thread,SIGNAL(getReci()),this,SLOT(showReci()),Qt::AutoConnection);
r_thread->start();
/* sendThread * s_thread = new sendThread();
connect(ui->sendButton,SIGNAL(clicked()),this,SLOT(getSend()),Qt::AutoConnection);
s_thread->start();*/
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::showReci()
{
ui->recieveTextEdit->setReadOnly(1);
ui->recieveTextEdit->setPlainText("123");=====>>问题在这,只要有这句话,运行程序就会死机,只有上句的话没问题
}
void MainWindow::getSend()
{
strOfSend = ui->sendTextEdit->toPlainText();
isReady = true;
}