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

QtCore compilation failure when configured with no-feature-ITEMVIEWS flag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.6.0
    • Core: Other
    • None

    Description

      When Qt configured with "no-feature-ITEMVIEWS" flag compilation of QtCore module failed because header file "qtbase/src/corelib/itemmodels/qitemselectionmodel.h" has an error: declaration of classes QItemSelection and QItemSelectionRange is hidden by QT_NO_ITEMVIEWS macro but statements "Q_DECLARE_METATYPE(QItemSelectionRange)" and "Q_DECLARE_METATYPE(QItemSelection)" are not and therefore we try to declare metatype for not existing classes. Patch with fix attached.

      Compiler output with error description:

      g++ -c -m64 -pipe -g -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -Wall -W -Wno-error=unused-parameter -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -D_REENTRANT -DQT_NO_MTDEV -DQT_NO_LIBUDEV -DQT_NO_EVDEV -DQT_NO_TSLIB -DQT_NO_LIBINPUT -DQT_NO_THREAD -DQT_NO_SOCKET_H -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -Wall -Wextra -Werror -Woverloaded-virtual -Wshadow -Wundef -Wnon-virtual-dtor -Wpointer-arith -Wformat-security -Wno-long-long -Wno-variadic-macros -pedantic-errors -Wchar-subscripts -Wcast-align -I. -I../3rdparty/zlib -I../../include -I../../include/QtCore -I../../include/QtCore/5.5.1 -I../../include/QtCore/5.5.1/QtCore -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty/forkfd -I.moc -I../../mkspecs/linux-g++-64 -DQT_NO_CAST_TO_ASCII=1 -DQT_NO_CAST_FROM_ASCII=1 -DQT_STRICT_ITERATORS -DQT_NO_URL_CAST_FROM_STRING=1 -DQT_NO_CAST_FROM_BYTEARRAY=1 -DQT_NO_KEYWORDS=1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -Dsignals=int -Dslots=int -Demit=public: -Dforeach=public: -Dforever=public: -xc++ itemmodels/qitemselectionmodel.h -o .obj/header_qitemselectionmodel.o
      In file included from ../../include/QtCore/qmetatype.h:1:0,
                       from ../../include/QtCore/../../src/corelib/kernel/qvariant.h:40,
                       from ../../include/QtCore/qvariant.h:1,
                       from ../../include/QtCore/../../src/corelib/itemmodels/qabstractitemmodel.h:37,
                       from ../../include/QtCore/qabstractitemmodel.h:1,
                       from itemmodels/qitemselectionmodel.h:40:
      itemmodels/qitemselectionmodel.h:257:20: error: ‘QItemSelectionRange’ was not declared in this scope
       Q_DECLARE_METATYPE(QItemSelectionRange)
                          ^
      ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1844:25: note: in definition of macro ‘Q_DECLARE_METATYPE_IMPL’
           struct QMetaTypeId< TYPE >                                          \
                               ^
      itemmodels/qitemselectionmodel.h:257:1: note: in expansion of macro ‘Q_DECLARE_METATYPE’
       Q_DECLARE_METATYPE(QItemSelectionRange)
       ^
      ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1844:30: error: template argument 1 is invalid
           struct QMetaTypeId< TYPE >                                          \
                                    ^
      ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1840:34: note: in expansion of macro ‘Q_DECLARE_METATYPE_IMPL’
       #define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
                                        ^
      itemmodels/qitemselectionmodel.h:257:1: note: in expansion of macro ‘Q_DECLARE_METATYPE’
       Q_DECLARE_METATYPE(QItemSelectionRange)
       ^
      itemmodels/qitemselectionmodel.h:258:20: error: ‘QItemSelection’ was not declared in this scope
       Q_DECLARE_METATYPE(QItemSelection)
                          ^
      ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1844:25: note: in definition of macro ‘Q_DECLARE_METATYPE_IMPL’
           struct QMetaTypeId< TYPE >                                          \
                               ^
      itemmodels/qitemselectionmodel.h:258:1: note: in expansion of macro ‘Q_DECLARE_METATYPE’
       Q_DECLARE_METATYPE(QItemSelection)
       ^
      ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1844:30: error: template argument 1 is invalid
           struct QMetaTypeId< TYPE >                                          \
                                    ^
      ../../include/QtCore/../../src/corelib/kernel/qmetatype.h:1840:34: note: in expansion of macro ‘Q_DECLARE_METATYPE_IMPL’
       #define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
                                        ^
      itemmodels/qitemselectionmodel.h:258:1: note: in expansion of macro ‘Q_DECLARE_METATYPE’
       Q_DECLARE_METATYPE(QItemSelection)
      

      Attachments

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

        Activity

          People

            tvete Paul Olav Tvete
            kohei Yury Prostov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes