void CommDeviceManager::connectToDevice(CommDefines::Type type) { disconnectFromDevices(); if (type == CommDefines::Udp) { connect(&udpSocket_, SIGNAL(readyRead()), this, SLOT(handleUdpDataIncoming()), Qt::UniqueConnection); } else { connect(&serialDevice_, SIGNAL(readyRead()), this, SLOT(handleSerialDataIncoming()), Qt::UniqueConnection); } }
VJoystickMainWindow::VJoystickMainWindow(QWidget *parent) : QMainWindow(parent), m_ui(new Ui::VJoystickMainWindow), m_adapter(0) { m_ui->setupUi(this); connect(m_ui->pushButtonScan, SIGNAL(clicked()), this, SLOT(scanDevices())); connect(m_ui->pushButtonConnect, SIGNAL(clicked()), this, SLOT(connectToDevices())); connect(m_ui->pushButtonDisconnect, SIGNAL(clicked()), this, SLOT(disconnectFromDevices())); connect(m_ui->actionScan, SIGNAL(triggered()), this, SLOT(scanDevices())); connect(m_ui->actionConnect, SIGNAL(triggered()), this, SLOT(connectToDevices())); connect(m_ui->actionDisconnect, SIGNAL(triggered()), this, SLOT(disconnectFromDevices())); connect(m_ui->actionExit, SIGNAL(triggered()), this, SLOT(appExit())); connect(m_ui->actionAbout, SIGNAL(triggered()), this, SLOT(about())); m_ui->comboBoxSelectJoy->setDisabled(true); setJoystickInfoVisible(false); setDeviceControlVisible(false); m_ui->ballWidget->hide(); m_ui->pushButtonScan->setFocus(); }