cExternalTrackers::cExternalTrackers(QObject *parent) : QObject(parent),m_HTTPServer(EXTERNAL_TRACKERS_HTTP_PORT) { m_Server.bind(QHostAddress::LocalHost, EXTERNAL_TRACKERS_UDP_PORT); connect(&m_Server, SIGNAL(readyRead()), this, SLOT(readyRead())); connect(&m_HTTPServer,SIGNAL(dataReady(QString)), this, SLOT(onDataReady(QString))); }
void Connection::init() { connect(this, SIGNAL(connected()), SLOT(handshake())); connect(this, SIGNAL(readyRead()), SLOT(onDataReady())); connect(this, SIGNAL(encrypted()), SLOT(onEncrypted())); connect(this, SIGNAL(sslErrors(const QList<QSslError>&)), SLOT(onSslErrors(const QList<QSslError>&))); connect(this, SIGNAL(bytesWritten(qint64)), SLOT(sendNext(qint64))); }
void LegacyPlayerListener::onNewConnection() { while (hasPendingConnections()) { QTcpSocket* socket = nextPendingConnection(); connect( socket, SIGNAL(readyRead()), SLOT(onDataReady()) ); } }
void PlayerListener::onNewConnection() { while (hasPendingConnections()) { QObject* o = nextPendingConnection(); connect( o, SIGNAL(readyRead()), SLOT(onDataReady()) ); connect( o, SIGNAL(disconnected()), o, SLOT(deleteLater()) ); } }
GetProfile::GetProfile(QWidget *parent) : QMainWindow(parent), ui(new Ui::GetProfile) { ui->setupUi(this); userProfile = new UserProfile(this); userProfile->setId("ragnermagalhaes"); ui->idEdit->setText("ragnermagalhaes"); connect(userProfile, SIGNAL(finished()), this, SLOT(onDataReady())); }
void QGstAppSrc::setStream(QIODevice *stream) { if (stream == 0) return; if (m_stream) { disconnect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); disconnect(m_stream, SIGNAL(destroyed()), this, SLOT(streamDestroyed())); } if (m_appSrc) gst_object_unref(G_OBJECT(m_appSrc)); m_dataRequestSize = -1; m_dataRequested = false; m_enoughData = false; m_forceData = false; m_maxBytes = 0; m_appSrc = 0; m_stream = stream; connect(m_stream, SIGNAL(destroyed()), SLOT(streamDestroyed())); connect(m_stream, SIGNAL(readyRead()), this, SLOT(onDataReady())); m_sequential = m_stream->isSequential(); m_setup = false; }
void cExternalTrackers::readyRead() { #if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)) qInfo() << "external tracker info"; #endif QByteArray buffer; buffer.resize(m_Server.pendingDatagramSize()); QHostAddress sender; quint16 senderPort; m_Server.readDatagram(buffer.data(), buffer.size(), &sender, &senderPort); QString Data(buffer); onDataReady(Data); }
bool FGAdvice::get(bool withAudio) { if(m_state > Idle) return false; m_getAudio = withAudio; m_state = GetText; m_stateData.restart(m_netAccMgr->get(m_netRequest)); connect(m_stateData.activeReply, SIGNAL(readyRead()), SLOT(onDataReady())); connect(m_stateData.activeReply, SIGNAL(finished()), SLOT(onRequestFinished())); return true; }
void SensorTread::run() { // qDebug()<<"From work thread: "<<currentThreadId(); QTimer timer; worker = new SensorWorker(); connect(&timer, SIGNAL(timeout()), worker, SLOT(onTimeout())); connect(&timer, SIGNAL(timeout()), this, SLOT(onDataReady())); connect(worker, SIGNAL(SendData(QByteArray)), comm, SLOT(SendData(QByteArray))); connect(comm, SIGNAL(PackageReady(QByteArray)), worker, SLOT(PackageReady(QByteArray))); timer.start(100); exec(); }
execWindow::execWindow(QWidget *parent, const QString& info) : QDialog(parent), m_ui(new Ui::execWindow) { m_ui->setupUi(this); m_proc = new QProcess(this); m_proc->setProcessChannelMode(QProcess::MergedChannels); connect(m_proc,SIGNAL(started()),this,SLOT(onStarted())); connect(m_proc,SIGNAL(error(QProcess::ProcessError)),this,SLOT(onError(QProcess::ProcessError))); connect(m_proc,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(onFinished(int))); connect(m_proc,SIGNAL(readyReadStandardOutput()),this,SLOT(onDataReady()) ); if(info.isEmpty()) m_ui->plainTextEdit->appendHtml(tr("<font color=gray>Sony PlayStation3 HD Movie Muxer<br>Copyright (C) 2011 Anton Burdinuk<br>[email protected]<br>http://code.google.com/p/tsdemuxer<br>---------------------------------------------------<br><br></font>")); else m_ui->plainTextEdit->appendHtml(info); }
void FGAdvice::onRequestFinished() { switch(m_state) { case GetText: { bool clearState = true; m_respData.clear(); if(!m_getAudio) { m_state = Idle; } if(m_stateData.activeReply->error() == QNetworkReply::NoError) { _interpretResponse(); } else { m_state = Error; m_respData.error = m_stateData.activeReply->errorString(); } if(m_state != GetText) { emit got(m_state == Error ? ReplyError : ReplyText); } else { QFile cfl(soundFilePath()); if(cfl.isReadable()) { m_state = Idle; emit got(ReplySound); } else { m_state = StartGetSound; QString u = QString(FGA_SOUND_URI).arg(m_respData.soundFile); QUrl url = QString(u); QNetworkRequest nrAudio(url); m_stateData.restart(m_netAccMgr->get(nrAudio)); connect(m_stateData.activeReply, SIGNAL(readyRead()), SLOT(onDataReady())); connect(m_stateData.activeReply, SIGNAL(finished()), SLOT(onRequestFinished())); clearState = false; } } if(clearState) m_stateData.clear(); } break; case GetSound: { if(m_stateData.activeReply->error() != QNetworkReply::NoError) { m_state = Error; m_respData.error = m_stateData.activeReply->errorString(); emit got(ReplyError); } else { m_state = Idle; emit got(ReplySound); } m_stateData.clear(); } break; case Error: emit got(ReplyError); break; default: m_state = Error; m_stateData.clear(); break; } }
void GetConnection::load(QString id, QString type) { m_reply = m_qFacebook->getConnections(id, type); if (m_reply) connect(m_reply, SIGNAL(finished()), this, SLOT(onDataReady())); }