Qt中QMessageLogContext的context.file和context.line为空的解决方案

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://shazhenyu.blog.csdn.net/article/details/78675143

QDebug版本是可以输出日志信息的,但在Release中输入日志的文件信息和行数为空。原因是,

Qt在Release版本默认舍弃了文件信息、行数等信息。

解决方案:

在.pro文件定义一个宏:

DEFINES += QT_MESSAGELOGCONTEXT

然后,qmake,重新编译,就可以了~


展开阅读全文

qt quick项目浏览页面为

09-06

在重新安装系统之前,我的qt项目是可以浏览的。可是重新安装了系统后,我的qt项目无法浏览了(页面始终显示为空白),这是怎么回事呢?请大神赐教。提示如下:rnQML debugging is enabled. Only use this in a safe environment.rngetProcAddress: Unable to resolve 'glGenBuffers'rngetProcAddress: Unable to resolve 'glGenBuffersOES'rngetProcAddress: Unable to resolve 'glGenBuffersARB'rngetProcAddress: Unable to resolve 'glGenBuffersEXT'rnQOpenGLBuffer::bind(): buffer not createdrnQOpenGLBuffer::allocate(): buffer not createdrnQOpenGLBuffer::release(): buffer not createdrngetProcAddress: Unable to resolve 'glBindFramebuffer'rngetProcAddress: Unable to resolve 'glBindFramebufferOES'rngetProcAddress: Unable to resolve 'glBindFramebufferARB'rngetProcAddress: Unable to resolve 'glBindFramebufferEXT'rngetProcAddress: Unable to resolve 'glBindBuffer'rngetProcAddress: Unable to resolve 'glBindBufferOES'rngetProcAddress: Unable to resolve 'glBindBufferARB'rngetProcAddress: Unable to resolve 'glBindBufferEXT'rngetProcAddress: Unable to resolve 'glBindBuffer'rngetProcAddress: Unable to resolve 'glBindBufferOES'rngetProcAddress: Unable to resolve 'glBindBufferARB'rngetProcAddress: Unable to resolve 'glBindBufferEXT'rngetProcAddress: Unable to resolve 'glDeleteBuffers'rngetProcAddress: Unable to resolve 'glDeleteBuffersOES'rngetProcAddress: Unable to resolve 'glDeleteBuffersARB'rngetProcAddress: Unable to resolve 'glDeleteBuffersEXT'rn这是在qt5.3版本中的错误信息。在qt5.4版本下的提示信息始终为:无法找到着色器。rn网上搜了好久都是说显卡不支持opengl2.0.如若不支持,重装系统之前怎么就好好的呢。rn重装系统之前我一直用的是qt5.3哪,重装系统后,我就直接装成qt5.4了,不知道有影响么? 论坛

没有更多推荐了,返回首页