title: QObject::connect: Parentheses expected, signal QSerialPort::readyRead in ..\voltage_sensor\dialop.cpp:41
body: <p>I am not sure why Qt is outputting this to me. The code compiles, and all the syntax is formatted correctly. I have tried looking at different forum posts, but I am unable to pinpoint the error.</p>
  
  <p>I am currently testing with a breadboard, circuit, and light bulb; all the hardware works and I am able to capture a voltage in the Arduino software (I can add the Arduino code if need be).</p>
  
  <p>The issue I am having is that I can't display a voltage in Qt. I am using an Arduino Uno and an Arduino Voltage sensor (VCC &lt;25V).</p>
  
  <p>voltage_sensor.pro</p>
  
  <pre><code>QT       += core gui serialport
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = voltage_sensor
  TEMPLATE = app
  
  # The following define makes your compiler emit warnings if you use
  # any Qt feature that has been marked deprecated (the exact warnings
  # depend on your compiler). Please consult the documentation of the
  # deprecated API in order to know how to port your code away from it.
  DEFINES += QT_DEPRECATED_WARNINGS
  
  # You can also make your code fail to compile if it uses deprecated APIs.
  # In order to do so, uncomment the following line.
  # You can also select to disable deprecated APIs only up to a certain version of Qt.
  #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
  
  SOURCES += \
      main.cpp \
      dialog.cpp
  
  HEADERS += \
      dialog.h
  
  FORMS += \
      dialog.ui
  
  # Default rules for deployment.
  qnx: target.path = /tmp/$${TARGET}/bin
  else: unix:!android: target.path = /opt/$${TARGET}/bin
  !isEmpty(target.path): INSTALLS += target
  </code></pre>
  
  <p>dialog.h</p>
  
  <pre><code>#ifndef DIALOG_H
  #define DIALOG_H
  
  #include &lt;QDialog&gt;
  #include &lt;QtSerialPort/QSerialPortInfo&gt;
  #include &lt;QByteArray&gt;
  
  QT_BEGIN_NAMESPACE
  namespace Ui { class Dialog; }
  QT_END_NAMESPACE
  
  class Dialog : public QDialog
  {
      Q_OBJECT
  
  public:
      Dialog(QWidget *parent = nullptr);
      ~Dialog();
  
  private slots:
      void readSerial();
      void updateVoltage(QString);
  
  private:
      Ui::Dialog *ui;
  
      QSerialPort *arduino;
      static const quint16 arduino_uno_vendor_id = 9025;
      static const quint16 arduino_uno_product_id = 67;
      QByteArray serialData;
      QString serialBuffer;
      QString parsed_data;
      double voltage_value;
  };
  #endif // DIALOG_H
  </code></pre>
  
  <p>dialog.cpp</p>
  
  <pre><code>#include "dialog.h"
  #include "ui_dialog.h"
  #include &lt;QSerialPort&gt;
  #include &lt;QSerialPortInfo&gt;
  #include &lt;string&gt;
  #include &lt;QDebug&gt;
  #include &lt;QMessageBox&gt;
  
  Dialog::Dialog(QWidget *parent) :
      QDialog(parent),
      ui(new Ui::Dialog)
  {
      ui-&gt;setupUi(this);
      ui-&gt;voltagelcdNumber-&gt;display("-------");
      arduino = new QSerialPort(this);
      serialBuffer = "";
      parsed_data = "";
      voltage_value = 0.0;
  
      bool arduino_is_available = false;
      QString arduino_uno_port_name;
      foreach(const QSerialPortInfo &amp;serialPortInfo, QSerialPortInfo::availablePorts()){
          if(serialPortInfo.hasProductIdentifier() &amp;&amp; serialPortInfo.hasVendorIdentifier()){
              if((serialPortInfo.productIdentifier() == arduino_uno_product_id) &amp;&amp; (serialPortInfo.vendorIdentifier() == arduino_uno_vendor_id)){
                  arduino_is_available = true;
                  arduino_uno_port_name = serialPortInfo.portName();
              }
          }
      }
  
      if(arduino_is_available)
      {
          qDebug()&lt;&lt;"Found the port \n";
          arduino-&gt;setPortName(arduino_uno_port_name);
          arduino-&gt;open(QSerialPort::ReadOnly);
          arduino-&gt;setBaudRate(QSerialPort::Baud9600);
          arduino-&gt;setDataBits(QSerialPort::Data8);
          arduino-&gt;setFlowControl(QSerialPort::NoFlowControl);
          arduino-&gt;setParity(QSerialPort::NoParity);
          arduino-&gt;setStopBits(QSerialPort::OneStop);
          QObject::connect(arduino, SIGNAL(readyRead), this, SLOT(readSerial()));
      } else {
          qDebug()&lt;&lt;"Could not find the correct port \n";
          QMessageBox::information(this,"Serial Port Error", "Could not open the serial port");
      }
  }
  
  Dialog::~Dialog()
  {
      if(arduino-&gt;isOpen())
      {
          arduino-&gt;close();
      }
      delete ui;
  }
  
  void Dialog::readSerial()
  {
      QStringList buffer_split = serialBuffer.split(",");
      if(buffer_split.length() &lt; 3)
      {
          serialData = arduino-&gt;readAll();
          serialBuffer = serialBuffer + QString::fromStdString(serialData.toStdString());
          serialData.clear();
      } else {
          serialBuffer = "";
          qDebug() &lt;&lt; buffer_split &lt;&lt; "\n";
          parsed_data = buffer_split[1];
          voltage_value = (parsed_data.toDouble()) - 0.1;
          qDebug() &lt;&lt; "Voltage: " &lt;&lt; voltage_value &lt;&lt; "\n";
          parsed_data = QString::number(voltage_value,'g',4);
          Dialog::updateVoltage(parsed_data);
      }
  }
  
  void Dialog::updateVoltage(QString sensor_reading)
  {
      ui-&gt;voltagelcdNumber-&gt;display(sensor_reading);
  }
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include "dialog.h"
  
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      Dialog w;
      w.setWindowTitle("Voltage Sensor");
      w.setFixedSize(434,122);
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p>dialog.ui</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ui version="4.0"&gt;
   &lt;class&gt;Dialog&lt;/class&gt;
   &lt;widget class="QDialog" name="Dialog"&gt;
    &lt;property name="geometry"&gt;
     &lt;rect&gt;
      &lt;x&gt;0&lt;/x&gt;
      &lt;y&gt;0&lt;/y&gt;
      &lt;width&gt;449&lt;/width&gt;
      &lt;height&gt;157&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name="windowTitle"&gt;
     &lt;string&gt;Dialog&lt;/string&gt;
    &lt;/property&gt;
    &lt;layout class="QGridLayout" name="gridLayout"&gt;
     &lt;item row="0" column="0"&gt;
      &lt;layout class="QHBoxLayout" name="horizontalLayout"&gt;
       &lt;item&gt;
        &lt;widget class="QLabel" name="voltagelabel"&gt;
         &lt;property name="text"&gt;
          &lt;string&gt;&amp;lt;html&amp;gt;&amp;lt;head/&amp;gt;&amp;lt;body&amp;gt;&amp;lt;p align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;span style=&amp;quot; font-size:24pt; font-weight:600; color:#ff0000;&amp;quot;&amp;gt;Voltage&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/string&gt;
         &lt;/property&gt;
        &lt;/widget&gt;
       &lt;/item&gt;
       &lt;item&gt;
        &lt;widget class="QLCDNumber" name="voltagelcdNumber"&gt;
         &lt;property name="palette"&gt;
          &lt;palette&gt;
           &lt;active&gt;
            &lt;colorrole role="WindowText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;255&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Light"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Dark"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Text"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="ButtonText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="PlaceholderText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="128"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
           &lt;/active&gt;
           &lt;inactive&gt;
            &lt;colorrole role="WindowText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;255&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Light"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Dark"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Text"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="ButtonText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="PlaceholderText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="128"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
           &lt;/inactive&gt;
           &lt;disabled&gt;
            &lt;colorrole role="WindowText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Light"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Dark"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="Text"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="ButtonText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="255"&gt;
               &lt;red&gt;20&lt;/red&gt;
               &lt;green&gt;20&lt;/green&gt;
               &lt;blue&gt;85&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
            &lt;colorrole role="PlaceholderText"&gt;
             &lt;brush brushstyle="SolidPattern"&gt;
              &lt;color alpha="128"&gt;
               &lt;red&gt;0&lt;/red&gt;
               &lt;green&gt;0&lt;/green&gt;
               &lt;blue&gt;0&lt;/blue&gt;
              &lt;/color&gt;
             &lt;/brush&gt;
            &lt;/colorrole&gt;
           &lt;/disabled&gt;
          &lt;/palette&gt;
         &lt;/property&gt;
         &lt;property name="digitCount"&gt;
          &lt;number&gt;7&lt;/number&gt;
         &lt;/property&gt;
        &lt;/widget&gt;
       &lt;/item&gt;
      &lt;/layout&gt;
     &lt;/item&gt;
    &lt;/layout&gt;
   &lt;/widget&gt;
   &lt;resources/&gt;
   &lt;connections/&gt;
  &lt;/ui&gt;
  </code></pre>
  
  <p>Application Output</p>
  
  <pre><code>QObject::connect: Parentheses expected, signal QSerialPort::readyRead in ..\voltage_sensor\dialog.cpp:41
  QObject::connect:  (receiver name: 'Dialog')
  10:56:14: C:/Users/judeb/Desktop/build-voltage_sensor-Desktop_Qt_5_12_6_MinGW_32_bit-Debug/debug/voltage_sensor.exe exited with code 0
  </code></pre>