laodino
laodino
采纳率100%
2021-03-03 14:56

QT MYSQL select as 问题

 1.//QString bstr = "select id as '序号' ,upbox as '上料盒',carrierboard as '载具板',DBC1 as 'DBC1',DBC2 as 'DBC2',DBC3 as 'DBC3',DBC4 as 'DBC4',DBC5 as 'DBC5',DBC6 as 'DBC6',downbox as '收料盒',uptime as '上传时间' from scancode order by uptime";
 2.   QString bstr = "select * from scancode order by uptime";

在release开发环境中,这两语句通过

_batchinfomodel->setQuery(bstr,db);都能正常执行且显示数据.

但是我用windeployqt生成依赖打包发布后,第1句的_batchinfomodel的行数列数都为0,无数据显示。第2句正常显示数据.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答