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

QVariant::toString description potentially incorrect.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.10.1
    • Fix Version/s: 5.11.0
    • Component/s: Documentation
    • Labels:
      None

      Description

      The description of the QVariant::toString function reads:

      Returns the variant as a QString if the variant has userType() QMetaType::QStringQMetaType::BoolQMetaType::QByteArrayQMetaType::QCharQMetaType::QDateQMetaType::QDateTimeQMetaType::DoubleQMetaType::IntQMetaType::LongLongQMetaType::QStringListQMetaType::QTimeQMetaType::UInt, or QMetaType::ULongLong; otherwise returns an empty string.

      However, there are several other values of QMetaType that will generate a non-empty string, namely: QMetaType::Float, QMetaType::Short, QMetaType::UShort, QMetaType::Long, QMetaType::ULong, QMetaType::SChar, QMetaType::UChar, etc...

      I can only assume that this intended behaviour (why would Double be printed and not Float??), so I believe that the documentation is incorrect.

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              paulwicking Paul Wicking
              Reporter:
              lscott Lewis Scott
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 30 minutes
                  30m
                  Remaining:
                  Remaining Estimate - 30 minutes
                  30m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                    Gerrit Reviews

                    There are no open Gerrit changes