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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 4.8.x, 5.4.0 Beta
    • 5.3.1
    • Serial Port
    • None
    • 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

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

        Activity

          People

            kuzulis Denis Shienkov
            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