TKN_Window::TKN_Window(QWidget *parent) : QMainWindow(parent), ui(new Ui::TKN_Window) { /* Ui setup */ ui->setupUi(this); ui->buttonStartStop->setText(buttonStartText); self = this; mTime = new QTime(); int i; /* available ports */ char** port_list = listSerialPorts(); if (port_list){ for (i=0; *port_list; i++, port_list++) ui->comboBox_ComPort->insertItem(i, QString(*port_list)); } /* baud rates */ for (i=0; i<sizeof(baudList)/sizeof(baudList[0]) ; i++) ui->comboBox_Baud->insertItem(i, baudList[i]); this->mTknStarted = false; /* Signal connections */ connect(this, SIGNAL(tokenReceived()), this, SLOT(onTokenReceived()), Qt::QueuedConnection); connect(this, SIGNAL(dataReady()), this, SLOT(dataReceive()), Qt::QueuedConnection); this->ui->labelAVR->setPixmap( QPixmap(":/AVR_Chip-W180px.png")); this->updateUI(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); sub=NULL; videoPlayer=new VideoPlayer(this,this); subtitles=new Subtitles(this,this); subtitles->setReadOnly(true); subtitles->hide(); ui->autoris->setText("Вы не авторизировались <a href=\"aut\">Авторизироваться</a>"); ui->logOut->setText(""); ui->closePan->setText("<a href=\"close\"><font color=\"red\">X</font></a>"); setLayouts(); connect(ui->action,SIGNAL(triggered()),this,SLOT(on_open_action_click())); connect(ui->action_2,SIGNAL(triggered()),this,SLOT(on_exit_action())); connect(ui->action_3,SIGNAL(triggered()),this,SLOT(on_open_subs_click())); connect(ui->action_5,SIGNAL(triggered()),this,SLOT(registretion_clicked())); connect(ui->play,SIGNAL(clicked()),this,SLOT(on_play_clicked())); connect(videoPlayer,SIGNAL(on_screen_state_change(bool)),this,SLOT(on_videoplayer_change_state(bool))); ui->pushButton->setToolTip(tr("Добавить слово в мой словарь")); if(QApplication::arguments().size()>1) videoPlayer->play(QApplication::arguments().at(1).trimmed()); ac=new RequestManager(); connect(ac,SIGNAL(finish(QMap<QString,QString>,Action)),this,SLOT(dataReceive(QMap<QString,QString>,Action))); QTimer::singleShot(10,this,SLOT(lazyInit())); }
void MainWindow::SerialDialog_PB_connect_clicked() { mythread = new MyThread(serialdialog.getPort(), serialdialog.getPortSettings(), this); connect(mythread,SIGNAL(serialFinished(QByteArray)),this,SLOT(dataReceive(QByteArray))); mythread->start(); ui->menuFunction->setDisabled(false); }
void MainWindow::newClient() { if(curSocket != NULL) { curSocket->close(); delete curSocket; curSocket = NULL; } curSocket = tcpServer.nextPendingConnection(); connect(curSocket, SIGNAL(readyRead()), this, SLOT(dataReceive())); ui->plainTextEdit->appendPlainText( tr("get new client ip:%1").arg(curSocket->peerAddress().toString())); }