惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - Loning

性能对比:aelf智能合约运行环境性能是evm的1000倍 aelf帮助C#工程师10分钟零门槛搭建DAPP&私有链开发环境 手机跨平台方案介绍 pInvokeStackImbalance MDA 异常解决方法 天津大学免费上网,IPV4及IPV6同时共享的解决方案 纪念那个死去的ASP.NET CMS系统,附死了的源码 基于事件通信的轻量级MVP框架实现,附源码 Git初始化的相关问题 解决mysql表已满的错误 Publish 提示与目标版本不同 C++关闭在debug模式下的“Microsoft Visual C++ Debug Library”对话框 我的OO实践---由GPS消息处理抽象出一通用命令处理类 敏捷开发读书笔记 谈谈我处理异常的一般方法 微软学生技术俱乐部夏令营的一些感受 N95当手柄玩游戏,甩起来还可以用手势控制电脑,分享一下我们的设计经验 这个回答真逗- - 收到开Windows 7 party的资源了【无图无真相】 初探MS SQL CE+Codesmith
Qt 中Enum进行反射来做Enum to QString
Loning · 2010-11-24 · via 博客园 - Loning

2010-11-24 22:37  Loning  阅读(1437)  评论()    收藏  举报

i assume you want to retrieve a QMetaEnum for a particular enum which is registered with Q_ENUMS.

let {class} denote the QObject-derived class which contains the enum, and let {enumName} denote the name of the enum. the following code gets you the enum's QMetaEnum:

QMetaObject metaObject = {class}.staticMetaObject;
QMetaEnum metaEnum = metaObject.enumerator( metaObject.indexOfEnumerator( {enumName} ) );

this compiles despite the fact that neither QMetaObject nor QMetaEnum define operator=(). i'm not sure why--they must be defined somewhere else, but i can't find them.