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

QSerialPort::isNull() returns always false (even for empty objects)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.3.1
    • Fix Version/s: 4.8.x, 5.4.0 Beta
    • Component/s: Serial Port
    • Labels:
      None
    • Environment:
      Windows 7 (x64), Qt Desktop

      Description

      If a new QSerialPortInfo object is created using the default constructor, isNull() returns false instead of true:

      QSerialPortInfo info;
      info.isNull(); // returns false (should be true)
      

      The isNull()-method is important for us to check the result of a method that tries to find a serial port by vendor ID and/or product ID:

      QSerialPortInfo portInfo = findPortInfo(vendorId, productId);
      if (portInfo.isNull()) {
          // port not found
      }
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kuzulis Denis Shienkov
            Reporter:
            mario.winterer Mario Winterer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes