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

QVariant not working with Q_ENUM

XMLWordPrintable

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes