Commit 823b4632b3a4e27248358d707260788aef223b5d

Authored by Imanol-Mikel Barba Sabariego
1 parent 8288ac94

git-svn-id: svn://imanolbarba.net/PAD@38 c2ee353e-ed0d-4329-bf56-03aec153487f

Showing 48 changed files with 1696 additions and 552 deletions
JChatServer/bin/pad/prac2/JChat.class deleted
No preview for this file type
JChatServer/.classpath renamed to JChatServerV2/.classpath
JChatServer/.project renamed to JChatServerV2/.project
JChatServer/.settings/org.eclipse.jdt.core.prefs renamed to JChatServerV2/.settings/org.eclipse.jdt.core.prefs
JChatServer/bin/pad/prac2/ChatException.class renamed to JChatServerV2/bin/pad/prac2/ChatException.class
No preview for this file type
JChatServer/bin/pad/prac2/Connection.class renamed to JChatServerV2/bin/pad/prac2/Connection.class
No preview for this file type
JChatServer/bin/pad/prac2/JChat$1.class renamed to JChatServerV2/bin/pad/prac2/JChat$1.class
No preview for this file type
JChatServerV2/bin/pad/prac2/JChat.class 0 → 100644
No preview for this file type
JChatServer/bin/pad/prac2/MyServerSocket.class renamed to JChatServerV2/bin/pad/prac2/MyServerSocket.class
No preview for this file type
JChatServer/bin/pad/prac2/MySocket.class renamed to JChatServerV2/bin/pad/prac2/MySocket.class
No preview for this file type
JChatServer/bin/pad/prac2/Server.class renamed to JChatServerV2/bin/pad/prac2/Server.class
No preview for this file type
JChatServer/src/pad/prac2/ChatException.java renamed to JChatServerV2/src/pad/prac2/ChatException.java
JChatServer/src/pad/prac2/Connection.java renamed to JChatServerV2/src/pad/prac2/Connection.java
... ... @@ -69,18 +69,23 @@ public class Connection extends Thread
69 69 try
70 70 {
71 71 str = socket.recvMsg();
72   - while(str.contains(" "))
  72 + if(str.contains(" "))
73 73 {
74 74 socket.sendMsg("CHATNICKINVALID");
75   - str = socket.recvMsg();
  75 + kill = true;
  76 + continue;
76 77 }
77   - while(serv.isOnline(str))
  78 + else if(serv.isOnline(str))
78 79 {
79 80 socket.sendMsg("CHATNICKEXIST");
80   - str = socket.recvMsg();
  81 + kill = true;
  82 + continue;
  83 + }
  84 + else
  85 + {
  86 + socket.sendMsg("CHATOK");
  87 + serv.addToChatroom(this, str);
81 88 }
82   - socket.sendMsg("CHATOK");
83   - serv.addToChatroom(this, str);
84 89 }
85 90 catch (IOException e)
86 91 {
... ... @@ -96,23 +101,24 @@ public class Connection extends Thread
96 101 {
97 102 try
98 103 {
99   - str = "/disconnect";
  104 + str = "0/disconnect";
100 105 str = socket.recvMsg();
  106 + str = str.substring(1);
101 107 if(str.equals("/disconnect"))
102 108 {
103   - socket.sendMsg("DISC_OK");
  109 + socket.sendMsg("0DISC_OK");
104 110 System.out.println(serv.getNickname(this) + " disconnected");
105 111 break;
106 112 }
107 113 else if(str.equals("/exit"))
108 114 {
109   - socket.sendMsg("EXIT_OK");
  115 + socket.sendMsg("0EXIT_OK");
110 116 System.out.println(serv.getNickname(this) + " disconnected");
111 117 break;
112 118 }
113 119 else if(str.equals("/who"))
114 120 {
115   - socket.sendMsg(serv.listOnline());
  121 + socket.sendMsg("0" + serv.listOnline());
116 122 }
117 123 else if(str.startsWith("@"))
118 124 {
... ... @@ -120,16 +126,16 @@ public class Connection extends Thread
120 126 {
121 127 if(!str.contains(" "))
122 128 {
123   - serv.sendTo(this,str.substring(1),"");
  129 + serv.sendTo(this,str.substring(1),"1");
124 130 }
125 131 else
126 132 {
127   - serv.sendTo(this,str.substring(1,str.indexOf(' ')),str.substring(str.indexOf(' ')+1));
  133 + serv.sendTo(this,"1"+str.substring(1,str.indexOf(' ')),str.substring(str.indexOf(' ')+1));
128 134 }
129 135 }
130 136 catch(ChatException cE)
131 137 {
132   - socket.sendMsg(cE.getMessage());
  138 + socket.sendMsg("0"+cE.getMessage());
133 139 }
134 140 }
135 141 else
... ...
JChatServer/src/pad/prac2/JChat.java renamed to JChatServerV2/src/pad/prac2/JChat.java
... ... @@ -8,14 +8,17 @@ public class JChat
8 8 {
9 9 String ip;
10 10 int port, roomSize;
11   - Scanner in = new Scanner(System.in);
  11 + /*Scanner in = new Scanner(System.in);
12 12 System.out.print("IP: ");
13 13 ip = in.nextLine();
14 14 System.out.print("Port: ");
15 15 port = in.nextInt();
16 16 System.out.print("Size of chatroom: ");
17 17 roomSize = in.nextInt();
18   - in.close();
  18 + in.close();*/
  19 + ip = "localhost";
  20 + port = 3001;
  21 + roomSize = 5;
19 22 final Server serv = new Server(ip,port,roomSize);
20 23 Runtime.getRuntime().addShutdownHook(new Thread()
21 24 {
... ...
JChatServer/src/pad/prac2/MyServerSocket.java renamed to JChatServerV2/src/pad/prac2/MyServerSocket.java
JChatServer/src/pad/prac2/MySocket.java renamed to JChatServerV2/src/pad/prac2/MySocket.java
JChatServer/src/pad/prac2/Server.java renamed to JChatServerV2/src/pad/prac2/Server.java
... ... @@ -134,7 +134,7 @@ public class Server
134 134 conn = it.next();
135 135 if(conn != origin)
136 136 {
137   - conn.sendMessage(nickname + ": " + message);
  137 + conn.sendMessage("0"+nickname + ": " + message);
138 138 }
139 139 }
140 140 lock.unlock();
... ... @@ -145,15 +145,38 @@ public class Server
145 145 return activeConnections.get(c);
146 146 }
147 147  
  148 + public void notifyAllConnections()
  149 + {
  150 + lock.lock();
  151 + Set<Connection> connections = activeConnections.keySet();
  152 + Iterator<Connection> it = connections.iterator();
  153 + Connection conn;
  154 + while(it.hasNext())
  155 + {
  156 + conn = it.next();
  157 + try
  158 + {
  159 + conn.sendMessage("USERLIST:"+nickList());
  160 + }
  161 + catch(IOException ioExc)
  162 + {
  163 + System.out.println("TCP: Error writing to socket");
  164 + }
  165 + }
  166 + lock.unlock();
  167 + }
  168 +
148 169 public void addToChatroom(Connection c, String nickName)
149 170 {
150 171 activeConnections.put(c, nickName);
151 172 System.out.println(nickName + " has entered the room");
  173 + notifyAllConnections();
152 174 }
153 175  
154 176 private void removeFromChatroom(Connection c)
155 177 {
156 178 activeConnections.remove(c);
  179 + notifyAllConnections();
157 180 }
158 181  
159 182 public boolean isOnline(String nick)
... ... @@ -165,15 +188,22 @@ public class Server
165 188 {
166 189 lock.lock();
167 190 String ret = new Integer(activeConnections.size()).toString();
168   - ret += " people currently online:";
  191 + ret += " people currently online:\n";
  192 + ret += nickList();
  193 + lock.unlock();
  194 + return ret;
  195 + }
  196 +
  197 + public String nickList()
  198 + {
  199 + String ret = "";
169 200 Collection<String> nickNames = activeConnections.values();
170 201 Iterator<String> it = nickNames.iterator();
171 202 while(it.hasNext())
172 203 {
173   - ret += "\n";
174 204 ret += it.next();
  205 + ret += "\n";
175 206 }
176   - lock.unlock();
177 207 return ret;
178 208 }
179 209  
... ...
QChatClient/QChatClient.pro
... ... @@ -13,21 +13,24 @@ TEMPLATE = app
13 13  
14 14  
15 15 SOURCES += main.cpp\
16   - chatwindow.cpp \
17 16 loginscreen.cpp \
18 17 chatroom.cpp \
19 18 Socket.cpp \
20   - chatwidget.cpp
  19 + chatwidget.cpp \
  20 + chatwindow.cpp \
  21 + chatinputtext.cpp
21 22  
22   -HEADERS += chatwindow.h \
  23 +HEADERS += \
23 24 loginscreen.h \
24 25 chatroom.h \
25 26 SocketException.h \
26 27 Socket.h \
27   - chatwidget.h
  28 + chatwidget.h \
  29 + chatwindow.h \
  30 + chatinputtext.h
28 31  
29 32 FORMS += chatwindow.ui \
30 33 loginscreen.ui \
31 34 chatroom.ui
32 35  
33   -LIBS += -lpthread
  36 +QMAKE_CXXFLAGS += -std=c++11
... ...
QChatClient/QChatClient.pro.user
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3   -<!-- Written by QtCreator 2.7.1, 2013-12-19T13:24:57. -->
  3 +<!-- Written by QtCreator 2.7.1, 2013-12-25T12:22:15. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
... ... @@ -53,7 +53,7 @@
53 53 <valuemap type="QVariantMap">
54 54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
55 55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
56   - <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">{430bae4e-c8d6-488c-936e-c89fd5587cd0}</value>
  56 + <value type="QByteArray" key="ProjectExplorer.ProjectConfiguration.Id">{d6a12d1a-dee4-4341-8f4f-e2749eba145e}</value>
57 57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
... ... @@ -247,7 +247,7 @@
247 247 </data>
248 248 <data>
249 249 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
250   - <value type="QString">{0fd5067a-d849-4d4e-9457-800baef2de83}</value>
  250 + <value type="QString">{fd24a9a9-cdbc-49b3-845c-b174fda2a7ac}</value>
251 251 </data>
252 252 <data>
253 253 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
... ...
QChatClient/chatinputtext.cpp 0 → 100644
  1 +#include "chatinputtext.h"
  2 +
  3 +chatInputText::chatInputText(QWidget *parent) :
  4 + QTextEdit(parent)
  5 +{
  6 +}
  7 +
  8 +void chatInputText::keyPressEvent(QKeyEvent *ke)
  9 +{
  10 + if(ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter)
  11 + {
  12 + emit msgReady();
  13 + return;
  14 + }
  15 + QTextEdit::keyPressEvent(ke);
  16 +}
... ...
QChatClient/chatinputtext.h 0 → 100644
  1 +#ifndef CHATINPUTTEXT_H
  2 +#define CHATINPUTTEXT_H
  3 +
  4 +#include <QTextEdit>
  5 +#include <QKeyEvent>
  6 +
  7 +class chatInputText : public QTextEdit
  8 +{
  9 + Q_OBJECT
  10 +public:
  11 + explicit chatInputText(QWidget *parent = 0);
  12 +
  13 +signals:
  14 +
  15 +protected:
  16 + void keyPressEvent(QKeyEvent *ke);
  17 +
  18 +signals:
  19 + void msgReady();
  20 +
  21 +public slots:
  22 +
  23 +};
  24 +
  25 +#endif // CHATINPUTTEXT_H
... ...
QChatClient/chatroom.cpp
1 1 #include "chatroom.h"
2 2 #include "ui_chatroom.h"
3 3  
  4 +list<QString> sendQueue;
  5 +
  6 +std::mutex myMutex;
  7 +
  8 +std::mutex msgMutex;
  9 +unique_lock<std::mutex>* msgLock;
  10 +
  11 +std::condition_variable msgListNotEmpty;
  12 +
4 13 Chatroom::Chatroom(QWidget *parent) :
5 14 QMainWindow(parent),
6 15 ui(new Ui::Chatroom)
... ... @@ -15,127 +24,253 @@ Chatroom::Chatroom(QWidget *parent) :
15 24 ui->chatSplitter->setSizes(chatSizes);
16 25 ui->windowSplitter->setSizes(splitSizes);
17 26 connected = false;
18   -}
  27 + msgLock = new unique_lock<std::mutex>(msgMutex,std::defer_lock);
  28 + send = NULL;
  29 + recv = NULL;
19 30  
20   -void killThread(thread_args *t_arg)
21   -{
22   - if(t_arg != 0)
23   - {
24   - delete t_arg;
25   - t_arg = 0;
26   - }
27   - pthread_exit(NULL);
  31 + connect(ui->actionConnect,SIGNAL(triggered()),this,SLOT(startSession()));
  32 + connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(finish()));
  33 + connect(this,SIGNAL(threadsFinished(bool)),this,SLOT(finishThreads(bool)));
  34 + connect(ui->inputText,SIGNAL(msgReady()),this,SLOT(sendMsg()));
  35 + connect(ui->actionDisconnect,SIGNAL(triggered()),this,SLOT(disconnectChatroom()));
  36 + connect(ui->sendButton,SIGNAL(clicked()),this,SLOT(sendMsg()));
  37 + connect(this,SIGNAL(messagesToPrint()),this,SLOT(printMsg()));
28 38 }
29 39  
30   -void *sendThread(void* args)
  40 +void sendThread(Socket* s, Chatroom* chat)
31 41 {
32 42 string send;
33   - struct thread_args *t_arg = (struct thread_args*)args;
34   - while(connected)
  43 + while(chat->getConnected())
35 44 {
36   - cout << "> ";
37   - getline(cin,send);
38   - if(cin.eof())
  45 + while(sendQueue.empty())
39 46 {
40   - send = "/exit";
  47 + msgLock->lock();
  48 + msgListNotEmpty.wait(*msgLock);
  49 + if(!chat->getConnected())
  50 + {
  51 + return;
  52 + }
  53 + msgLock->unlock();
41 54 }
  55 + msgLock->lock();
  56 + send = sendQueue.front().toStdString();
  57 + sendQueue.pop_front();
42 58 try
43 59 {
44   - *(t_arg->s) << send;
  60 + if(send[0] == '@')
  61 + {
  62 + send = '1' + send;
  63 + }
  64 + else
  65 + {
  66 + send = '0' + send;
  67 + }
  68 + *s << send;
  69 + msgLock->unlock();
  70 + send = send.substr(1);
45 71 if(send == "/disconnect" || send == "/exit")
46 72 {
47 73 break;
48 74 }
  75 + chat->putMsgToPrintQueue(chat->getNickname().toStdString().append(": ").append(send));
49 76 }
50 77 catch(SocketException& e)
51 78 {
52 79 cout << e.description() << endl;
53 80 }
54 81 }
55   - killThread(t_arg);
  82 + cout << "sendThread finished" << endl;
56 83 }
57 84  
58   -void *recvThread(void* args)
  85 +void recvThread(Socket* s, Chatroom* chat)
59 86 {
60 87 string recv;
61   - struct thread_args *t_arg = (struct thread_args*)args;
62 88 while(true)
63 89 {
64 90 try
65 91 {
66   - *(t_arg->s) >> recv;
  92 + *s >> recv;
  93 + if(recv[0] == '1')
  94 + {
  95 + recv = recv.substr(1);
  96 + chat->relayMsg(recv);
  97 + continue;
  98 + }
  99 + else if(recv[0] == '0')
  100 + {
  101 + recv = recv.substr(1);
  102 + }
67 103 }
68 104 catch(SocketException &e)
69 105 {
70   - connected = false;
  106 + chat->setConnected(false);
71 107 cout << e.description() << endl;
72   - cout << "Connection lost. Press Enter to retry connection to chatroom. Press CTRL+C to exit." << endl;
73   - pthread_cond_signal(t_arg->condition);
  108 + msgListNotEmpty.notify_all();
  109 + emit chat->threadsFinished(false);
74 110 break;
75 111 }
76 112 if(recv == "DISC_OK")
77 113 {
78 114 cout << "Disconnecting" << endl;
79   - connected = false;
80   - pthread_cond_signal(t_arg->condition);
  115 + chat->setConnected(false);
  116 + msgListNotEmpty.notify_all();
  117 + emit chat->threadsFinished(false);
81 118 break;
82 119 }
83 120 else if(recv == "EXIT_OK")
84 121 {
85 122 cout << "Exiting" << endl;
86   - connected = false;
87   - pthread_cond_signal(t_arg->condition);
  123 + chat->setConnected(false);
  124 + msgListNotEmpty.notify_all();
  125 + emit chat->threadsFinished(true);
88 126 break;
89 127 }
90 128 else
91 129 {
92   - cout << recv << endl;
  130 + chat->putMsgToPrintQueue(recv);
93 131 }
94 132 }
95   - killThread(t_arg);
  133 + cout << "recvThread finished" << endl;
96 134 }
97 135  
98   -void Chatroom::start()
  136 +bool Chatroom::getConnected()
99 137 {
100   - Socket s;
101   - connected = false;
102   - pthread_mutex_t mutex;
103   - pthread_mutex_init(&mutex,0);
104   - pthread_cond_t condition;
105   - pthread_cond_init(&condition,0);
106   - pthread_t recv, send;
107   - pthread_attr_t attr;
108   - pthread_attr_init(&attr);
109   - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
110   - pthread_mutex_lock(&mutex);
111   - thread_args *sArgs = new thread_args;
112   - thread_args *rArgs = new thread_args;
113   - sArgs->mutex = &mutex;
114   - sArgs->condition = &condition;
115   - sArgs->s = &s;
116   -
117   - rArgs->mutex = &mutex;
118   - rArgs->condition = &condition;
119   - rArgs->s = &s;
120   -
121   - pthread_create(&send,&attr,sendThread,(void *)sArgs);
122   - pthread_create(&recv,&attr,recvThread,(void *)rArgs);
123   -
124   - while(connected)
  138 + myMutex.lock();
  139 + bool val = connected;
  140 + myMutex.unlock();
  141 + return val;
  142 +}
  143 +
  144 +void Chatroom::setConnected(bool status)
  145 +{
  146 + myMutex.lock();
  147 + connected = status;
  148 + myMutex.unlock();
  149 +}
  150 +
  151 +void Chatroom::putMsgToPrintQueue(string &msg)
  152 +{
  153 + printQueue.push_back(msg);
  154 + emit messagesToPrint();
  155 +}
  156 +
  157 +string Chatroom::getSender(string& msg)
  158 +{
  159 + return msg.substr(5,msg.find(':')-5);
  160 +}
  161 +
  162 +void Chatroom::relayMsg(string& msg)
  163 +{
  164 + string sender = getSender(msg);
  165 + map<string,ChatWindow>::iterator it = activeChats.begin();
  166 + if(activeChats.find(sender) == activeChats.end())
125 167 {
126   - pthread_cond_wait(&condition,&mutex);
  168 + //LAUNCH new windowchat
127 169 }
128   - pthread_mutex_unlock(&mutex);
129   - pthread_join(recv,NULL);
130   - pthread_join(send,NULL);
131   - s.Close();
132   - pthread_cond_destroy(&condition);
133   - pthread_mutex_destroy(&mutex);
  170 + it = activeChats.find(sender);
  171 + it->second.printMsg(msg);
  172 +}
134 173  
135   - //LAUNCH LOGINSCREEN
  174 +void Chatroom::printMsg()
  175 +{
  176 + while(!printQueue.empty())
  177 + {
  178 + string msg = printQueue.front();
  179 + ui->chatText->printMsg(msg);
  180 + printQueue.pop_front();
  181 + }
  182 +}
  183 +
  184 +void Chatroom::putMsgToSendQueue(QString& msg)
  185 +{
  186 + msgMutex.lock();
  187 + sendQueue.push_back(msg);
  188 + msgMutex.unlock();
  189 + msgListNotEmpty.notify_all();
  190 +}
  191 +
  192 +void Chatroom::setNickname(QString nick)
  193 +{
  194 + nickname = nick;
  195 +}
  196 +
  197 +QString Chatroom::getNickname()
  198 +{
  199 + return nickname;
  200 +}
  201 +
  202 +void Chatroom::startSession()
  203 +{
  204 + LoginScreen login(&s,this);
  205 + login.exec();
  206 + int result = login.result();
  207 + if(result == QDialog::Accepted)
  208 + {
  209 + ui->inputText->setReadOnly(false);
  210 + }
  211 + else if(result == QDialog::Rejected)
  212 + {
  213 + return;
  214 + }
  215 + connected = true;
  216 + ui->chatText->printServerMsg("Connected to chatroom");
  217 + recv = new std::thread(recvThread,&s,this);
  218 + send = new std::thread(sendThread,&s,this);
  219 +}
  220 +
  221 +void Chatroom::sendMsg()
  222 +{
  223 + QString msg = ui->inputText->toPlainText();
  224 + ui->inputText->clear();
  225 + putMsgToSendQueue(msg);
  226 +}
  227 +
  228 +void Chatroom::finish()
  229 +{
  230 + if(recv == NULL && send == NULL)
  231 + {
  232 + ui->inputText->setReadOnly(true);
  233 + ui->chatText->printServerMsg("Disconnected");
  234 + this->close();
  235 + }
  236 + msgMutex.lock();
  237 + sendQueue.clear();
  238 + sendQueue.push_back("/exit");
  239 + msgMutex.unlock();
  240 + msgListNotEmpty.notify_all();
  241 +}
  242 +
  243 +void Chatroom::disconnectChatroom()
  244 +{
  245 + msgMutex.lock();
  246 + sendQueue.clear();
  247 + sendQueue.push_back("/disconnect");
  248 + msgMutex.unlock();
  249 + msgListNotEmpty.notify_all();
  250 +}
  251 +
  252 +void Chatroom::finishThreads(bool exit)
  253 +{
  254 + myMutex.lock();
  255 + ui->inputText->setReadOnly(true);
  256 + recv->join();
  257 + send->join();
  258 + myMutex.unlock();
  259 + ui->chatText->printServerMsg("Disconnected");
  260 + send = NULL;
  261 + recv = NULL;
  262 + if(exit)
  263 + {
  264 + this->close();
  265 + }
136 266 }
137 267  
138 268 Chatroom::~Chatroom()
139 269 {
  270 + delete msgLock;
  271 + delete recv;
  272 + delete send;
140 273 delete ui;
141 274 }
  275 +
  276 +
... ...
QChatClient/chatroom.h
... ... @@ -3,13 +3,12 @@
3 3  
4 4 #include <QMainWindow>
5 5 #include "Socket.h"
6   -
7   -struct thread_args
8   -{
9   - pthread_mutex_t *mutex;
10   - pthread_cond_t *condition;
11   - Socket *s;
12   -};
  6 +#include "loginscreen.h"
  7 +#include <thread>
  8 +#include <mutex>
  9 +#include <condition_variable>
  10 +#include "chatwindow.h"
  11 +#include <map>
13 12  
14 13 namespace Ui {
15 14 class Chatroom;
... ... @@ -21,16 +20,42 @@ class Chatroom : public QMainWindow
21 20  
22 21 public:
23 22 explicit Chatroom(QWidget *parent = 0);
  23 + bool getConnected();
  24 + void setConnected(bool status);
  25 + void relayMsg(string& msg);
  26 + void setNickname(QString nick);
  27 + QString getNickname();
  28 + void putMsgToPrintQueue(string& msg);
24 29 ~Chatroom();
  30 +
  31 +public slots:
  32 + void startSession();
  33 + void sendMsg();
  34 + void printMsg();
  35 +
  36 +private slots:
  37 + void finishThreads(bool exit);
  38 + void finish();
  39 + void disconnectChatroom();
  40 +
  41 +signals:
  42 + void threadsFinished(bool exit);
  43 + void messagesToPrint();
25 44  
26 45 private:
27 46 Ui::Chatroom *ui;
28   - void start();
  47 + map<string,ChatWindow> activeChats;
29 48 bool connected;
  49 + string getSender(string& msg);
  50 + void putMsgToSendQueue(QString& msg);
  51 + std::thread *send;
  52 + std::thread *recv;
  53 + Socket s;
  54 + QString nickname;
  55 + list<string> printQueue;
30 56 };
31 57  
32   -void *sendThread(void* args);
33   -void *recvThread(void* args);
34   -void killThread(thread_args *t_arg);
  58 +void sendThread(Socket* s, Chatroom *chat);
  59 +void recvThread(Socket *s, Chatroom *chat);
35 60  
36 61 #endif // CHATROOM_H
... ...
QChatClient/chatroom.ui
... ... @@ -11,7 +11,7 @@
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14   - <string>MainWindow</string>
  14 + <string>QChatClient</string>
15 15 </property>
16 16 <widget class="QWidget" name="centralwidget">
17 17 <layout class="QGridLayout" name="gridLayout_2">
... ... @@ -44,10 +44,10 @@
44 44 </property>
45 45 <widget class="ChatWidget" name="chatText">
46 46 <property name="readOnly">
47   - <bool>true</bool>
  47 + <bool>false</bool>
48 48 </property>
49 49 </widget>
50   - <widget class="QTextEdit" name="inputText">
  50 + <widget class="chatInputText" name="inputText">
51 51 <property name="sizePolicy">
52 52 <sizepolicy hsizetype="Expanding" vsizetype="Ignored">
53 53 <horstretch>0</horstretch>
... ... @@ -60,6 +60,9 @@
60 60 <height>16777215</height>
61 61 </size>
62 62 </property>
  63 + <property name="readOnly">
  64 + <bool>true</bool>
  65 + </property>
63 66 </widget>
64 67 </widget>
65 68 </item>
... ... @@ -87,8 +90,55 @@
87 90 </widget>
88 91 </widget>
89 92 </item>
  93 + <item row="1" column="0">
  94 + <widget class="QPushButton" name="sendButton">
  95 + <property name="sizePolicy">
  96 + <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
  97 + <horstretch>0</horstretch>
  98 + <verstretch>0</verstretch>
  99 + </sizepolicy>
  100 + </property>
  101 + <property name="text">
  102 + <string>Send</string>
  103 + </property>
  104 + </widget>
  105 + </item>
90 106 </layout>
91 107 </widget>
  108 + <widget class="QMenuBar" name="menuBar">
  109 + <property name="geometry">
  110 + <rect>
  111 + <x>0</x>
  112 + <y>0</y>
  113 + <width>800</width>
  114 + <height>26</height>
  115 + </rect>
  116 + </property>
  117 + <widget class="QMenu" name="menuChat">
  118 + <property name="title">
  119 + <string>Chat</string>
  120 + </property>
  121 + <addaction name="actionConnect"/>
  122 + <addaction name="actionDisconnect"/>
  123 + <addaction name="actionExit"/>
  124 + </widget>
  125 + <addaction name="menuChat"/>
  126 + </widget>
  127 + <action name="actionConnect">
  128 + <property name="text">
  129 + <string>Connect...</string>
  130 + </property>
  131 + </action>
  132 + <action name="actionExit">
  133 + <property name="text">
  134 + <string>Exit</string>
  135 + </property>
  136 + </action>
  137 + <action name="actionDisconnect">
  138 + <property name="text">
  139 + <string>Disconnect</string>
  140 + </property>
  141 + </action>
92 142 </widget>
93 143 <customwidgets>
94 144 <customwidget>
... ... @@ -96,6 +146,11 @@
96 146 <extends>QTextEdit</extends>
97 147 <header>chatwidget.h</header>
98 148 </customwidget>
  149 + <customwidget>
  150 + <class>chatInputText</class>
  151 + <extends>QTextEdit</extends>
  152 + <header>chatinputtext.h</header>
  153 + </customwidget>
99 154 </customwidgets>
100 155 <resources/>
101 156 <connections/>
... ...
QChatClient/chatwidget.cpp
... ... @@ -6,18 +6,17 @@ ChatWidget::ChatWidget(QWidget *parent) :
6 6  
7 7 }
8 8  
9   -void ChatWidget::printServerMsg(QString &str)
  9 +void ChatWidget::printServerMsg(const string &str)
10 10 {
11   - this->append("<p style=\"font-style:italic;color:gray;\">" + str + "</p>");
  11 + this->append("<p style=\"font-style:italic;color:gray;line-height:25%;\">" + QString::fromStdString(str) + "</p>");
12 12 }
13 13  
14   -void ChatWidget::printMsg(QString &str)
  14 +void ChatWidget::printMsg(const string &str)
15 15 {
16   - this->append(str);
  16 + this->append(QString::fromStdString(str));
17 17 }
18 18  
19   -void ChatWidget::printStatusMsg(QString &str)
  19 +void ChatWidget::printStatusMsg(const string &str)
20 20 {
21   - this->append("<p style=\"font-weight:bold;\">" + str + "</p>");
  21 + this->append("<p style=\"font-weight:bold;line-height:25%;\">" + QString::fromStdString(str) + "</p>");
22 22 }
23   -
... ...
QChatClient/chatwidget.h
... ... @@ -3,14 +3,16 @@
3 3  
4 4 #include <QTextEdit>
5 5  
  6 +using namespace std;
  7 +
6 8 class ChatWidget : public QTextEdit
7 9 {
8 10 Q_OBJECT
9 11 public:
10 12 explicit ChatWidget(QWidget *parent = 0);
11   - void printServerMsg(QString &str);
12   - void printMsg(QString& str);
13   - void printStatusMsg(QString& str);
  13 + void printServerMsg(const string &str);
  14 + void printMsg(const string& str);
  15 + void printStatusMsg(const string& str);
14 16  
15 17 signals:
16 18  
... ...
QChatClient/chatwindow.cpp
... ... @@ -3,7 +3,7 @@
3 3  
4 4 using namespace std;
5 5  
6   -ChatWindow::ChatWindow(QWidget *parent) :
  6 +ChatWindow::ChatWindow(QString& nickname, QWidget *parent) :
7 7 QMainWindow(parent),
8 8 ui(new Ui::ChatWindow)
9 9 {
... ... @@ -12,6 +12,13 @@ ChatWindow::ChatWindow(QWidget *parent) :
12 12 sizes.push_front(ui->chatText->height());
13 13 sizes.push_front(100);
14 14 ui->splitter->setSizes(sizes);
  15 + this->setWindowTitle("Chat with " + nickname);
  16 + connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(close()));
  17 +}
  18 +
  19 +void ChatWindow::printMsg(string& str)
  20 +{
  21 + ui->chatText->printMsg(str);
15 22 }
16 23  
17 24 ChatWindow::~ChatWindow()
... ...
QChatClient/chatwindow.h
... ... @@ -2,6 +2,9 @@
2 2 #define CHATWINDOW_H
3 3  
4 4 #include <QMainWindow>
  5 +#include <string>
  6 +
  7 +using namespace std;
5 8  
6 9 namespace Ui {
7 10 class ChatWindow;
... ... @@ -12,7 +15,8 @@ class ChatWindow : public QMainWindow
12 15 Q_OBJECT
13 16  
14 17 public:
15   - explicit ChatWindow(QWidget *parent = 0);
  18 + explicit ChatWindow(QString& nickname,QWidget *parent = 0);
  19 + void printMsg(string& str);
16 20 ~ChatWindow();
17 21  
18 22 private:
... ...
QChatClient/chatwindow.ui
... ... @@ -11,7 +11,7 @@
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
14   - <string>ChatWindow</string>
  14 + <string>QChatClient</string>
15 15 </property>
16 16 <widget class="QWidget" name="centralWidget">
17 17 <property name="enabled">
... ... @@ -24,45 +24,80 @@
24 24 </sizepolicy>
25 25 </property>
26 26 <layout class="QGridLayout" name="gridLayout">
27   - <item row="0" column="0">
28   - <widget class="QSplitter" name="splitter">
  27 + <item row="3" column="1">
  28 + <spacer name="horizontalSpacer">
29 29 <property name="orientation">
30   - <enum>Qt::Vertical</enum>
  30 + <enum>Qt::Horizontal</enum>
31 31 </property>
32   - <widget class="ChatWidget" name="chatText">
33   - <property name="readOnly">
34   - <bool>true</bool>
35   - </property>
36   - </widget>
37   - <widget class="QTextEdit" name="inputText">
38   - <property name="enabled">
39   - <bool>true</bool>
40   - </property>
41   - <property name="sizePolicy">
42   - <sizepolicy hsizetype="Expanding" vsizetype="Ignored">
43   - <horstretch>0</horstretch>
44   - <verstretch>0</verstretch>
45   - </sizepolicy>
46   - </property>
47   - <property name="minimumSize">
48   - <size>
49   - <width>0</width>
50   - <height>0</height>
51   - </size>
52   - </property>
53   - <property name="maximumSize">
54   - <size>
55   - <width>16777215</width>
56   - <height>16777215</height>
57   - </size>
58   - </property>
59   - <property name="baseSize">
60   - <size>
61   - <width>0</width>
62   - <height>0</height>
63   - </size>
64   - </property>
65   - </widget>
  32 + <property name="sizeHint" stdset="0">
  33 + <size>
  34 + <width>40</width>
  35 + <height>20</height>
  36 + </size>
  37 + </property>
  38 + </spacer>
  39 + </item>
  40 + <item row="3" column="0">
  41 + <widget class="QPushButton" name="sendButton">
  42 + <property name="sizePolicy">
  43 + <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
  44 + <horstretch>0</horstretch>
  45 + <verstretch>0</verstretch>
  46 + </sizepolicy>
  47 + </property>
  48 + <property name="text">
  49 + <string>Send</string>
  50 + </property>
  51 + </widget>
  52 + </item>
  53 + <item row="0" column="0" colspan="2">
  54 + <widget class="QWidget" name="widget" native="true">
  55 + <layout class="QGridLayout" name="gridLayout_2">
  56 + <item row="0" column="0">
  57 + <widget class="QSplitter" name="splitter">
  58 + <property name="orientation">
  59 + <enum>Qt::Vertical</enum>
  60 + </property>
  61 + <widget class="ChatWidget" name="chatText">
  62 + <property name="readOnly">
  63 + <bool>true</bool>
  64 + </property>
  65 + </widget>
  66 + <widget class="chatInputText" name="inputText">
  67 + <property name="enabled">
  68 + <bool>true</bool>
  69 + </property>
  70 + <property name="sizePolicy">
  71 + <sizepolicy hsizetype="Expanding" vsizetype="Ignored">
  72 + <horstretch>0</horstretch>
  73 + <verstretch>0</verstretch>
  74 + </sizepolicy>
  75 + </property>
  76 + <property name="minimumSize">
  77 + <size>
  78 + <width>0</width>
  79 + <height>0</height>
  80 + </size>
  81 + </property>
  82 + <property name="maximumSize">
  83 + <size>
  84 + <width>16777215</width>
  85 + <height>16777215</height>
  86 + </size>
  87 + </property>
  88 + <property name="baseSize">
  89 + <size>
  90 + <width>0</width>
  91 + <height>0</height>
  92 + </size>
  93 + </property>
  94 + <property name="readOnly">
  95 + <bool>true</bool>
  96 + </property>
  97 + </widget>
  98 + </widget>
  99 + </item>
  100 + </layout>
66 101 </widget>
67 102 </item>
68 103 </layout>
... ... @@ -73,10 +108,22 @@
73 108 <x>0</x>
74 109 <y>0</y>
75 110 <width>400</width>
76   - <height>25</height>
  111 + <height>26</height>
77 112 </rect>
78 113 </property>
  114 + <widget class="QMenu" name="menuChat">
  115 + <property name="title">
  116 + <string>Chat</string>
  117 + </property>
  118 + <addaction name="actionExit"/>
  119 + </widget>
  120 + <addaction name="menuChat"/>
79 121 </widget>
  122 + <action name="actionExit">
  123 + <property name="text">
  124 + <string>Exit</string>
  125 + </property>
  126 + </action>
80 127 </widget>
81 128 <layoutdefault spacing="6" margin="11"/>
82 129 <customwidgets>
... ... @@ -85,6 +132,11 @@
85 132 <extends>QTextEdit</extends>
86 133 <header>chatwidget.h</header>
87 134 </customwidget>
  135 + <customwidget>
  136 + <class>chatInputText</class>
  137 + <extends>QTextEdit</extends>
  138 + <header>chatinputtext.h</header>
  139 + </customwidget>
88 140 </customwidgets>
89 141 <resources/>
90 142 <connections/>
... ...
QChatClient/loginscreen.cpp
1 1 #include "loginscreen.h"
2 2 #include "ui_loginscreen.h"
3 3  
4   -LoginScreen::LoginScreen(QWidget *parent) :
  4 +LoginScreen::LoginScreen(Socket* s, QWidget *parent) :
5 5 QDialog(parent),
6 6 ui(new Ui::LoginScreen)
7 7 {
8 8 ui->setupUi(this);
9 9 ui->nickEdit->setPlaceholderText("Nickname");
10 10 ui->serverURLEdit->setPlaceholderText("Server hostname:port");
  11 + ui->label->setStyleSheet("QLabel { color : red}");
  12 + ui->label->setVisible(false);
  13 + this->s = s;
  14 + connect(ui->connectButton,SIGNAL(clicked()),this,SLOT(connectToChat()));
  15 + connect(ui->cancelButton,SIGNAL(clicked()),this,SLOT(cancelLogin()));
11 16 }
12 17  
13   -void LoginScreen::parseURL(QString host, int port, QString URL)
  18 +bool LoginScreen::parseURL(QString& URL)
14 19 {
15 20 if(validateURL(URL))
16 21 {
  22 + ui->label->setVisible(false);
17 23 QStringList strings = URL.split(':');
18   - host = strings[0].toStdString();
  24 + host = strings[0];
19 25 port = strings[1].toInt();
  26 + return true;
  27 + }
  28 + else
  29 + {
  30 + ui->label->setVisible(true);
  31 + return false;
20 32 }
21 33 }
22 34  
23   -bool LoginScreen::validateURL(QString& url)
  35 +bool LoginScreen::validateURL(QString& URL)
24 36 {
25   -
  37 + QRegExp regex("([a-zA-Z.]+|((\\d{1,3}\\.){3}\\d{1,3})):\\d+");
  38 + return regex.exactMatch(URL);
26 39 }
27 40  
28   -bool LoginScreen::connect(Socket& s)
  41 +void LoginScreen::connectToChat()
29 42 {
30   - QString host, nick;
  43 + QString nick;
31 44 string response;
32   - int port;
33   - parseURL(host,port,ui->serverURLEdit->text());
34   - nick = ui->nickEdit->text();
35   - try
  45 + QString URL = ui->serverURLEdit->text();
  46 + if(parseURL(URL))
36 47 {
37   - s.Create();
38   - s.Connect(host.toStdString(),port);
39   - s << nick.toStdString();
40   - s >> response;
41   - if(response == "CHATNICKINVALID")
42   - {
43   - cout << "Spaces not allowed in nicknames, please enter another nickname: ";
44   - }
45   - else if(response == "CHATNICKEXIST")
46   - {
47   - cout << "Nickname in use, please enter another nickname: ";
48   - }
49   - else if(response == "CHATFULL")
  48 + nick = ui->nickEdit->text();
  49 + try
50 50 {
51   - cout << "Chatroom is full, please wait..." << endl;
  51 + s->Create();
  52 + s->Connect(host.toStdString(),port);
  53 + (*s) << nick.toStdString();
  54 + (*s) >> response;
  55 + if(response == "CHATNICKINVALID")
  56 + {
  57 + ui->label->setText("Spaces not allowed in nicknames, please enter another nickname");
  58 + }
  59 + else if(response == "CHATNICKEXIST")
  60 + {
  61 + ui->label->setText("Nickname in use, please enter another nickname");
  62 + }
  63 + else if(response == "CHATFULL")
  64 + {
  65 + ui->label->setText("Chatroom is full, please wait...");
  66 + }
  67 + else if(response != "CHATOK")
  68 + {
  69 + ui->label->setText("Error: " + QString::fromStdString(response));
  70 + }
  71 + else
  72 + {
  73 + ((Chatroom*)this->parent())->setNickname(nick);
  74 + this->accept();
  75 + return;
  76 + }
  77 + ui->label->setVisible(true);
52 78 }
53   - else if(response != "CHATOK")
  79 + catch(SocketException& e)
54 80 {
55   - cout << "Error: " << response << endl;
  81 + cout << e.description() << endl;
  82 + QString exception = QString::fromStdString(e.description());
  83 + ui->label->setText(exception);
  84 + ui->label->setVisible(true);
56 85 }
57   - else
58   - {
59   - return true;
60   - }
61   - s.Close();
62   - return false;
63   - }
64   - catch(SocketException& e)
65   - {
66   - cout << e.description() << endl;
67   - exit(-1);
68 86 }
69 87 }
70 88  
  89 +void LoginScreen::cancelLogin()
  90 +{
  91 + this->reject();
  92 +}
  93 +
71 94 LoginScreen::~LoginScreen()
72 95 {
73 96 delete ui;
... ...
QChatClient/loginscreen.h
... ... @@ -2,7 +2,9 @@
2 2 #define LOGINSCREEN_H
3 3  
4 4 #include <QDialog>
  5 +#include <QRegExp>
5 6 #include "Socket.h"
  7 +#include "chatroom.h"
6 8  
7 9 namespace Ui {
8 10 class LoginScreen;
... ... @@ -13,14 +15,20 @@ class LoginScreen : public QDialog
13 15 Q_OBJECT
14 16  
15 17 public:
16   - explicit LoginScreen(QWidget *parent = 0);
17   - bool connect(Socket& s);
  18 + explicit LoginScreen(Socket *s, QWidget *parent = 0);
18 19 bool validateURL(QString& url);
19   - void parseURL(QString host, int port, QString URL);
  20 + bool parseURL(QString& URL);
20 21 ~LoginScreen();
  22 +
  23 +public slots:
  24 + void connectToChat();
  25 + void cancelLogin();
21 26  
22 27 private:
23 28 Ui::LoginScreen *ui;
  29 + int port;
  30 + QString host;
  31 + Socket* s;
24 32 };
25 33  
26 34 #endif // LOGINSCREEN_H
... ...
QChatClient/loginscreen.ui
... ... @@ -7,7 +7,7 @@
7 7 <x>0</x>
8 8 <y>0</y>
9 9 <width>402</width>
10   - <height>173</height>
  10 + <height>206</height>
11 11 </rect>
12 12 </property>
13 13 <property name="sizePolicy">
... ... @@ -20,6 +20,25 @@
20 20 <string>Login</string>
21 21 </property>
22 22 <layout class="QGridLayout" name="gridLayout">
  23 + <item row="4" column="1">
  24 + <widget class="QLineEdit" name="serverURLEdit"/>
  25 + </item>
  26 + <item row="0" column="1">
  27 + <spacer name="topSpacer">
  28 + <property name="orientation">
  29 + <enum>Qt::Vertical</enum>
  30 + </property>
  31 + <property name="sizeType">
  32 + <enum>QSizePolicy::Fixed</enum>
  33 + </property>
  34 + <property name="sizeHint" stdset="0">
  35 + <size>
  36 + <width>20</width>
  37 + <height>5</height>
  38 + </size>
  39 + </property>
  40 + </spacer>
  41 + </item>
23 42 <item row="1" column="1">
24 43 <widget class="QLabel" name="titleLabel">
25 44 <property name="sizePolicy">
... ... @@ -39,45 +58,6 @@
39 58 </property>
40 59 </widget>
41 60 </item>
42   - <item row="7" column="1">
43   - <widget class="QWidget" name="buttonBox" native="true">
44   - <property name="sizePolicy">
45   - <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
46   - <horstretch>0</horstretch>
47   - <verstretch>0</verstretch>
48   - </sizepolicy>
49   - </property>
50   - <layout class="QGridLayout" name="gridLayout_2">
51   - <item row="0" column="2">
52   - <widget class="QPushButton" name="cancelButton">
53   - <property name="text">
54   - <string>Cancel</string>
55   - </property>
56   - </widget>
57   - </item>
58   - <item row="0" column="1">
59   - <widget class="QPushButton" name="connectButton">
60   - <property name="text">
61   - <string>OK</string>
62   - </property>
63   - </widget>
64   - </item>
65   - <item row="0" column="0">
66   - <spacer name="buttonHorizSpacer">
67   - <property name="orientation">
68   - <enum>Qt::Horizontal</enum>
69   - </property>
70   - <property name="sizeHint" stdset="0">
71   - <size>
72   - <width>40</width>
73   - <height>20</height>
74   - </size>
75   - </property>
76   - </spacer>
77   - </item>
78   - </layout>
79   - </widget>
80   - </item>
81 61 <item row="2" column="1">
82 62 <spacer name="verticalSpacer">
83 63 <property name="orientation">
... ... @@ -94,18 +74,18 @@
94 74 </property>
95 75 </spacer>
96 76 </item>
97   - <item row="0" column="1">
98   - <spacer name="topSpacer">
  77 + <item row="4" column="2">
  78 + <spacer name="rightSpacer">
99 79 <property name="orientation">
100   - <enum>Qt::Vertical</enum>
  80 + <enum>Qt::Horizontal</enum>
101 81 </property>
102 82 <property name="sizeType">
103   - <enum>QSizePolicy::Fixed</enum>
  83 + <enum>QSizePolicy::Minimum</enum>
104 84 </property>
105 85 <property name="sizeHint" stdset="0">
106 86 <size>
107   - <width>20</width>
108   - <height>5</height>
  87 + <width>10</width>
  88 + <height>20</height>
109 89 </size>
110 90 </property>
111 91 </spacer>
... ... @@ -129,27 +109,63 @@
129 109 <item row="3" column="1">
130 110 <widget class="QLineEdit" name="nickEdit"/>
131 111 </item>
132   - <item row="4" column="1">
133   - <widget class="QLineEdit" name="serverURLEdit"/>
134   - </item>
135   - <item row="4" column="2">
136   - <spacer name="rightSpacer">
137   - <property name="orientation">
138   - <enum>Qt::Horizontal</enum>
139   - </property>
140   - <property name="sizeType">
141   - <enum>QSizePolicy::Minimum</enum>
142   - </property>
143   - <property name="sizeHint" stdset="0">
144   - <size>
145   - <width>10</width>
146   - <height>20</height>
147   - </size>
  112 + <item row="7" column="1">
  113 + <widget class="QWidget" name="buttonBox" native="true">
  114 + <property name="sizePolicy">
  115 + <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
  116 + <horstretch>0</horstretch>
  117 + <verstretch>0</verstretch>
  118 + </sizepolicy>
148 119 </property>
149   - </spacer>
  120 + <layout class="QGridLayout" name="gridLayout_2">
  121 + <item row="1" column="1">
  122 + <widget class="QPushButton" name="connectButton">
  123 + <property name="text">
  124 + <string>OK</string>
  125 + </property>
  126 + </widget>
  127 + </item>
  128 + <item row="1" column="2">
  129 + <widget class="QPushButton" name="cancelButton">
  130 + <property name="text">
  131 + <string>Cancel</string>
  132 + </property>
  133 + </widget>
  134 + </item>
  135 + <item row="1" column="0">
  136 + <spacer name="buttonHorizSpacer">
  137 + <property name="orientation">
  138 + <enum>Qt::Horizontal</enum>
  139 + </property>
  140 + <property name="sizeHint" stdset="0">
  141 + <size>
  142 + <width>40</width>
  143 + <height>20</height>
  144 + </size>
  145 + </property>
  146 + </spacer>
  147 + </item>
  148 + <item row="0" column="0">
  149 + <widget class="QLabel" name="label">
  150 + <property name="enabled">
  151 + <bool>true</bool>
  152 + </property>
  153 + <property name="text">
  154 + <string>INVALID HOSTNAME</string>
  155 + </property>
  156 + </widget>
  157 + </item>
  158 + </layout>
  159 + </widget>
150 160 </item>
151 161 </layout>
152 162 </widget>
  163 + <tabstops>
  164 + <tabstop>nickEdit</tabstop>
  165 + <tabstop>serverURLEdit</tabstop>
  166 + <tabstop>connectButton</tabstop>
  167 + <tabstop>cancelButton</tabstop>
  168 + </tabstops>
153 169 <resources/>
154 170 <connections/>
155 171 </ui>
... ...
QChatClient/main.cpp
1 1 #include "loginscreen.h"
2 2 #include "chatroom.h"
3   -#include "chatwindow.h"
4 3 #include <QApplication>
5 4  
6 5 int main(int argc, char *argv[])
... ... @@ -8,6 +7,6 @@ int main(int argc, char *argv[])
8 7 QApplication a(argc, argv);
9 8 Chatroom c;
10 9 c.show();
11   -
  10 + c.startSession();
12 11 return a.exec();
13 12 }
... ...
build-QChatClient-Desktop-Debug/Makefile
1 1 #############################################################################
2 2 # Makefile for building: QChatClient
3   -# Generated by qmake (3.0) (Qt 5.0.2) on: mié dic 18 21:28:34 2013
  3 +# Generated by qmake (3.0) (Qt 5.0.2) on: mié dic 25 23:14:46 2013
4 4 # Project: ../QChatClient/QChatClient.pro
5 5 # Template: app
6 6 # Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -spec linux-g++-64 CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug -o Makefile ../QChatClient/QChatClient.pro
... ... @@ -14,7 +14,7 @@ CC = gcc
14 14 CXX = g++
15 15 DEFINES = -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
16 16 CFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT -fPIE $(DEFINES)
17   -CXXFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT -fPIE $(DEFINES)
  17 +CXXFLAGS = -m64 -pipe -std=c++11 -g -Wall -W -D_REENTRANT -fPIE $(DEFINES)
18 18 INCPATH = -I/usr/share/qt5/mkspecs/linux-g++-64 -I../QChatClient -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -I.
19 19 LINK = g++
20 20 LFLAGS = -m64
... ... @@ -46,26 +46,28 @@ OBJECTS_DIR = ./
46 46 ####### Files
47 47  
48 48 SOURCES = ../QChatClient/main.cpp \
49   - ../QChatClient/chatwindow.cpp \
50 49 ../QChatClient/loginscreen.cpp \
51 50 ../QChatClient/chatroom.cpp \
52 51 ../QChatClient/Socket.cpp \
53   - ../QChatClient/client.cpp \
54   - ../QChatClient/chatwidget.cpp moc_chatwindow.cpp \
55   - moc_loginscreen.cpp \
  52 + ../QChatClient/chatwidget.cpp \
  53 + ../QChatClient/chatwindow.cpp \
  54 + ../QChatClient/chatinputtext.cpp moc_loginscreen.cpp \
56 55 moc_chatroom.cpp \
57   - moc_chatwidget.cpp
  56 + moc_chatwidget.cpp \
  57 + moc_chatwindow.cpp \
  58 + moc_chatinputtext.cpp
58 59 OBJECTS = main.o \
59   - chatwindow.o \
60 60 loginscreen.o \
61 61 chatroom.o \
62 62 Socket.o \
63   - client.o \
64 63 chatwidget.o \
65   - moc_chatwindow.o \
  64 + chatwindow.o \
  65 + chatinputtext.o \
66 66 moc_loginscreen.o \
67 67 moc_chatroom.o \
68   - moc_chatwidget.o
  68 + moc_chatwidget.o \
  69 + moc_chatwindow.o \
  70 + moc_chatinputtext.o
69 71 DIST = /usr/share/qt5/mkspecs/features/spec_pre.prf \
70 72 /usr/share/qt5/mkspecs/common/shell-unix.conf \
71 73 /usr/share/qt5/mkspecs/common/unix.conf \
... ... @@ -84,8 +86,14 @@ DIST = /usr/share/qt5/mkspecs/features/spec_pre.prf \
84 86 /usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri \
85 87 /usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri \
86 88 /usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri \
  89 + /usr/share/qt5/mkspecs/modules/qt_lib_qml.pri \
  90 + /usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri \
  91 + /usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri \
  92 + /usr/share/qt5/mkspecs/modules/qt_lib_quick.pri \
  93 + /usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri \
87 94 /usr/share/qt5/mkspecs/modules/qt_lib_sql.pri \
88 95 /usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri \
  96 + /usr/share/qt5/mkspecs/modules/qt_lib_v8.pri \
89 97 /usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri \
90 98 /usr/share/qt5/mkspecs/modules/qt_lib_xml.pri \
91 99 /usr/share/qt5/mkspecs/features/qt_functions.prf \
... ... @@ -165,8 +173,14 @@ Makefile: ../QChatClient/QChatClient.pro /usr/share/qt5/mkspecs/linux-g++-64/qma
165 173 /usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri \
166 174 /usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri \
167 175 /usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri \
  176 + /usr/share/qt5/mkspecs/modules/qt_lib_qml.pri \
  177 + /usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri \
  178 + /usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri \
  179 + /usr/share/qt5/mkspecs/modules/qt_lib_quick.pri \
  180 + /usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri \
168 181 /usr/share/qt5/mkspecs/modules/qt_lib_sql.pri \
169 182 /usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri \
  183 + /usr/share/qt5/mkspecs/modules/qt_lib_v8.pri \
170 184 /usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri \
171 185 /usr/share/qt5/mkspecs/modules/qt_lib_xml.pri \
172 186 /usr/share/qt5/mkspecs/features/qt_functions.prf \
... ... @@ -216,8 +230,14 @@ Makefile: ../QChatClient/QChatClient.pro /usr/share/qt5/mkspecs/linux-g++-64/qma
216 230 /usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri:
217 231 /usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri:
218 232 /usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri:
  233 +/usr/share/qt5/mkspecs/modules/qt_lib_qml.pri:
  234 +/usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri:
  235 +/usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri:
  236 +/usr/share/qt5/mkspecs/modules/qt_lib_quick.pri:
  237 +/usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri:
219 238 /usr/share/qt5/mkspecs/modules/qt_lib_sql.pri:
220 239 /usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri:
  240 +/usr/share/qt5/mkspecs/modules/qt_lib_v8.pri:
221 241 /usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri:
222 242 /usr/share/qt5/mkspecs/modules/qt_lib_xml.pri:
223 243 /usr/share/qt5/mkspecs/features/qt_functions.prf:
... ... @@ -255,7 +275,7 @@ qmake_all: FORCE
255 275  
256 276 dist:
257 277 @test -d .tmp/QChatClient1.0.0 || mkdir -p .tmp/QChatClient1.0.0
258   - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/QChatClient1.0.0/ && $(COPY_FILE) --parents ../QChatClient/chatwindow.h ../QChatClient/loginscreen.h ../QChatClient/chatroom.h ../QChatClient/SocketException.h ../QChatClient/Socket.h ../QChatClient/client.h ../QChatClient/chatwidget.h .tmp/QChatClient1.0.0/ && $(COPY_FILE) --parents ../QChatClient/main.cpp ../QChatClient/chatwindow.cpp ../QChatClient/loginscreen.cpp ../QChatClient/chatroom.cpp ../QChatClient/Socket.cpp ../QChatClient/client.cpp ../QChatClient/chatwidget.cpp .tmp/QChatClient1.0.0/ && $(COPY_FILE) --parents ../QChatClient/chatwindow.ui ../QChatClient/loginscreen.ui ../QChatClient/chatroom.ui .tmp/QChatClient1.0.0/ && (cd `dirname .tmp/QChatClient1.0.0` && $(TAR) QChatClient1.0.0.tar QChatClient1.0.0 && $(COMPRESS) QChatClient1.0.0.tar) && $(MOVE) `dirname .tmp/QChatClient1.0.0`/QChatClient1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/QChatClient1.0.0
  278 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/QChatClient1.0.0/ && $(COPY_FILE) --parents ../QChatClient/loginscreen.h ../QChatClient/chatroom.h ../QChatClient/SocketException.h ../QChatClient/Socket.h ../QChatClient/chatwidget.h ../QChatClient/chatwindow.h ../QChatClient/chatinputtext.h .tmp/QChatClient1.0.0/ && $(COPY_FILE) --parents ../QChatClient/main.cpp ../QChatClient/loginscreen.cpp ../QChatClient/chatroom.cpp ../QChatClient/Socket.cpp ../QChatClient/chatwidget.cpp ../QChatClient/chatwindow.cpp ../QChatClient/chatinputtext.cpp .tmp/QChatClient1.0.0/ && $(COPY_FILE) --parents ../QChatClient/chatwindow.ui ../QChatClient/loginscreen.ui ../QChatClient/chatroom.ui .tmp/QChatClient1.0.0/ && (cd `dirname .tmp/QChatClient1.0.0` && $(TAR) QChatClient1.0.0.tar QChatClient1.0.0 && $(COMPRESS) QChatClient1.0.0.tar) && $(MOVE) `dirname .tmp/QChatClient1.0.0`/QChatClient1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/QChatClient1.0.0
259 279  
260 280  
261 281 clean:compiler_clean
... ... @@ -282,11 +302,11 @@ compiler_wayland-server-header_make_all:
282 302 compiler_wayland-server-header_clean:
283 303 compiler_wayland-client-header_make_all:
284 304 compiler_wayland-client-header_clean:
285   -compiler_moc_header_make_all: moc_chatwindow.cpp moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp
  305 +compiler_moc_header_make_all: moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp moc_chatwindow.cpp moc_chatinputtext.cpp
286 306 compiler_moc_header_clean:
287   - -$(DEL_FILE) moc_chatwindow.cpp moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp
288   -moc_chatwindow.cpp: /usr/include/qt5/QtWidgets/QMainWindow \
289   - /usr/include/qt5/QtWidgets/qmainwindow.h \
  307 + -$(DEL_FILE) moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp moc_chatwindow.cpp moc_chatinputtext.cpp
  308 +moc_loginscreen.cpp: /usr/include/qt5/QtWidgets/QDialog \
  309 + /usr/include/qt5/QtWidgets/qdialog.h \
290 310 /usr/include/qt5/QtWidgets/qwidget.h \
291 311 /usr/include/qt5/QtGui/qwindowdefs.h \
292 312 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -393,13 +413,21 @@ moc_chatwindow.cpp: /usr/include/qt5/QtWidgets/QMainWindow \
393 413 /usr/include/qt5/QtCore/qfiledevice.h \
394 414 /usr/include/qt5/QtGui/qvector2d.h \
395 415 /usr/include/qt5/QtGui/qtouchdevice.h \
  416 + /usr/include/qt5/QtCore/QRegExp \
  417 + ../QChatClient/Socket.h \
  418 + ../QChatClient/SocketException.h \
  419 + ../QChatClient/chatroom.h \
  420 + /usr/include/qt5/QtWidgets/QMainWindow \
  421 + /usr/include/qt5/QtWidgets/qmainwindow.h \
396 422 /usr/include/qt5/QtWidgets/qtabwidget.h \
397 423 /usr/include/qt5/QtGui/qicon.h \
398   - ../QChatClient/chatwindow.h
399   - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwindow.h -o moc_chatwindow.cpp
  424 + ../QChatClient/loginscreen.h \
  425 + ../QChatClient/chatwindow.h \
  426 + ../QChatClient/loginscreen.h
  427 + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/loginscreen.h -o moc_loginscreen.cpp
400 428  
401   -moc_loginscreen.cpp: /usr/include/qt5/QtWidgets/QDialog \
402   - /usr/include/qt5/QtWidgets/qdialog.h \
  429 +moc_chatroom.cpp: /usr/include/qt5/QtWidgets/QMainWindow \
  430 + /usr/include/qt5/QtWidgets/qmainwindow.h \
403 431 /usr/include/qt5/QtWidgets/qwidget.h \
404 432 /usr/include/qt5/QtGui/qwindowdefs.h \
405 433 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -506,13 +534,23 @@ moc_loginscreen.cpp: /usr/include/qt5/QtWidgets/QDialog \
506 534 /usr/include/qt5/QtCore/qfiledevice.h \
507 535 /usr/include/qt5/QtGui/qvector2d.h \
508 536 /usr/include/qt5/QtGui/qtouchdevice.h \
  537 + /usr/include/qt5/QtWidgets/qtabwidget.h \
  538 + /usr/include/qt5/QtGui/qicon.h \
509 539 ../QChatClient/Socket.h \
510 540 ../QChatClient/SocketException.h \
511   - ../QChatClient/loginscreen.h
512   - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/loginscreen.h -o moc_loginscreen.cpp
  541 + ../QChatClient/loginscreen.h \
  542 + /usr/include/qt5/QtWidgets/QDialog \
  543 + /usr/include/qt5/QtWidgets/qdialog.h \
  544 + /usr/include/qt5/QtCore/QRegExp \
  545 + ../QChatClient/chatroom.h \
  546 + ../QChatClient/chatwindow.h \
  547 + ../QChatClient/chatroom.h
  548 + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatroom.h -o moc_chatroom.cpp
513 549  
514   -moc_chatroom.cpp: /usr/include/qt5/QtWidgets/QMainWindow \
515   - /usr/include/qt5/QtWidgets/qmainwindow.h \
  550 +moc_chatwidget.cpp: /usr/include/qt5/QtWidgets/QTextEdit \
  551 + /usr/include/qt5/QtWidgets/qtextedit.h \
  552 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  553 + /usr/include/qt5/QtWidgets/qframe.h \
516 554 /usr/include/qt5/QtWidgets/qwidget.h \
517 555 /usr/include/qt5/QtGui/qwindowdefs.h \
518 556 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -619,17 +657,16 @@ moc_chatroom.cpp: /usr/include/qt5/QtWidgets/QMainWindow \
619 657 /usr/include/qt5/QtCore/qfiledevice.h \
620 658 /usr/include/qt5/QtGui/qvector2d.h \
621 659 /usr/include/qt5/QtGui/qtouchdevice.h \
622   - /usr/include/qt5/QtWidgets/qtabwidget.h \
623   - /usr/include/qt5/QtGui/qicon.h \
624   - ../QChatClient/Socket.h \
625   - ../QChatClient/SocketException.h \
626   - ../QChatClient/chatroom.h
627   - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatroom.h -o moc_chatroom.cpp
  660 + /usr/include/qt5/QtGui/qtextdocument.h \
  661 + /usr/include/qt5/QtGui/qtextoption.h \
  662 + /usr/include/qt5/QtGui/qtextcursor.h \
  663 + /usr/include/qt5/QtGui/qtextformat.h \
  664 + /usr/include/qt5/QtGui/qpen.h \
  665 + ../QChatClient/chatwidget.h
  666 + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwidget.h -o moc_chatwidget.cpp
628 667  
629   -moc_chatwidget.cpp: /usr/include/qt5/QtWidgets/QTextEdit \
630   - /usr/include/qt5/QtWidgets/qtextedit.h \
631   - /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
632   - /usr/include/qt5/QtWidgets/qframe.h \
  668 +moc_chatwindow.cpp: /usr/include/qt5/QtWidgets/QMainWindow \
  669 + /usr/include/qt5/QtWidgets/qmainwindow.h \
633 670 /usr/include/qt5/QtWidgets/qwidget.h \
634 671 /usr/include/qt5/QtGui/qwindowdefs.h \
635 672 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -736,24 +773,12 @@ moc_chatwidget.cpp: /usr/include/qt5/QtWidgets/QTextEdit \
736 773 /usr/include/qt5/QtCore/qfiledevice.h \
737 774 /usr/include/qt5/QtGui/qvector2d.h \
738 775 /usr/include/qt5/QtGui/qtouchdevice.h \
739   - /usr/include/qt5/QtGui/qtextdocument.h \
740   - /usr/include/qt5/QtGui/qtextoption.h \
741   - /usr/include/qt5/QtGui/qtextcursor.h \
742   - /usr/include/qt5/QtGui/qtextformat.h \
743   - /usr/include/qt5/QtGui/qpen.h \
744   - ../QChatClient/chatwidget.h
745   - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwidget.h -o moc_chatwidget.cpp
  776 + /usr/include/qt5/QtWidgets/qtabwidget.h \
  777 + /usr/include/qt5/QtGui/qicon.h \
  778 + ../QChatClient/chatwindow.h
  779 + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwindow.h -o moc_chatwindow.cpp
746 780  
747   -compiler_wayland-code_make_all:
748   -compiler_wayland-code_clean:
749   -compiler_moc_source_make_all:
750   -compiler_moc_source_clean:
751   -compiler_uic_make_all: ui_chatwindow.h ui_loginscreen.h ui_chatroom.h
752   -compiler_uic_clean:
753   - -$(DEL_FILE) ui_chatwindow.h ui_loginscreen.h ui_chatroom.h
754   -ui_chatwindow.h: ../QChatClient/chatwindow.ui \
755   - ../QChatClient/chatwidget.h \
756   - /usr/include/qt5/QtWidgets/QTextEdit \
  781 +moc_chatinputtext.cpp: /usr/include/qt5/QtWidgets/QTextEdit \
757 782 /usr/include/qt5/QtWidgets/qtextedit.h \
758 783 /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
759 784 /usr/include/qt5/QtWidgets/qframe.h \
... ... @@ -867,14 +892,21 @@ ui_chatwindow.h: ../QChatClient/chatwindow.ui \
867 892 /usr/include/qt5/QtGui/qtextoption.h \
868 893 /usr/include/qt5/QtGui/qtextcursor.h \
869 894 /usr/include/qt5/QtGui/qtextformat.h \
870   - /usr/include/qt5/QtGui/qpen.h
871   - /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatwindow.ui -o ui_chatwindow.h
872   -
873   -ui_loginscreen.h: ../QChatClient/loginscreen.ui
874   - /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/loginscreen.ui -o ui_loginscreen.h
  895 + /usr/include/qt5/QtGui/qpen.h \
  896 + /usr/include/qt5/QtGui/QKeyEvent \
  897 + ../QChatClient/chatinputtext.h
  898 + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatinputtext.h -o moc_chatinputtext.cpp
875 899  
876   -ui_chatroom.h: ../QChatClient/chatroom.ui \
  900 +compiler_wayland-code_make_all:
  901 +compiler_wayland-code_clean:
  902 +compiler_moc_source_make_all:
  903 +compiler_moc_source_clean:
  904 +compiler_uic_make_all: ui_chatwindow.h ui_loginscreen.h ui_chatroom.h
  905 +compiler_uic_clean:
  906 + -$(DEL_FILE) ui_chatwindow.h ui_loginscreen.h ui_chatroom.h
  907 +ui_chatwindow.h: ../QChatClient/chatwindow.ui \
877 908 ../QChatClient/chatwidget.h \
  909 + ../QChatClient/chatinputtext.h \
878 910 /usr/include/qt5/QtWidgets/QTextEdit \
879 911 /usr/include/qt5/QtWidgets/qtextedit.h \
880 912 /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
... ... @@ -989,22 +1021,11 @@ ui_chatroom.h: ../QChatClient/chatroom.ui \
989 1021 /usr/include/qt5/QtGui/qtextoption.h \
990 1022 /usr/include/qt5/QtGui/qtextcursor.h \
991 1023 /usr/include/qt5/QtGui/qtextformat.h \
992   - /usr/include/qt5/QtGui/qpen.h
993   - /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatroom.ui -o ui_chatroom.h
994   -
995   -compiler_yacc_decl_make_all:
996   -compiler_yacc_decl_clean:
997   -compiler_yacc_impl_make_all:
998   -compiler_yacc_impl_clean:
999   -compiler_lex_make_all:
1000   -compiler_lex_clean:
1001   -compiler_clean: compiler_moc_header_clean compiler_uic_clean
1002   -
1003   -####### Compile
1004   -
1005   -main.o: ../QChatClient/main.cpp ../QChatClient/loginscreen.h \
1006   - /usr/include/qt5/QtWidgets/QDialog \
1007   - /usr/include/qt5/QtWidgets/qdialog.h \
  1024 + /usr/include/qt5/QtGui/qpen.h \
  1025 + /usr/include/qt5/QtWidgets/QTextEdit \
  1026 + /usr/include/qt5/QtWidgets/qtextedit.h \
  1027 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  1028 + /usr/include/qt5/QtWidgets/qframe.h \
1008 1029 /usr/include/qt5/QtWidgets/qwidget.h \
1009 1030 /usr/include/qt5/QtGui/qwindowdefs.h \
1010 1031 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -1111,26 +1132,24 @@ main.o: ../QChatClient/main.cpp ../QChatClient/loginscreen.h \
1111 1132 /usr/include/qt5/QtCore/qfiledevice.h \
1112 1133 /usr/include/qt5/QtGui/qvector2d.h \
1113 1134 /usr/include/qt5/QtGui/qtouchdevice.h \
1114   - ../QChatClient/Socket.h \
1115   - ../QChatClient/SocketException.h \
1116   - ../QChatClient/chatroom.h \
1117   - /usr/include/qt5/QtWidgets/QMainWindow \
1118   - /usr/include/qt5/QtWidgets/qmainwindow.h \
1119   - /usr/include/qt5/QtWidgets/qtabwidget.h \
1120   - /usr/include/qt5/QtGui/qicon.h \
1121   - ../QChatClient/chatwindow.h \
1122   - /usr/include/qt5/QtWidgets/QApplication \
1123   - /usr/include/qt5/QtWidgets/qapplication.h \
1124   - /usr/include/qt5/QtCore/qcoreapplication.h \
1125   - /usr/include/qt5/QtCore/qeventloop.h \
1126   - /usr/include/qt5/QtWidgets/qdesktopwidget.h \
1127   - /usr/include/qt5/QtGui/qguiapplication.h \
1128   - /usr/include/qt5/QtGui/qinputmethod.h
1129   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../QChatClient/main.cpp
  1135 + /usr/include/qt5/QtGui/qtextdocument.h \
  1136 + /usr/include/qt5/QtGui/qtextoption.h \
  1137 + /usr/include/qt5/QtGui/qtextcursor.h \
  1138 + /usr/include/qt5/QtGui/qtextformat.h \
  1139 + /usr/include/qt5/QtGui/qpen.h \
  1140 + /usr/include/qt5/QtGui/QKeyEvent
  1141 + /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatwindow.ui -o ui_chatwindow.h
1130 1142  
1131   -chatwindow.o: ../QChatClient/chatwindow.cpp ../QChatClient/chatwindow.h \
1132   - /usr/include/qt5/QtWidgets/QMainWindow \
1133   - /usr/include/qt5/QtWidgets/qmainwindow.h \
  1143 +ui_loginscreen.h: ../QChatClient/loginscreen.ui
  1144 + /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/loginscreen.ui -o ui_loginscreen.h
  1145 +
  1146 +ui_chatroom.h: ../QChatClient/chatroom.ui \
  1147 + ../QChatClient/chatwidget.h \
  1148 + ../QChatClient/chatinputtext.h \
  1149 + /usr/include/qt5/QtWidgets/QTextEdit \
  1150 + /usr/include/qt5/QtWidgets/qtextedit.h \
  1151 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  1152 + /usr/include/qt5/QtWidgets/qframe.h \
1134 1153 /usr/include/qt5/QtWidgets/qwidget.h \
1135 1154 /usr/include/qt5/QtGui/qwindowdefs.h \
1136 1155 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -1237,62 +1256,15 @@ chatwindow.o: ../QChatClient/chatwindow.cpp ../QChatClient/chatwindow.h \
1237 1256 /usr/include/qt5/QtCore/qfiledevice.h \
1238 1257 /usr/include/qt5/QtGui/qvector2d.h \
1239 1258 /usr/include/qt5/QtGui/qtouchdevice.h \
1240   - /usr/include/qt5/QtWidgets/qtabwidget.h \
1241   - /usr/include/qt5/QtGui/qicon.h \
1242   - ui_chatwindow.h \
1243   - /usr/include/qt5/QtCore/QVariant \
1244   - /usr/include/qt5/QtWidgets/QAction \
1245   - /usr/include/qt5/QtWidgets/qaction.h \
1246   - /usr/include/qt5/QtWidgets/qactiongroup.h \
1247   - /usr/include/qt5/QtWidgets/QApplication \
1248   - /usr/include/qt5/QtWidgets/qapplication.h \
1249   - /usr/include/qt5/QtCore/qcoreapplication.h \
1250   - /usr/include/qt5/QtCore/qeventloop.h \
1251   - /usr/include/qt5/QtWidgets/qdesktopwidget.h \
1252   - /usr/include/qt5/QtGui/qguiapplication.h \
1253   - /usr/include/qt5/QtGui/qinputmethod.h \
1254   - /usr/include/qt5/QtWidgets/QButtonGroup \
1255   - /usr/include/qt5/QtWidgets/qbuttongroup.h \
1256   - /usr/include/qt5/QtWidgets/QGridLayout \
1257   - /usr/include/qt5/QtWidgets/qgridlayout.h \
1258   - /usr/include/qt5/QtWidgets/qlayout.h \
1259   - /usr/include/qt5/QtWidgets/qlayoutitem.h \
1260   - /usr/include/qt5/QtWidgets/qboxlayout.h \
1261   - /usr/include/qt5/QtWidgets/QHeaderView \
1262   - /usr/include/qt5/QtWidgets/qheaderview.h \
1263   - /usr/include/qt5/QtWidgets/qabstractitemview.h \
1264   - /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
1265   - /usr/include/qt5/QtWidgets/qframe.h \
1266   - /usr/include/qt5/QtCore/qabstractitemmodel.h \
1267   - /usr/include/qt5/QtCore/qitemselectionmodel.h \
1268   - /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \
1269   - /usr/include/qt5/QtWidgets/qstyleoption.h \
1270   - /usr/include/qt5/QtWidgets/qabstractspinbox.h \
1271   - /usr/include/qt5/QtGui/qvalidator.h \
1272   - /usr/include/qt5/QtWidgets/qslider.h \
1273   - /usr/include/qt5/QtWidgets/qabstractslider.h \
1274   - /usr/include/qt5/QtWidgets/qstyle.h \
1275   - /usr/include/qt5/QtWidgets/qtabbar.h \
1276   - /usr/include/qt5/QtWidgets/qrubberband.h \
1277   - /usr/include/qt5/QtWidgets/QMenuBar \
1278   - /usr/include/qt5/QtWidgets/qmenubar.h \
1279   - /usr/include/qt5/QtWidgets/qmenu.h \
1280   - /usr/include/qt5/QtWidgets/QSplitter \
1281   - /usr/include/qt5/QtWidgets/qsplitter.h \
1282   - /usr/include/qt5/QtWidgets/QTextEdit \
1283   - /usr/include/qt5/QtWidgets/qtextedit.h \
1284 1259 /usr/include/qt5/QtGui/qtextdocument.h \
1285 1260 /usr/include/qt5/QtGui/qtextoption.h \
1286 1261 /usr/include/qt5/QtGui/qtextcursor.h \
1287 1262 /usr/include/qt5/QtGui/qtextformat.h \
1288 1263 /usr/include/qt5/QtGui/qpen.h \
1289   - /usr/include/qt5/QtWidgets/QWidget \
1290   - ../QChatClient/chatwidget.h
1291   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwindow.o ../QChatClient/chatwindow.cpp
1292   -
1293   -loginscreen.o: ../QChatClient/loginscreen.cpp ../QChatClient/loginscreen.h \
1294   - /usr/include/qt5/QtWidgets/QDialog \
1295   - /usr/include/qt5/QtWidgets/qdialog.h \
  1264 + /usr/include/qt5/QtWidgets/QTextEdit \
  1265 + /usr/include/qt5/QtWidgets/qtextedit.h \
  1266 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  1267 + /usr/include/qt5/QtWidgets/qframe.h \
1296 1268 /usr/include/qt5/QtWidgets/qwidget.h \
1297 1269 /usr/include/qt5/QtGui/qwindowdefs.h \
1298 1270 /usr/include/qt5/QtCore/qglobal.h \
... ... @@ -1399,61 +1371,620 @@ loginscreen.o: ../QChatClient/loginscreen.cpp ../QChatClient/loginscreen.h \
1399 1371 /usr/include/qt5/QtCore/qfiledevice.h \
1400 1372 /usr/include/qt5/QtGui/qvector2d.h \
1401 1373 /usr/include/qt5/QtGui/qtouchdevice.h \
1402   - ../QChatClient/Socket.h \
1403   - ../QChatClient/SocketException.h \
1404   - ui_loginscreen.h \
1405   - /usr/include/qt5/QtCore/QVariant \
1406   - /usr/include/qt5/QtWidgets/QAction \
1407   - /usr/include/qt5/QtWidgets/qaction.h \
1408   - /usr/include/qt5/QtGui/qicon.h \
1409   - /usr/include/qt5/QtWidgets/qactiongroup.h \
1410   - /usr/include/qt5/QtWidgets/QApplication \
1411   - /usr/include/qt5/QtWidgets/qapplication.h \
1412   - /usr/include/qt5/QtCore/qcoreapplication.h \
1413   - /usr/include/qt5/QtCore/qeventloop.h \
1414   - /usr/include/qt5/QtWidgets/qdesktopwidget.h \
1415   - /usr/include/qt5/QtGui/qguiapplication.h \
1416   - /usr/include/qt5/QtGui/qinputmethod.h \
1417   - /usr/include/qt5/QtWidgets/QButtonGroup \
1418   - /usr/include/qt5/QtWidgets/qbuttongroup.h \
1419   - /usr/include/qt5/QtWidgets/QGridLayout \
1420   - /usr/include/qt5/QtWidgets/qgridlayout.h \
1421   - /usr/include/qt5/QtWidgets/qlayout.h \
1422   - /usr/include/qt5/QtWidgets/qlayoutitem.h \
1423   - /usr/include/qt5/QtWidgets/qboxlayout.h \
1424   - /usr/include/qt5/QtWidgets/QHeaderView \
1425   - /usr/include/qt5/QtWidgets/qheaderview.h \
1426   - /usr/include/qt5/QtWidgets/qabstractitemview.h \
1427   - /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
1428   - /usr/include/qt5/QtWidgets/qframe.h \
1429   - /usr/include/qt5/QtCore/qabstractitemmodel.h \
1430   - /usr/include/qt5/QtCore/qitemselectionmodel.h \
1431   - /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \
1432   - /usr/include/qt5/QtWidgets/qstyleoption.h \
1433   - /usr/include/qt5/QtWidgets/qabstractspinbox.h \
1434   - /usr/include/qt5/QtGui/qvalidator.h \
1435   - /usr/include/qt5/QtWidgets/qslider.h \
1436   - /usr/include/qt5/QtWidgets/qabstractslider.h \
1437   - /usr/include/qt5/QtWidgets/qstyle.h \
1438   - /usr/include/qt5/QtWidgets/qtabbar.h \
1439   - /usr/include/qt5/QtWidgets/qtabwidget.h \
1440   - /usr/include/qt5/QtWidgets/qrubberband.h \
1441   - /usr/include/qt5/QtWidgets/QLabel \
1442   - /usr/include/qt5/QtWidgets/qlabel.h \
1443   - /usr/include/qt5/QtWidgets/QLineEdit \
1444   - /usr/include/qt5/QtWidgets/qlineedit.h \
  1374 + /usr/include/qt5/QtGui/qtextdocument.h \
  1375 + /usr/include/qt5/QtGui/qtextoption.h \
1445 1376 /usr/include/qt5/QtGui/qtextcursor.h \
1446 1377 /usr/include/qt5/QtGui/qtextformat.h \
1447 1378 /usr/include/qt5/QtGui/qpen.h \
1448   - /usr/include/qt5/QtGui/qtextoption.h \
1449   - /usr/include/qt5/QtWidgets/QPushButton \
1450   - /usr/include/qt5/QtWidgets/qpushbutton.h \
1451   - /usr/include/qt5/QtWidgets/qabstractbutton.h \
1452   - /usr/include/qt5/QtWidgets/QSpacerItem \
1453   - /usr/include/qt5/QtWidgets/QWidget
  1379 + /usr/include/qt5/QtGui/QKeyEvent
  1380 + /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatroom.ui -o ui_chatroom.h
  1381 +
  1382 +compiler_yacc_decl_make_all:
  1383 +compiler_yacc_decl_clean:
  1384 +compiler_yacc_impl_make_all:
  1385 +compiler_yacc_impl_clean:
  1386 +compiler_lex_make_all:
  1387 +compiler_lex_clean:
  1388 +compiler_clean: compiler_moc_header_clean compiler_uic_clean
  1389 +
  1390 +####### Compile
  1391 +
  1392 +main.o: ../QChatClient/main.cpp ../QChatClient/loginscreen.h \
  1393 + /usr/include/qt5/QtWidgets/QDialog \
  1394 + /usr/include/qt5/QtWidgets/qdialog.h \
  1395 + /usr/include/qt5/QtWidgets/qwidget.h \
  1396 + /usr/include/qt5/QtGui/qwindowdefs.h \
  1397 + /usr/include/qt5/QtCore/qglobal.h \
  1398 + /usr/include/qt5/QtCore/qconfig.h \
  1399 + /usr/include/qt5/QtCore/qfeatures.h \
  1400 + /usr/include/qt5/QtCore/qsystemdetection.h \
  1401 + /usr/include/qt5/QtCore/qcompilerdetection.h \
  1402 + /usr/include/qt5/QtCore/qprocessordetection.h \
  1403 + /usr/include/qt5/QtCore/qlogging.h \
  1404 + /usr/include/qt5/QtCore/qflags.h \
  1405 + /usr/include/qt5/QtCore/qtypeinfo.h \
  1406 + /usr/include/qt5/QtCore/qtypetraits.h \
  1407 + /usr/include/qt5/QtCore/qsysinfo.h \
  1408 + /usr/include/qt5/QtCore/qobjectdefs.h \
  1409 + /usr/include/qt5/QtCore/qnamespace.h \
  1410 + /usr/include/qt5/QtCore/qobjectdefs_impl.h \
  1411 + /usr/include/qt5/QtGui/qwindowdefs_win.h \
  1412 + /usr/include/qt5/QtCore/qobject.h \
  1413 + /usr/include/qt5/QtCore/qstring.h \
  1414 + /usr/include/qt5/QtCore/qchar.h \
  1415 + /usr/include/qt5/QtCore/qbytearray.h \
  1416 + /usr/include/qt5/QtCore/qrefcount.h \
  1417 + /usr/include/qt5/QtCore/qatomic.h \
  1418 + /usr/include/qt5/QtCore/qbasicatomic.h \
  1419 + /usr/include/qt5/QtCore/qatomic_bootstrap.h \
  1420 + /usr/include/qt5/QtCore/qgenericatomic.h \
  1421 + /usr/include/qt5/QtCore/qatomic_msvc.h \
  1422 + /usr/include/qt5/QtCore/qatomic_integrity.h \
  1423 + /usr/include/qt5/QtCore/qoldbasicatomic.h \
  1424 + /usr/include/qt5/QtCore/qatomic_vxworks.h \
  1425 + /usr/include/qt5/QtCore/qatomic_power.h \
  1426 + /usr/include/qt5/QtCore/qatomic_aarch64.h \
  1427 + /usr/include/qt5/QtCore/qatomic_alpha.h \
  1428 + /usr/include/qt5/QtCore/qatomic_armv7.h \
  1429 + /usr/include/qt5/QtCore/qatomic_armv6.h \
  1430 + /usr/include/qt5/QtCore/qatomic_armv5.h \
  1431 + /usr/include/qt5/QtCore/qatomic_bfin.h \
  1432 + /usr/include/qt5/QtCore/qatomic_ia64.h \
  1433 + /usr/include/qt5/QtCore/qatomic_mips.h \
  1434 + /usr/include/qt5/QtCore/qatomic_s390.h \
  1435 + /usr/include/qt5/QtCore/qatomic_sh4a.h \
  1436 + /usr/include/qt5/QtCore/qatomic_sparc.h \
  1437 + /usr/include/qt5/QtCore/qatomic_x86.h \
  1438 + /usr/include/qt5/QtCore/qatomic_cxx11.h \
  1439 + /usr/include/qt5/QtCore/qatomic_gcc.h \
  1440 + /usr/include/qt5/QtCore/qatomic_unix.h \
  1441 + /usr/include/qt5/QtCore/qarraydata.h \
  1442 + /usr/include/qt5/QtCore/qstringbuilder.h \
  1443 + /usr/include/qt5/QtCore/qlist.h \
  1444 + /usr/include/qt5/QtCore/qalgorithms.h \
  1445 + /usr/include/qt5/QtCore/qiterator.h \
  1446 + /usr/include/qt5/QtCore/qcoreevent.h \
  1447 + /usr/include/qt5/QtCore/qscopedpointer.h \
  1448 + /usr/include/qt5/QtCore/qmetatype.h \
  1449 + /usr/include/qt5/QtCore/qvarlengtharray.h \
  1450 + /usr/include/qt5/QtCore/qcontainerfwd.h \
  1451 + /usr/include/qt5/QtCore/qisenum.h \
  1452 + /usr/include/qt5/QtCore/qobject_impl.h \
  1453 + /usr/include/qt5/QtCore/qmargins.h \
  1454 + /usr/include/qt5/QtGui/qpaintdevice.h \
  1455 + /usr/include/qt5/QtCore/qrect.h \
  1456 + /usr/include/qt5/QtCore/qsize.h \
  1457 + /usr/include/qt5/QtCore/qpoint.h \
  1458 + /usr/include/qt5/QtGui/qpalette.h \
  1459 + /usr/include/qt5/QtGui/qcolor.h \
  1460 + /usr/include/qt5/QtGui/qrgb.h \
  1461 + /usr/include/qt5/QtCore/qstringlist.h \
  1462 + /usr/include/qt5/QtCore/qdatastream.h \
  1463 + /usr/include/qt5/QtCore/qiodevice.h \
  1464 + /usr/include/qt5/QtCore/qpair.h \
  1465 + /usr/include/qt5/QtCore/qregexp.h \
  1466 + /usr/include/qt5/QtCore/qstringmatcher.h \
  1467 + /usr/include/qt5/QtGui/qbrush.h \
  1468 + /usr/include/qt5/QtCore/qvector.h \
  1469 + /usr/include/qt5/QtGui/qmatrix.h \
  1470 + /usr/include/qt5/QtGui/qpolygon.h \
  1471 + /usr/include/qt5/QtGui/qregion.h \
  1472 + /usr/include/qt5/QtCore/qline.h \
  1473 + /usr/include/qt5/QtGui/qtransform.h \
  1474 + /usr/include/qt5/QtGui/qpainterpath.h \
  1475 + /usr/include/qt5/QtGui/qimage.h \
  1476 + /usr/include/qt5/QtGui/qpixmap.h \
  1477 + /usr/include/qt5/QtCore/qsharedpointer.h \
  1478 + /usr/include/qt5/QtCore/qshareddata.h \
  1479 + /usr/include/qt5/QtCore/qsharedpointer_impl.h \
  1480 + /usr/include/qt5/QtCore/qhash.h \
  1481 + /usr/include/qt5/QtGui/qfont.h \
  1482 + /usr/include/qt5/QtGui/qfontmetrics.h \
  1483 + /usr/include/qt5/QtGui/qfontinfo.h \
  1484 + /usr/include/qt5/QtWidgets/qsizepolicy.h \
  1485 + /usr/include/qt5/QtGui/qcursor.h \
  1486 + /usr/include/qt5/QtGui/qkeysequence.h \
  1487 + /usr/include/qt5/QtGui/qevent.h \
  1488 + /usr/include/qt5/QtCore/qvariant.h \
  1489 + /usr/include/qt5/QtCore/qmap.h \
  1490 + /usr/include/qt5/QtCore/qdebug.h \
  1491 + /usr/include/qt5/QtCore/qtextstream.h \
  1492 + /usr/include/qt5/QtCore/qlocale.h \
  1493 + /usr/include/qt5/QtCore/qset.h \
  1494 + /usr/include/qt5/QtCore/qcontiguouscache.h \
  1495 + /usr/include/qt5/QtCore/qurl.h \
  1496 + /usr/include/qt5/QtCore/qurlquery.h \
  1497 + /usr/include/qt5/QtCore/qfile.h \
  1498 + /usr/include/qt5/QtCore/qfiledevice.h \
  1499 + /usr/include/qt5/QtGui/qvector2d.h \
  1500 + /usr/include/qt5/QtGui/qtouchdevice.h \
  1501 + /usr/include/qt5/QtCore/QRegExp \
  1502 + ../QChatClient/Socket.h \
  1503 + ../QChatClient/SocketException.h \
  1504 + ../QChatClient/chatroom.h \
  1505 + /usr/include/qt5/QtWidgets/QMainWindow \
  1506 + /usr/include/qt5/QtWidgets/qmainwindow.h \
  1507 + /usr/include/qt5/QtWidgets/qtabwidget.h \
  1508 + /usr/include/qt5/QtGui/qicon.h \
  1509 + ../QChatClient/chatwindow.h \
  1510 + /usr/include/qt5/QtWidgets/QApplication \
  1511 + /usr/include/qt5/QtWidgets/qapplication.h \
  1512 + /usr/include/qt5/QtCore/qcoreapplication.h \
  1513 + /usr/include/qt5/QtCore/qeventloop.h \
  1514 + /usr/include/qt5/QtWidgets/qdesktopwidget.h \
  1515 + /usr/include/qt5/QtGui/qguiapplication.h \
  1516 + /usr/include/qt5/QtGui/qinputmethod.h
  1517 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../QChatClient/main.cpp
  1518 +
  1519 +loginscreen.o: ../QChatClient/loginscreen.cpp ../QChatClient/loginscreen.h \
  1520 + /usr/include/qt5/QtWidgets/QDialog \
  1521 + /usr/include/qt5/QtWidgets/qdialog.h \
  1522 + /usr/include/qt5/QtWidgets/qwidget.h \
  1523 + /usr/include/qt5/QtGui/qwindowdefs.h \
  1524 + /usr/include/qt5/QtCore/qglobal.h \
  1525 + /usr/include/qt5/QtCore/qconfig.h \
  1526 + /usr/include/qt5/QtCore/qfeatures.h \
  1527 + /usr/include/qt5/QtCore/qsystemdetection.h \
  1528 + /usr/include/qt5/QtCore/qcompilerdetection.h \
  1529 + /usr/include/qt5/QtCore/qprocessordetection.h \
  1530 + /usr/include/qt5/QtCore/qlogging.h \
  1531 + /usr/include/qt5/QtCore/qflags.h \
  1532 + /usr/include/qt5/QtCore/qtypeinfo.h \
  1533 + /usr/include/qt5/QtCore/qtypetraits.h \
  1534 + /usr/include/qt5/QtCore/qsysinfo.h \
  1535 + /usr/include/qt5/QtCore/qobjectdefs.h \
  1536 + /usr/include/qt5/QtCore/qnamespace.h \
  1537 + /usr/include/qt5/QtCore/qobjectdefs_impl.h \
  1538 + /usr/include/qt5/QtGui/qwindowdefs_win.h \
  1539 + /usr/include/qt5/QtCore/qobject.h \
  1540 + /usr/include/qt5/QtCore/qstring.h \
  1541 + /usr/include/qt5/QtCore/qchar.h \
  1542 + /usr/include/qt5/QtCore/qbytearray.h \
  1543 + /usr/include/qt5/QtCore/qrefcount.h \
  1544 + /usr/include/qt5/QtCore/qatomic.h \
  1545 + /usr/include/qt5/QtCore/qbasicatomic.h \
  1546 + /usr/include/qt5/QtCore/qatomic_bootstrap.h \
  1547 + /usr/include/qt5/QtCore/qgenericatomic.h \
  1548 + /usr/include/qt5/QtCore/qatomic_msvc.h \
  1549 + /usr/include/qt5/QtCore/qatomic_integrity.h \
  1550 + /usr/include/qt5/QtCore/qoldbasicatomic.h \
  1551 + /usr/include/qt5/QtCore/qatomic_vxworks.h \
  1552 + /usr/include/qt5/QtCore/qatomic_power.h \
  1553 + /usr/include/qt5/QtCore/qatomic_aarch64.h \
  1554 + /usr/include/qt5/QtCore/qatomic_alpha.h \
  1555 + /usr/include/qt5/QtCore/qatomic_armv7.h \
  1556 + /usr/include/qt5/QtCore/qatomic_armv6.h \
  1557 + /usr/include/qt5/QtCore/qatomic_armv5.h \
  1558 + /usr/include/qt5/QtCore/qatomic_bfin.h \
  1559 + /usr/include/qt5/QtCore/qatomic_ia64.h \
  1560 + /usr/include/qt5/QtCore/qatomic_mips.h \
  1561 + /usr/include/qt5/QtCore/qatomic_s390.h \
  1562 + /usr/include/qt5/QtCore/qatomic_sh4a.h \
  1563 + /usr/include/qt5/QtCore/qatomic_sparc.h \
  1564 + /usr/include/qt5/QtCore/qatomic_x86.h \
  1565 + /usr/include/qt5/QtCore/qatomic_cxx11.h \
  1566 + /usr/include/qt5/QtCore/qatomic_gcc.h \
  1567 + /usr/include/qt5/QtCore/qatomic_unix.h \
  1568 + /usr/include/qt5/QtCore/qarraydata.h \
  1569 + /usr/include/qt5/QtCore/qstringbuilder.h \
  1570 + /usr/include/qt5/QtCore/qlist.h \
  1571 + /usr/include/qt5/QtCore/qalgorithms.h \
  1572 + /usr/include/qt5/QtCore/qiterator.h \
  1573 + /usr/include/qt5/QtCore/qcoreevent.h \
  1574 + /usr/include/qt5/QtCore/qscopedpointer.h \
  1575 + /usr/include/qt5/QtCore/qmetatype.h \
  1576 + /usr/include/qt5/QtCore/qvarlengtharray.h \
  1577 + /usr/include/qt5/QtCore/qcontainerfwd.h \
  1578 + /usr/include/qt5/QtCore/qisenum.h \
  1579 + /usr/include/qt5/QtCore/qobject_impl.h \
  1580 + /usr/include/qt5/QtCore/qmargins.h \
  1581 + /usr/include/qt5/QtGui/qpaintdevice.h \
  1582 + /usr/include/qt5/QtCore/qrect.h \
  1583 + /usr/include/qt5/QtCore/qsize.h \
  1584 + /usr/include/qt5/QtCore/qpoint.h \
  1585 + /usr/include/qt5/QtGui/qpalette.h \
  1586 + /usr/include/qt5/QtGui/qcolor.h \
  1587 + /usr/include/qt5/QtGui/qrgb.h \
  1588 + /usr/include/qt5/QtCore/qstringlist.h \
  1589 + /usr/include/qt5/QtCore/qdatastream.h \
  1590 + /usr/include/qt5/QtCore/qiodevice.h \
  1591 + /usr/include/qt5/QtCore/qpair.h \
  1592 + /usr/include/qt5/QtCore/qregexp.h \
  1593 + /usr/include/qt5/QtCore/qstringmatcher.h \
  1594 + /usr/include/qt5/QtGui/qbrush.h \
  1595 + /usr/include/qt5/QtCore/qvector.h \
  1596 + /usr/include/qt5/QtGui/qmatrix.h \
  1597 + /usr/include/qt5/QtGui/qpolygon.h \
  1598 + /usr/include/qt5/QtGui/qregion.h \
  1599 + /usr/include/qt5/QtCore/qline.h \
  1600 + /usr/include/qt5/QtGui/qtransform.h \
  1601 + /usr/include/qt5/QtGui/qpainterpath.h \
  1602 + /usr/include/qt5/QtGui/qimage.h \
  1603 + /usr/include/qt5/QtGui/qpixmap.h \
  1604 + /usr/include/qt5/QtCore/qsharedpointer.h \
  1605 + /usr/include/qt5/QtCore/qshareddata.h \
  1606 + /usr/include/qt5/QtCore/qsharedpointer_impl.h \
  1607 + /usr/include/qt5/QtCore/qhash.h \
  1608 + /usr/include/qt5/QtGui/qfont.h \
  1609 + /usr/include/qt5/QtGui/qfontmetrics.h \
  1610 + /usr/include/qt5/QtGui/qfontinfo.h \
  1611 + /usr/include/qt5/QtWidgets/qsizepolicy.h \
  1612 + /usr/include/qt5/QtGui/qcursor.h \
  1613 + /usr/include/qt5/QtGui/qkeysequence.h \
  1614 + /usr/include/qt5/QtGui/qevent.h \
  1615 + /usr/include/qt5/QtCore/qvariant.h \
  1616 + /usr/include/qt5/QtCore/qmap.h \
  1617 + /usr/include/qt5/QtCore/qdebug.h \
  1618 + /usr/include/qt5/QtCore/qtextstream.h \
  1619 + /usr/include/qt5/QtCore/qlocale.h \
  1620 + /usr/include/qt5/QtCore/qset.h \
  1621 + /usr/include/qt5/QtCore/qcontiguouscache.h \
  1622 + /usr/include/qt5/QtCore/qurl.h \
  1623 + /usr/include/qt5/QtCore/qurlquery.h \
  1624 + /usr/include/qt5/QtCore/qfile.h \
  1625 + /usr/include/qt5/QtCore/qfiledevice.h \
  1626 + /usr/include/qt5/QtGui/qvector2d.h \
  1627 + /usr/include/qt5/QtGui/qtouchdevice.h \
  1628 + /usr/include/qt5/QtCore/QRegExp \
  1629 + ../QChatClient/Socket.h \
  1630 + ../QChatClient/SocketException.h \
  1631 + ../QChatClient/chatroom.h \
  1632 + /usr/include/qt5/QtWidgets/QMainWindow \
  1633 + /usr/include/qt5/QtWidgets/qmainwindow.h \
  1634 + /usr/include/qt5/QtWidgets/qtabwidget.h \
  1635 + /usr/include/qt5/QtGui/qicon.h \
  1636 + ../QChatClient/chatwindow.h \
  1637 + ui_loginscreen.h \
  1638 + /usr/include/qt5/QtCore/QVariant \
  1639 + /usr/include/qt5/QtWidgets/QAction \
  1640 + /usr/include/qt5/QtWidgets/qaction.h \
  1641 + /usr/include/qt5/QtWidgets/qactiongroup.h \
  1642 + /usr/include/qt5/QtWidgets/QApplication \
  1643 + /usr/include/qt5/QtWidgets/qapplication.h \
  1644 + /usr/include/qt5/QtCore/qcoreapplication.h \
  1645 + /usr/include/qt5/QtCore/qeventloop.h \
  1646 + /usr/include/qt5/QtWidgets/qdesktopwidget.h \
  1647 + /usr/include/qt5/QtGui/qguiapplication.h \
  1648 + /usr/include/qt5/QtGui/qinputmethod.h \
  1649 + /usr/include/qt5/QtWidgets/QButtonGroup \
  1650 + /usr/include/qt5/QtWidgets/qbuttongroup.h \
  1651 + /usr/include/qt5/QtWidgets/QGridLayout \
  1652 + /usr/include/qt5/QtWidgets/qgridlayout.h \
  1653 + /usr/include/qt5/QtWidgets/qlayout.h \
  1654 + /usr/include/qt5/QtWidgets/qlayoutitem.h \
  1655 + /usr/include/qt5/QtWidgets/qboxlayout.h \
  1656 + /usr/include/qt5/QtWidgets/QHeaderView \
  1657 + /usr/include/qt5/QtWidgets/qheaderview.h \
  1658 + /usr/include/qt5/QtWidgets/qabstractitemview.h \
  1659 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  1660 + /usr/include/qt5/QtWidgets/qframe.h \
  1661 + /usr/include/qt5/QtCore/qabstractitemmodel.h \
  1662 + /usr/include/qt5/QtCore/qitemselectionmodel.h \
  1663 + /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \
  1664 + /usr/include/qt5/QtWidgets/qstyleoption.h \
  1665 + /usr/include/qt5/QtWidgets/qabstractspinbox.h \
  1666 + /usr/include/qt5/QtGui/qvalidator.h \
  1667 + /usr/include/qt5/QtWidgets/qslider.h \
  1668 + /usr/include/qt5/QtWidgets/qabstractslider.h \
  1669 + /usr/include/qt5/QtWidgets/qstyle.h \
  1670 + /usr/include/qt5/QtWidgets/qtabbar.h \
  1671 + /usr/include/qt5/QtWidgets/qrubberband.h \
  1672 + /usr/include/qt5/QtWidgets/QLabel \
  1673 + /usr/include/qt5/QtWidgets/qlabel.h \
  1674 + /usr/include/qt5/QtWidgets/QLineEdit \
  1675 + /usr/include/qt5/QtWidgets/qlineedit.h \
  1676 + /usr/include/qt5/QtGui/qtextcursor.h \
  1677 + /usr/include/qt5/QtGui/qtextformat.h \
  1678 + /usr/include/qt5/QtGui/qpen.h \
  1679 + /usr/include/qt5/QtGui/qtextoption.h \
  1680 + /usr/include/qt5/QtWidgets/QPushButton \
  1681 + /usr/include/qt5/QtWidgets/qpushbutton.h \
  1682 + /usr/include/qt5/QtWidgets/qabstractbutton.h \
  1683 + /usr/include/qt5/QtWidgets/QSpacerItem \
  1684 + /usr/include/qt5/QtWidgets/QWidget
1454 1685 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o loginscreen.o ../QChatClient/loginscreen.cpp
1455 1686  
1456   -chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \
  1687 +chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \
  1688 + /usr/include/qt5/QtWidgets/QMainWindow \
  1689 + /usr/include/qt5/QtWidgets/qmainwindow.h \
  1690 + /usr/include/qt5/QtWidgets/qwidget.h \
  1691 + /usr/include/qt5/QtGui/qwindowdefs.h \
  1692 + /usr/include/qt5/QtCore/qglobal.h \
  1693 + /usr/include/qt5/QtCore/qconfig.h \
  1694 + /usr/include/qt5/QtCore/qfeatures.h \
  1695 + /usr/include/qt5/QtCore/qsystemdetection.h \
  1696 + /usr/include/qt5/QtCore/qcompilerdetection.h \
  1697 + /usr/include/qt5/QtCore/qprocessordetection.h \
  1698 + /usr/include/qt5/QtCore/qlogging.h \
  1699 + /usr/include/qt5/QtCore/qflags.h \
  1700 + /usr/include/qt5/QtCore/qtypeinfo.h \
  1701 + /usr/include/qt5/QtCore/qtypetraits.h \
  1702 + /usr/include/qt5/QtCore/qsysinfo.h \
  1703 + /usr/include/qt5/QtCore/qobjectdefs.h \
  1704 + /usr/include/qt5/QtCore/qnamespace.h \
  1705 + /usr/include/qt5/QtCore/qobjectdefs_impl.h \
  1706 + /usr/include/qt5/QtGui/qwindowdefs_win.h \
  1707 + /usr/include/qt5/QtCore/qobject.h \
  1708 + /usr/include/qt5/QtCore/qstring.h \
  1709 + /usr/include/qt5/QtCore/qchar.h \
  1710 + /usr/include/qt5/QtCore/qbytearray.h \
  1711 + /usr/include/qt5/QtCore/qrefcount.h \
  1712 + /usr/include/qt5/QtCore/qatomic.h \
  1713 + /usr/include/qt5/QtCore/qbasicatomic.h \
  1714 + /usr/include/qt5/QtCore/qatomic_bootstrap.h \
  1715 + /usr/include/qt5/QtCore/qgenericatomic.h \
  1716 + /usr/include/qt5/QtCore/qatomic_msvc.h \
  1717 + /usr/include/qt5/QtCore/qatomic_integrity.h \
  1718 + /usr/include/qt5/QtCore/qoldbasicatomic.h \
  1719 + /usr/include/qt5/QtCore/qatomic_vxworks.h \
  1720 + /usr/include/qt5/QtCore/qatomic_power.h \
  1721 + /usr/include/qt5/QtCore/qatomic_aarch64.h \
  1722 + /usr/include/qt5/QtCore/qatomic_alpha.h \
  1723 + /usr/include/qt5/QtCore/qatomic_armv7.h \
  1724 + /usr/include/qt5/QtCore/qatomic_armv6.h \
  1725 + /usr/include/qt5/QtCore/qatomic_armv5.h \
  1726 + /usr/include/qt5/QtCore/qatomic_bfin.h \
  1727 + /usr/include/qt5/QtCore/qatomic_ia64.h \
  1728 + /usr/include/qt5/QtCore/qatomic_mips.h \
  1729 + /usr/include/qt5/QtCore/qatomic_s390.h \
  1730 + /usr/include/qt5/QtCore/qatomic_sh4a.h \
  1731 + /usr/include/qt5/QtCore/qatomic_sparc.h \
  1732 + /usr/include/qt5/QtCore/qatomic_x86.h \
  1733 + /usr/include/qt5/QtCore/qatomic_cxx11.h \
  1734 + /usr/include/qt5/QtCore/qatomic_gcc.h \
  1735 + /usr/include/qt5/QtCore/qatomic_unix.h \
  1736 + /usr/include/qt5/QtCore/qarraydata.h \
  1737 + /usr/include/qt5/QtCore/qstringbuilder.h \
  1738 + /usr/include/qt5/QtCore/qlist.h \
  1739 + /usr/include/qt5/QtCore/qalgorithms.h \
  1740 + /usr/include/qt5/QtCore/qiterator.h \
  1741 + /usr/include/qt5/QtCore/qcoreevent.h \
  1742 + /usr/include/qt5/QtCore/qscopedpointer.h \
  1743 + /usr/include/qt5/QtCore/qmetatype.h \
  1744 + /usr/include/qt5/QtCore/qvarlengtharray.h \
  1745 + /usr/include/qt5/QtCore/qcontainerfwd.h \
  1746 + /usr/include/qt5/QtCore/qisenum.h \
  1747 + /usr/include/qt5/QtCore/qobject_impl.h \
  1748 + /usr/include/qt5/QtCore/qmargins.h \
  1749 + /usr/include/qt5/QtGui/qpaintdevice.h \
  1750 + /usr/include/qt5/QtCore/qrect.h \
  1751 + /usr/include/qt5/QtCore/qsize.h \
  1752 + /usr/include/qt5/QtCore/qpoint.h \
  1753 + /usr/include/qt5/QtGui/qpalette.h \
  1754 + /usr/include/qt5/QtGui/qcolor.h \
  1755 + /usr/include/qt5/QtGui/qrgb.h \
  1756 + /usr/include/qt5/QtCore/qstringlist.h \
  1757 + /usr/include/qt5/QtCore/qdatastream.h \
  1758 + /usr/include/qt5/QtCore/qiodevice.h \
  1759 + /usr/include/qt5/QtCore/qpair.h \
  1760 + /usr/include/qt5/QtCore/qregexp.h \
  1761 + /usr/include/qt5/QtCore/qstringmatcher.h \
  1762 + /usr/include/qt5/QtGui/qbrush.h \
  1763 + /usr/include/qt5/QtCore/qvector.h \
  1764 + /usr/include/qt5/QtGui/qmatrix.h \
  1765 + /usr/include/qt5/QtGui/qpolygon.h \
  1766 + /usr/include/qt5/QtGui/qregion.h \
  1767 + /usr/include/qt5/QtCore/qline.h \
  1768 + /usr/include/qt5/QtGui/qtransform.h \
  1769 + /usr/include/qt5/QtGui/qpainterpath.h \
  1770 + /usr/include/qt5/QtGui/qimage.h \
  1771 + /usr/include/qt5/QtGui/qpixmap.h \
  1772 + /usr/include/qt5/QtCore/qsharedpointer.h \
  1773 + /usr/include/qt5/QtCore/qshareddata.h \
  1774 + /usr/include/qt5/QtCore/qsharedpointer_impl.h \
  1775 + /usr/include/qt5/QtCore/qhash.h \
  1776 + /usr/include/qt5/QtGui/qfont.h \
  1777 + /usr/include/qt5/QtGui/qfontmetrics.h \
  1778 + /usr/include/qt5/QtGui/qfontinfo.h \
  1779 + /usr/include/qt5/QtWidgets/qsizepolicy.h \
  1780 + /usr/include/qt5/QtGui/qcursor.h \
  1781 + /usr/include/qt5/QtGui/qkeysequence.h \
  1782 + /usr/include/qt5/QtGui/qevent.h \
  1783 + /usr/include/qt5/QtCore/qvariant.h \
  1784 + /usr/include/qt5/QtCore/qmap.h \
  1785 + /usr/include/qt5/QtCore/qdebug.h \
  1786 + /usr/include/qt5/QtCore/qtextstream.h \
  1787 + /usr/include/qt5/QtCore/qlocale.h \
  1788 + /usr/include/qt5/QtCore/qset.h \
  1789 + /usr/include/qt5/QtCore/qcontiguouscache.h \
  1790 + /usr/include/qt5/QtCore/qurl.h \
  1791 + /usr/include/qt5/QtCore/qurlquery.h \
  1792 + /usr/include/qt5/QtCore/qfile.h \
  1793 + /usr/include/qt5/QtCore/qfiledevice.h \
  1794 + /usr/include/qt5/QtGui/qvector2d.h \
  1795 + /usr/include/qt5/QtGui/qtouchdevice.h \
  1796 + /usr/include/qt5/QtWidgets/qtabwidget.h \
  1797 + /usr/include/qt5/QtGui/qicon.h \
  1798 + ../QChatClient/Socket.h \
  1799 + ../QChatClient/SocketException.h \
  1800 + ../QChatClient/loginscreen.h \
  1801 + /usr/include/qt5/QtWidgets/QDialog \
  1802 + /usr/include/qt5/QtWidgets/qdialog.h \
  1803 + /usr/include/qt5/QtCore/QRegExp \
  1804 + ../QChatClient/chatwindow.h \
  1805 + ui_chatroom.h \
  1806 + /usr/include/qt5/QtCore/QVariant \
  1807 + /usr/include/qt5/QtWidgets/QAction \
  1808 + /usr/include/qt5/QtWidgets/qaction.h \
  1809 + /usr/include/qt5/QtWidgets/qactiongroup.h \
  1810 + /usr/include/qt5/QtWidgets/QApplication \
  1811 + /usr/include/qt5/QtWidgets/qapplication.h \
  1812 + /usr/include/qt5/QtCore/qcoreapplication.h \
  1813 + /usr/include/qt5/QtCore/qeventloop.h \
  1814 + /usr/include/qt5/QtWidgets/qdesktopwidget.h \
  1815 + /usr/include/qt5/QtGui/qguiapplication.h \
  1816 + /usr/include/qt5/QtGui/qinputmethod.h \
  1817 + /usr/include/qt5/QtWidgets/QButtonGroup \
  1818 + /usr/include/qt5/QtWidgets/qbuttongroup.h \
  1819 + /usr/include/qt5/QtWidgets/QGridLayout \
  1820 + /usr/include/qt5/QtWidgets/qgridlayout.h \
  1821 + /usr/include/qt5/QtWidgets/qlayout.h \
  1822 + /usr/include/qt5/QtWidgets/qlayoutitem.h \
  1823 + /usr/include/qt5/QtWidgets/qboxlayout.h \
  1824 + /usr/include/qt5/QtWidgets/QHeaderView \
  1825 + /usr/include/qt5/QtWidgets/qheaderview.h \
  1826 + /usr/include/qt5/QtWidgets/qabstractitemview.h \
  1827 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  1828 + /usr/include/qt5/QtWidgets/qframe.h \
  1829 + /usr/include/qt5/QtCore/qabstractitemmodel.h \
  1830 + /usr/include/qt5/QtCore/qitemselectionmodel.h \
  1831 + /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \
  1832 + /usr/include/qt5/QtWidgets/qstyleoption.h \
  1833 + /usr/include/qt5/QtWidgets/qabstractspinbox.h \
  1834 + /usr/include/qt5/QtGui/qvalidator.h \
  1835 + /usr/include/qt5/QtWidgets/qslider.h \
  1836 + /usr/include/qt5/QtWidgets/qabstractslider.h \
  1837 + /usr/include/qt5/QtWidgets/qstyle.h \
  1838 + /usr/include/qt5/QtWidgets/qtabbar.h \
  1839 + /usr/include/qt5/QtWidgets/qrubberband.h \
  1840 + /usr/include/qt5/QtWidgets/QListWidget \
  1841 + /usr/include/qt5/QtWidgets/qlistwidget.h \
  1842 + /usr/include/qt5/QtWidgets/qlistview.h \
  1843 + /usr/include/qt5/QtWidgets/QMenu \
  1844 + /usr/include/qt5/QtWidgets/qmenu.h \
  1845 + /usr/include/qt5/QtWidgets/QMenuBar \
  1846 + /usr/include/qt5/QtWidgets/qmenubar.h \
  1847 + /usr/include/qt5/QtWidgets/QPushButton \
  1848 + /usr/include/qt5/QtWidgets/qpushbutton.h \
  1849 + /usr/include/qt5/QtWidgets/qabstractbutton.h \
  1850 + /usr/include/qt5/QtWidgets/QSplitter \
  1851 + /usr/include/qt5/QtWidgets/qsplitter.h \
  1852 + /usr/include/qt5/QtWidgets/QWidget \
  1853 + ../QChatClient/chatinputtext.h \
  1854 + /usr/include/qt5/QtWidgets/QTextEdit \
  1855 + /usr/include/qt5/QtWidgets/qtextedit.h \
  1856 + /usr/include/qt5/QtGui/qtextdocument.h \
  1857 + /usr/include/qt5/QtGui/qtextoption.h \
  1858 + /usr/include/qt5/QtGui/qtextcursor.h \
  1859 + /usr/include/qt5/QtGui/qtextformat.h \
  1860 + /usr/include/qt5/QtGui/qpen.h \
  1861 + /usr/include/qt5/QtGui/QKeyEvent \
  1862 + ../QChatClient/chatwidget.h
  1863 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatroom.o ../QChatClient/chatroom.cpp
  1864 +
  1865 +Socket.o: ../QChatClient/Socket.cpp ../QChatClient/Socket.h \
  1866 + ../QChatClient/SocketException.h
  1867 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Socket.o ../QChatClient/Socket.cpp
  1868 +
  1869 +chatwidget.o: ../QChatClient/chatwidget.cpp ../QChatClient/chatwidget.h \
  1870 + /usr/include/qt5/QtWidgets/QTextEdit \
  1871 + /usr/include/qt5/QtWidgets/qtextedit.h \
  1872 + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
  1873 + /usr/include/qt5/QtWidgets/qframe.h \
  1874 + /usr/include/qt5/QtWidgets/qwidget.h \
  1875 + /usr/include/qt5/QtGui/qwindowdefs.h \
  1876 + /usr/include/qt5/QtCore/qglobal.h \
  1877 + /usr/include/qt5/QtCore/qconfig.h \
  1878 + /usr/include/qt5/QtCore/qfeatures.h \
  1879 + /usr/include/qt5/QtCore/qsystemdetection.h \
  1880 + /usr/include/qt5/QtCore/qcompilerdetection.h \
  1881 + /usr/include/qt5/QtCore/qprocessordetection.h \
  1882 + /usr/include/qt5/QtCore/qlogging.h \
  1883 + /usr/include/qt5/QtCore/qflags.h \
  1884 + /usr/include/qt5/QtCore/qtypeinfo.h \
  1885 + /usr/include/qt5/QtCore/qtypetraits.h \
  1886 + /usr/include/qt5/QtCore/qsysinfo.h \
  1887 + /usr/include/qt5/QtCore/qobjectdefs.h \
  1888 + /usr/include/qt5/QtCore/qnamespace.h \
  1889 + /usr/include/qt5/QtCore/qobjectdefs_impl.h \
  1890 + /usr/include/qt5/QtGui/qwindowdefs_win.h \
  1891 + /usr/include/qt5/QtCore/qobject.h \
  1892 + /usr/include/qt5/QtCore/qstring.h \
  1893 + /usr/include/qt5/QtCore/qchar.h \
  1894 + /usr/include/qt5/QtCore/qbytearray.h \
  1895 + /usr/include/qt5/QtCore/qrefcount.h \
  1896 + /usr/include/qt5/QtCore/qatomic.h \
  1897 + /usr/include/qt5/QtCore/qbasicatomic.h \
  1898 + /usr/include/qt5/QtCore/qatomic_bootstrap.h \
  1899 + /usr/include/qt5/QtCore/qgenericatomic.h \
  1900 + /usr/include/qt5/QtCore/qatomic_msvc.h \
  1901 + /usr/include/qt5/QtCore/qatomic_integrity.h \
  1902 + /usr/include/qt5/QtCore/qoldbasicatomic.h \
  1903 + /usr/include/qt5/QtCore/qatomic_vxworks.h \
  1904 + /usr/include/qt5/QtCore/qatomic_power.h \
  1905 + /usr/include/qt5/QtCore/qatomic_aarch64.h \
  1906 + /usr/include/qt5/QtCore/qatomic_alpha.h \
  1907 + /usr/include/qt5/QtCore/qatomic_armv7.h \
  1908 + /usr/include/qt5/QtCore/qatomic_armv6.h \
  1909 + /usr/include/qt5/QtCore/qatomic_armv5.h \
  1910 + /usr/include/qt5/QtCore/qatomic_bfin.h \
  1911 + /usr/include/qt5/QtCore/qatomic_ia64.h \
  1912 + /usr/include/qt5/QtCore/qatomic_mips.h \
  1913 + /usr/include/qt5/QtCore/qatomic_s390.h \
  1914 + /usr/include/qt5/QtCore/qatomic_sh4a.h \
  1915 + /usr/include/qt5/QtCore/qatomic_sparc.h \
  1916 + /usr/include/qt5/QtCore/qatomic_x86.h \
  1917 + /usr/include/qt5/QtCore/qatomic_cxx11.h \
  1918 + /usr/include/qt5/QtCore/qatomic_gcc.h \
  1919 + /usr/include/qt5/QtCore/qatomic_unix.h \
  1920 + /usr/include/qt5/QtCore/qarraydata.h \
  1921 + /usr/include/qt5/QtCore/qstringbuilder.h \
  1922 + /usr/include/qt5/QtCore/qlist.h \
  1923 + /usr/include/qt5/QtCore/qalgorithms.h \
  1924 + /usr/include/qt5/QtCore/qiterator.h \
  1925 + /usr/include/qt5/QtCore/qcoreevent.h \
  1926 + /usr/include/qt5/QtCore/qscopedpointer.h \
  1927 + /usr/include/qt5/QtCore/qmetatype.h \
  1928 + /usr/include/qt5/QtCore/qvarlengtharray.h \
  1929 + /usr/include/qt5/QtCore/qcontainerfwd.h \
  1930 + /usr/include/qt5/QtCore/qisenum.h \
  1931 + /usr/include/qt5/QtCore/qobject_impl.h \
  1932 + /usr/include/qt5/QtCore/qmargins.h \
  1933 + /usr/include/qt5/QtGui/qpaintdevice.h \
  1934 + /usr/include/qt5/QtCore/qrect.h \
  1935 + /usr/include/qt5/QtCore/qsize.h \
  1936 + /usr/include/qt5/QtCore/qpoint.h \
  1937 + /usr/include/qt5/QtGui/qpalette.h \
  1938 + /usr/include/qt5/QtGui/qcolor.h \
  1939 + /usr/include/qt5/QtGui/qrgb.h \
  1940 + /usr/include/qt5/QtCore/qstringlist.h \
  1941 + /usr/include/qt5/QtCore/qdatastream.h \
  1942 + /usr/include/qt5/QtCore/qiodevice.h \
  1943 + /usr/include/qt5/QtCore/qpair.h \
  1944 + /usr/include/qt5/QtCore/qregexp.h \
  1945 + /usr/include/qt5/QtCore/qstringmatcher.h \
  1946 + /usr/include/qt5/QtGui/qbrush.h \
  1947 + /usr/include/qt5/QtCore/qvector.h \
  1948 + /usr/include/qt5/QtGui/qmatrix.h \
  1949 + /usr/include/qt5/QtGui/qpolygon.h \
  1950 + /usr/include/qt5/QtGui/qregion.h \
  1951 + /usr/include/qt5/QtCore/qline.h \
  1952 + /usr/include/qt5/QtGui/qtransform.h \
  1953 + /usr/include/qt5/QtGui/qpainterpath.h \
  1954 + /usr/include/qt5/QtGui/qimage.h \
  1955 + /usr/include/qt5/QtGui/qpixmap.h \
  1956 + /usr/include/qt5/QtCore/qsharedpointer.h \
  1957 + /usr/include/qt5/QtCore/qshareddata.h \
  1958 + /usr/include/qt5/QtCore/qsharedpointer_impl.h \
  1959 + /usr/include/qt5/QtCore/qhash.h \
  1960 + /usr/include/qt5/QtGui/qfont.h \
  1961 + /usr/include/qt5/QtGui/qfontmetrics.h \
  1962 + /usr/include/qt5/QtGui/qfontinfo.h \
  1963 + /usr/include/qt5/QtWidgets/qsizepolicy.h \
  1964 + /usr/include/qt5/QtGui/qcursor.h \
  1965 + /usr/include/qt5/QtGui/qkeysequence.h \
  1966 + /usr/include/qt5/QtGui/qevent.h \
  1967 + /usr/include/qt5/QtCore/qvariant.h \
  1968 + /usr/include/qt5/QtCore/qmap.h \
  1969 + /usr/include/qt5/QtCore/qdebug.h \
  1970 + /usr/include/qt5/QtCore/qtextstream.h \
  1971 + /usr/include/qt5/QtCore/qlocale.h \
  1972 + /usr/include/qt5/QtCore/qset.h \
  1973 + /usr/include/qt5/QtCore/qcontiguouscache.h \
  1974 + /usr/include/qt5/QtCore/qurl.h \
  1975 + /usr/include/qt5/QtCore/qurlquery.h \
  1976 + /usr/include/qt5/QtCore/qfile.h \
  1977 + /usr/include/qt5/QtCore/qfiledevice.h \
  1978 + /usr/include/qt5/QtGui/qvector2d.h \
  1979 + /usr/include/qt5/QtGui/qtouchdevice.h \
  1980 + /usr/include/qt5/QtGui/qtextdocument.h \
  1981 + /usr/include/qt5/QtGui/qtextoption.h \
  1982 + /usr/include/qt5/QtGui/qtextcursor.h \
  1983 + /usr/include/qt5/QtGui/qtextformat.h \
  1984 + /usr/include/qt5/QtGui/qpen.h
  1985 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwidget.o ../QChatClient/chatwidget.cpp
  1986 +
  1987 +chatwindow.o: ../QChatClient/chatwindow.cpp ../QChatClient/chatwindow.h \
1457 1988 /usr/include/qt5/QtWidgets/QMainWindow \
1458 1989 /usr/include/qt5/QtWidgets/qmainwindow.h \
1459 1990 /usr/include/qt5/QtWidgets/qwidget.h \
... ... @@ -1564,9 +2095,7 @@ chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \
1564 2095 /usr/include/qt5/QtGui/qtouchdevice.h \
1565 2096 /usr/include/qt5/QtWidgets/qtabwidget.h \
1566 2097 /usr/include/qt5/QtGui/qicon.h \
1567   - ../QChatClient/Socket.h \
1568   - ../QChatClient/SocketException.h \
1569   - ui_chatroom.h \
  2098 + ui_chatwindow.h \
1570 2099 /usr/include/qt5/QtCore/QVariant \
1571 2100 /usr/include/qt5/QtWidgets/QAction \
1572 2101 /usr/include/qt5/QtWidgets/qaction.h \
... ... @@ -1601,11 +2130,18 @@ chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \
1601 2130 /usr/include/qt5/QtWidgets/qstyle.h \
1602 2131 /usr/include/qt5/QtWidgets/qtabbar.h \
1603 2132 /usr/include/qt5/QtWidgets/qrubberband.h \
1604   - /usr/include/qt5/QtWidgets/QListWidget \
1605   - /usr/include/qt5/QtWidgets/qlistwidget.h \
1606   - /usr/include/qt5/QtWidgets/qlistview.h \
  2133 + /usr/include/qt5/QtWidgets/QMenu \
  2134 + /usr/include/qt5/QtWidgets/qmenu.h \
  2135 + /usr/include/qt5/QtWidgets/QMenuBar \
  2136 + /usr/include/qt5/QtWidgets/qmenubar.h \
  2137 + /usr/include/qt5/QtWidgets/QPushButton \
  2138 + /usr/include/qt5/QtWidgets/qpushbutton.h \
  2139 + /usr/include/qt5/QtWidgets/qabstractbutton.h \
  2140 + /usr/include/qt5/QtWidgets/QSpacerItem \
1607 2141 /usr/include/qt5/QtWidgets/QSplitter \
1608 2142 /usr/include/qt5/QtWidgets/qsplitter.h \
  2143 + /usr/include/qt5/QtWidgets/QWidget \
  2144 + ../QChatClient/chatinputtext.h \
1609 2145 /usr/include/qt5/QtWidgets/QTextEdit \
1610 2146 /usr/include/qt5/QtWidgets/qtextedit.h \
1611 2147 /usr/include/qt5/QtGui/qtextdocument.h \
... ... @@ -1613,20 +2149,11 @@ chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \
1613 2149 /usr/include/qt5/QtGui/qtextcursor.h \
1614 2150 /usr/include/qt5/QtGui/qtextformat.h \
1615 2151 /usr/include/qt5/QtGui/qpen.h \
1616   - /usr/include/qt5/QtWidgets/QWidget \
  2152 + /usr/include/qt5/QtGui/QKeyEvent \
1617 2153 ../QChatClient/chatwidget.h
1618   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatroom.o ../QChatClient/chatroom.cpp
1619   -
1620   -Socket.o: ../QChatClient/Socket.cpp ../QChatClient/Socket.h \
1621   - ../QChatClient/SocketException.h
1622   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Socket.o ../QChatClient/Socket.cpp
1623   -
1624   -client.o: ../QChatClient/client.cpp ../QChatClient/client.h \
1625   - ../QChatClient/Socket.h \
1626   - ../QChatClient/SocketException.h
1627   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o client.o ../QChatClient/client.cpp
  2154 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwindow.o ../QChatClient/chatwindow.cpp
1628 2155  
1629   -chatwidget.o: ../QChatClient/chatwidget.cpp ../QChatClient/chatwidget.h \
  2156 +chatinputtext.o: ../QChatClient/chatinputtext.cpp ../QChatClient/chatinputtext.h \
1630 2157 /usr/include/qt5/QtWidgets/QTextEdit \
1631 2158 /usr/include/qt5/QtWidgets/qtextedit.h \
1632 2159 /usr/include/qt5/QtWidgets/qabstractscrollarea.h \
... ... @@ -1741,11 +2268,9 @@ chatwidget.o: ../QChatClient/chatwidget.cpp ../QChatClient/chatwidget.h \
1741 2268 /usr/include/qt5/QtGui/qtextoption.h \
1742 2269 /usr/include/qt5/QtGui/qtextcursor.h \
1743 2270 /usr/include/qt5/QtGui/qtextformat.h \
1744   - /usr/include/qt5/QtGui/qpen.h
1745   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwidget.o ../QChatClient/chatwidget.cpp
1746   -
1747   -moc_chatwindow.o: moc_chatwindow.cpp
1748   - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatwindow.o moc_chatwindow.cpp
  2271 + /usr/include/qt5/QtGui/qpen.h \
  2272 + /usr/include/qt5/QtGui/QKeyEvent
  2273 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatinputtext.o ../QChatClient/chatinputtext.cpp
1749 2274  
1750 2275 moc_loginscreen.o: moc_loginscreen.cpp
1751 2276 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_loginscreen.o moc_loginscreen.cpp
... ... @@ -1756,6 +2281,12 @@ moc_chatroom.o: moc_chatroom.cpp
1756 2281 moc_chatwidget.o: moc_chatwidget.cpp
1757 2282 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatwidget.o moc_chatwidget.cpp
1758 2283  
  2284 +moc_chatwindow.o: moc_chatwindow.cpp
  2285 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatwindow.o moc_chatwindow.cpp
  2286 +
  2287 +moc_chatinputtext.o: moc_chatinputtext.cpp
  2288 + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatinputtext.o moc_chatinputtext.cpp
  2289 +
1759 2290 ####### Install
1760 2291  
1761 2292 install: FORCE
... ...
build-QChatClient-Desktop-Debug/QChatClient
No preview for this file type
build-QChatClient-Desktop-Debug/chatwidget.o
No preview for this file type
build-QChatClient-Desktop-Debug/chatwindow.o
No preview for this file type
build-QChatClient-Desktop-Debug/loginscreen.o
No preview for this file type
build-QChatClient-Desktop-Debug/main.o
No preview for this file type
build-QChatClient-Desktop-Debug/moc_chatroom.cpp
... ... @@ -19,8 +19,8 @@
19 19  
20 20 QT_BEGIN_MOC_NAMESPACE
21 21 struct qt_meta_stringdata_Chatroom_t {
22   - QByteArrayData data[1];
23   - char stringdata[10];
  22 + QByteArrayData data[11];
  23 + char stringdata[118];
24 24 };
25 25 #define QT_MOC_LITERAL(idx, ofs, len) \
26 26 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
... ... @@ -29,9 +29,22 @@ struct qt_meta_stringdata_Chatroom_t {
29 29 )
30 30 static const qt_meta_stringdata_Chatroom_t qt_meta_stringdata_Chatroom = {
31 31 {
32   -QT_MOC_LITERAL(0, 0, 8)
  32 +QT_MOC_LITERAL(0, 0, 8),
  33 +QT_MOC_LITERAL(1, 9, 15),
  34 +QT_MOC_LITERAL(2, 25, 0),
  35 +QT_MOC_LITERAL(3, 26, 4),
  36 +QT_MOC_LITERAL(4, 31, 15),
  37 +QT_MOC_LITERAL(5, 47, 12),
  38 +QT_MOC_LITERAL(6, 60, 7),
  39 +QT_MOC_LITERAL(7, 68, 8),
  40 +QT_MOC_LITERAL(8, 77, 13),
  41 +QT_MOC_LITERAL(9, 91, 6),
  42 +QT_MOC_LITERAL(10, 98, 18)
33 43 },
34   - "Chatroom\0"
  44 + "Chatroom\0threadsFinished\0\0exit\0"
  45 + "messagesToPrint\0startSession\0sendMsg\0"
  46 + "printMsg\0finishThreads\0finish\0"
  47 + "disconnectChatroom\0"
35 48 };
36 49 #undef QT_MOC_LITERAL
37 50  
... ... @@ -41,22 +54,71 @@ static const uint qt_meta_data_Chatroom[] = {
41 54 7, // revision
42 55 0, // classname
43 56 0, 0, // classinfo
44   - 0, 0, // methods
  57 + 8, 14, // methods
45 58 0, 0, // properties
46 59 0, 0, // enums/sets
47 60 0, 0, // constructors
48 61 0, // flags
49   - 0, // signalCount
  62 + 2, // signalCount
  63 +
  64 + // signals: name, argc, parameters, tag, flags
  65 + 1, 1, 54, 2, 0x05,
  66 + 4, 0, 57, 2, 0x05,
  67 +
  68 + // slots: name, argc, parameters, tag, flags
  69 + 5, 0, 58, 2, 0x0a,
  70 + 6, 0, 59, 2, 0x0a,
  71 + 7, 0, 60, 2, 0x0a,
  72 + 8, 1, 61, 2, 0x08,
  73 + 9, 0, 64, 2, 0x08,
  74 + 10, 0, 65, 2, 0x08,
  75 +
  76 + // signals: parameters
  77 + QMetaType::Void, QMetaType::Bool, 3,
  78 + QMetaType::Void,
  79 +
  80 + // slots: parameters
  81 + QMetaType::Void,
  82 + QMetaType::Void,
  83 + QMetaType::Void,
  84 + QMetaType::Void, QMetaType::Bool, 3,
  85 + QMetaType::Void,
  86 + QMetaType::Void,
50 87  
51 88 0 // eod
52 89 };
53 90  
54 91 void Chatroom::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
55 92 {
56   - Q_UNUSED(_o);
57   - Q_UNUSED(_id);
58   - Q_UNUSED(_c);
59   - Q_UNUSED(_a);
  93 + if (_c == QMetaObject::InvokeMetaMethod) {
  94 + Chatroom *_t = static_cast<Chatroom *>(_o);
  95 + switch (_id) {
  96 + case 0: _t->threadsFinished((*reinterpret_cast< bool(*)>(_a[1]))); break;
  97 + case 1: _t->messagesToPrint(); break;
  98 + case 2: _t->startSession(); break;
  99 + case 3: _t->sendMsg(); break;
  100 + case 4: _t->printMsg(); break;
  101 + case 5: _t->finishThreads((*reinterpret_cast< bool(*)>(_a[1]))); break;
  102 + case 6: _t->finish(); break;
  103 + case 7: _t->disconnectChatroom(); break;
  104 + default: ;
  105 + }
  106 + } else if (_c == QMetaObject::IndexOfMethod) {
  107 + int *result = reinterpret_cast<int *>(_a[0]);
  108 + void **func = reinterpret_cast<void **>(_a[1]);
  109 + {
  110 + typedef void (Chatroom::*_t)(bool );
  111 + if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Chatroom::threadsFinished)) {
  112 + *result = 0;
  113 + }
  114 + }
  115 + {
  116 + typedef void (Chatroom::*_t)();
  117 + if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Chatroom::messagesToPrint)) {
  118 + *result = 1;
  119 + }
  120 + }
  121 + }
60 122 }
61 123  
62 124 const QMetaObject Chatroom::staticMetaObject = {
... ... @@ -83,6 +145,28 @@ int Chatroom::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 145 _id = QMainWindow::qt_metacall(_c, _id, _a);
84 146 if (_id < 0)
85 147 return _id;
  148 + if (_c == QMetaObject::InvokeMetaMethod) {
  149 + if (_id < 8)
  150 + qt_static_metacall(this, _c, _id, _a);
  151 + _id -= 8;
  152 + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
  153 + if (_id < 8)
  154 + *reinterpret_cast<int*>(_a[0]) = -1;
  155 + _id -= 8;
  156 + }
86 157 return _id;
87 158 }
  159 +
  160 +// SIGNAL 0
  161 +void Chatroom::threadsFinished(bool _t1)
  162 +{
  163 + void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
  164 + QMetaObject::activate(this, &staticMetaObject, 0, _a);
  165 +}
  166 +
  167 +// SIGNAL 1
  168 +void Chatroom::messagesToPrint()
  169 +{
  170 + QMetaObject::activate(this, &staticMetaObject, 1, 0);
  171 +}
88 172 QT_END_MOC_NAMESPACE
... ...
build-QChatClient-Desktop-Debug/moc_chatroom.o
No preview for this file type
build-QChatClient-Desktop-Debug/moc_chatwidget.o
No preview for this file type
build-QChatClient-Desktop-Debug/moc_chatwindow.o
No preview for this file type
build-QChatClient-Desktop-Debug/moc_loginscreen.cpp
... ... @@ -19,8 +19,8 @@
19 19  
20 20 QT_BEGIN_MOC_NAMESPACE
21 21 struct qt_meta_stringdata_LoginScreen_t {
22   - QByteArrayData data[1];
23   - char stringdata[13];
  22 + QByteArrayData data[4];
  23 + char stringdata[40];
24 24 };
25 25 #define QT_MOC_LITERAL(idx, ofs, len) \
26 26 Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
... ... @@ -29,9 +29,12 @@ struct qt_meta_stringdata_LoginScreen_t {
29 29 )
30 30 static const qt_meta_stringdata_LoginScreen_t qt_meta_stringdata_LoginScreen = {
31 31 {
32   -QT_MOC_LITERAL(0, 0, 11)
  32 +QT_MOC_LITERAL(0, 0, 11),
  33 +QT_MOC_LITERAL(1, 12, 13),
  34 +QT_MOC_LITERAL(2, 26, 0),
  35 +QT_MOC_LITERAL(3, 27, 11)
33 36 },
34   - "LoginScreen\0"
  37 + "LoginScreen\0connectToChat\0\0cancelLogin\0"
35 38 };
36 39 #undef QT_MOC_LITERAL
37 40  
... ... @@ -41,21 +44,34 @@ static const uint qt_meta_data_LoginScreen[] = {
41 44 7, // revision
42 45 0, // classname
43 46 0, 0, // classinfo
44   - 0, 0, // methods
  47 + 2, 14, // methods
45 48 0, 0, // properties
46 49 0, 0, // enums/sets
47 50 0, 0, // constructors
48 51 0, // flags
49 52 0, // signalCount
50 53  
  54 + // slots: name, argc, parameters, tag, flags
  55 + 1, 0, 24, 2, 0x0a,
  56 + 3, 0, 25, 2, 0x0a,
  57 +
  58 + // slots: parameters
  59 + QMetaType::Void,
  60 + QMetaType::Void,
  61 +
51 62 0 // eod
52 63 };
53 64  
54 65 void LoginScreen::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
55 66 {
56   - Q_UNUSED(_o);
57   - Q_UNUSED(_id);
58   - Q_UNUSED(_c);
  67 + if (_c == QMetaObject::InvokeMetaMethod) {
  68 + LoginScreen *_t = static_cast<LoginScreen *>(_o);
  69 + switch (_id) {
  70 + case 0: _t->connectToChat(); break;
  71 + case 1: _t->cancelLogin(); break;
  72 + default: ;
  73 + }
  74 + }
59 75 Q_UNUSED(_a);
60 76 }
61 77  
... ... @@ -83,6 +99,15 @@ int LoginScreen::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 99 _id = QDialog::qt_metacall(_c, _id, _a);
84 100 if (_id < 0)
85 101 return _id;
  102 + if (_c == QMetaObject::InvokeMetaMethod) {
  103 + if (_id < 2)
  104 + qt_static_metacall(this, _c, _id, _a);
  105 + _id -= 2;
  106 + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
  107 + if (_id < 2)
  108 + *reinterpret_cast<int*>(_a[0]) = -1;
  109 + _id -= 2;
  110 + }
