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

QVariant not working with Q_ENUM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.2
    • 5.6.0
    • Core: Other
    • None
    • Mac

    Description

      I have an enum and am using Q_ENUM. I store this in a database. I bind a prepared statement wit the enum field, and it stores correctly. When I read the value back in from a select statement, it is reading the correct value, but value<T> always returns the first value of the enum, not the correct one.

      For me, I am reading in QVariant(qlonglong, 2), and canConvert<T> is returning true, but, value<T>() is always returning the enum with value 0.

      Attachments

        Issue Links

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

          Activity

            People

              ogoffart Olivier Goffart (Woboq GmbH)
              treaves Timothy Reaves
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes