rviz错误, Attempt to set a screen on a child window.

在ros中运行rviz时不断刷出错误

0x29a0920 void QWindowPrivate::setTopLevelScreen(QScreen*, bool) ( QScreen(0x1e857b0) ): Attempt to set a screen on a child window.

该错误会在多显示器的环境下报出,并不是使用上的错误而是rviz本身与Qt的一个bug

Finally, I understood what happens:

The warning messages occur whenever setMinimumWidth() / setMinimumHeight() are called on a QGLWidget under Linux with a dual screen display.
This is probably a bug in Qt. It will probably be not fixed, since it is recommended in the documentation to use the new QOpenGLWidget instead, that appeared in Qt 5.4 (note: "OpenGL" instead of "GL"), which I did and the warning messages disappeared.

Edit: I saw a message from someone that had problems with text not rendering properly with the new QOpenGLWidget which I answer here: When using the new QOpenGLWidget, one needs to take care that it no longer has an independent OpenGL context, it shares the OpenGL context with Qt (therefore, OpenGL states modified in the rendering function needs to be restored after exiting the rendering function, for instance blending mode).

rviz作者暂时没有解决这个问题

你可能感兴趣的:(ROS,rviz,qt)