86 111 return _id;
87 112 }
88 113 QT_END_MOC_NAMESPACE
... ...
build-QChatClient-Desktop-Debug/moc_loginscreen.o
No preview for this file type
build-QChatClient-Desktop-Debug/ui_chatroom.h
... ... @@ -17,9 +17,12 @@
17 17 #include <QtWidgets/QHeaderView>
18 18 #include <QtWidgets/QListWidget>
19 19 #include <QtWidgets/QMainWindow>
  20 +#include <QtWidgets/QMenu>
  21 +#include <QtWidgets/QMenuBar>
  22 +#include <QtWidgets/QPushButton>
20 23 #include <QtWidgets/QSplitter>
21   -#include <QtWidgets/QTextEdit>
22 24 #include <QtWidgets/QWidget>
  25 +#include "chatinputtext.h"
23 26 #include "chatwidget.h"
24 27  
25 28 QT_BEGIN_NAMESPACE
... ... @@ -27,6 +30,9 @@ QT_BEGIN_NAMESPACE
27 30 class Ui_Chatroom
28 31 {
29 32 public:
  33 + QAction *actionConnect;
  34 + QAction *actionExit;
  35 + QAction *actionDisconnect;
30 36 QWidget *centralwidget;
31 37 QGridLayout *gridLayout_2;
32 38 QSplitter *windowSplitter;
... ... @@ -34,14 +40,23 @@ public:
34 40 QGridLayout *gridLayout;
35 41 QSplitter *chatSplitter;
36 42 ChatWidget *chatText;
37   - QTextEdit *inputText;
  43 + chatInputText *inputText;
38 44 QListWidget *userList;
  45 + QPushButton *sendButton;
  46 + QMenuBar *menuBar;
  47 + QMenu *menuChat;
39 48  
40 49 void setupUi(QMainWindow *Chatroom)
41 50 {
42 51 if (Chatroom->objectName().isEmpty())
43 52 Chatroom->setObjectName(QStringLiteral("Chatroom"));
44 53 Chatroom->resize(800, 600);
  54 + actionConnect = new QAction(Chatroom);
  55 + actionConnect->setObjectName(QStringLiteral("actionConnect"));
  56 + actionExit = new QAction(Chatroom);
  57 + actionExit->setObjectName(QStringLiteral("actionExit"));
  58 + actionDisconnect = new QAction(Chatroom);
  59 + actionDisconnect->setObjectName(QStringLiteral("actionDisconnect"));
45 60 centralwidget = new QWidget(Chatroom);
46 61 centralwidget->setObjectName(QStringLiteral("centralwidget"));
47 62 gridLayout_2 = new QGridLayout(centralwidget);
... ... @@ -60,9 +75,9 @@ public:
60 75 chatSplitter->setOrientation(Qt::Vertical);
61 76 chatText = new ChatWidget(chatSplitter);
62 77 chatText->setObjectName(QStringLiteral("chatText"));
63   - chatText->setReadOnly(true);
  78 + chatText->setReadOnly(false);
64 79 chatSplitter->addWidget(chatText);
65   - inputText = new QTextEdit(chatSplitter);
  80 + inputText = new chatInputText(chatSplitter);
66 81 inputText->setObjectName(QStringLiteral("inputText"));
67 82 QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored);
68 83 sizePolicy.setHorizontalStretch(0);
... ... @@ -70,6 +85,7 @@ public:
70 85 sizePolicy.setHeightForWidth(inputText->sizePolicy().hasHeightForWidth());
71 86 inputText->setSizePolicy(sizePolicy);
72 87 inputText->setMaximumSize(QSize(16777215, 16777215));
  88 + inputText->setReadOnly(true);
73 89 chatSplitter->addWidget(inputText);
74 90  
75 91 gridLayout->addWidget(chatSplitter, 0, 0, 1, 1);
... ... @@ -88,7 +104,28 @@ public:
88 104  
89 105 gridLayout_2->addWidget(windowSplitter, 0, 0, 1, 1);
90 106  
  107 + sendButton = new QPushButton(centralwidget);
  108 + sendButton->setObjectName(QStringLiteral("sendButton"));
  109 + QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Fixed);
  110 + sizePolicy2.setHorizontalStretch(0);
  111 + sizePolicy2.setVerticalStretch(0);
  112 + sizePolicy2.setHeightForWidth(sendButton->sizePolicy().hasHeightForWidth());
  113 + sendButton->setSizePolicy(sizePolicy2);
  114 +
  115 + gridLayout_2->addWidget(sendButton, 1, 0, 1, 1);
  116 +
