Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QSerialPort::sendBreak() is deprecated but no alternative is proposed

    General and Desktop
    2
    6
    574
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mark81 last edited by aha_1980

      The subject is self-explanatory: the official docs states the sendBreak() function is deprecated but they don't propose an alternative. How do they suppose we can send a break now?

      Edit: @aha_1980 corrected link

      aha_1980 1 Reply Last reply Reply Quote 0
      • aha_1980
        aha_1980 Lifetime Qt Champion @Mark81 last edited by

        @Mark81 Out of curiosity, for what do you need this function?

        Qt has to stay free or it will die.

        1 Reply Last reply Reply Quote 0
        • M
          Mark81 last edited by Mark81

          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.

          aha_1980 1 Reply Last reply Reply Quote 0
          • aha_1980
            aha_1980 Lifetime Qt Champion @Mark81 last edited by

            @Mark81

            The commit that deprecated the function contains the following message:

            Improve usage of the break state for the Tx line

            1. 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.
            1. 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.

            Qt has to stay free or it will die.

            1 Reply Last reply Reply Quote 2
            • M
              Mark81 last edited by

              Thank you. I didn't searched for the commit, just relied on the documentation. Next time I'll try to do that.

              aha_1980 1 Reply Last reply Reply Quote 0
              • aha_1980
                aha_1980 Lifetime Qt Champion @Mark81 last edited by

                @Mark81

                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 to setBreakEnabled().

                Regards

                Qt has to stay free or it will die.

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post