diff --git a/JChatServer/bin/pad/prac2/JChat.class b/JChatServer/bin/pad/prac2/JChat.class deleted file mode 100644 index 5c8923a..0000000 --- a/JChatServer/bin/pad/prac2/JChat.class +++ /dev/null diff --git a/JChatServer/.classpath b/JChatServerV2/.classpath index fb565a5..fb565a5 100644 --- a/JChatServer/.classpath +++ b/JChatServerV2/.classpath diff --git a/JChatServer/.project b/JChatServerV2/.project index 28dac34..28dac34 100644 --- a/JChatServer/.project +++ b/JChatServerV2/.project diff --git a/JChatServer/.settings/org.eclipse.jdt.core.prefs b/JChatServerV2/.settings/org.eclipse.jdt.core.prefs index 7341ab1..7341ab1 100644 --- a/JChatServer/.settings/org.eclipse.jdt.core.prefs +++ b/JChatServerV2/.settings/org.eclipse.jdt.core.prefs diff --git a/JChatServer/bin/pad/prac2/ChatException.class b/JChatServerV2/bin/pad/prac2/ChatException.class index 0e0d11e..0e0d11e 100644 --- a/JChatServer/bin/pad/prac2/ChatException.class +++ b/JChatServerV2/bin/pad/prac2/ChatException.class diff --git a/JChatServer/bin/pad/prac2/Connection.class b/JChatServerV2/bin/pad/prac2/Connection.class index 53b85cd..60fd918 100644 --- a/JChatServer/bin/pad/prac2/Connection.class +++ b/JChatServerV2/bin/pad/prac2/Connection.class diff --git a/JChatServer/bin/pad/prac2/JChat$1.class b/JChatServerV2/bin/pad/prac2/JChat$1.class index e8fef6f..b020840 100644 --- a/JChatServer/bin/pad/prac2/JChat$1.class +++ b/JChatServerV2/bin/pad/prac2/JChat$1.class diff --git a/JChatServerV2/bin/pad/prac2/JChat.class b/JChatServerV2/bin/pad/prac2/JChat.class new file mode 100644 index 0000000..81345fb --- /dev/null +++ b/JChatServerV2/bin/pad/prac2/JChat.class diff --git a/JChatServer/bin/pad/prac2/MyServerSocket.class b/JChatServerV2/bin/pad/prac2/MyServerSocket.class index 97d4974..97d4974 100644 --- a/JChatServer/bin/pad/prac2/MyServerSocket.class +++ b/JChatServerV2/bin/pad/prac2/MyServerSocket.class diff --git a/JChatServer/bin/pad/prac2/MySocket.class b/JChatServerV2/bin/pad/prac2/MySocket.class index ea93697..ea93697 100644 --- a/JChatServer/bin/pad/prac2/MySocket.class +++ b/JChatServerV2/bin/pad/prac2/MySocket.class diff --git a/JChatServer/bin/pad/prac2/Server.class b/JChatServerV2/bin/pad/prac2/Server.class index a6de29a..62938a8 100644 --- a/JChatServer/bin/pad/prac2/Server.class +++ b/JChatServerV2/bin/pad/prac2/Server.class diff --git a/JChatServer/src/pad/prac2/ChatException.java b/JChatServerV2/src/pad/prac2/ChatException.java index ab9017e..ab9017e 100644 --- a/JChatServer/src/pad/prac2/ChatException.java +++ b/JChatServerV2/src/pad/prac2/ChatException.java diff --git a/JChatServer/src/pad/prac2/Connection.java b/JChatServerV2/src/pad/prac2/Connection.java index 3d8c263..fda5ab6 100644 --- a/JChatServer/src/pad/prac2/Connection.java +++ b/JChatServerV2/src/pad/prac2/Connection.java @@ -69,18 +69,23 @@ public class Connection extends Thread try { str = socket.recvMsg(); - while(str.contains(" ")) + if(str.contains(" ")) { socket.sendMsg("CHATNICKINVALID"); - str = socket.recvMsg(); + kill = true; + continue; } - while(serv.isOnline(str)) + else if(serv.isOnline(str)) { socket.sendMsg("CHATNICKEXIST"); - str = socket.recvMsg(); + kill = true; + continue; + } + else + { + socket.sendMsg("CHATOK"); + serv.addToChatroom(this, str); } - socket.sendMsg("CHATOK"); - serv.addToChatroom(this, str); } catch (IOException e) { @@ -96,23 +101,24 @@ public class Connection extends Thread { try { - str = "/disconnect"; + str = "0/disconnect"; str = socket.recvMsg(); + str = str.substring(1); if(str.equals("/disconnect")) { - socket.sendMsg("DISC_OK"); + socket.sendMsg("0DISC_OK"); System.out.println(serv.getNickname(this) + " disconnected"); break; } else if(str.equals("/exit")) { - socket.sendMsg("EXIT_OK"); + socket.sendMsg("0EXIT_OK"); System.out.println(serv.getNickname(this) + " disconnected"); break; } else if(str.equals("/who")) { - socket.sendMsg(serv.listOnline()); + socket.sendMsg("0" + serv.listOnline()); } else if(str.startsWith("@")) { @@ -120,16 +126,16 @@ public class Connection extends Thread { if(!str.contains(" ")) { - serv.sendTo(this,str.substring(1),""); + serv.sendTo(this,str.substring(1),"1"); } else { - serv.sendTo(this,str.substring(1,str.indexOf(' ')),str.substring(str.indexOf(' ')+1)); + serv.sendTo(this,"1"+str.substring(1,str.indexOf(' ')),str.substring(str.indexOf(' ')+1)); } } catch(ChatException cE) { - socket.sendMsg(cE.getMessage()); + socket.sendMsg("0"+cE.getMessage()); } } else diff --git a/JChatServer/src/pad/prac2/JChat.java b/JChatServerV2/src/pad/prac2/JChat.java index a906273..907b3a4 100644 --- a/JChatServer/src/pad/prac2/JChat.java +++ b/JChatServerV2/src/pad/prac2/JChat.java @@ -8,14 +8,17 @@ public class JChat { String ip; int port, roomSize; - Scanner in = new Scanner(System.in); + /*Scanner in = new Scanner(System.in); System.out.print("IP: "); ip = in.nextLine(); System.out.print("Port: "); port = in.nextInt(); System.out.print("Size of chatroom: "); roomSize = in.nextInt(); - in.close(); + in.close();*/ + ip = "localhost"; + port = 3001; + roomSize = 5; final Server serv = new Server(ip,port,roomSize); Runtime.getRuntime().addShutdownHook(new Thread() { diff --git a/JChatServer/src/pad/prac2/MyServerSocket.java b/JChatServerV2/src/pad/prac2/MyServerSocket.java index ae9a6e3..ae9a6e3 100644 --- a/JChatServer/src/pad/prac2/MyServerSocket.java +++ b/JChatServerV2/src/pad/prac2/MyServerSocket.java diff --git a/JChatServer/src/pad/prac2/MySocket.java b/JChatServerV2/src/pad/prac2/MySocket.java index 26d367b..26d367b 100644 --- a/JChatServer/src/pad/prac2/MySocket.java +++ b/JChatServerV2/src/pad/prac2/MySocket.java diff --git a/JChatServer/src/pad/prac2/Server.java b/JChatServerV2/src/pad/prac2/Server.java index 4d860de..2b34466 100644 --- a/JChatServer/src/pad/prac2/Server.java +++ b/JChatServerV2/src/pad/prac2/Server.java @@ -134,7 +134,7 @@ public class Server conn = it.next(); if(conn != origin) { - conn.sendMessage(nickname + ": " + message); + conn.sendMessage("0"+nickname + ": " + message); } } lock.unlock(); @@ -145,15 +145,38 @@ public class Server return activeConnections.get(c); } + public void notifyAllConnections() + { + lock.lock(); + Set connections = activeConnections.keySet(); + Iterator it = connections.iterator(); + Connection conn; + while(it.hasNext()) + { + conn = it.next(); + try + { + conn.sendMessage("USERLIST:"+nickList()); + } + catch(IOException ioExc) + { + System.out.println("TCP: Error writing to socket"); + } + } + lock.unlock(); + } + public void addToChatroom(Connection c, String nickName) { activeConnections.put(c, nickName); System.out.println(nickName + " has entered the room"); + notifyAllConnections(); } private void removeFromChatroom(Connection c) { activeConnections.remove(c); + notifyAllConnections(); } public boolean isOnline(String nick) @@ -165,15 +188,22 @@ public class Server { lock.lock(); String ret = new Integer(activeConnections.size()).toString(); - ret += " people currently online:"; + ret += " people currently online:\n"; + ret += nickList(); + lock.unlock(); + return ret; + } + + public String nickList() + { + String ret = ""; Collection nickNames = activeConnections.values(); Iterator it = nickNames.iterator(); while(it.hasNext()) { - ret += "\n"; ret += it.next(); + ret += "\n"; } - lock.unlock(); return ret; } diff --git a/QChatClient/QChatClient.pro b/QChatClient/QChatClient.pro index c970da3..4eef058 100644 --- a/QChatClient/QChatClient.pro +++ b/QChatClient/QChatClient.pro @@ -13,21 +13,24 @@ TEMPLATE = app SOURCES += main.cpp\ - chatwindow.cpp \ loginscreen.cpp \ chatroom.cpp \ Socket.cpp \ - chatwidget.cpp + chatwidget.cpp \ + chatwindow.cpp \ + chatinputtext.cpp -HEADERS += chatwindow.h \ +HEADERS += \ loginscreen.h \ chatroom.h \ SocketException.h \ Socket.h \ - chatwidget.h + chatwidget.h \ + chatwindow.h \ + chatinputtext.h FORMS += chatwindow.ui \ loginscreen.ui \ chatroom.ui -LIBS += -lpthread +QMAKE_CXXFLAGS += -std=c++11 diff --git a/QChatClient/QChatClient.pro.user b/QChatClient/QChatClient.pro.user index 01dd7af..8e46c2c 100644 --- a/QChatClient/QChatClient.pro.user +++ b/QChatClient/QChatClient.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget @@ -53,7 +53,7 @@ Desktop Desktop - {430bae4e-c8d6-488c-936e-c89fd5587cd0} + {d6a12d1a-dee4-4341-8f4f-e2749eba145e} 0 0 0 @@ -247,7 +247,7 @@ ProjectExplorer.Project.Updater.EnvironmentId - {0fd5067a-d849-4d4e-9457-800baef2de83} + {fd24a9a9-cdbc-49b3-845c-b174fda2a7ac} ProjectExplorer.Project.Updater.FileVersion diff --git a/QChatClient/chatinputtext.cpp b/QChatClient/chatinputtext.cpp new file mode 100644 index 0000000..cd2efb2 --- /dev/null +++ b/QChatClient/chatinputtext.cpp @@ -0,0 +1,16 @@ +#include "chatinputtext.h" + +chatInputText::chatInputText(QWidget *parent) : + QTextEdit(parent) +{ +} + +void chatInputText::keyPressEvent(QKeyEvent *ke) +{ + if(ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) + { + emit msgReady(); + return; + } + QTextEdit::keyPressEvent(ke); +} diff --git a/QChatClient/chatinputtext.h b/QChatClient/chatinputtext.h new file mode 100644 index 0000000..dc8eaf9 --- /dev/null +++ b/QChatClient/chatinputtext.h @@ -0,0 +1,25 @@ +#ifndef CHATINPUTTEXT_H +#define CHATINPUTTEXT_H + +#include +#include + +class chatInputText : public QTextEdit +{ + Q_OBJECT +public: + explicit chatInputText(QWidget *parent = 0); + +signals: + +protected: + void keyPressEvent(QKeyEvent *ke); + +signals: + void msgReady(); + +public slots: + +}; + +#endif // CHATINPUTTEXT_H diff --git a/QChatClient/chatroom.cpp b/QChatClient/chatroom.cpp index b76abde..445f21a 100644 --- a/QChatClient/chatroom.cpp +++ b/QChatClient/chatroom.cpp @@ -1,6 +1,15 @@ #include "chatroom.h" #include "ui_chatroom.h" +list sendQueue; + +std::mutex myMutex; + +std::mutex msgMutex; +unique_lock* msgLock; + +std::condition_variable msgListNotEmpty; + Chatroom::Chatroom(QWidget *parent) : QMainWindow(parent), ui(new Ui::Chatroom) @@ -15,127 +24,253 @@ Chatroom::Chatroom(QWidget *parent) : ui->chatSplitter->setSizes(chatSizes); ui->windowSplitter->setSizes(splitSizes); connected = false; -} + msgLock = new unique_lock(msgMutex,std::defer_lock); + send = NULL; + recv = NULL; -void killThread(thread_args *t_arg) -{ - if(t_arg != 0) - { - delete t_arg; - t_arg = 0; - } - pthread_exit(NULL); + connect(ui->actionConnect,SIGNAL(triggered()),this,SLOT(startSession())); + connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(finish())); + connect(this,SIGNAL(threadsFinished(bool)),this,SLOT(finishThreads(bool))); + connect(ui->inputText,SIGNAL(msgReady()),this,SLOT(sendMsg())); + connect(ui->actionDisconnect,SIGNAL(triggered()),this,SLOT(disconnectChatroom())); + connect(ui->sendButton,SIGNAL(clicked()),this,SLOT(sendMsg())); + connect(this,SIGNAL(messagesToPrint()),this,SLOT(printMsg())); } -void *sendThread(void* args) +void sendThread(Socket* s, Chatroom* chat) { string send; - struct thread_args *t_arg = (struct thread_args*)args; - while(connected) + while(chat->getConnected()) { - cout << "> "; - getline(cin,send); - if(cin.eof()) + while(sendQueue.empty()) { - send = "/exit"; + msgLock->lock(); + msgListNotEmpty.wait(*msgLock); + if(!chat->getConnected()) + { + return; + } + msgLock->unlock(); } + msgLock->lock(); + send = sendQueue.front().toStdString(); + sendQueue.pop_front(); try { - *(t_arg->s) << send; + if(send[0] == '@') + { + send = '1' + send; + } + else + { + send = '0' + send; + } + *s << send; + msgLock->unlock(); + send = send.substr(1); if(send == "/disconnect" || send == "/exit") { break; } + chat->putMsgToPrintQueue(chat->getNickname().toStdString().append(": ").append(send)); } catch(SocketException& e) { cout << e.description() << endl; } } - killThread(t_arg); + cout << "sendThread finished" << endl; } -void *recvThread(void* args) +void recvThread(Socket* s, Chatroom* chat) { string recv; - struct thread_args *t_arg = (struct thread_args*)args; while(true) { try { - *(t_arg->s) >> recv; + *s >> recv; + if(recv[0] == '1') + { + recv = recv.substr(1); + chat->relayMsg(recv); + continue; + } + else if(recv[0] == '0') + { + recv = recv.substr(1); + } } catch(SocketException &e) { - connected = false; + chat->setConnected(false); cout << e.description() << endl; - cout << "Connection lost. Press Enter to retry connection to chatroom. Press CTRL+C to exit." << endl; - pthread_cond_signal(t_arg->condition); + msgListNotEmpty.notify_all(); + emit chat->threadsFinished(false); break; } if(recv == "DISC_OK") { cout << "Disconnecting" << endl; - connected = false; - pthread_cond_signal(t_arg->condition); + chat->setConnected(false); + msgListNotEmpty.notify_all(); + emit chat->threadsFinished(false); break; } else if(recv == "EXIT_OK") { cout << "Exiting" << endl; - connected = false; - pthread_cond_signal(t_arg->condition); + chat->setConnected(false); + msgListNotEmpty.notify_all(); + emit chat->threadsFinished(true); break; } else { - cout << recv << endl; + chat->putMsgToPrintQueue(recv); } } - killThread(t_arg); + cout << "recvThread finished" << endl; } -void Chatroom::start() +bool Chatroom::getConnected() { - Socket s; - connected = false; - pthread_mutex_t mutex; - pthread_mutex_init(&mutex,0); - pthread_cond_t condition; - pthread_cond_init(&condition,0); - pthread_t recv, send; - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_mutex_lock(&mutex); - thread_args *sArgs = new thread_args; - thread_args *rArgs = new thread_args; - sArgs->mutex = &mutex; - sArgs->condition = &condition; - sArgs->s = &s; - - rArgs->mutex = &mutex; - rArgs->condition = &condition; - rArgs->s = &s; - - pthread_create(&send,&attr,sendThread,(void *)sArgs); - pthread_create(&recv,&attr,recvThread,(void *)rArgs); - - while(connected) + myMutex.lock(); + bool val = connected; + myMutex.unlock(); + return val; +} + +void Chatroom::setConnected(bool status) +{ + myMutex.lock(); + connected = status; + myMutex.unlock(); +} + +void Chatroom::putMsgToPrintQueue(string &msg) +{ + printQueue.push_back(msg); + emit messagesToPrint(); +} + +string Chatroom::getSender(string& msg) +{ + return msg.substr(5,msg.find(':')-5); +} + +void Chatroom::relayMsg(string& msg) +{ + string sender = getSender(msg); + map::iterator it = activeChats.begin(); + if(activeChats.find(sender) == activeChats.end()) { - pthread_cond_wait(&condition,&mutex); + //LAUNCH new windowchat } - pthread_mutex_unlock(&mutex); - pthread_join(recv,NULL); - pthread_join(send,NULL); - s.Close(); - pthread_cond_destroy(&condition); - pthread_mutex_destroy(&mutex); + it = activeChats.find(sender); + it->second.printMsg(msg); +} - //LAUNCH LOGINSCREEN +void Chatroom::printMsg() +{ + while(!printQueue.empty()) + { + string msg = printQueue.front(); + ui->chatText->printMsg(msg); + printQueue.pop_front(); + } +} + +void Chatroom::putMsgToSendQueue(QString& msg) +{ + msgMutex.lock(); + sendQueue.push_back(msg); + msgMutex.unlock(); + msgListNotEmpty.notify_all(); +} + +void Chatroom::setNickname(QString nick) +{ + nickname = nick; +} + +QString Chatroom::getNickname() +{ + return nickname; +} + +void Chatroom::startSession() +{ + LoginScreen login(&s,this); + login.exec(); + int result = login.result(); + if(result == QDialog::Accepted) + { + ui->inputText->setReadOnly(false); + } + else if(result == QDialog::Rejected) + { + return; + } + connected = true; + ui->chatText->printServerMsg("Connected to chatroom"); + recv = new std::thread(recvThread,&s,this); + send = new std::thread(sendThread,&s,this); +} + +void Chatroom::sendMsg() +{ + QString msg = ui->inputText->toPlainText(); + ui->inputText->clear(); + putMsgToSendQueue(msg); +} + +void Chatroom::finish() +{ + if(recv == NULL && send == NULL) + { + ui->inputText->setReadOnly(true); + ui->chatText->printServerMsg("Disconnected"); + this->close(); + } + msgMutex.lock(); + sendQueue.clear(); + sendQueue.push_back("/exit"); + msgMutex.unlock(); + msgListNotEmpty.notify_all(); +} + +void Chatroom::disconnectChatroom() +{ + msgMutex.lock(); + sendQueue.clear(); + sendQueue.push_back("/disconnect"); + msgMutex.unlock(); + msgListNotEmpty.notify_all(); +} + +void Chatroom::finishThreads(bool exit) +{ + myMutex.lock(); + ui->inputText->setReadOnly(true); + recv->join(); + send->join(); + myMutex.unlock(); + ui->chatText->printServerMsg("Disconnected"); + send = NULL; + recv = NULL; + if(exit) + { + this->close(); + } } Chatroom::~Chatroom() { + delete msgLock; + delete recv; + delete send; delete ui; } + + diff --git a/QChatClient/chatroom.h b/QChatClient/chatroom.h index d0d31b4..e7080d6 100644 --- a/QChatClient/chatroom.h +++ b/QChatClient/chatroom.h @@ -3,13 +3,12 @@ #include #include "Socket.h" - -struct thread_args -{ - pthread_mutex_t *mutex; - pthread_cond_t *condition; - Socket *s; -}; +#include "loginscreen.h" +#include +#include +#include +#include "chatwindow.h" +#include namespace Ui { class Chatroom; @@ -21,16 +20,42 @@ class Chatroom : public QMainWindow public: explicit Chatroom(QWidget *parent = 0); + bool getConnected(); + void setConnected(bool status); + void relayMsg(string& msg); + void setNickname(QString nick); + QString getNickname(); + void putMsgToPrintQueue(string& msg); ~Chatroom(); + +public slots: + void startSession(); + void sendMsg(); + void printMsg(); + +private slots: + void finishThreads(bool exit); + void finish(); + void disconnectChatroom(); + +signals: + void threadsFinished(bool exit); + void messagesToPrint(); private: Ui::Chatroom *ui; - void start(); + map activeChats; bool connected; + string getSender(string& msg); + void putMsgToSendQueue(QString& msg); + std::thread *send; + std::thread *recv; + Socket s; + QString nickname; + list printQueue; }; -void *sendThread(void* args); -void *recvThread(void* args); -void killThread(thread_args *t_arg); +void sendThread(Socket* s, Chatroom *chat); +void recvThread(Socket *s, Chatroom *chat); #endif // CHATROOM_H diff --git a/QChatClient/chatroom.ui b/QChatClient/chatroom.ui index 688ada8..aa7a479 100644 --- a/QChatClient/chatroom.ui +++ b/QChatClient/chatroom.ui @@ -11,7 +11,7 @@ - MainWindow + QChatClient @@ -44,10 +44,10 @@ - true + false - + 0 @@ -60,6 +60,9 @@ 16777215 + + true + @@ -87,8 +90,55 @@ + + + + + 0 + 0 + + + + Send + + + + + + + 0 + 0 + 800 + 26 + + + + + Chat + + + + + + + + + + Connect... + + + + + Exit + + + + + Disconnect + + @@ -96,6 +146,11 @@ QTextEdit
chatwidget.h
+ + chatInputText + QTextEdit +
chatinputtext.h
+
diff --git a/QChatClient/chatwidget.cpp b/QChatClient/chatwidget.cpp index 6dc6814..9b2c7f4 100644 --- a/QChatClient/chatwidget.cpp +++ b/QChatClient/chatwidget.cpp @@ -6,18 +6,17 @@ ChatWidget::ChatWidget(QWidget *parent) : } -void ChatWidget::printServerMsg(QString &str) +void ChatWidget::printServerMsg(const string &str) { - this->append("

" + str + "

"); + this->append("

" + QString::fromStdString(str) + "

"); } -void ChatWidget::printMsg(QString &str) +void ChatWidget::printMsg(const string &str) { - this->append(str); + this->append(QString::fromStdString(str)); } -void ChatWidget::printStatusMsg(QString &str) +void ChatWidget::printStatusMsg(const string &str) { - this->append("

" + str + "

"); + this->append("

" + QString::fromStdString(str) + "

"); } - diff --git a/QChatClient/chatwidget.h b/QChatClient/chatwidget.h index 6805494..eb7610d 100644 --- a/QChatClient/chatwidget.h +++ b/QChatClient/chatwidget.h @@ -3,14 +3,16 @@ #include +using namespace std; + class ChatWidget : public QTextEdit { Q_OBJECT public: explicit ChatWidget(QWidget *parent = 0); - void printServerMsg(QString &str); - void printMsg(QString& str); - void printStatusMsg(QString& str); + void printServerMsg(const string &str); + void printMsg(const string& str); + void printStatusMsg(const string& str); signals: diff --git a/QChatClient/chatwindow.cpp b/QChatClient/chatwindow.cpp index effe099..5477699 100644 --- a/QChatClient/chatwindow.cpp +++ b/QChatClient/chatwindow.cpp @@ -3,7 +3,7 @@ using namespace std; -ChatWindow::ChatWindow(QWidget *parent) : +ChatWindow::ChatWindow(QString& nickname, QWidget *parent) : QMainWindow(parent), ui(new Ui::ChatWindow) { @@ -12,6 +12,13 @@ ChatWindow::ChatWindow(QWidget *parent) : sizes.push_front(ui->chatText->height()); sizes.push_front(100); ui->splitter->setSizes(sizes); + this->setWindowTitle("Chat with " + nickname); + connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(close())); +} + +void ChatWindow::printMsg(string& str) +{ + ui->chatText->printMsg(str); } ChatWindow::~ChatWindow() diff --git a/QChatClient/chatwindow.h b/QChatClient/chatwindow.h index 3265343..027602b 100644 --- a/QChatClient/chatwindow.h +++ b/QChatClient/chatwindow.h @@ -2,6 +2,9 @@ #define CHATWINDOW_H #include +#include + +using namespace std; namespace Ui { class ChatWindow; @@ -12,7 +15,8 @@ class ChatWindow : public QMainWindow Q_OBJECT public: - explicit ChatWindow(QWidget *parent = 0); + explicit ChatWindow(QString& nickname,QWidget *parent = 0); + void printMsg(string& str); ~ChatWindow(); private: diff --git a/QChatClient/chatwindow.ui b/QChatClient/chatwindow.ui index 5cc3eb8..9d9b960 100644 --- a/QChatClient/chatwindow.ui +++ b/QChatClient/chatwindow.ui @@ -11,7 +11,7 @@ - ChatWindow + QChatClient @@ -24,45 +24,80 @@ - - + + - Qt::Vertical + Qt::Horizontal - - - true - - - - - true - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 0 - 0 - - - + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Send + + + + + + + + + + Qt::Vertical + + + + true + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + 0 + 0 + + + + true + + + + + @@ -73,10 +108,22 @@ 0 0 400 - 25 + 26 + + + Chat + + + + + + + Exit + + @@ -85,6 +132,11 @@ QTextEdit
chatwidget.h
+ + chatInputText + QTextEdit +
chatinputtext.h
+
diff --git a/QChatClient/loginscreen.cpp b/QChatClient/loginscreen.cpp index 8312af4..17f9317 100644 --- a/QChatClient/loginscreen.cpp +++ b/QChatClient/loginscreen.cpp @@ -1,73 +1,96 @@ #include "loginscreen.h" #include "ui_loginscreen.h" -LoginScreen::LoginScreen(QWidget *parent) : +LoginScreen::LoginScreen(Socket* s, QWidget *parent) : QDialog(parent), ui(new Ui::LoginScreen) { ui->setupUi(this); ui->nickEdit->setPlaceholderText("Nickname"); ui->serverURLEdit->setPlaceholderText("Server hostname:port"); + ui->label->setStyleSheet("QLabel { color : red}"); + ui->label->setVisible(false); + this->s = s; + connect(ui->connectButton,SIGNAL(clicked()),this,SLOT(connectToChat())); + connect(ui->cancelButton,SIGNAL(clicked()),this,SLOT(cancelLogin())); } -void LoginScreen::parseURL(QString host, int port, QString URL) +bool LoginScreen::parseURL(QString& URL) { if(validateURL(URL)) { + ui->label->setVisible(false); QStringList strings = URL.split(':'); - host = strings[0].toStdString(); + host = strings[0]; port = strings[1].toInt(); + return true; + } + else + { + ui->label->setVisible(true); + return false; } } -bool LoginScreen::validateURL(QString& url) +bool LoginScreen::validateURL(QString& URL) { - + QRegExp regex("([a-zA-Z.]+|((\\d{1,3}\\.){3}\\d{1,3})):\\d+"); + return regex.exactMatch(URL); } -bool LoginScreen::connect(Socket& s) +void LoginScreen::connectToChat() { - QString host, nick; + QString nick; string response; - int port; - parseURL(host,port,ui->serverURLEdit->text()); - nick = ui->nickEdit->text(); - try + QString URL = ui->serverURLEdit->text(); + if(parseURL(URL)) { - s.Create(); - s.Connect(host.toStdString(),port); - s << nick.toStdString(); - s >> response; - if(response == "CHATNICKINVALID") - { - cout << "Spaces not allowed in nicknames, please enter another nickname: "; - } - else if(response == "CHATNICKEXIST") - { - cout << "Nickname in use, please enter another nickname: "; - } - else if(response == "CHATFULL") + nick = ui->nickEdit->text(); + try { - cout << "Chatroom is full, please wait..." << endl; + s->Create(); + s->Connect(host.toStdString(),port); + (*s) << nick.toStdString(); + (*s) >> response; + if(response == "CHATNICKINVALID") + { + ui->label->setText("Spaces not allowed in nicknames, please enter another nickname"); + } + else if(response == "CHATNICKEXIST") + { + ui->label->setText("Nickname in use, please enter another nickname"); + } + else if(response == "CHATFULL") + { + ui->label->setText("Chatroom is full, please wait..."); + } + else if(response != "CHATOK") + { + ui->label->setText("Error: " + QString::fromStdString(response)); + } + else + { + ((Chatroom*)this->parent())->setNickname(nick); + this->accept(); + return; + } + ui->label->setVisible(true); } - else if(response != "CHATOK") + catch(SocketException& e) { - cout << "Error: " << response << endl; + cout << e.description() << endl; + QString exception = QString::fromStdString(e.description()); + ui->label->setText(exception); + ui->label->setVisible(true); } - else - { - return true; - } - s.Close(); - return false; - } - catch(SocketException& e) - { - cout << e.description() << endl; - exit(-1); } } +void LoginScreen::cancelLogin() +{ + this->reject(); +} + LoginScreen::~LoginScreen() { delete ui; diff --git a/QChatClient/loginscreen.h b/QChatClient/loginscreen.h index 63dd44d..95f8292 100644 --- a/QChatClient/loginscreen.h +++ b/QChatClient/loginscreen.h @@ -2,7 +2,9 @@ #define LOGINSCREEN_H #include +#include #include "Socket.h" +#include "chatroom.h" namespace Ui { class LoginScreen; @@ -13,14 +15,20 @@ class LoginScreen : public QDialog Q_OBJECT public: - explicit LoginScreen(QWidget *parent = 0); - bool connect(Socket& s); + explicit LoginScreen(Socket *s, QWidget *parent = 0); bool validateURL(QString& url); - void parseURL(QString host, int port, QString URL); + bool parseURL(QString& URL); ~LoginScreen(); + +public slots: + void connectToChat(); + void cancelLogin(); private: Ui::LoginScreen *ui; + int port; + QString host; + Socket* s; }; #endif // LOGINSCREEN_H diff --git a/QChatClient/loginscreen.ui b/QChatClient/loginscreen.ui index b2e9fbc..8cf4ab8 100644 --- a/QChatClient/loginscreen.ui +++ b/QChatClient/loginscreen.ui @@ -7,7 +7,7 @@ 0 0 402 - 173 + 206 @@ -20,6 +20,25 @@ Login + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 5 + + + + @@ -39,45 +58,6 @@ - - - - - 0 - 0 - - - - - - - Cancel - - - - - - - OK - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - @@ -94,18 +74,18 @@ - - + + - Qt::Vertical + Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Minimum - 20 - 5 + 10 + 20 @@ -129,27 +109,63 @@ - - - - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - - - 10 - 20 - + + + + + 0 + 0 + - + + + + + OK + + + + + + + Cancel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + INVALID HOSTNAME + + + + + + + nickEdit + serverURLEdit + connectButton + cancelButton + diff --git a/QChatClient/main.cpp b/QChatClient/main.cpp index 735d840..5edec52 100644 --- a/QChatClient/main.cpp +++ b/QChatClient/main.cpp @@ -1,6 +1,5 @@ #include "loginscreen.h" #include "chatroom.h" -#include "chatwindow.h" #include int main(int argc, char *argv[]) @@ -8,6 +7,6 @@ int main(int argc, char *argv[]) QApplication a(argc, argv); Chatroom c; c.show(); - + c.startSession(); return a.exec(); } diff --git a/build-QChatClient-Desktop-Debug/Makefile b/build-QChatClient-Desktop-Debug/Makefile index 0f73fb6..0abc36c 100644 --- a/build-QChatClient-Desktop-Debug/Makefile +++ b/build-QChatClient-Desktop-Debug/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: QChatClient -# Generated by qmake (3.0) (Qt 5.0.2) on: mié dic 18 21:28:34 2013 +# Generated by qmake (3.0) (Qt 5.0.2) on: mié dic 25 23:14:46 2013 # Project: ../QChatClient/QChatClient.pro # Template: app # 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 CXX = g++ DEFINES = -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB CFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT -fPIE $(DEFINES) -CXXFLAGS = -m64 -pipe -g -Wall -W -D_REENTRANT -fPIE $(DEFINES) +CXXFLAGS = -m64 -pipe -std=c++11 -g -Wall -W -D_REENTRANT -fPIE $(DEFINES) 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. LINK = g++ LFLAGS = -m64 @@ -46,26 +46,28 @@ OBJECTS_DIR = ./ ####### Files SOURCES = ../QChatClient/main.cpp \ - ../QChatClient/chatwindow.cpp \ ../QChatClient/loginscreen.cpp \ ../QChatClient/chatroom.cpp \ ../QChatClient/Socket.cpp \ - ../QChatClient/client.cpp \ - ../QChatClient/chatwidget.cpp moc_chatwindow.cpp \ - moc_loginscreen.cpp \ + ../QChatClient/chatwidget.cpp \ + ../QChatClient/chatwindow.cpp \ + ../QChatClient/chatinputtext.cpp moc_loginscreen.cpp \ moc_chatroom.cpp \ - moc_chatwidget.cpp + moc_chatwidget.cpp \ + moc_chatwindow.cpp \ + moc_chatinputtext.cpp OBJECTS = main.o \ - chatwindow.o \ loginscreen.o \ chatroom.o \ Socket.o \ - client.o \ chatwidget.o \ - moc_chatwindow.o \ + chatwindow.o \ + chatinputtext.o \ moc_loginscreen.o \ moc_chatroom.o \ - moc_chatwidget.o + moc_chatwidget.o \ + moc_chatwindow.o \ + moc_chatinputtext.o DIST = /usr/share/qt5/mkspecs/features/spec_pre.prf \ /usr/share/qt5/mkspecs/common/shell-unix.conf \ /usr/share/qt5/mkspecs/common/unix.conf \ @@ -84,8 +86,14 @@ DIST = /usr/share/qt5/mkspecs/features/spec_pre.prf \ /usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_qml.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_quick.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_sql.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_v8.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_xml.pri \ /usr/share/qt5/mkspecs/features/qt_functions.prf \ @@ -165,8 +173,14 @@ Makefile: ../QChatClient/QChatClient.pro /usr/share/qt5/mkspecs/linux-g++-64/qma /usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_qml.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_quick.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_sql.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/share/qt5/mkspecs/modules/qt_lib_v8.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri \ /usr/share/qt5/mkspecs/modules/qt_lib_xml.pri \ /usr/share/qt5/mkspecs/features/qt_functions.prf \ @@ -216,8 +230,14 @@ Makefile: ../QChatClient/QChatClient.pro /usr/share/qt5/mkspecs/linux-g++-64/qma /usr/share/qt5/mkspecs/modules/qt_lib_opengl.pri: /usr/share/qt5/mkspecs/modules/qt_lib_platformsupport.pri: /usr/share/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/share/qt5/mkspecs/modules/qt_lib_qml.pri: +/usr/share/qt5/mkspecs/modules/qt_lib_qmldevtools.pri: +/usr/share/qt5/mkspecs/modules/qt_lib_qmltest.pri: +/usr/share/qt5/mkspecs/modules/qt_lib_quick.pri: +/usr/share/qt5/mkspecs/modules/qt_lib_quickparticles.pri: /usr/share/qt5/mkspecs/modules/qt_lib_sql.pri: /usr/share/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/share/qt5/mkspecs/modules/qt_lib_v8.pri: /usr/share/qt5/mkspecs/modules/qt_lib_widgets.pri: /usr/share/qt5/mkspecs/modules/qt_lib_xml.pri: /usr/share/qt5/mkspecs/features/qt_functions.prf: @@ -255,7 +275,7 @@ qmake_all: FORCE dist: @test -d .tmp/QChatClient1.0.0 || mkdir -p .tmp/QChatClient1.0.0 - $(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 + $(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 clean:compiler_clean @@ -282,11 +302,11 @@ compiler_wayland-server-header_make_all: compiler_wayland-server-header_clean: compiler_wayland-client-header_make_all: compiler_wayland-client-header_clean: -compiler_moc_header_make_all: moc_chatwindow.cpp moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp +compiler_moc_header_make_all: moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp moc_chatwindow.cpp moc_chatinputtext.cpp compiler_moc_header_clean: - -$(DEL_FILE) moc_chatwindow.cpp moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp -moc_chatwindow.cpp: /usr/include/qt5/QtWidgets/QMainWindow \ - /usr/include/qt5/QtWidgets/qmainwindow.h \ + -$(DEL_FILE) moc_loginscreen.cpp moc_chatroom.cpp moc_chatwidget.cpp moc_chatwindow.cpp moc_chatinputtext.cpp +moc_loginscreen.cpp: /usr/include/qt5/QtWidgets/QDialog \ + /usr/include/qt5/QtWidgets/qdialog.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -393,13 +413,21 @@ moc_chatwindow.cpp: /usr/include/qt5/QtWidgets/QMainWindow \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ + /usr/include/qt5/QtCore/QRegExp \ + ../QChatClient/Socket.h \ + ../QChatClient/SocketException.h \ + ../QChatClient/chatroom.h \ + /usr/include/qt5/QtWidgets/QMainWindow \ + /usr/include/qt5/QtWidgets/qmainwindow.h \ /usr/include/qt5/QtWidgets/qtabwidget.h \ /usr/include/qt5/QtGui/qicon.h \ - ../QChatClient/chatwindow.h - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwindow.h -o moc_chatwindow.cpp + ../QChatClient/loginscreen.h \ + ../QChatClient/chatwindow.h \ + ../QChatClient/loginscreen.h + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/loginscreen.h -o moc_loginscreen.cpp -moc_loginscreen.cpp: /usr/include/qt5/QtWidgets/QDialog \ - /usr/include/qt5/QtWidgets/qdialog.h \ +moc_chatroom.cpp: /usr/include/qt5/QtWidgets/QMainWindow \ + /usr/include/qt5/QtWidgets/qmainwindow.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -506,13 +534,23 @@ moc_loginscreen.cpp: /usr/include/qt5/QtWidgets/QDialog \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ + /usr/include/qt5/QtWidgets/qtabwidget.h \ + /usr/include/qt5/QtGui/qicon.h \ ../QChatClient/Socket.h \ ../QChatClient/SocketException.h \ - ../QChatClient/loginscreen.h - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/loginscreen.h -o moc_loginscreen.cpp + ../QChatClient/loginscreen.h \ + /usr/include/qt5/QtWidgets/QDialog \ + /usr/include/qt5/QtWidgets/qdialog.h \ + /usr/include/qt5/QtCore/QRegExp \ + ../QChatClient/chatroom.h \ + ../QChatClient/chatwindow.h \ + ../QChatClient/chatroom.h + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatroom.h -o moc_chatroom.cpp -moc_chatroom.cpp: /usr/include/qt5/QtWidgets/QMainWindow \ - /usr/include/qt5/QtWidgets/qmainwindow.h \ +moc_chatwidget.cpp: /usr/include/qt5/QtWidgets/QTextEdit \ + /usr/include/qt5/QtWidgets/qtextedit.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -619,17 +657,16 @@ moc_chatroom.cpp: /usr/include/qt5/QtWidgets/QMainWindow \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ - /usr/include/qt5/QtWidgets/qtabwidget.h \ - /usr/include/qt5/QtGui/qicon.h \ - ../QChatClient/Socket.h \ - ../QChatClient/SocketException.h \ - ../QChatClient/chatroom.h - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatroom.h -o moc_chatroom.cpp + /usr/include/qt5/QtGui/qtextdocument.h \ + /usr/include/qt5/QtGui/qtextoption.h \ + /usr/include/qt5/QtGui/qtextcursor.h \ + /usr/include/qt5/QtGui/qtextformat.h \ + /usr/include/qt5/QtGui/qpen.h \ + ../QChatClient/chatwidget.h + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwidget.h -o moc_chatwidget.cpp -moc_chatwidget.cpp: /usr/include/qt5/QtWidgets/QTextEdit \ - /usr/include/qt5/QtWidgets/qtextedit.h \ - /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ - /usr/include/qt5/QtWidgets/qframe.h \ +moc_chatwindow.cpp: /usr/include/qt5/QtWidgets/QMainWindow \ + /usr/include/qt5/QtWidgets/qmainwindow.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -736,24 +773,12 @@ moc_chatwidget.cpp: /usr/include/qt5/QtWidgets/QTextEdit \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ - /usr/include/qt5/QtGui/qtextdocument.h \ - /usr/include/qt5/QtGui/qtextoption.h \ - /usr/include/qt5/QtGui/qtextcursor.h \ - /usr/include/qt5/QtGui/qtextformat.h \ - /usr/include/qt5/QtGui/qpen.h \ - ../QChatClient/chatwidget.h - /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwidget.h -o moc_chatwidget.cpp + /usr/include/qt5/QtWidgets/qtabwidget.h \ + /usr/include/qt5/QtGui/qicon.h \ + ../QChatClient/chatwindow.h + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatwindow.h -o moc_chatwindow.cpp -compiler_wayland-code_make_all: -compiler_wayland-code_clean: -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: ui_chatwindow.h ui_loginscreen.h ui_chatroom.h -compiler_uic_clean: - -$(DEL_FILE) ui_chatwindow.h ui_loginscreen.h ui_chatroom.h -ui_chatwindow.h: ../QChatClient/chatwindow.ui \ - ../QChatClient/chatwidget.h \ - /usr/include/qt5/QtWidgets/QTextEdit \ +moc_chatinputtext.cpp: /usr/include/qt5/QtWidgets/QTextEdit \ /usr/include/qt5/QtWidgets/qtextedit.h \ /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ /usr/include/qt5/QtWidgets/qframe.h \ @@ -867,14 +892,21 @@ ui_chatwindow.h: ../QChatClient/chatwindow.ui \ /usr/include/qt5/QtGui/qtextoption.h \ /usr/include/qt5/QtGui/qtextcursor.h \ /usr/include/qt5/QtGui/qtextformat.h \ - /usr/include/qt5/QtGui/qpen.h - /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatwindow.ui -o ui_chatwindow.h - -ui_loginscreen.h: ../QChatClient/loginscreen.ui - /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/loginscreen.ui -o ui_loginscreen.h + /usr/include/qt5/QtGui/qpen.h \ + /usr/include/qt5/QtGui/QKeyEvent \ + ../QChatClient/chatinputtext.h + /usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) $(INCPATH) ../QChatClient/chatinputtext.h -o moc_chatinputtext.cpp -ui_chatroom.h: ../QChatClient/chatroom.ui \ +compiler_wayland-code_make_all: +compiler_wayland-code_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_chatwindow.h ui_loginscreen.h ui_chatroom.h +compiler_uic_clean: + -$(DEL_FILE) ui_chatwindow.h ui_loginscreen.h ui_chatroom.h +ui_chatwindow.h: ../QChatClient/chatwindow.ui \ ../QChatClient/chatwidget.h \ + ../QChatClient/chatinputtext.h \ /usr/include/qt5/QtWidgets/QTextEdit \ /usr/include/qt5/QtWidgets/qtextedit.h \ /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ @@ -989,22 +1021,11 @@ ui_chatroom.h: ../QChatClient/chatroom.ui \ /usr/include/qt5/QtGui/qtextoption.h \ /usr/include/qt5/QtGui/qtextcursor.h \ /usr/include/qt5/QtGui/qtextformat.h \ - /usr/include/qt5/QtGui/qpen.h - /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatroom.ui -o ui_chatroom.h - -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean compiler_uic_clean - -####### Compile - -main.o: ../QChatClient/main.cpp ../QChatClient/loginscreen.h \ - /usr/include/qt5/QtWidgets/QDialog \ - /usr/include/qt5/QtWidgets/qdialog.h \ + /usr/include/qt5/QtGui/qpen.h \ + /usr/include/qt5/QtWidgets/QTextEdit \ + /usr/include/qt5/QtWidgets/qtextedit.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -1111,26 +1132,24 @@ main.o: ../QChatClient/main.cpp ../QChatClient/loginscreen.h \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ - ../QChatClient/Socket.h \ - ../QChatClient/SocketException.h \ - ../QChatClient/chatroom.h \ - /usr/include/qt5/QtWidgets/QMainWindow \ - /usr/include/qt5/QtWidgets/qmainwindow.h \ - /usr/include/qt5/QtWidgets/qtabwidget.h \ - /usr/include/qt5/QtGui/qicon.h \ - ../QChatClient/chatwindow.h \ - /usr/include/qt5/QtWidgets/QApplication \ - /usr/include/qt5/QtWidgets/qapplication.h \ - /usr/include/qt5/QtCore/qcoreapplication.h \ - /usr/include/qt5/QtCore/qeventloop.h \ - /usr/include/qt5/QtWidgets/qdesktopwidget.h \ - /usr/include/qt5/QtGui/qguiapplication.h \ - /usr/include/qt5/QtGui/qinputmethod.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../QChatClient/main.cpp + /usr/include/qt5/QtGui/qtextdocument.h \ + /usr/include/qt5/QtGui/qtextoption.h \ + /usr/include/qt5/QtGui/qtextcursor.h \ + /usr/include/qt5/QtGui/qtextformat.h \ + /usr/include/qt5/QtGui/qpen.h \ + /usr/include/qt5/QtGui/QKeyEvent + /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatwindow.ui -o ui_chatwindow.h -chatwindow.o: ../QChatClient/chatwindow.cpp ../QChatClient/chatwindow.h \ - /usr/include/qt5/QtWidgets/QMainWindow \ - /usr/include/qt5/QtWidgets/qmainwindow.h \ +ui_loginscreen.h: ../QChatClient/loginscreen.ui + /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/loginscreen.ui -o ui_loginscreen.h + +ui_chatroom.h: ../QChatClient/chatroom.ui \ + ../QChatClient/chatwidget.h \ + ../QChatClient/chatinputtext.h \ + /usr/include/qt5/QtWidgets/QTextEdit \ + /usr/include/qt5/QtWidgets/qtextedit.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -1237,62 +1256,15 @@ chatwindow.o: ../QChatClient/chatwindow.cpp ../QChatClient/chatwindow.h \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ - /usr/include/qt5/QtWidgets/qtabwidget.h \ - /usr/include/qt5/QtGui/qicon.h \ - ui_chatwindow.h \ - /usr/include/qt5/QtCore/QVariant \ - /usr/include/qt5/QtWidgets/QAction \ - /usr/include/qt5/QtWidgets/qaction.h \ - /usr/include/qt5/QtWidgets/qactiongroup.h \ - /usr/include/qt5/QtWidgets/QApplication \ - /usr/include/qt5/QtWidgets/qapplication.h \ - /usr/include/qt5/QtCore/qcoreapplication.h \ - /usr/include/qt5/QtCore/qeventloop.h \ - /usr/include/qt5/QtWidgets/qdesktopwidget.h \ - /usr/include/qt5/QtGui/qguiapplication.h \ - /usr/include/qt5/QtGui/qinputmethod.h \ - /usr/include/qt5/QtWidgets/QButtonGroup \ - /usr/include/qt5/QtWidgets/qbuttongroup.h \ - /usr/include/qt5/QtWidgets/QGridLayout \ - /usr/include/qt5/QtWidgets/qgridlayout.h \ - /usr/include/qt5/QtWidgets/qlayout.h \ - /usr/include/qt5/QtWidgets/qlayoutitem.h \ - /usr/include/qt5/QtWidgets/qboxlayout.h \ - /usr/include/qt5/QtWidgets/QHeaderView \ - /usr/include/qt5/QtWidgets/qheaderview.h \ - /usr/include/qt5/QtWidgets/qabstractitemview.h \ - /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ - /usr/include/qt5/QtWidgets/qframe.h \ - /usr/include/qt5/QtCore/qabstractitemmodel.h \ - /usr/include/qt5/QtCore/qitemselectionmodel.h \ - /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \ - /usr/include/qt5/QtWidgets/qstyleoption.h \ - /usr/include/qt5/QtWidgets/qabstractspinbox.h \ - /usr/include/qt5/QtGui/qvalidator.h \ - /usr/include/qt5/QtWidgets/qslider.h \ - /usr/include/qt5/QtWidgets/qabstractslider.h \ - /usr/include/qt5/QtWidgets/qstyle.h \ - /usr/include/qt5/QtWidgets/qtabbar.h \ - /usr/include/qt5/QtWidgets/qrubberband.h \ - /usr/include/qt5/QtWidgets/QMenuBar \ - /usr/include/qt5/QtWidgets/qmenubar.h \ - /usr/include/qt5/QtWidgets/qmenu.h \ - /usr/include/qt5/QtWidgets/QSplitter \ - /usr/include/qt5/QtWidgets/qsplitter.h \ - /usr/include/qt5/QtWidgets/QTextEdit \ - /usr/include/qt5/QtWidgets/qtextedit.h \ /usr/include/qt5/QtGui/qtextdocument.h \ /usr/include/qt5/QtGui/qtextoption.h \ /usr/include/qt5/QtGui/qtextcursor.h \ /usr/include/qt5/QtGui/qtextformat.h \ /usr/include/qt5/QtGui/qpen.h \ - /usr/include/qt5/QtWidgets/QWidget \ - ../QChatClient/chatwidget.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwindow.o ../QChatClient/chatwindow.cpp - -loginscreen.o: ../QChatClient/loginscreen.cpp ../QChatClient/loginscreen.h \ - /usr/include/qt5/QtWidgets/QDialog \ - /usr/include/qt5/QtWidgets/qdialog.h \ + /usr/include/qt5/QtWidgets/QTextEdit \ + /usr/include/qt5/QtWidgets/qtextedit.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ /usr/include/qt5/QtWidgets/qwidget.h \ /usr/include/qt5/QtGui/qwindowdefs.h \ /usr/include/qt5/QtCore/qglobal.h \ @@ -1399,61 +1371,620 @@ loginscreen.o: ../QChatClient/loginscreen.cpp ../QChatClient/loginscreen.h \ /usr/include/qt5/QtCore/qfiledevice.h \ /usr/include/qt5/QtGui/qvector2d.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ - ../QChatClient/Socket.h \ - ../QChatClient/SocketException.h \ - ui_loginscreen.h \ - /usr/include/qt5/QtCore/QVariant \ - /usr/include/qt5/QtWidgets/QAction \ - /usr/include/qt5/QtWidgets/qaction.h \ - /usr/include/qt5/QtGui/qicon.h \ - /usr/include/qt5/QtWidgets/qactiongroup.h \ - /usr/include/qt5/QtWidgets/QApplication \ - /usr/include/qt5/QtWidgets/qapplication.h \ - /usr/include/qt5/QtCore/qcoreapplication.h \ - /usr/include/qt5/QtCore/qeventloop.h \ - /usr/include/qt5/QtWidgets/qdesktopwidget.h \ - /usr/include/qt5/QtGui/qguiapplication.h \ - /usr/include/qt5/QtGui/qinputmethod.h \ - /usr/include/qt5/QtWidgets/QButtonGroup \ - /usr/include/qt5/QtWidgets/qbuttongroup.h \ - /usr/include/qt5/QtWidgets/QGridLayout \ - /usr/include/qt5/QtWidgets/qgridlayout.h \ - /usr/include/qt5/QtWidgets/qlayout.h \ - /usr/include/qt5/QtWidgets/qlayoutitem.h \ - /usr/include/qt5/QtWidgets/qboxlayout.h \ - /usr/include/qt5/QtWidgets/QHeaderView \ - /usr/include/qt5/QtWidgets/qheaderview.h \ - /usr/include/qt5/QtWidgets/qabstractitemview.h \ - /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ - /usr/include/qt5/QtWidgets/qframe.h \ - /usr/include/qt5/QtCore/qabstractitemmodel.h \ - /usr/include/qt5/QtCore/qitemselectionmodel.h \ - /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \ - /usr/include/qt5/QtWidgets/qstyleoption.h \ - /usr/include/qt5/QtWidgets/qabstractspinbox.h \ - /usr/include/qt5/QtGui/qvalidator.h \ - /usr/include/qt5/QtWidgets/qslider.h \ - /usr/include/qt5/QtWidgets/qabstractslider.h \ - /usr/include/qt5/QtWidgets/qstyle.h \ - /usr/include/qt5/QtWidgets/qtabbar.h \ - /usr/include/qt5/QtWidgets/qtabwidget.h \ - /usr/include/qt5/QtWidgets/qrubberband.h \ - /usr/include/qt5/QtWidgets/QLabel \ - /usr/include/qt5/QtWidgets/qlabel.h \ - /usr/include/qt5/QtWidgets/QLineEdit \ - /usr/include/qt5/QtWidgets/qlineedit.h \ + /usr/include/qt5/QtGui/qtextdocument.h \ + /usr/include/qt5/QtGui/qtextoption.h \ /usr/include/qt5/QtGui/qtextcursor.h \ /usr/include/qt5/QtGui/qtextformat.h \ /usr/include/qt5/QtGui/qpen.h \ - /usr/include/qt5/QtGui/qtextoption.h \ - /usr/include/qt5/QtWidgets/QPushButton \ - /usr/include/qt5/QtWidgets/qpushbutton.h \ - /usr/include/qt5/QtWidgets/qabstractbutton.h \ - /usr/include/qt5/QtWidgets/QSpacerItem \ - /usr/include/qt5/QtWidgets/QWidget + /usr/include/qt5/QtGui/QKeyEvent + /usr/lib/x86_64-linux-gnu/qt5/bin/uic ../QChatClient/chatroom.ui -o ui_chatroom.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +main.o: ../QChatClient/main.cpp ../QChatClient/loginscreen.h \ + /usr/include/qt5/QtWidgets/QDialog \ + /usr/include/qt5/QtWidgets/qdialog.h \ + /usr/include/qt5/QtWidgets/qwidget.h \ + /usr/include/qt5/QtGui/qwindowdefs.h \ + /usr/include/qt5/QtCore/qglobal.h \ + /usr/include/qt5/QtCore/qconfig.h \ + /usr/include/qt5/QtCore/qfeatures.h \ + /usr/include/qt5/QtCore/qsystemdetection.h \ + /usr/include/qt5/QtCore/qcompilerdetection.h \ + /usr/include/qt5/QtCore/qprocessordetection.h \ + /usr/include/qt5/QtCore/qlogging.h \ + /usr/include/qt5/QtCore/qflags.h \ + /usr/include/qt5/QtCore/qtypeinfo.h \ + /usr/include/qt5/QtCore/qtypetraits.h \ + /usr/include/qt5/QtCore/qsysinfo.h \ + /usr/include/qt5/QtCore/qobjectdefs.h \ + /usr/include/qt5/QtCore/qnamespace.h \ + /usr/include/qt5/QtCore/qobjectdefs_impl.h \ + /usr/include/qt5/QtGui/qwindowdefs_win.h \ + /usr/include/qt5/QtCore/qobject.h \ + /usr/include/qt5/QtCore/qstring.h \ + /usr/include/qt5/QtCore/qchar.h \ + /usr/include/qt5/QtCore/qbytearray.h \ + /usr/include/qt5/QtCore/qrefcount.h \ + /usr/include/qt5/QtCore/qatomic.h \ + /usr/include/qt5/QtCore/qbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_bootstrap.h \ + /usr/include/qt5/QtCore/qgenericatomic.h \ + /usr/include/qt5/QtCore/qatomic_msvc.h \ + /usr/include/qt5/QtCore/qatomic_integrity.h \ + /usr/include/qt5/QtCore/qoldbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_vxworks.h \ + /usr/include/qt5/QtCore/qatomic_power.h \ + /usr/include/qt5/QtCore/qatomic_aarch64.h \ + /usr/include/qt5/QtCore/qatomic_alpha.h \ + /usr/include/qt5/QtCore/qatomic_armv7.h \ + /usr/include/qt5/QtCore/qatomic_armv6.h \ + /usr/include/qt5/QtCore/qatomic_armv5.h \ + /usr/include/qt5/QtCore/qatomic_bfin.h \ + /usr/include/qt5/QtCore/qatomic_ia64.h \ + /usr/include/qt5/QtCore/qatomic_mips.h \ + /usr/include/qt5/QtCore/qatomic_s390.h \ + /usr/include/qt5/QtCore/qatomic_sh4a.h \ + /usr/include/qt5/QtCore/qatomic_sparc.h \ + /usr/include/qt5/QtCore/qatomic_x86.h \ + /usr/include/qt5/QtCore/qatomic_cxx11.h \ + /usr/include/qt5/QtCore/qatomic_gcc.h \ + /usr/include/qt5/QtCore/qatomic_unix.h \ + /usr/include/qt5/QtCore/qarraydata.h \ + /usr/include/qt5/QtCore/qstringbuilder.h \ + /usr/include/qt5/QtCore/qlist.h \ + /usr/include/qt5/QtCore/qalgorithms.h \ + /usr/include/qt5/QtCore/qiterator.h \ + /usr/include/qt5/QtCore/qcoreevent.h \ + /usr/include/qt5/QtCore/qscopedpointer.h \ + /usr/include/qt5/QtCore/qmetatype.h \ + /usr/include/qt5/QtCore/qvarlengtharray.h \ + /usr/include/qt5/QtCore/qcontainerfwd.h \ + /usr/include/qt5/QtCore/qisenum.h \ + /usr/include/qt5/QtCore/qobject_impl.h \ + /usr/include/qt5/QtCore/qmargins.h \ + /usr/include/qt5/QtGui/qpaintdevice.h \ + /usr/include/qt5/QtCore/qrect.h \ + /usr/include/qt5/QtCore/qsize.h \ + /usr/include/qt5/QtCore/qpoint.h \ + /usr/include/qt5/QtGui/qpalette.h \ + /usr/include/qt5/QtGui/qcolor.h \ + /usr/include/qt5/QtGui/qrgb.h \ + /usr/include/qt5/QtCore/qstringlist.h \ + /usr/include/qt5/QtCore/qdatastream.h \ + /usr/include/qt5/QtCore/qiodevice.h \ + /usr/include/qt5/QtCore/qpair.h \ + /usr/include/qt5/QtCore/qregexp.h \ + /usr/include/qt5/QtCore/qstringmatcher.h \ + /usr/include/qt5/QtGui/qbrush.h \ + /usr/include/qt5/QtCore/qvector.h \ + /usr/include/qt5/QtGui/qmatrix.h \ + /usr/include/qt5/QtGui/qpolygon.h \ + /usr/include/qt5/QtGui/qregion.h \ + /usr/include/qt5/QtCore/qline.h \ + /usr/include/qt5/QtGui/qtransform.h \ + /usr/include/qt5/QtGui/qpainterpath.h \ + /usr/include/qt5/QtGui/qimage.h \ + /usr/include/qt5/QtGui/qpixmap.h \ + /usr/include/qt5/QtCore/qsharedpointer.h \ + /usr/include/qt5/QtCore/qshareddata.h \ + /usr/include/qt5/QtCore/qsharedpointer_impl.h \ + /usr/include/qt5/QtCore/qhash.h \ + /usr/include/qt5/QtGui/qfont.h \ + /usr/include/qt5/QtGui/qfontmetrics.h \ + /usr/include/qt5/QtGui/qfontinfo.h \ + /usr/include/qt5/QtWidgets/qsizepolicy.h \ + /usr/include/qt5/QtGui/qcursor.h \ + /usr/include/qt5/QtGui/qkeysequence.h \ + /usr/include/qt5/QtGui/qevent.h \ + /usr/include/qt5/QtCore/qvariant.h \ + /usr/include/qt5/QtCore/qmap.h \ + /usr/include/qt5/QtCore/qdebug.h \ + /usr/include/qt5/QtCore/qtextstream.h \ + /usr/include/qt5/QtCore/qlocale.h \ + /usr/include/qt5/QtCore/qset.h \ + /usr/include/qt5/QtCore/qcontiguouscache.h \ + /usr/include/qt5/QtCore/qurl.h \ + /usr/include/qt5/QtCore/qurlquery.h \ + /usr/include/qt5/QtCore/qfile.h \ + /usr/include/qt5/QtCore/qfiledevice.h \ + /usr/include/qt5/QtGui/qvector2d.h \ + /usr/include/qt5/QtGui/qtouchdevice.h \ + /usr/include/qt5/QtCore/QRegExp \ + ../QChatClient/Socket.h \ + ../QChatClient/SocketException.h \ + ../QChatClient/chatroom.h \ + /usr/include/qt5/QtWidgets/QMainWindow \ + /usr/include/qt5/QtWidgets/qmainwindow.h \ + /usr/include/qt5/QtWidgets/qtabwidget.h \ + /usr/include/qt5/QtGui/qicon.h \ + ../QChatClient/chatwindow.h \ + /usr/include/qt5/QtWidgets/QApplication \ + /usr/include/qt5/QtWidgets/qapplication.h \ + /usr/include/qt5/QtCore/qcoreapplication.h \ + /usr/include/qt5/QtCore/qeventloop.h \ + /usr/include/qt5/QtWidgets/qdesktopwidget.h \ + /usr/include/qt5/QtGui/qguiapplication.h \ + /usr/include/qt5/QtGui/qinputmethod.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../QChatClient/main.cpp + +loginscreen.o: ../QChatClient/loginscreen.cpp ../QChatClient/loginscreen.h \ + /usr/include/qt5/QtWidgets/QDialog \ + /usr/include/qt5/QtWidgets/qdialog.h \ + /usr/include/qt5/QtWidgets/qwidget.h \ + /usr/include/qt5/QtGui/qwindowdefs.h \ + /usr/include/qt5/QtCore/qglobal.h \ + /usr/include/qt5/QtCore/qconfig.h \ + /usr/include/qt5/QtCore/qfeatures.h \ + /usr/include/qt5/QtCore/qsystemdetection.h \ + /usr/include/qt5/QtCore/qcompilerdetection.h \ + /usr/include/qt5/QtCore/qprocessordetection.h \ + /usr/include/qt5/QtCore/qlogging.h \ + /usr/include/qt5/QtCore/qflags.h \ + /usr/include/qt5/QtCore/qtypeinfo.h \ + /usr/include/qt5/QtCore/qtypetraits.h \ + /usr/include/qt5/QtCore/qsysinfo.h \ + /usr/include/qt5/QtCore/qobjectdefs.h \ + /usr/include/qt5/QtCore/qnamespace.h \ + /usr/include/qt5/QtCore/qobjectdefs_impl.h \ + /usr/include/qt5/QtGui/qwindowdefs_win.h \ + /usr/include/qt5/QtCore/qobject.h \ + /usr/include/qt5/QtCore/qstring.h \ + /usr/include/qt5/QtCore/qchar.h \ + /usr/include/qt5/QtCore/qbytearray.h \ + /usr/include/qt5/QtCore/qrefcount.h \ + /usr/include/qt5/QtCore/qatomic.h \ + /usr/include/qt5/QtCore/qbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_bootstrap.h \ + /usr/include/qt5/QtCore/qgenericatomic.h \ + /usr/include/qt5/QtCore/qatomic_msvc.h \ + /usr/include/qt5/QtCore/qatomic_integrity.h \ + /usr/include/qt5/QtCore/qoldbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_vxworks.h \ + /usr/include/qt5/QtCore/qatomic_power.h \ + /usr/include/qt5/QtCore/qatomic_aarch64.h \ + /usr/include/qt5/QtCore/qatomic_alpha.h \ + /usr/include/qt5/QtCore/qatomic_armv7.h \ + /usr/include/qt5/QtCore/qatomic_armv6.h \ + /usr/include/qt5/QtCore/qatomic_armv5.h \ + /usr/include/qt5/QtCore/qatomic_bfin.h \ + /usr/include/qt5/QtCore/qatomic_ia64.h \ + /usr/include/qt5/QtCore/qatomic_mips.h \ + /usr/include/qt5/QtCore/qatomic_s390.h \ + /usr/include/qt5/QtCore/qatomic_sh4a.h \ + /usr/include/qt5/QtCore/qatomic_sparc.h \ + /usr/include/qt5/QtCore/qatomic_x86.h \ + /usr/include/qt5/QtCore/qatomic_cxx11.h \ + /usr/include/qt5/QtCore/qatomic_gcc.h \ + /usr/include/qt5/QtCore/qatomic_unix.h \ + /usr/include/qt5/QtCore/qarraydata.h \ + /usr/include/qt5/QtCore/qstringbuilder.h \ + /usr/include/qt5/QtCore/qlist.h \ + /usr/include/qt5/QtCore/qalgorithms.h \ + /usr/include/qt5/QtCore/qiterator.h \ + /usr/include/qt5/QtCore/qcoreevent.h \ + /usr/include/qt5/QtCore/qscopedpointer.h \ + /usr/include/qt5/QtCore/qmetatype.h \ + /usr/include/qt5/QtCore/qvarlengtharray.h \ + /usr/include/qt5/QtCore/qcontainerfwd.h \ + /usr/include/qt5/QtCore/qisenum.h \ + /usr/include/qt5/QtCore/qobject_impl.h \ + /usr/include/qt5/QtCore/qmargins.h \ + /usr/include/qt5/QtGui/qpaintdevice.h \ + /usr/include/qt5/QtCore/qrect.h \ + /usr/include/qt5/QtCore/qsize.h \ + /usr/include/qt5/QtCore/qpoint.h \ + /usr/include/qt5/QtGui/qpalette.h \ + /usr/include/qt5/QtGui/qcolor.h \ + /usr/include/qt5/QtGui/qrgb.h \ + /usr/include/qt5/QtCore/qstringlist.h \ + /usr/include/qt5/QtCore/qdatastream.h \ + /usr/include/qt5/QtCore/qiodevice.h \ + /usr/include/qt5/QtCore/qpair.h \ + /usr/include/qt5/QtCore/qregexp.h \ + /usr/include/qt5/QtCore/qstringmatcher.h \ + /usr/include/qt5/QtGui/qbrush.h \ + /usr/include/qt5/QtCore/qvector.h \ + /usr/include/qt5/QtGui/qmatrix.h \ + /usr/include/qt5/QtGui/qpolygon.h \ + /usr/include/qt5/QtGui/qregion.h \ + /usr/include/qt5/QtCore/qline.h \ + /usr/include/qt5/QtGui/qtransform.h \ + /usr/include/qt5/QtGui/qpainterpath.h \ + /usr/include/qt5/QtGui/qimage.h \ + /usr/include/qt5/QtGui/qpixmap.h \ + /usr/include/qt5/QtCore/qsharedpointer.h \ + /usr/include/qt5/QtCore/qshareddata.h \ + /usr/include/qt5/QtCore/qsharedpointer_impl.h \ + /usr/include/qt5/QtCore/qhash.h \ + /usr/include/qt5/QtGui/qfont.h \ + /usr/include/qt5/QtGui/qfontmetrics.h \ + /usr/include/qt5/QtGui/qfontinfo.h \ + /usr/include/qt5/QtWidgets/qsizepolicy.h \ + /usr/include/qt5/QtGui/qcursor.h \ + /usr/include/qt5/QtGui/qkeysequence.h \ + /usr/include/qt5/QtGui/qevent.h \ + /usr/include/qt5/QtCore/qvariant.h \ + /usr/include/qt5/QtCore/qmap.h \ + /usr/include/qt5/QtCore/qdebug.h \ + /usr/include/qt5/QtCore/qtextstream.h \ + /usr/include/qt5/QtCore/qlocale.h \ + /usr/include/qt5/QtCore/qset.h \ + /usr/include/qt5/QtCore/qcontiguouscache.h \ + /usr/include/qt5/QtCore/qurl.h \ + /usr/include/qt5/QtCore/qurlquery.h \ + /usr/include/qt5/QtCore/qfile.h \ + /usr/include/qt5/QtCore/qfiledevice.h \ + /usr/include/qt5/QtGui/qvector2d.h \ + /usr/include/qt5/QtGui/qtouchdevice.h \ + /usr/include/qt5/QtCore/QRegExp \ + ../QChatClient/Socket.h \ + ../QChatClient/SocketException.h \ + ../QChatClient/chatroom.h \ + /usr/include/qt5/QtWidgets/QMainWindow \ + /usr/include/qt5/QtWidgets/qmainwindow.h \ + /usr/include/qt5/QtWidgets/qtabwidget.h \ + /usr/include/qt5/QtGui/qicon.h \ + ../QChatClient/chatwindow.h \ + ui_loginscreen.h \ + /usr/include/qt5/QtCore/QVariant \ + /usr/include/qt5/QtWidgets/QAction \ + /usr/include/qt5/QtWidgets/qaction.h \ + /usr/include/qt5/QtWidgets/qactiongroup.h \ + /usr/include/qt5/QtWidgets/QApplication \ + /usr/include/qt5/QtWidgets/qapplication.h \ + /usr/include/qt5/QtCore/qcoreapplication.h \ + /usr/include/qt5/QtCore/qeventloop.h \ + /usr/include/qt5/QtWidgets/qdesktopwidget.h \ + /usr/include/qt5/QtGui/qguiapplication.h \ + /usr/include/qt5/QtGui/qinputmethod.h \ + /usr/include/qt5/QtWidgets/QButtonGroup \ + /usr/include/qt5/QtWidgets/qbuttongroup.h \ + /usr/include/qt5/QtWidgets/QGridLayout \ + /usr/include/qt5/QtWidgets/qgridlayout.h \ + /usr/include/qt5/QtWidgets/qlayout.h \ + /usr/include/qt5/QtWidgets/qlayoutitem.h \ + /usr/include/qt5/QtWidgets/qboxlayout.h \ + /usr/include/qt5/QtWidgets/QHeaderView \ + /usr/include/qt5/QtWidgets/qheaderview.h \ + /usr/include/qt5/QtWidgets/qabstractitemview.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ + /usr/include/qt5/QtCore/qabstractitemmodel.h \ + /usr/include/qt5/QtCore/qitemselectionmodel.h \ + /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \ + /usr/include/qt5/QtWidgets/qstyleoption.h \ + /usr/include/qt5/QtWidgets/qabstractspinbox.h \ + /usr/include/qt5/QtGui/qvalidator.h \ + /usr/include/qt5/QtWidgets/qslider.h \ + /usr/include/qt5/QtWidgets/qabstractslider.h \ + /usr/include/qt5/QtWidgets/qstyle.h \ + /usr/include/qt5/QtWidgets/qtabbar.h \ + /usr/include/qt5/QtWidgets/qrubberband.h \ + /usr/include/qt5/QtWidgets/QLabel \ + /usr/include/qt5/QtWidgets/qlabel.h \ + /usr/include/qt5/QtWidgets/QLineEdit \ + /usr/include/qt5/QtWidgets/qlineedit.h \ + /usr/include/qt5/QtGui/qtextcursor.h \ + /usr/include/qt5/QtGui/qtextformat.h \ + /usr/include/qt5/QtGui/qpen.h \ + /usr/include/qt5/QtGui/qtextoption.h \ + /usr/include/qt5/QtWidgets/QPushButton \ + /usr/include/qt5/QtWidgets/qpushbutton.h \ + /usr/include/qt5/QtWidgets/qabstractbutton.h \ + /usr/include/qt5/QtWidgets/QSpacerItem \ + /usr/include/qt5/QtWidgets/QWidget $(CXX) -c $(CXXFLAGS) $(INCPATH) -o loginscreen.o ../QChatClient/loginscreen.cpp -chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \ +chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \ + /usr/include/qt5/QtWidgets/QMainWindow \ + /usr/include/qt5/QtWidgets/qmainwindow.h \ + /usr/include/qt5/QtWidgets/qwidget.h \ + /usr/include/qt5/QtGui/qwindowdefs.h \ + /usr/include/qt5/QtCore/qglobal.h \ + /usr/include/qt5/QtCore/qconfig.h \ + /usr/include/qt5/QtCore/qfeatures.h \ + /usr/include/qt5/QtCore/qsystemdetection.h \ + /usr/include/qt5/QtCore/qcompilerdetection.h \ + /usr/include/qt5/QtCore/qprocessordetection.h \ + /usr/include/qt5/QtCore/qlogging.h \ + /usr/include/qt5/QtCore/qflags.h \ + /usr/include/qt5/QtCore/qtypeinfo.h \ + /usr/include/qt5/QtCore/qtypetraits.h \ + /usr/include/qt5/QtCore/qsysinfo.h \ + /usr/include/qt5/QtCore/qobjectdefs.h \ + /usr/include/qt5/QtCore/qnamespace.h \ + /usr/include/qt5/QtCore/qobjectdefs_impl.h \ + /usr/include/qt5/QtGui/qwindowdefs_win.h \ + /usr/include/qt5/QtCore/qobject.h \ + /usr/include/qt5/QtCore/qstring.h \ + /usr/include/qt5/QtCore/qchar.h \ + /usr/include/qt5/QtCore/qbytearray.h \ + /usr/include/qt5/QtCore/qrefcount.h \ + /usr/include/qt5/QtCore/qatomic.h \ + /usr/include/qt5/QtCore/qbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_bootstrap.h \ + /usr/include/qt5/QtCore/qgenericatomic.h \ + /usr/include/qt5/QtCore/qatomic_msvc.h \ + /usr/include/qt5/QtCore/qatomic_integrity.h \ + /usr/include/qt5/QtCore/qoldbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_vxworks.h \ + /usr/include/qt5/QtCore/qatomic_power.h \ + /usr/include/qt5/QtCore/qatomic_aarch64.h \ + /usr/include/qt5/QtCore/qatomic_alpha.h \ + /usr/include/qt5/QtCore/qatomic_armv7.h \ + /usr/include/qt5/QtCore/qatomic_armv6.h \ + /usr/include/qt5/QtCore/qatomic_armv5.h \ + /usr/include/qt5/QtCore/qatomic_bfin.h \ + /usr/include/qt5/QtCore/qatomic_ia64.h \ + /usr/include/qt5/QtCore/qatomic_mips.h \ + /usr/include/qt5/QtCore/qatomic_s390.h \ + /usr/include/qt5/QtCore/qatomic_sh4a.h \ + /usr/include/qt5/QtCore/qatomic_sparc.h \ + /usr/include/qt5/QtCore/qatomic_x86.h \ + /usr/include/qt5/QtCore/qatomic_cxx11.h \ + /usr/include/qt5/QtCore/qatomic_gcc.h \ + /usr/include/qt5/QtCore/qatomic_unix.h \ + /usr/include/qt5/QtCore/qarraydata.h \ + /usr/include/qt5/QtCore/qstringbuilder.h \ + /usr/include/qt5/QtCore/qlist.h \ + /usr/include/qt5/QtCore/qalgorithms.h \ + /usr/include/qt5/QtCore/qiterator.h \ + /usr/include/qt5/QtCore/qcoreevent.h \ + /usr/include/qt5/QtCore/qscopedpointer.h \ + /usr/include/qt5/QtCore/qmetatype.h \ + /usr/include/qt5/QtCore/qvarlengtharray.h \ + /usr/include/qt5/QtCore/qcontainerfwd.h \ + /usr/include/qt5/QtCore/qisenum.h \ + /usr/include/qt5/QtCore/qobject_impl.h \ + /usr/include/qt5/QtCore/qmargins.h \ + /usr/include/qt5/QtGui/qpaintdevice.h \ + /usr/include/qt5/QtCore/qrect.h \ + /usr/include/qt5/QtCore/qsize.h \ + /usr/include/qt5/QtCore/qpoint.h \ + /usr/include/qt5/QtGui/qpalette.h \ + /usr/include/qt5/QtGui/qcolor.h \ + /usr/include/qt5/QtGui/qrgb.h \ + /usr/include/qt5/QtCore/qstringlist.h \ + /usr/include/qt5/QtCore/qdatastream.h \ + /usr/include/qt5/QtCore/qiodevice.h \ + /usr/include/qt5/QtCore/qpair.h \ + /usr/include/qt5/QtCore/qregexp.h \ + /usr/include/qt5/QtCore/qstringmatcher.h \ + /usr/include/qt5/QtGui/qbrush.h \ + /usr/include/qt5/QtCore/qvector.h \ + /usr/include/qt5/QtGui/qmatrix.h \ + /usr/include/qt5/QtGui/qpolygon.h \ + /usr/include/qt5/QtGui/qregion.h \ + /usr/include/qt5/QtCore/qline.h \ + /usr/include/qt5/QtGui/qtransform.h \ + /usr/include/qt5/QtGui/qpainterpath.h \ + /usr/include/qt5/QtGui/qimage.h \ + /usr/include/qt5/QtGui/qpixmap.h \ + /usr/include/qt5/QtCore/qsharedpointer.h \ + /usr/include/qt5/QtCore/qshareddata.h \ + /usr/include/qt5/QtCore/qsharedpointer_impl.h \ + /usr/include/qt5/QtCore/qhash.h \ + /usr/include/qt5/QtGui/qfont.h \ + /usr/include/qt5/QtGui/qfontmetrics.h \ + /usr/include/qt5/QtGui/qfontinfo.h \ + /usr/include/qt5/QtWidgets/qsizepolicy.h \ + /usr/include/qt5/QtGui/qcursor.h \ + /usr/include/qt5/QtGui/qkeysequence.h \ + /usr/include/qt5/QtGui/qevent.h \ + /usr/include/qt5/QtCore/qvariant.h \ + /usr/include/qt5/QtCore/qmap.h \ + /usr/include/qt5/QtCore/qdebug.h \ + /usr/include/qt5/QtCore/qtextstream.h \ + /usr/include/qt5/QtCore/qlocale.h \ + /usr/include/qt5/QtCore/qset.h \ + /usr/include/qt5/QtCore/qcontiguouscache.h \ + /usr/include/qt5/QtCore/qurl.h \ + /usr/include/qt5/QtCore/qurlquery.h \ + /usr/include/qt5/QtCore/qfile.h \ + /usr/include/qt5/QtCore/qfiledevice.h \ + /usr/include/qt5/QtGui/qvector2d.h \ + /usr/include/qt5/QtGui/qtouchdevice.h \ + /usr/include/qt5/QtWidgets/qtabwidget.h \ + /usr/include/qt5/QtGui/qicon.h \ + ../QChatClient/Socket.h \ + ../QChatClient/SocketException.h \ + ../QChatClient/loginscreen.h \ + /usr/include/qt5/QtWidgets/QDialog \ + /usr/include/qt5/QtWidgets/qdialog.h \ + /usr/include/qt5/QtCore/QRegExp \ + ../QChatClient/chatwindow.h \ + ui_chatroom.h \ + /usr/include/qt5/QtCore/QVariant \ + /usr/include/qt5/QtWidgets/QAction \ + /usr/include/qt5/QtWidgets/qaction.h \ + /usr/include/qt5/QtWidgets/qactiongroup.h \ + /usr/include/qt5/QtWidgets/QApplication \ + /usr/include/qt5/QtWidgets/qapplication.h \ + /usr/include/qt5/QtCore/qcoreapplication.h \ + /usr/include/qt5/QtCore/qeventloop.h \ + /usr/include/qt5/QtWidgets/qdesktopwidget.h \ + /usr/include/qt5/QtGui/qguiapplication.h \ + /usr/include/qt5/QtGui/qinputmethod.h \ + /usr/include/qt5/QtWidgets/QButtonGroup \ + /usr/include/qt5/QtWidgets/qbuttongroup.h \ + /usr/include/qt5/QtWidgets/QGridLayout \ + /usr/include/qt5/QtWidgets/qgridlayout.h \ + /usr/include/qt5/QtWidgets/qlayout.h \ + /usr/include/qt5/QtWidgets/qlayoutitem.h \ + /usr/include/qt5/QtWidgets/qboxlayout.h \ + /usr/include/qt5/QtWidgets/QHeaderView \ + /usr/include/qt5/QtWidgets/qheaderview.h \ + /usr/include/qt5/QtWidgets/qabstractitemview.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ + /usr/include/qt5/QtCore/qabstractitemmodel.h \ + /usr/include/qt5/QtCore/qitemselectionmodel.h \ + /usr/include/qt5/QtWidgets/qabstractitemdelegate.h \ + /usr/include/qt5/QtWidgets/qstyleoption.h \ + /usr/include/qt5/QtWidgets/qabstractspinbox.h \ + /usr/include/qt5/QtGui/qvalidator.h \ + /usr/include/qt5/QtWidgets/qslider.h \ + /usr/include/qt5/QtWidgets/qabstractslider.h \ + /usr/include/qt5/QtWidgets/qstyle.h \ + /usr/include/qt5/QtWidgets/qtabbar.h \ + /usr/include/qt5/QtWidgets/qrubberband.h \ + /usr/include/qt5/QtWidgets/QListWidget \ + /usr/include/qt5/QtWidgets/qlistwidget.h \ + /usr/include/qt5/QtWidgets/qlistview.h \ + /usr/include/qt5/QtWidgets/QMenu \ + /usr/include/qt5/QtWidgets/qmenu.h \ + /usr/include/qt5/QtWidgets/QMenuBar \ + /usr/include/qt5/QtWidgets/qmenubar.h \ + /usr/include/qt5/QtWidgets/QPushButton \ + /usr/include/qt5/QtWidgets/qpushbutton.h \ + /usr/include/qt5/QtWidgets/qabstractbutton.h \ + /usr/include/qt5/QtWidgets/QSplitter \ + /usr/include/qt5/QtWidgets/qsplitter.h \ + /usr/include/qt5/QtWidgets/QWidget \ + ../QChatClient/chatinputtext.h \ + /usr/include/qt5/QtWidgets/QTextEdit \ + /usr/include/qt5/QtWidgets/qtextedit.h \ + /usr/include/qt5/QtGui/qtextdocument.h \ + /usr/include/qt5/QtGui/qtextoption.h \ + /usr/include/qt5/QtGui/qtextcursor.h \ + /usr/include/qt5/QtGui/qtextformat.h \ + /usr/include/qt5/QtGui/qpen.h \ + /usr/include/qt5/QtGui/QKeyEvent \ + ../QChatClient/chatwidget.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatroom.o ../QChatClient/chatroom.cpp + +Socket.o: ../QChatClient/Socket.cpp ../QChatClient/Socket.h \ + ../QChatClient/SocketException.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Socket.o ../QChatClient/Socket.cpp + +chatwidget.o: ../QChatClient/chatwidget.cpp ../QChatClient/chatwidget.h \ + /usr/include/qt5/QtWidgets/QTextEdit \ + /usr/include/qt5/QtWidgets/qtextedit.h \ + /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ + /usr/include/qt5/QtWidgets/qframe.h \ + /usr/include/qt5/QtWidgets/qwidget.h \ + /usr/include/qt5/QtGui/qwindowdefs.h \ + /usr/include/qt5/QtCore/qglobal.h \ + /usr/include/qt5/QtCore/qconfig.h \ + /usr/include/qt5/QtCore/qfeatures.h \ + /usr/include/qt5/QtCore/qsystemdetection.h \ + /usr/include/qt5/QtCore/qcompilerdetection.h \ + /usr/include/qt5/QtCore/qprocessordetection.h \ + /usr/include/qt5/QtCore/qlogging.h \ + /usr/include/qt5/QtCore/qflags.h \ + /usr/include/qt5/QtCore/qtypeinfo.h \ + /usr/include/qt5/QtCore/qtypetraits.h \ + /usr/include/qt5/QtCore/qsysinfo.h \ + /usr/include/qt5/QtCore/qobjectdefs.h \ + /usr/include/qt5/QtCore/qnamespace.h \ + /usr/include/qt5/QtCore/qobjectdefs_impl.h \ + /usr/include/qt5/QtGui/qwindowdefs_win.h \ + /usr/include/qt5/QtCore/qobject.h \ + /usr/include/qt5/QtCore/qstring.h \ + /usr/include/qt5/QtCore/qchar.h \ + /usr/include/qt5/QtCore/qbytearray.h \ + /usr/include/qt5/QtCore/qrefcount.h \ + /usr/include/qt5/QtCore/qatomic.h \ + /usr/include/qt5/QtCore/qbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_bootstrap.h \ + /usr/include/qt5/QtCore/qgenericatomic.h \ + /usr/include/qt5/QtCore/qatomic_msvc.h \ + /usr/include/qt5/QtCore/qatomic_integrity.h \ + /usr/include/qt5/QtCore/qoldbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_vxworks.h \ + /usr/include/qt5/QtCore/qatomic_power.h \ + /usr/include/qt5/QtCore/qatomic_aarch64.h \ + /usr/include/qt5/QtCore/qatomic_alpha.h \ + /usr/include/qt5/QtCore/qatomic_armv7.h \ + /usr/include/qt5/QtCore/qatomic_armv6.h \ + /usr/include/qt5/QtCore/qatomic_armv5.h \ + /usr/include/qt5/QtCore/qatomic_bfin.h \ + /usr/include/qt5/QtCore/qatomic_ia64.h \ + /usr/include/qt5/QtCore/qatomic_mips.h \ + /usr/include/qt5/QtCore/qatomic_s390.h \ + /usr/include/qt5/QtCore/qatomic_sh4a.h \ + /usr/include/qt5/QtCore/qatomic_sparc.h \ + /usr/include/qt5/QtCore/qatomic_x86.h \ + /usr/include/qt5/QtCore/qatomic_cxx11.h \ + /usr/include/qt5/QtCore/qatomic_gcc.h \ + /usr/include/qt5/QtCore/qatomic_unix.h \ + /usr/include/qt5/QtCore/qarraydata.h \ + /usr/include/qt5/QtCore/qstringbuilder.h \ + /usr/include/qt5/QtCore/qlist.h \ + /usr/include/qt5/QtCore/qalgorithms.h \ + /usr/include/qt5/QtCore/qiterator.h \ + /usr/include/qt5/QtCore/qcoreevent.h \ + /usr/include/qt5/QtCore/qscopedpointer.h \ + /usr/include/qt5/QtCore/qmetatype.h \ + /usr/include/qt5/QtCore/qvarlengtharray.h \ + /usr/include/qt5/QtCore/qcontainerfwd.h \ + /usr/include/qt5/QtCore/qisenum.h \ + /usr/include/qt5/QtCore/qobject_impl.h \ + /usr/include/qt5/QtCore/qmargins.h \ + /usr/include/qt5/QtGui/qpaintdevice.h \ + /usr/include/qt5/QtCore/qrect.h \ + /usr/include/qt5/QtCore/qsize.h \ + /usr/include/qt5/QtCore/qpoint.h \ + /usr/include/qt5/QtGui/qpalette.h \ + /usr/include/qt5/QtGui/qcolor.h \ + /usr/include/qt5/QtGui/qrgb.h \ + /usr/include/qt5/QtCore/qstringlist.h \ + /usr/include/qt5/QtCore/qdatastream.h \ + /usr/include/qt5/QtCore/qiodevice.h \ + /usr/include/qt5/QtCore/qpair.h \ + /usr/include/qt5/QtCore/qregexp.h \ + /usr/include/qt5/QtCore/qstringmatcher.h \ + /usr/include/qt5/QtGui/qbrush.h \ + /usr/include/qt5/QtCore/qvector.h \ + /usr/include/qt5/QtGui/qmatrix.h \ + /usr/include/qt5/QtGui/qpolygon.h \ + /usr/include/qt5/QtGui/qregion.h \ + /usr/include/qt5/QtCore/qline.h \ + /usr/include/qt5/QtGui/qtransform.h \ + /usr/include/qt5/QtGui/qpainterpath.h \ + /usr/include/qt5/QtGui/qimage.h \ + /usr/include/qt5/QtGui/qpixmap.h \ + /usr/include/qt5/QtCore/qsharedpointer.h \ + /usr/include/qt5/QtCore/qshareddata.h \ + /usr/include/qt5/QtCore/qsharedpointer_impl.h \ + /usr/include/qt5/QtCore/qhash.h \ + /usr/include/qt5/QtGui/qfont.h \ + /usr/include/qt5/QtGui/qfontmetrics.h \ + /usr/include/qt5/QtGui/qfontinfo.h \ + /usr/include/qt5/QtWidgets/qsizepolicy.h \ + /usr/include/qt5/QtGui/qcursor.h \ + /usr/include/qt5/QtGui/qkeysequence.h \ + /usr/include/qt5/QtGui/qevent.h \ + /usr/include/qt5/QtCore/qvariant.h \ + /usr/include/qt5/QtCore/qmap.h \ + /usr/include/qt5/QtCore/qdebug.h \ + /usr/include/qt5/QtCore/qtextstream.h \ + /usr/include/qt5/QtCore/qlocale.h \ + /usr/include/qt5/QtCore/qset.h \ + /usr/include/qt5/QtCore/qcontiguouscache.h \ + /usr/include/qt5/QtCore/qurl.h \ + /usr/include/qt5/QtCore/qurlquery.h \ + /usr/include/qt5/QtCore/qfile.h \ + /usr/include/qt5/QtCore/qfiledevice.h \ + /usr/include/qt5/QtGui/qvector2d.h \ + /usr/include/qt5/QtGui/qtouchdevice.h \ + /usr/include/qt5/QtGui/qtextdocument.h \ + /usr/include/qt5/QtGui/qtextoption.h \ + /usr/include/qt5/QtGui/qtextcursor.h \ + /usr/include/qt5/QtGui/qtextformat.h \ + /usr/include/qt5/QtGui/qpen.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwidget.o ../QChatClient/chatwidget.cpp + +chatwindow.o: ../QChatClient/chatwindow.cpp ../QChatClient/chatwindow.h \ /usr/include/qt5/QtWidgets/QMainWindow \ /usr/include/qt5/QtWidgets/qmainwindow.h \ /usr/include/qt5/QtWidgets/qwidget.h \ @@ -1564,9 +2095,7 @@ chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \ /usr/include/qt5/QtGui/qtouchdevice.h \ /usr/include/qt5/QtWidgets/qtabwidget.h \ /usr/include/qt5/QtGui/qicon.h \ - ../QChatClient/Socket.h \ - ../QChatClient/SocketException.h \ - ui_chatroom.h \ + ui_chatwindow.h \ /usr/include/qt5/QtCore/QVariant \ /usr/include/qt5/QtWidgets/QAction \ /usr/include/qt5/QtWidgets/qaction.h \ @@ -1601,11 +2130,18 @@ chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \ /usr/include/qt5/QtWidgets/qstyle.h \ /usr/include/qt5/QtWidgets/qtabbar.h \ /usr/include/qt5/QtWidgets/qrubberband.h \ - /usr/include/qt5/QtWidgets/QListWidget \ - /usr/include/qt5/QtWidgets/qlistwidget.h \ - /usr/include/qt5/QtWidgets/qlistview.h \ + /usr/include/qt5/QtWidgets/QMenu \ + /usr/include/qt5/QtWidgets/qmenu.h \ + /usr/include/qt5/QtWidgets/QMenuBar \ + /usr/include/qt5/QtWidgets/qmenubar.h \ + /usr/include/qt5/QtWidgets/QPushButton \ + /usr/include/qt5/QtWidgets/qpushbutton.h \ + /usr/include/qt5/QtWidgets/qabstractbutton.h \ + /usr/include/qt5/QtWidgets/QSpacerItem \ /usr/include/qt5/QtWidgets/QSplitter \ /usr/include/qt5/QtWidgets/qsplitter.h \ + /usr/include/qt5/QtWidgets/QWidget \ + ../QChatClient/chatinputtext.h \ /usr/include/qt5/QtWidgets/QTextEdit \ /usr/include/qt5/QtWidgets/qtextedit.h \ /usr/include/qt5/QtGui/qtextdocument.h \ @@ -1613,20 +2149,11 @@ chatroom.o: ../QChatClient/chatroom.cpp ../QChatClient/chatroom.h \ /usr/include/qt5/QtGui/qtextcursor.h \ /usr/include/qt5/QtGui/qtextformat.h \ /usr/include/qt5/QtGui/qpen.h \ - /usr/include/qt5/QtWidgets/QWidget \ + /usr/include/qt5/QtGui/QKeyEvent \ ../QChatClient/chatwidget.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatroom.o ../QChatClient/chatroom.cpp - -Socket.o: ../QChatClient/Socket.cpp ../QChatClient/Socket.h \ - ../QChatClient/SocketException.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Socket.o ../QChatClient/Socket.cpp - -client.o: ../QChatClient/client.cpp ../QChatClient/client.h \ - ../QChatClient/Socket.h \ - ../QChatClient/SocketException.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o client.o ../QChatClient/client.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwindow.o ../QChatClient/chatwindow.cpp -chatwidget.o: ../QChatClient/chatwidget.cpp ../QChatClient/chatwidget.h \ +chatinputtext.o: ../QChatClient/chatinputtext.cpp ../QChatClient/chatinputtext.h \ /usr/include/qt5/QtWidgets/QTextEdit \ /usr/include/qt5/QtWidgets/qtextedit.h \ /usr/include/qt5/QtWidgets/qabstractscrollarea.h \ @@ -1741,11 +2268,9 @@ chatwidget.o: ../QChatClient/chatwidget.cpp ../QChatClient/chatwidget.h \ /usr/include/qt5/QtGui/qtextoption.h \ /usr/include/qt5/QtGui/qtextcursor.h \ /usr/include/qt5/QtGui/qtextformat.h \ - /usr/include/qt5/QtGui/qpen.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatwidget.o ../QChatClient/chatwidget.cpp - -moc_chatwindow.o: moc_chatwindow.cpp - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatwindow.o moc_chatwindow.cpp + /usr/include/qt5/QtGui/qpen.h \ + /usr/include/qt5/QtGui/QKeyEvent + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o chatinputtext.o ../QChatClient/chatinputtext.cpp moc_loginscreen.o: moc_loginscreen.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_loginscreen.o moc_loginscreen.cpp @@ -1756,6 +2281,12 @@ moc_chatroom.o: moc_chatroom.cpp moc_chatwidget.o: moc_chatwidget.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatwidget.o moc_chatwidget.cpp +moc_chatwindow.o: moc_chatwindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatwindow.o moc_chatwindow.cpp + +moc_chatinputtext.o: moc_chatinputtext.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_chatinputtext.o moc_chatinputtext.cpp + ####### Install install: FORCE diff --git a/build-QChatClient-Desktop-Debug/QChatClient b/build-QChatClient-Desktop-Debug/QChatClient index 1d95cd0..87b81ee 100755 --- a/build-QChatClient-Desktop-Debug/QChatClient +++ b/build-QChatClient-Desktop-Debug/QChatClient diff --git a/build-QChatClient-Desktop-Debug/chatwidget.o b/build-QChatClient-Desktop-Debug/chatwidget.o index d52d43f..66897aa 100644 --- a/build-QChatClient-Desktop-Debug/chatwidget.o +++ b/build-QChatClient-Desktop-Debug/chatwidget.o diff --git a/build-QChatClient-Desktop-Debug/chatwindow.o b/build-QChatClient-Desktop-Debug/chatwindow.o index ac59618..4afe43a 100644 --- a/build-QChatClient-Desktop-Debug/chatwindow.o +++ b/build-QChatClient-Desktop-Debug/chatwindow.o diff --git a/build-QChatClient-Desktop-Debug/loginscreen.o b/build-QChatClient-Desktop-Debug/loginscreen.o index a96cbf1..06081e3 100644 --- a/build-QChatClient-Desktop-Debug/loginscreen.o +++ b/build-QChatClient-Desktop-Debug/loginscreen.o diff --git a/build-QChatClient-Desktop-Debug/main.o b/build-QChatClient-Desktop-Debug/main.o index 2ad5da7..ef17633 100644 --- a/build-QChatClient-Desktop-Debug/main.o +++ b/build-QChatClient-Desktop-Debug/main.o diff --git a/build-QChatClient-Desktop-Debug/moc_chatroom.cpp b/build-QChatClient-Desktop-Debug/moc_chatroom.cpp index 6456f86..1ae239a 100644 --- a/build-QChatClient-Desktop-Debug/moc_chatroom.cpp +++ b/build-QChatClient-Desktop-Debug/moc_chatroom.cpp @@ -19,8 +19,8 @@ QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_Chatroom_t { - QByteArrayData data[1]; - char stringdata[10]; + QByteArrayData data[11]; + char stringdata[118]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -29,9 +29,22 @@ struct qt_meta_stringdata_Chatroom_t { ) static const qt_meta_stringdata_Chatroom_t qt_meta_stringdata_Chatroom = { { -QT_MOC_LITERAL(0, 0, 8) +QT_MOC_LITERAL(0, 0, 8), +QT_MOC_LITERAL(1, 9, 15), +QT_MOC_LITERAL(2, 25, 0), +QT_MOC_LITERAL(3, 26, 4), +QT_MOC_LITERAL(4, 31, 15), +QT_MOC_LITERAL(5, 47, 12), +QT_MOC_LITERAL(6, 60, 7), +QT_MOC_LITERAL(7, 68, 8), +QT_MOC_LITERAL(8, 77, 13), +QT_MOC_LITERAL(9, 91, 6), +QT_MOC_LITERAL(10, 98, 18) }, - "Chatroom\0" + "Chatroom\0threadsFinished\0\0exit\0" + "messagesToPrint\0startSession\0sendMsg\0" + "printMsg\0finishThreads\0finish\0" + "disconnectChatroom\0" }; #undef QT_MOC_LITERAL @@ -41,22 +54,71 @@ static const uint qt_meta_data_Chatroom[] = { 7, // revision 0, // classname 0, 0, // classinfo - 0, 0, // methods + 8, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 0, // signalCount + 2, // signalCount + + // signals: name, argc, parameters, tag, flags + 1, 1, 54, 2, 0x05, + 4, 0, 57, 2, 0x05, + + // slots: name, argc, parameters, tag, flags + 5, 0, 58, 2, 0x0a, + 6, 0, 59, 2, 0x0a, + 7, 0, 60, 2, 0x0a, + 8, 1, 61, 2, 0x08, + 9, 0, 64, 2, 0x08, + 10, 0, 65, 2, 0x08, + + // signals: parameters + QMetaType::Void, QMetaType::Bool, 3, + QMetaType::Void, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, + QMetaType::Void, QMetaType::Bool, 3, + QMetaType::Void, + QMetaType::Void, 0 // eod }; void Chatroom::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { - Q_UNUSED(_o); - Q_UNUSED(_id); - Q_UNUSED(_c); - Q_UNUSED(_a); + if (_c == QMetaObject::InvokeMetaMethod) { + Chatroom *_t = static_cast(_o); + switch (_id) { + case 0: _t->threadsFinished((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 1: _t->messagesToPrint(); break; + case 2: _t->startSession(); break; + case 3: _t->sendMsg(); break; + case 4: _t->printMsg(); break; + case 5: _t->finishThreads((*reinterpret_cast< bool(*)>(_a[1]))); break; + case 6: _t->finish(); break; + case 7: _t->disconnectChatroom(); break; + default: ; + } + } else if (_c == QMetaObject::IndexOfMethod) { + int *result = reinterpret_cast(_a[0]); + void **func = reinterpret_cast(_a[1]); + { + typedef void (Chatroom::*_t)(bool ); + if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Chatroom::threadsFinished)) { + *result = 0; + } + } + { + typedef void (Chatroom::*_t)(); + if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&Chatroom::messagesToPrint)) { + *result = 1; + } + } + } } const QMetaObject Chatroom::staticMetaObject = { @@ -83,6 +145,28 @@ int Chatroom::qt_metacall(QMetaObject::Call _c, int _id, void **_a) _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 8) + qt_static_metacall(this, _c, _id, _a); + _id -= 8; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 8) + *reinterpret_cast(_a[0]) = -1; + _id -= 8; + } return _id; } + +// SIGNAL 0 +void Chatroom::threadsFinished(bool _t1) +{ + void *_a[] = { 0, const_cast(reinterpret_cast(&_t1)) }; + QMetaObject::activate(this, &staticMetaObject, 0, _a); +} + +// SIGNAL 1 +void Chatroom::messagesToPrint() +{ + QMetaObject::activate(this, &staticMetaObject, 1, 0); +} QT_END_MOC_NAMESPACE diff --git a/build-QChatClient-Desktop-Debug/moc_chatroom.o b/build-QChatClient-Desktop-Debug/moc_chatroom.o index 2120d98..fc639f9 100644 --- a/build-QChatClient-Desktop-Debug/moc_chatroom.o +++ b/build-QChatClient-Desktop-Debug/moc_chatroom.o diff --git a/build-QChatClient-Desktop-Debug/moc_chatwidget.o b/build-QChatClient-Desktop-Debug/moc_chatwidget.o index 33e1fa7..5da1b57 100644 --- a/build-QChatClient-Desktop-Debug/moc_chatwidget.o +++ b/build-QChatClient-Desktop-Debug/moc_chatwidget.o diff --git a/build-QChatClient-Desktop-Debug/moc_chatwindow.o b/build-QChatClient-Desktop-Debug/moc_chatwindow.o index c9820ef..7790e5b 100644 --- a/build-QChatClient-Desktop-Debug/moc_chatwindow.o +++ b/build-QChatClient-Desktop-Debug/moc_chatwindow.o diff --git a/build-QChatClient-Desktop-Debug/moc_loginscreen.cpp b/build-QChatClient-Desktop-Debug/moc_loginscreen.cpp index 3d087ac..d449b2f 100644 --- a/build-QChatClient-Desktop-Debug/moc_loginscreen.cpp +++ b/build-QChatClient-Desktop-Debug/moc_loginscreen.cpp @@ -19,8 +19,8 @@ QT_BEGIN_MOC_NAMESPACE struct qt_meta_stringdata_LoginScreen_t { - QByteArrayData data[1]; - char stringdata[13]; + QByteArrayData data[4]; + char stringdata[40]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ @@ -29,9 +29,12 @@ struct qt_meta_stringdata_LoginScreen_t { ) static const qt_meta_stringdata_LoginScreen_t qt_meta_stringdata_LoginScreen = { { -QT_MOC_LITERAL(0, 0, 11) +QT_MOC_LITERAL(0, 0, 11), +QT_MOC_LITERAL(1, 12, 13), +QT_MOC_LITERAL(2, 26, 0), +QT_MOC_LITERAL(3, 27, 11) }, - "LoginScreen\0" + "LoginScreen\0connectToChat\0\0cancelLogin\0" }; #undef QT_MOC_LITERAL @@ -41,21 +44,34 @@ static const uint qt_meta_data_LoginScreen[] = { 7, // revision 0, // classname 0, 0, // classinfo - 0, 0, // methods + 2, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount + // slots: name, argc, parameters, tag, flags + 1, 0, 24, 2, 0x0a, + 3, 0, 25, 2, 0x0a, + + // slots: parameters + QMetaType::Void, + QMetaType::Void, + 0 // eod }; void LoginScreen::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { - Q_UNUSED(_o); - Q_UNUSED(_id); - Q_UNUSED(_c); + if (_c == QMetaObject::InvokeMetaMethod) { + LoginScreen *_t = static_cast(_o); + switch (_id) { + case 0: _t->connectToChat(); break; + case 1: _t->cancelLogin(); break; + default: ; + } + } Q_UNUSED(_a); } @@ -83,6 +99,15 @@ int LoginScreen::qt_metacall(QMetaObject::Call _c, int _id, void **_a) _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 2) + qt_static_metacall(this, _c, _id, _a); + _id -= 2; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 2) + *reinterpret_cast(_a[0]) = -1; + _id -= 2; + } return _id; } QT_END_MOC_NAMESPACE diff --git a/build-QChatClient-Desktop-Debug/moc_loginscreen.o b/build-QChatClient-Desktop-Debug/moc_loginscreen.o index d5c9b09..f4b685d 100644 --- a/build-QChatClient-Desktop-Debug/moc_loginscreen.o +++ b/build-QChatClient-Desktop-Debug/moc_loginscreen.o diff --git a/build-QChatClient-Desktop-Debug/ui_chatroom.h b/build-QChatClient-Desktop-Debug/ui_chatroom.h index 75ea0dd..27fee6a 100644 --- a/build-QChatClient-Desktop-Debug/ui_chatroom.h +++ b/build-QChatClient-Desktop-Debug/ui_chatroom.h @@ -17,9 +17,12 @@ #include #include #include +#include +#include +#include #include -#include #include +#include "chatinputtext.h" #include "chatwidget.h" QT_BEGIN_NAMESPACE @@ -27,6 +30,9 @@ QT_BEGIN_NAMESPACE class Ui_Chatroom { public: + QAction *actionConnect; + QAction *actionExit; + QAction *actionDisconnect; QWidget *centralwidget; QGridLayout *gridLayout_2; QSplitter *windowSplitter; @@ -34,14 +40,23 @@ public: QGridLayout *gridLayout; QSplitter *chatSplitter; ChatWidget *chatText; - QTextEdit *inputText; + chatInputText *inputText; QListWidget *userList; + QPushButton *sendButton; + QMenuBar *menuBar; + QMenu *menuChat; void setupUi(QMainWindow *Chatroom) { if (Chatroom->objectName().isEmpty()) Chatroom->setObjectName(QStringLiteral("Chatroom")); Chatroom->resize(800, 600); + actionConnect = new QAction(Chatroom); + actionConnect->setObjectName(QStringLiteral("actionConnect")); + actionExit = new QAction(Chatroom); + actionExit->setObjectName(QStringLiteral("actionExit")); + actionDisconnect = new QAction(Chatroom); + actionDisconnect->setObjectName(QStringLiteral("actionDisconnect")); centralwidget = new QWidget(Chatroom); centralwidget->setObjectName(QStringLiteral("centralwidget")); gridLayout_2 = new QGridLayout(centralwidget); @@ -60,9 +75,9 @@ public: chatSplitter->setOrientation(Qt::Vertical); chatText = new ChatWidget(chatSplitter); chatText->setObjectName(QStringLiteral("chatText")); - chatText->setReadOnly(true); + chatText->setReadOnly(false); chatSplitter->addWidget(chatText); - inputText = new QTextEdit(chatSplitter); + inputText = new chatInputText(chatSplitter); inputText->setObjectName(QStringLiteral("inputText")); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored); sizePolicy.setHorizontalStretch(0); @@ -70,6 +85,7 @@ public: sizePolicy.setHeightForWidth(inputText->sizePolicy().hasHeightForWidth()); inputText->setSizePolicy(sizePolicy); inputText->setMaximumSize(QSize(16777215, 16777215)); + inputText->setReadOnly(true); chatSplitter->addWidget(inputText); gridLayout->addWidget(chatSplitter, 0, 0, 1, 1); @@ -88,7 +104,28 @@ public: gridLayout_2->addWidget(windowSplitter, 0, 0, 1, 1); + sendButton = new QPushButton(centralwidget); + sendButton->setObjectName(QStringLiteral("sendButton")); + QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Fixed); + sizePolicy2.setHorizontalStretch(0); + sizePolicy2.setVerticalStretch(0); + sizePolicy2.setHeightForWidth(sendButton->sizePolicy().hasHeightForWidth()); + sendButton->setSizePolicy(sizePolicy2); + + gridLayout_2->addWidget(sendButton, 1, 0, 1, 1); + Chatroom->setCentralWidget(centralwidget); + menuBar = new QMenuBar(Chatroom); + menuBar->setObjectName(QStringLiteral("menuBar")); + menuBar->setGeometry(QRect(0, 0, 800, 26)); + menuChat = new QMenu(menuBar); + menuChat->setObjectName(QStringLiteral("menuChat")); + Chatroom->setMenuBar(menuBar); + + menuBar->addAction(menuChat->menuAction()); + menuChat->addAction(actionConnect); + menuChat->addAction(actionDisconnect); + menuChat->addAction(actionExit); retranslateUi(Chatroom); @@ -97,7 +134,12 @@ public: void retranslateUi(QMainWindow *Chatroom) { - Chatroom->setWindowTitle(QApplication::translate("Chatroom", "MainWindow", 0)); + Chatroom->setWindowTitle(QApplication::translate("Chatroom", "QChatClient", 0)); + actionConnect->setText(QApplication::translate("Chatroom", "Connect...", 0)); + actionExit->setText(QApplication::translate("Chatroom", "Exit", 0)); + actionDisconnect->setText(QApplication::translate("Chatroom", "Disconnect", 0)); + sendButton->setText(QApplication::translate("Chatroom", "Send", 0)); + menuChat->setTitle(QApplication::translate("Chatroom", "Chat", 0)); } // retranslateUi }; diff --git a/build-QChatClient-Desktop-Debug/ui_chatwindow.h b/build-QChatClient-Desktop-Debug/ui_chatwindow.h index 84991b1..3b205c2 100644 --- a/build-QChatClient-Desktop-Debug/ui_chatwindow.h +++ b/build-QChatClient-Desktop-Debug/ui_chatwindow.h @@ -16,10 +16,13 @@ #include #include #include +#include #include +#include +#include #include -#include #include +#include "chatinputtext.h" #include "chatwidget.h" QT_BEGIN_NAMESPACE @@ -27,18 +30,26 @@ QT_BEGIN_NAMESPACE class Ui_ChatWindow { public: + QAction *actionExit; QWidget *centralWidget; QGridLayout *gridLayout; + QSpacerItem *horizontalSpacer; + QPushButton *sendButton; + QWidget *widget; + QGridLayout *gridLayout_2; QSplitter *splitter; ChatWidget *chatText; - QTextEdit *inputText; + chatInputText *inputText; QMenuBar *menuBar; + QMenu *menuChat; void setupUi(QMainWindow *ChatWindow) { if (ChatWindow->objectName().isEmpty()) ChatWindow->setObjectName(QStringLiteral("ChatWindow")); ChatWindow->resize(400, 502); + actionExit = new QAction(ChatWindow); + actionExit->setObjectName(QStringLiteral("actionExit")); centralWidget = new QWidget(ChatWindow); centralWidget->setObjectName(QStringLiteral("centralWidget")); centralWidget->setEnabled(true); @@ -51,34 +62,63 @@ public: gridLayout->setSpacing(6); gridLayout->setContentsMargins(11, 11, 11, 11); gridLayout->setObjectName(QStringLiteral("gridLayout")); - splitter = new QSplitter(centralWidget); + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout->addItem(horizontalSpacer, 3, 1, 1, 1); + + sendButton = new QPushButton(centralWidget); + sendButton->setObjectName(QStringLiteral("sendButton")); + QSizePolicy sizePolicy1(QSizePolicy::Minimum, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(sendButton->sizePolicy().hasHeightForWidth()); + sendButton->setSizePolicy(sizePolicy1); + + gridLayout->addWidget(sendButton, 3, 0, 1, 1); + + widget = new QWidget(centralWidget); + widget->setObjectName(QStringLiteral("widget")); + gridLayout_2 = new QGridLayout(widget); + gridLayout_2->setSpacing(6); + gridLayout_2->setContentsMargins(11, 11, 11, 11); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + splitter = new QSplitter(widget); splitter->setObjectName(QStringLiteral("splitter")); splitter->setOrientation(Qt::Vertical); chatText = new ChatWidget(splitter); chatText->setObjectName(QStringLiteral("chatText")); chatText->setReadOnly(true); splitter->addWidget(chatText); - inputText = new QTextEdit(splitter); + inputText = new chatInputText(splitter); inputText->setObjectName(QStringLiteral("inputText")); inputText->setEnabled(true); - QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Ignored); - sizePolicy1.setHorizontalStretch(0); - sizePolicy1.setVerticalStretch(0); - sizePolicy1.setHeightForWidth(inputText->sizePolicy().hasHeightForWidth()); - inputText->setSizePolicy(sizePolicy1); + QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Ignored); + sizePolicy2.setHorizontalStretch(0); + sizePolicy2.setVerticalStretch(0); + sizePolicy2.setHeightForWidth(inputText->sizePolicy().hasHeightForWidth()); + inputText->setSizePolicy(sizePolicy2); inputText->setMinimumSize(QSize(0, 0)); inputText->setMaximumSize(QSize(16777215, 16777215)); inputText->setBaseSize(QSize(0, 0)); + inputText->setReadOnly(true); splitter->addWidget(inputText); - gridLayout->addWidget(splitter, 0, 0, 1, 1); + gridLayout_2->addWidget(splitter, 0, 0, 1, 1); + + + gridLayout->addWidget(widget, 0, 0, 1, 2); ChatWindow->setCentralWidget(centralWidget); menuBar = new QMenuBar(ChatWindow); menuBar->setObjectName(QStringLiteral("menuBar")); - menuBar->setGeometry(QRect(0, 0, 400, 25)); + menuBar->setGeometry(QRect(0, 0, 400, 26)); + menuChat = new QMenu(menuBar); + menuChat->setObjectName(QStringLiteral("menuChat")); ChatWindow->setMenuBar(menuBar); + menuBar->addAction(menuChat->menuAction()); + menuChat->addAction(actionExit); + retranslateUi(ChatWindow); QMetaObject::connectSlotsByName(ChatWindow); @@ -86,7 +126,10 @@ public: void retranslateUi(QMainWindow *ChatWindow) { - ChatWindow->setWindowTitle(QApplication::translate("ChatWindow", "ChatWindow", 0)); + ChatWindow->setWindowTitle(QApplication::translate("ChatWindow", "QChatClient", 0)); + actionExit->setText(QApplication::translate("ChatWindow", "Exit", 0)); + sendButton->setText(QApplication::translate("ChatWindow", "Send", 0)); + menuChat->setTitle(QApplication::translate("ChatWindow", "Chat", 0)); } // retranslateUi }; diff --git a/build-QChatClient-Desktop-Debug/ui_loginscreen.h b/build-QChatClient-Desktop-Debug/ui_loginscreen.h index 615a5e3..13dc0a8 100644 --- a/build-QChatClient-Desktop-Debug/ui_loginscreen.h +++ b/build-QChatClient-Desktop-Debug/ui_loginscreen.h @@ -28,24 +28,25 @@ class Ui_LoginScreen { public: QGridLayout *gridLayout; + QLineEdit *serverURLEdit; + QSpacerItem *topSpacer; QLabel *titleLabel; + QSpacerItem *verticalSpacer; + QSpacerItem *rightSpacer; + QSpacerItem *leftSpacer; + QLineEdit *nickEdit; QWidget *buttonBox; QGridLayout *gridLayout_2; - QPushButton *cancelButton; QPushButton *connectButton; + QPushButton *cancelButton; QSpacerItem *buttonHorizSpacer; - QSpacerItem *verticalSpacer; - QSpacerItem *topSpacer; - QSpacerItem *leftSpacer; - QLineEdit *nickEdit; - QLineEdit *serverURLEdit; - QSpacerItem *rightSpacer; + QLabel *label; void setupUi(QDialog *LoginScreen) { if (LoginScreen->objectName().isEmpty()) LoginScreen->setObjectName(QStringLiteral("LoginScreen")); - LoginScreen->resize(402, 173); + LoginScreen->resize(402, 206); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -53,6 +54,15 @@ public: LoginScreen->setSizePolicy(sizePolicy); gridLayout = new QGridLayout(LoginScreen); gridLayout->setObjectName(QStringLiteral("gridLayout")); + serverURLEdit = new QLineEdit(LoginScreen); + serverURLEdit->setObjectName(QStringLiteral("serverURLEdit")); + + gridLayout->addWidget(serverURLEdit, 4, 1, 1, 1); + + topSpacer = new QSpacerItem(20, 5, QSizePolicy::Minimum, QSizePolicy::Fixed); + + gridLayout->addItem(topSpacer, 0, 1, 1, 1); + titleLabel = new QLabel(LoginScreen); titleLabel->setObjectName(QStringLiteral("titleLabel")); QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum); @@ -64,36 +74,13 @@ public: gridLayout->addWidget(titleLabel, 1, 1, 1, 1); - buttonBox = new QWidget(LoginScreen); - buttonBox->setObjectName(QStringLiteral("buttonBox")); - sizePolicy1.setHeightForWidth(buttonBox->sizePolicy().hasHeightForWidth()); - buttonBox->setSizePolicy(sizePolicy1); - gridLayout_2 = new QGridLayout(buttonBox); - gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); - cancelButton = new QPushButton(buttonBox); - cancelButton->setObjectName(QStringLiteral("cancelButton")); - - gridLayout_2->addWidget(cancelButton, 0, 2, 1, 1); - - connectButton = new QPushButton(buttonBox); - connectButton->setObjectName(QStringLiteral("connectButton")); - - gridLayout_2->addWidget(connectButton, 0, 1, 1, 1); - - buttonHorizSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - gridLayout_2->addItem(buttonHorizSpacer, 0, 0, 1, 1); - - - gridLayout->addWidget(buttonBox, 7, 1, 1, 1); - verticalSpacer = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed); gridLayout->addItem(verticalSpacer, 2, 1, 1, 1); - topSpacer = new QSpacerItem(20, 5, QSizePolicy::Minimum, QSizePolicy::Fixed); + rightSpacer = new QSpacerItem(10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum); - gridLayout->addItem(topSpacer, 0, 1, 1, 1); + gridLayout->addItem(rightSpacer, 4, 2, 1, 1); leftSpacer = new QSpacerItem(10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum); @@ -104,15 +91,38 @@ public: gridLayout->addWidget(nickEdit, 3, 1, 1, 1); - serverURLEdit = new QLineEdit(LoginScreen); - serverURLEdit->setObjectName(QStringLiteral("serverURLEdit")); + buttonBox = new QWidget(LoginScreen); + buttonBox->setObjectName(QStringLiteral("buttonBox")); + sizePolicy1.setHeightForWidth(buttonBox->sizePolicy().hasHeightForWidth()); + buttonBox->setSizePolicy(sizePolicy1); + gridLayout_2 = new QGridLayout(buttonBox); + gridLayout_2->setObjectName(QStringLiteral("gridLayout_2")); + connectButton = new QPushButton(buttonBox); + connectButton->setObjectName(QStringLiteral("connectButton")); - gridLayout->addWidget(serverURLEdit, 4, 1, 1, 1); + gridLayout_2->addWidget(connectButton, 1, 1, 1, 1); - rightSpacer = new QSpacerItem(10, 20, QSizePolicy::Minimum, QSizePolicy::Minimum); + cancelButton = new QPushButton(buttonBox); + cancelButton->setObjectName(QStringLiteral("cancelButton")); - gridLayout->addItem(rightSpacer, 4, 2, 1, 1); + gridLayout_2->addWidget(cancelButton, 1, 2, 1, 1); + + buttonHorizSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + gridLayout_2->addItem(buttonHorizSpacer, 1, 0, 1, 1); + + label = new QLabel(buttonBox); + label->setObjectName(QStringLiteral("label")); + label->setEnabled(true); + gridLayout_2->addWidget(label, 0, 0, 1, 1); + + + gridLayout->addWidget(buttonBox, 7, 1, 1, 1); + + QWidget::setTabOrder(nickEdit, serverURLEdit); + QWidget::setTabOrder(serverURLEdit, connectButton); + QWidget::setTabOrder(connectButton, cancelButton); retranslateUi(LoginScreen); @@ -123,8 +133,9 @@ public: { LoginScreen->setWindowTitle(QApplication::translate("LoginScreen", "Login", 0)); titleLabel->setText(QApplication::translate("LoginScreen", "Log in to chatroom", 0)); - cancelButton->setText(QApplication::translate("LoginScreen", "Cancel", 0)); connectButton->setText(QApplication::translate("LoginScreen", "OK", 0)); + cancelButton->setText(QApplication::translate("LoginScreen", "Cancel", 0)); + label->setText(QApplication::translate("LoginScreen", "INVALID HOSTNAME", 0)); } // retranslateUi };