这是一个代码示例:
SELECT EmpFirstName,
EmpLastName,
CAST(DateHired, + 6 MONTH) AS ReviewDate
From Employees
输出:
#include <QDebug>
enum Pouet
{
F1 = 1,
F2 = 2,
F3 = 4,
};
Q_DECLARE_FLAGS(Pouets, Pouet)
Q_DECLARE_METATYPE(Pouets)
Q_DECLARE_OPERATORS_FOR_FLAGS(Pouets)
int main(int argc, char *argv[])
{
Pouets p = F1|F3;
qDebug()<<p;
qDebug()<<QVariant(p).toString();
qDebug()<<QVariant(QVariant(p).toString()).value<Pouets>();
}
拜托,这里有什么问题? 我只是无法检索以前存储在QVariant中的QFlag?