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

QVariant::toString description potentially incorrect.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.11.0
    • 5.10.1
    • Documentation
    • 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

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

          Activity

            People

              paulwicking Paul Wicking
              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