|
1
2
3
|
#include "chatwindow.h"
#include "ui_chatwindow.h"
|
|
4
5
|
using namespace std;
|
|
6
|
ChatWindow::ChatWindow(QString& nickname, QWidget *parent) :
|
|
7
8
9
10
|
QMainWindow(parent),
ui(new Ui::ChatWindow)
{
ui->setupUi(this);
|
|
11
12
13
14
|
QList<int> sizes;
sizes.push_front(ui->chatText->height());
sizes.push_front(100);
ui->splitter->setSizes(sizes);
|
|
15
16
17
18
19
20
21
|
this->setWindowTitle("Chat with " + nickname);
connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(close()));
}
void ChatWindow::printMsg(string& str)
{
ui->chatText->printMsg(str);
|
|
22
23
24
25
26
27
|
}
ChatWindow::~ChatWindow()
{
delete ui;
}
|