| 
 | 
TQ-lkp 发表于 2013-5-17 18:03   
这个跟多个线程关系不大,打开两个串口,就调用 两次就行了,传递个串口名不就行了  
#if 1 
        m_fd = openSerialPort_1(); 
        if (m_fd < 0) 
                { 
                QMessageBox::warning(this, tr("Error"), tr("Fail to open serial port1!")); 
                return ; 
                } 
        m_notifier_1 = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); 
        connect (m_notifier_1, SIGNAL(activated(int)), this, SLOT(remoteDataIncoming_1())); 
       // QMessageBox::warning(this, tr("Error"), tr("read")); 
#endif  
///////////////////////////////////// 
#if 1 
 
  connect (this, SIGNAL(close_signal()), this, SLOT(camara_quit())); 
  connect (this, SIGNAL(quit_signal()), qApp, SLOT(quit())); 
  connect (CloseButton, SIGNAL(clicked()), this, SLOT(camara_quit())); 
  connect (SnapButton, SIGNAL(clicked()), this, SLOT(camara_snap())); 
 
  timer = new QTimer(this); // 瀹氫箟QT瀹氭椂鍣� 
  connect (timer, SIGNAL(timeout()), this, SLOT(showMe())); 
  timer->start(FRAME_IDLE); // 寮�鍚?畾鏃跺櫒10ms瀹氭椂) 
#endif 
} |   
 
 
 
 |