Thank you for the reply, here is what I have so far and it's still not working,
Qt Code:
  1. void MainWindow::on_pushButton_3_clicked() //testing button
  2. {
  3. ui->lineEdit_2->setInputMask("hhhhhhhhhhhhhh");
  4. QString input = ui->lineEdit_2->text();
  5. bool ok;
  6. char command=input.toInt(&ok,16);
  7. serial->write(command,sizeof(command));
  8. }
To copy to clipboard, switch view to plain text mode 

and also is there a method to input as many as hex pairs as I want? Since setinputmask restricts my input to only that many that I set. Thank you.