-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.8.0
-
None
-
3f6b128d7 (dev), 59314a160 (6.10), 24864285e (6.9)
http://doc.qt.io/qt-5/qmetaenum.html#details doesn't have a single code example. The detailed description doesn't even mention that fromType() is the first function you need to call to actually get a QMetaEnum. This makes it necessary to go elsewhere (e.g. Stack Overflow) to find out how to use it.
The most common question is how to get a string from an enum value, which this question answers:
http://stackoverflow.com/a/34282031/904422
We should have a similar snippet in the detailed description (including the Q_ENUM part).
For Gerrit Dashboard: QTBUG-60355 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
659451,4 | Doc: Add QMetaEnum usage snippet to detailed description | dev | qt/qtbase | Status: MERGED | +2 | 0 |
659874,2 | Doc: Add QMetaEnum usage snippet to detailed description | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
660126,2 | Doc: Add QMetaEnum usage snippet to detailed description | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |