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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.5.0 Beta
    • None
    • 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. main.cpp
          0.3 kB
        2. example.pro
          0.1 kB
        3. CMakeLists.txt
          0.4 kB

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              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