-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
57 lines (52 loc) · 1.08 KB
/
mainwindow.cpp
File metadata and controls
57 lines (52 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include <iostream>
#include <thread>
#include <chat_box.h>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void server_read(int t, Server s){
s.read_text(t);
}
void server_send(int a, Server s)
{
s.send_text("hey");
}
void client_send(int a, Client s)
{
s.send_text("hey");
}
void client_read(int a, Client s)
{
s.read_text(a);
}
void MainWindow::on_pb_server_clicked()
{
Server serv;
chat_box *chat=new chat_box;
chat->show();
std::cout<<"fuck you"<<std::endl;
// std::thread sent_server(server_send, 3, serv);
// std::thread read_server(server_read, 4, serv);
// sent_server.join();
// read_server.join();
}
void MainWindow::on_pb_client_clicked()
{
Client cli;
chat_box *chat=new chat_box;
chat->show();
std::cout<<"fuck you"<<std::endl;
// std::thread thr(client_read, 4, cli);
// std::thread sent(client_send, 3, cli);
// sent.join();
// thr.join();
}