91 117 Chatroom->setCentralWidget(centralwidget);
  118 + menuBar = new QMenuBar(Chatroom);
  119 + menuBar->setObjectName(QStringLiteral("menuBar"));
  120 + menuBar->setGeometry(QRect(0, 0, 800, 26));
  121 + menuChat = new QMenu(menuBar);
  122 + menuChat->setObjectName(QStringLiteral("menuChat"));
  123 + Chatroom->setMenuBar(menuBar);
  124 +
  125 + menuBar->addAction(menuChat->menuAction());
  126 + menuChat->addAction(actionConnect);
  127 + menuChat->addAction(actionDisconnect);
  128 + menuChat->addAction(actionExit);
92 129  
93 130 retranslateUi(Chatroom);
94 131  
... ... @@ -97,7 +134,12 @@ public:
97 134  
98 135 void retranslateUi(QMainWindow *Chatroom)
99 136 {
100   - Chatroom->setWindowTitle(QApplication::translate("Chatroom", "MainWindow", 0));
  137 + Chatroom->setWindowTitle(QApplication::translate("Chatroom", "QChatClient", 0));
  138 + actionConnect->setText(QApplication::translate("Chatroom", "Connect...", 0));
  139 + actionExit->setText(QApplication::translate("Chatroom", "Exit", 0));
  140 + actionDisconnect->setText(QApplication::translate("Chatroom", "Disconnect", 0));
  141 + sendButton->setText(QApplication::translate("Chatroom", "Send", 0));
  142 + menuChat->setTitle(QApplication::translate("Chatroom", "Chat", 0));
101 143 } // retranslateUi
102 144  
103 145 };
... ...
build-QChatClient-Desktop-Debug/ui_chatwindow.h
... ... @@ -16,10 +16,13 @@
16 16 #include <QtWidgets/QGridLayout>
17 17 #include <QtWidgets/QHeaderView>
18 18 #include <QtWidgets/QMainWindow>
  19 +#include <QtWidgets/QMenu>
