MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->setWindowIcon(QIcon(":/resource/icon/telescope.png")); this->setWindowTitle(tr("Telescope")); //For common initialization isConnected = false; hostIsSet = false; client= NULL; background=QImage(":/resource/image/colourback.jpg"); net.setParentWidget(this); connect(&net,SIGNAL(hideIMSignal()),this,SLOT(hideIM())); //For exit Tool ui->actionExit->setIcon(QIcon(":/resource/icon/exit.png")); ui->actionExit->setStatusTip(tr("Exit from Telescope.")); connect(ui->actionExit, SIGNAL(triggered()), this, SLOT(closeClient())); //For connect Tool ui->actionConnect->setIcon(QIcon(":/resource/icon/connect.png")); ui->actionConnect->setStatusTip(tr("Set up connection.")); connect(ui->actionConnect, SIGNAL(triggered()), this, SLOT(getConnectInfo())); //For IM Tool ui->actionIM->setIcon(QIcon(":/resource/icon/chat2.png")); ui->actionIM->setStatusTip(tr("Open the IM Dialog.")); ui->actionIM->setCheckable(true); //单击后保持按下状态 connect(ui->actionIM,SIGNAL(triggered()),this,SLOT(showIM())); //For disconnect Tool ui->actionDisConnect->setIcon(QIcon(":/resource/icon/disconnect.png")); ui->actionDisConnect->setStatusTip(tr("Close up connection.")); connect(ui->actionDisConnect, SIGNAL(triggered()), this, SLOT(closeConnect())); //For ToolBar ui->mainToolBar->setMovable(false); //固定工具栏 ui->mainToolBar->addAction(ui->actionConnect); ui->mainToolBar->addAction(ui->actionIM); ui->mainToolBar->addAction(ui->actionDisConnect); ui->mainToolBar->addAction(ui->actionExit); ui->mainToolBar->setIconSize(QSize(50,45)); //设置工具栏图标大小 //For MainWindow setAttribute(Qt::WA_TranslucentBackground); //窗口半透明 setWindowFlags(Qt::Window | Qt::FramelessWindowHint); //无边框窗口 //For central Widget shPic = new ShowPic(this); //shPic->setMinimumSize(QSize(80, 60)); this->setCentralWidget(shPic); }
//----------------------------------------------------------------------------- NetConnectInfo* ServerNetApplyManager::getServerConnectInfo( I32 id ) { return getConnectInfo(mServerDriver,id); }
//----------------------------------------------------------------------------- NetConnectInfo* ServerNetApplyManager::getClientConnectInfo( I32 id ) { return getConnectInfo(mClientDriver,id); }