I think you have to use QSerialPort as a pointer

I don't have the documentation in front of me, but here's some pseudo code:

Qt Code:
  1. QSerialPort *serial;
  2. serial->setName("MYPORT");
  3. serial->open();
  4. serial->setBaudRate(9600);
To copy to clipboard, switch view to plain text mode 

I distinctly remember the little terminal GUI example that comes with QSerialPort was immensely helpful.