19 20 #include <QtWidgets/QMenuBar>
  21 +#include <QtWidgets/QPushButton>
  22 +#include <QtWidgets/QSpacerItem>
20 23 #include <QtWidgets/QSplitter>
21   -#include <QtWidgets/QTextEdit>
22 24 #include <QtWidgets/QWidget>
  25 +#include "chatinputtext.h"
23 26 #include "chatwidget.h"
24 27  
25 28 QT_BEGIN_NAMESPACE
... ... @@ -27,18 +30,26 @@ QT_BEGIN_NAMESPACE
27 30 class Ui_ChatWindow
28 31 {
29 32 public:
  33 + QAction *actionExit;
30 34 QWidget *centralWidget;
31 35 QGridLayout *gridLayout;
  36 + QSpacerItem *horizontalSpacer;
  37 + QPushButton *sendButton;
  38 + QWidget *widget;
  39 + QGridLayout *gridLayout_2;
32 40 QSplitter *splitter;
33 41 ChatWidget *chatText;
34   - QTextEdit *inputText;
  42 + chatInputText *inputText;
35 43 QMenuBar *menuBar;
  44 + QMenu *menuChat;
36 45  
37 46 void setupUi(QMainWindow *ChatWindow)
38 47 {
39 48 if (ChatWindow->objectName().isEmpty())
40 49 ChatWindow->setObjectName(QStringLiteral("ChatWindow"));
41 50 ChatWindow->resize(400, 502);
  51 + actionExit = new QAction(ChatWindow);
  52 + actionExit->setObjectName(QStringLiteral("actionExit"));
42 53 centralWidget = new QWidget(ChatWindow);
43 54 centralWidget->setObjectName(QStringLiteral("centralWidget"));
44 55 centralWidget->setEnabled(true);
... ... @@ -51,34 +62,63 @@ public:
51 62 gridLayout->setSpacing(6);
52 63 gridLayout->setContentsMargins(11, 11, 11, 11);
53 64 gridLayout->setObjectName(QStringLiteral("gridLayout"));
54   - splitter = new QSplitter(centralWidget);
  65 + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
  66 +
  67 + gridLayout->addItem(horizontalSpacer, 3, 1, 1, 1);
  68 +
  69 + sendButton = new QPushButton(centralWidget);
  70 + sendButton->setObjectName(QStringLiteral("sendButton"));
  71 + QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed);
  72 + sizePolicy1.setHorizontalStretch(0);
  73 + sizePolicy1.setVerticalStretch(0);
  74 + sizePolicy1.setHeightForWidth(sendButton->sizePolicy().hasHeightForWidth());
  75 + sendButton->setSizePolicy(sizePolicy1);
  76 +
  77 + gridLayout->addWidget(sendButton, 3, 0, 1, 1);
  78 +
  79 + widget = new QWidget(centralWidget);
  80 + widget->setObjectName(QStringLiteral("widget"));
  81 + gridLayout_2 = new QGridLayout(widget);
  82 + gridLayout_2->setSpacing(6);
  83 + gridLayout_2->setContentsMargins(11, 11, 11, 11);
  84 + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
  85 + splitter = new QSplitter(widget);
55 86 splitter->setObjectName(QStringLiteral("splitter"));
56 87 splitter->setOrientation(Qt::Vertical);
57 88 chatText = new ChatWidget(splitter);
58 89 chatText->setObjectName(QStringLiteral("chatText"));
59 90 chatText->setReadOnly(true);
60 91 splitter->addWidget(chatText);
61   - inputText = new QTextEdit(splitter);
  92 + inputText = new chatInputText(splitter);
62 93 inputText->setObjectName(QStringLiteral("inputText"));
63 94 inputText->setEnabled(true);
64   - QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Ignored);
65   - sizePolicy1.setHorizontalStretch(0);
66   - sizePolicy1.setVerticalStretch(0);
67   - sizePolicy1.setHeightForWidth(inputText->sizePolicy().hasHeightForWidth());
68   - inputText->setSizePolicy(sizePolicy1);
  95 + QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Ignored);
  96 + sizePolicy2.setHorizontalStretch(0);
  97 + sizePolicy2.setVerticalStretch(0);
  98 + sizePolicy2.setHeightForWidth(inputText->sizePolicy().hasHeightForWidth());
  99 + inputText->setSizePolicy(sizePolicy2);
