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

API review: deprecation of QVariant::Type causes problems for APIs which return a QVariant

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.0.0
    • Core: Other
    • None

      In Qt 5, QVariant::Type is deprecated and replaced with QMetaType::Type

      However, QVariant::type() returns QVariant::Type, and this is source incompatible with QMetaType::Type.
      For example, http://doc-snapshot.qt-project.org/5.0/qnetworkrequest.html#Attribute-enum has many (obsolete) warnings.
      But replacing the QVariant types with QMetaType types causes compilation errors where QVariant::type() is used.
      e.g. static QByteArray headerValue(QNetworkRequest::KnownHeaders..) in qnetworkreply.cpp

      The compilation error can be avoided by casting to int, but I cannot just change the documentation to talk about a different type than what the API makes available.

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

            nierob Nierob
            shkearns Shane Kearns
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes