Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-75502

Clarify the implications of QCanBusFrame::setFrameId() on frame format in documentation


    • Type: Suggestion
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.11, 5.12, 5.13
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
    • Platform/s:


      In the description of


      is stated, that the CAN extended frame format setting is automatically adapted to match newFrameId.

      Actually, that sentence suggests, that one frame that had an extended id before, but is now adjusted to have a base format id, will automatically get isExtendedFormat removed, which is not the case due to

          void setFrameId(quint32 newFrameId)
              if (Q_LIKELY(newFrameId < 0x20000000U)) {
                  isValidFrameId = true;
                  canId = newFrameId;
                  setExtendedFrameFormat(isExtendedFrame || (newFrameId & 0x1FFFF800U));
              } else {
                  isValidFrameId = false;
                  canId = 0;

      I suggest the following change in qcanbusframe.cpp;

          \fn QCanBusFrame::setFrameId(quint32 newFrameId)
          Sets the identifier of the CAN frame to \a newFrameId. The maximum size of a CAN frame
          identifier is 11 bits, which can be extended up to 29 bits by supporting the \e {CAN extended frame
          format}. The \e {CAN extended frame format} setting is automatically adapted to match \a newFrameId with more than 11 bits in size. When the format is extended and \a newFrameId with up to 11 bits or less is passed, the  \e {CAN extended frame format} setting is \a not changed. You have to manually adjust the setting back to base format.
          \sa frameId(), hasExtendedFrameFormat()


        For Gerrit Dashboard: QTBUG-75502
        # Subject Branch Project Status CR V



            • Assignee:
              paulwicking Paul Wicking
              darkmattercoder Jochen Bauer
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created:

                Gerrit Reviews

                There is 1 open Gerrit change