1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "qtchatmx.h"
- #include <QtCore>
- #include <QtGui>
- #include <QPropertyAnimation>
- QtChatMX::QtChatMX(QWidget *parent, Qt::WFlags flags)
- : QMainWindow(parent, flags)
- {
- homeView = new LoginView(this);
- chatView = new ChatView(this);
- networkApi = new NetworkApi(this);
- homeView->resize(640, 360);
- chatView->resize(640, 360);
- chatView->hide();
- connect(homeView, SIGNAL(loginComplete(QString*)), this, SLOT(showChatView(QString*)));
- connect(chatView, SIGNAL(logoutEvent(QString*)), this, SLOT(showHomeView(QString*)));
- chatView->init(networkApi);
- homeView->init(networkApi);
- homeView->show();
- }
- void QtChatMX::showChatView(QString *nick)
- {
- chatView->setNick(nick);
- homeView->hide();
- chatView->show();
- }
- void QtChatMX::showHomeView(QString *nick)
- {
-
- chatView->resetUI();
- chatView->hide();
- homeView->resetUI();
- homeView->show();
- }
- QtChatMX::~QtChatMX()
- {
- }
|