Widget::Widget(QWidget *parent) : QWidget(parent) { SetUI(); SetConnect(); //初始化星座 GetDateData(); }
void NetClient::HandleStart() { // Use thread group can add code to connect more servers // here can SetConnect more socket connect SetConnect(m_rGameSocket); thread_group tg; tg.create_thread(boost::bind( &NetClient::Run , this ) ); this_thread::yield(); tg.join_all(); // Waitting threads to complete }
void NetClient::HandleConnect(const boost::system::error_code& error,NetSocket* pSocket) { if(error) { SetConnect(*pSocket); }else{ cout << "Connected Success.................ok" << endl; pSocket->Run(); cout << "Socket io event start.................ok" << endl; (m_pOnMsgConnected)(*pSocket); } }
TSlaveForm::TSlaveForm(QWidget *parent) { ui.setupUi(this); connect(ui.bDown, SIGNAL(pressed()), this, SLOT(sl_DownPressed())); connect(ui.bUp, SIGNAL(pressed()), this, SLOT(sl_UpPressed())); connect(ui.bLeft, SIGNAL(pressed()), this, SLOT(sl_LeftPressed())); connect(ui.bRight, SIGNAL(pressed()), this, SLOT(sl_RightPressed())); connect(ui.bDown, SIGNAL(released()), this, SLOT(sl_DownReleased())); connect(ui.bUp, SIGNAL(released()), this, SLOT(sl_UpReleased())); connect(ui.bLeft, SIGNAL(released()), this, SLOT(sl_LeftReleased())); connect(ui.bRight, SIGNAL(released()), this, SLOT(sl_RightReleased())); setWindowTitle(tr("Slave")); SetConnect(false); Refresh(); }