| EIGHT::EIGHT(QWidget *parent) : QWidget(parent),
 ui(new Ui::EIGHT)
 {
 ui->setupUi(this);
 setWindowFlags(Qt::FramelessWindowHint);//设置没有边框
 myCom = new Posix_QextSerialPort("/dev/ttySAC0",QextSerialBase::Polling);
 if (myCom->open(QIODevice::ReadWrite))
 {
 myCom->setBaudRate(BAUD9600);
 myCom->setDataBits(DATA_8);
 myCom->setParity(PAR_NONE);
 myCom->setStopBits(STOP_1);
 myCom->setFlowControl(FLOW_OFF);
 myCom->setTimeout(10);
 QTimer *myTimer=new QTimer(this);
 connect(myTimer, SIGNAL(timeout()), this, SLOT(serial_port()));
 myTimer->start(100);
 }
 }
 
 |