void Moto::initGui() { ui.statusbar->showMessage( "Press F1 for help" ); ui.speed_msr->setLabel( "x100" ); ui.software->setEnabled( false ); slotClosed(); lockConfig(); loadSettings(); connect( this, SIGNAL(sigSpeed()), this, SLOT(slotSpeed()) ); connect( this, SIGNAL(sigStatus()), this, SLOT(slotStatus()) ); connect( this, SIGNAL(sigConfig()), this, SLOT(slotConfig()) ); connect( this, SIGNAL(sigOpened()), this, SLOT(slotOpened()) ); connect( this, SIGNAL(sigClosed()), this, SLOT(slotClosed()) ); // Binding GUI controls. connect( ui.throttle, SIGNAL(valueChanged(int)), this, SLOT(slotThrottleChanged(int)) ); connect( ui.speed, SIGNAL(valueChanged(int)), this, SLOT(slotSpeedChanged(int)) ); connect( ui.direction, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDirectionChanged(int)) ); connect( ui.unlock, SIGNAL(clicked()), this, SLOT(slotUnlock()) ); connect( ui.apply, SIGNAL(clicked()), this, SLOT(slotApply()) ); connect( ui.help, SIGNAL(triggered()), this, SLOT(slotHelp()) ); m_speedTimer = new QTimer(); m_statusTimer = new QTimer(); connect( m_speedTimer, SIGNAL(timeout()), this, SLOT(slotSpeedTimeout()) ); connect( m_statusTimer, SIGNAL(timeout()), this, SLOT(slotStatusTimeout()) ); m_speedTimer->setInterval( 100 ); m_statusTimer->setInterval( 1000 ); m_speedTimer->start(); m_statusTimer->start(); }
void QtServiceSysPrivate::incomingConnection(int socketDescriptor) { QTcpSocket *s = new QTcpSocket(this); s->setSocketDescriptor(socketDescriptor); connect(s, SIGNAL(readyRead()), this, SLOT(slotReady())); connect(s, SIGNAL(disconnected()), this, SLOT(slotClosed())); }
void DBGConnection::newConnection(int socket) { clearSocket(); m_currentSocket = new QSocket(); m_currentSocket->setSocket(socket); //m_currentSocket->socketDevice()->setBlocking(true); connect(m_currentSocket, SIGNAL(connectionClosed()), this, SLOT(slotClosed())); connect(m_currentSocket, SIGNAL(error(int)), this, SLOT(slotError(int))); emit sigAccepted(m_currentSocket); }
void Connection::slotIncomingConnection(int) { int fd = m_device->accept(); if(fd < 0) return; clearSocket(); m_currentClient = new QSocket(); m_currentClient->setSocket(fd); connect(m_currentClient, SIGNAL(connectionClosed()), this, SLOT(slotClosed())); connect(m_currentClient, SIGNAL(error(int)), this, SLOT(slotError(int))); emit sigAccepted(m_currentClient); }
bool QHttp::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: abort(); break; case 1: clientReply((const QHttpResponseHeader&)*((const QHttpResponseHeader*)static_QUType_ptr.get(_o+1))); break; case 2: clientDone((bool)static_QUType_bool.get(_o+1)); break; case 3: clientStateChanged((int)static_QUType_int.get(_o+1)); break; case 4: startNextRequest(); break; case 5: slotReadyRead(); break; case 6: slotConnected(); break; case 7: slotError((int)static_QUType_int.get(_o+1)); break; case 8: slotClosed(); break; case 9: slotBytesWritten((int)static_QUType_int.get(_o+1)); break; default: return QNetworkProtocol::qt_invoke( _id, _o ); } return TRUE; }
void KDEPrintd::statusMessage(const QString &msg, int pid, const QString &appName) { StatusWindow *w = m_windows.find(pid); if(!w && !msg.isEmpty()) { w = new StatusWindow(pid); if(appName.isEmpty()) w->setCaption(i18n("Printing Status - %1").arg("(pid=" + QString::number(pid) + ")")); else w->setCaption(i18n("Printing Status - %1").arg(appName)); connect(w, SIGNAL(destroyed()), SLOT(slotClosed())); w->show(); m_windows.insert(pid, w); } if(w) { if(!msg.isEmpty()) w->setMessage(msg); else w->close(); } }