69 100 inputText->setMinimumSize(QSize(0, 0));
70 101 inputText->setMaximumSize(QSize(16777215, 16777215));
71 102 inputText->setBaseSize(QSize(0, 0));
  103 + inputText->setReadOnly(true);
72 104 splitter->addWidget(inputText);
73 105  
74   - gridLayout->addWidget(splitter, 0, 0, 1, 1);
  106 + gridLayout_2->addWidget(splitter, 0, 0, 1, 1);
  107 +
  108 +
  109 + gridLayout->addWidget(widget, 0, 0, 1, 2);
75 110  
76 111 ChatWindow->setCentralWidget(centralWidget);
77 112 menuBar = new QMenuBar(ChatWindow);
78 113 menuBar->setObjectName(QStringLiteral("menuBar"));
79   - menuBar->setGeometry(QRect(0, 0, 400, 25));
  114 + menuBar->setGeometry(QRect(0, 0, 400, 26));
  115 + menuChat = new QMenu(menuBar);
  116 + menuChat->setObjectName(QStringLiteral("menuChat"));
80 117 ChatWindow->setMenuBar(menuBar);
81 118  
  119 + menuBar->addAction(menuChat->menuAction());
  120 + menuChat->addAction(actionExit);
  121 +
82 122 retranslateUi(ChatWindow);
83 123  
84 124 QMetaObject::connectSlotsByName(ChatWindow);
... ... @@ -86,7 +126,10 @@ public:
86 126  
87 127 void retranslateUi(QMainWindow *ChatWindow)
88 128 {
89   - ChatWindow->setWindowTitle(QApplication::translate("ChatWindow", "ChatWindow", 0));
  129 + ChatWindow->setWindowTitle(QApplication::translate("ChatWindow", "QChatClient", 0));
  130 + actionExit->setText(QApplication::translate("ChatWindow", "Exit", 0));
  131 + sendButton->setText(QApplication::translate("ChatWindow", "Send", 0));
  132 + menuChat->setTitle(QApplication::translate("ChatWindow", "Chat", 0));
90 133 } // retranslateUi
91 134  
92 135 };
... ...
build-QChatClient-Desktop-Debug/ui_loginscreen.h
... ... @@ -28,24 +28,25 @@ class Ui_LoginScreen
28 28 {
29 29 public:
30 30 QGridLayout *gridLayout;
  31 + QLineEdit *serverURLEdit;
  32 + QSpacerItem *topSpacer;
31 33 QLabel *titleLabel;
  34 + QSpacerItem *verticalSpacer;
  35 + QSpacerItem *rightSpacer;
  36 + QSpacerItem *leftSpacer;
  37 + QLineEdit *nickEdit;
32 38 QWidget *buttonBox;
33 39 QGridLayout *gridLayout_2;
34   - QPushButton *cancelButton;
35 40 QPushButton *connectButton;
  41 + QPushButton *cancelButton;
36 42 QSpacerItem *buttonHorizSpacer;
37   - QSpacerItem *verticalSpacer;
38   - QSpacerItem *topSpacer;
39   - QSpacerItem *leftSpacer;
40   - QLineEdit *nickEdit;
41   - QLineEdit *serverURLEdit;
42   - QSpacerItem *rightSpacer;
  43 + QLabel *label;
43 44  
44 45 void setupUi(QDialog *LoginScreen)
45 46 {
46 47 if (LoginScreen->objectName().isEmpty())
47 48 LoginScreen->setObjectName(QStringLiteral("LoginScreen"));
48   - LoginScreen->resize(402, 173);
  49 + LoginScreen->resize(402, 206);
49 50 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
50 51 sizePolicy.setHorizontalStretch(0);
51 52 sizePolicy.setVerticalStretch(0);
... ... @@ -53,6 +54,15 @@ public:
53 54 LoginScreen->setSizePolicy(sizePolicy);
54 55 gridLayout = new QGridLayout(LoginScreen);
55 56 gridLayout->setObjectName(QStringLiteral("gridLayout"));
  57 + serverURLEdit = new QLineEdit(LoginScreen);
  58 + serverURLEdit->setObjectName(QStringLiteral("serverURLEdit"));
  59 +
  60 + gridLayout->addWidget(serverURLEdit, 4, 1, 1, 1);
  61 +
  62 + topSpacer = new QSpacerItem(20, 5, QSizePolicy::Minimum, QSizePolicy::Fixed);
  63 +
  64 + gridLayout->addItem(topSpacer, 0, 1, 1, 1);
  65 +
56 66 titleLabel = new QLabel(LoginScreen);
57 67 titleLabel->setObjectName(QStringLiteral("titleLabel"));
58 68 QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum);
... ... @@ -64,36 +74,13 @@ public:
64 74  
65 75 gridLayout->addWidget(titleLabel, 1, 1, 1, 1);
66 76  
67   - buttonBox = new QWidget(LoginScreen);
68   - buttonBox->setObjectName(QStringLiteral("buttonBox"));
69   - sizePolicy1.setHeightForWidth(buttonBox->sizePolicy().hasHeightForWidth());
70   - buttonBox->setSizePolicy(sizePolicy1);
71   - gridLayout_2 = new QGridLayout(buttonBox);
72   - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
73   - cancelButton = new QPushButton(buttonBox);
74   - cancelButton->setObjectName(QStringLiteral("cancelButton"));
75   -
76   - gridLayout_2->addWidget(cancelButton, 0, 2, 1, 1);
77   -
78   - connectButton = new QPushButton(buttonBox);
79   - connectButton->setObjectName(QStringLiteral("connectButton"));
80   -
81   - gridLayout_2->addWidget(connectButton, 0, 1, 1, 1);
82   -
83   - buttonHorizSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
84   -
85   - gridLayout_2->addItem(buttonHorizSpacer, 0, 0, 1, 1);
86   -
87   -
88   - gridLayout->addWidget(buttonBox, 7, 1, 1, 1);
89   -
90 77 verticalSpacer = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed);
91 78  
92 79 gridLayout->addItem(verticalSpacer, 2, 1, 1, 1);
93 80  
94   - topSpacer = new QSpacerItem(20, 5, QSizePolicy::Minimum, QSizePolicy::Fixed);
  81 + rightSpacer = new QSpacerItem(10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum);
95 82  
96   - gridLayout->addItem(topSpacer, 0, 1, 1, 1);
  83 + gridLayout->addItem(rightSpacer, 4, 2, 1, 1);
97 84  
98 85 leftSpacer = new QSpacerItem(10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum);
99 86  
... ... @@ -104,15 +91,38 @@ public:
104 91  
105 92 gridLayout->addWidget(nickEdit, 3, 1, 1, 1);
106 93  
107   - serverURLEdit = new QLineEdit(LoginScreen);
108   - serverURLEdit->setObjectName(QStringLiteral("serverURLEdit"));
  94 + buttonBox = new QWidget(LoginScreen);
  95 + buttonBox->setObjectName(QStringLiteral("buttonBox"));
  96 + sizePolicy1.setHeightForWidth(buttonBox->sizePolicy().hasHeightForWidth());
  97 + buttonBox->setSizePolicy(sizePolicy1);
  98 + gridLayout_2 = new QGridLayout(buttonBox);
  99 + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
  100 + connectButton = new QPushButton(buttonBox);
  101 + connectButton->setObjectName(QStringLiteral("connectButton"));
109 102  
110   - gridLayout->addWidget(serverURLEdit, 4, 1, 1, 1);
  103 + gridLayout_2->addWidget(connectButton, 1, 1, 1, 1);
