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

QByteArray::isNull() doesn't work properly under CMake

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 5.5.0 Beta
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Arch Linux x86_64

      Description

      When using the default constructor for QByteArray, isNull() returns false when the project is compiled under CMake. Passing null to the QByteArray constructor works correctly. Both constructors properly return true for isNull() under QMake.

      QByteArray().isNull() // True under qmake, false under cmake
      QByteArray(NULL).isNull() // True under qmake and cmake

      When running the attached sample program under gdb, the internal d pointer is different for the default constructor and for passing in NULL. My theory is that this has something to do with the inline default constructor, though I'm not sure why it would work under qmake but not under cmake.

        Attachments

        1. CMakeLists.txt
          0.4 kB
        2. example.pro
          0.1 kB
        3. main.cpp
          0.3 kB

          Issue Links

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

            Activity

              People

              Assignee:
              thiago Thiago Macieira
              Reporter:
              mspencer Michael Spencer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes