The connect (modbusDevice, & amp; QModbusDevice: : errorOccurred, [this] (QModbusDevice: : Error) {
The UI - & gt; StatusBar - & gt; ShowMessage (modbusDevice - & gt; ErrorString (), 5000);//statusBar ();
});
(parameters) : parameter list, in line with normal function argument list, if you don't need to pass parameters, can be omitted, along with parentheses (), for example, auto add=[] (int a, int b) - & gt; Int {return a + b; };
What (QModbusDevice: : Error) parameters? No variable name, the function body {
The UI - & gt; StatusBar - & gt; ShowMessage (modbusDevice - & gt; ErrorString (), 5000);//statusBar ();
} is not used, please the great god, thank you!
CodePudding user response:
QModbusDevice: : Error is sending a signal parameters, useless to can not writeCodePudding user response:
QModbusDevice: : is the Error signal parameters, Error messages, do not use can not write;