我是执行sql语句后获得的值,他是QVariant的,所以不知怎么转化
QString sql="SELECT status,status_a,status_b FROM `ifis_main`.`TBR_STATUS_IED` where ied_name='aa';
QSqlQuery query;
query.exec(sql);
while(query.next()){
int status_a=(int)(query.value(1)); //想要将query.value(1)获得的值转为整数 int status_b=(int)(query.value(2));
status=status_a|status_b; //将获得的两个整数进行位或运算
}
代码中红色字体就是我想要实现的功能,但是系统报错