qt/K-observer_client_qt/main.cpp

32 lines
1.0 KiB
C++
Raw Normal View History

2013-01-19 20:12:40 +00:00
#include <QtGui/QApplication>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "observerclientmodel.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
TObserverClientModel observerClient;
w.ObserverClientModel = &observerClient;
observerClient.MainWindowPtr = &w;
w.OpenMap();
w.GetUi()->ConnectButton->PressedHandler = boost::bind(&TObserverClientModel::OnConnectButtonPressed, &observerClient);
w.GetUi()->UpdateDataButton->PressedHandler = boost::bind(&TObserverClientModel::OnUpdateInfoButtonPressed, &observerClient);
w.GetUi()->DisconnectButton->PressedHandler = boost::bind(&TObserverClientModel::Finish, &observerClient);
w.GetUi()->MapTypeButton->PressedHandler = boost::bind(&TObserverClientModel::OnChangeMapTypeButtonPressed, &observerClient);
w.GetUi()->ChatSendButton->PressedHandler = boost::bind(&TObserverClientModel::OnChatSendClick, &observerClient);
return a.exec();
}