111 104  
112   - rightSpacer = new QSpacerItem(10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum);
  105 + cancelButton = new QPushButton(buttonBox);
  106 + cancelButton->setObjectName(QStringLiteral("cancelButton"));
113 107  
114   - gridLayout->addItem(rightSpacer, 4, 2, 1, 1);
  108 + gridLayout_2->addWidget(cancelButton, 1, 2, 1, 1);
  109 +
  110 + buttonHorizSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
  111 +
  112 + gridLayout_2->addItem(buttonHorizSpacer, 1, 0, 1, 1);
  113 +
  114 + label = new QLabel(buttonBox);
  115 + label->setObjectName(QStringLiteral("label"));
  116 + label->setEnabled(true);
115 117  
  118 + gridLayout_2->addWidget(label, 0, 0, 1, 1);
  119 +
  120 +
  121 + gridLayout->addWidget(buttonBox, 7, 1, 1, 1);
  122 +
  123 + QWidget::setTabOrder(nickEdit, serverURLEdit);
  124 + QWidget::setTabOrder(serverURLEdit, connectButton);
  125 + QWidget::setTabOrder(connectButton, cancelButton);
116 126  
117 127 retranslateUi(LoginScreen);
118 128  
... ... @@ -123,8 +133,9 @@ public:
123 133 {
124 134 LoginScreen->setWindowTitle(QApplication::translate("LoginScreen", "Login", 0));
125 135 titleLabel->setText(QApplication::translate("LoginScreen", "Log in to chatroom", 0));
126   - cancelButton->setText(QApplication::translate("LoginScreen", "Cancel", 0));
127 136 connectButton->setText(QApplication::translate("LoginScreen", "OK", 0));
  137 + cancelButton->setText(QApplication::translate("LoginScreen", "Cancel", 0));
  138 + label->setText(QApplication::translate("LoginScreen", "INVALID HOSTNAME", 0));
128 139 } // retranslateUi
129 140  
130 141 };
... ...