CppSharp icon indicating copy to clipboard operation
CppSharp copied to clipboard

Null ref at Enumeration.Item.IsHexadecimal with qmetatype.h

Open ddobrev opened this issue 12 years ago • 3 comments
trafficstars

The problem is that most enum members of QMetaType::Type are defined using a macro, that is:

enum Type {
    // these are merged with QVariant
    QT_FOR_EACH_STATIC_TYPE(QT_DEFINE_METATYPE_ID)

    FirstCoreType = Bool,
    LastCoreType = QJsonDocument,
    FirstGuiType = QFont,
    LastGuiType = QPolygonF,
    FirstWidgetsType = QSizePolicy,
    LastWidgetsType = QSizePolicy,
    HighestInternalId = LastWidgetsType,

    QReal = sizeof(qreal) == sizeof(double) ? Double : Float,

    UnknownType = 0,
    User = 1024
};

I'd think the macro would have to be expanded before working with the items of the enum.

ddobrev avatar Aug 10 '13 12:08 ddobrev

Still a problem?

tritao avatar Sep 09 '13 04:09 tritao

Not to me, it's worked around. But the Expression property of such enum members is still null. The work around is that such members are assumed to be non-hexadecimal. While this concerns only the pretty print and not the API or behaviour, it's still a hack.

ddobrev avatar Sep 09 '13 10:09 ddobrev

Issues go stale after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

bnbot avatar Jun 09 '21 10:06 bnbot