以event->type
举例
const QMetaObject& mo = QEvent::staticMetaObject;
QMetaEnum me = mo.enumerator(mo.indexOfEnumerator("Type"));
QString str(me.valueToKey(event->type()));
Qt5直接用QMetaEnum::fromType
和valueToKey
就可以了
以event->type
举例
const QMetaObject& mo = QEvent::staticMetaObject;
QMetaEnum me = mo.enumerator(mo.indexOfEnumerator("Type"));
QString str(me.valueToKey(event->type()));
Qt5直接用QMetaEnum::fromType
和valueToKey
就可以了