C++ (Qt)DatabaseAccessor::dbHost;DatabaseAccessor::dbName; DatabaseAccessor::DatabaseAccessor(QObject *parent) { db.setHostName(dbHost); db.setDatabaseName(dbName); ...
void EchoServer::incomingConnection(int socketDescriptor) { EchoThread *thread = new EchoThread(socketDescriptor, this); connect(thread, SIGNAL(finished()), this, SLOT(removeThread()), Qt::DirectConnection); m_threads.append(thread); thread->start();}void EchoServer::removeThread(){ EchoThread *thread = qobject_cast<EchoThread*>(sender()); m_threads.removeAt(m_threads.indexOf(thread)); thread->deleteLater();}