Hello newbie here.

I am having trouble converting a simple text within the UI to Char. My goal is to submit text in the UI which will be sent to a usb to rs 485.

I have no trouble sending text directly from within the code, but I would like to send my component different commands from within the UI on the fly.

Here is the snippet of code giving me problems.
Qt Code:
  1. QString Motor_Command_;
  2.  
  3.  
  4. Motor_Command_ = ui->MotorCommandText->toPlainText().toLocal8Bit().constData();
  5.  
  6.  
  7.  
  8. char TxBuffer[] = {Motor_Command_};
To copy to clipboard, switch view to plain text mode 

The error I get:

error: cannot convert 'QString' to 'char' in initialization
char TxBuffer[] = {Motor_Command_};
^