Solved QSerialPort::sendBreak() is deprecated but no alternative is proposed
-
-
@Mark81 Out of curiosity, for what do you need this function?
-
For example to generate a DMX-512 signal.
But, generally speaking, if something becomes obsolete or deprecated one should know how to do the same thing with the newer functions. At least, IMHO. -
The commit that deprecated the function contains the following message:
Improve usage of the break state for the Tx line
- Now the sendBreak() method is deprecated since it is blocking and
impossible to implement same behavior on different platforms using
their API's. Besides, this method can be implemented via
setBreakEnabled() and QTimer.
- Introduced the new property named as "breakEnabled" which consist
of setBreakEnabled() and isBreakEnabled() methods and the signal
breakEnabledChanged().
Note: After opening, the port always is in non-break state.
So it seems
setBreakEnabled()
is the function to use now. - Now the sendBreak() method is deprecated since it is blocking and
-
Thank you. I didn't searched for the commit, just relied on the documentation. Next time I'll try to do that.
-
Well, maybe the sentence "This function is deprecated" could be "This function is deprecated. Use xxx instead".
But at least, at the end of the
sendBreak()
chapter, there is a "see also" link tosetBreakEnabled()
.Regards