Qt Code:
  1. while (inpSt.compare("quit") != 0)
  2. {
  3. std::getline(std::cin, inpSt);
  4. std::cerr << serialPort->write(inpSt.c_str());
  5. std::cerr << "Sent command: " << inpSt << std::endl;
  6. }
To copy to clipboard, switch view to plain text mode 
What do you get from this on stderr?
And am I missing something or you're not opening the port in your code?
The rest as wysota wrote