首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > QT开发 >

qt控件展示在最上层

2013-07-08 
qt控件显示在最上层有一个窗体,窗体上面有一个QToolBar控件,我想让QToolBar始终显示在最上层;窗体是用来显

qt控件显示在最上层
有一个窗体,窗体上面有一个QToolBar控件,我想让QToolBar始终显示在最上层;窗体是用来显示视频的,当有视频流显示的时候,QToolBar就会被遮挡在后面,有什么办法让QToolBar一直显示在最前面呢?  求教! qt控件显示
[解决办法]
你显示视频用什么机制?
按理来说 在windows下 如果你对QWidget的natvite Widget获取其HWND并直接显示的话 是不会覆盖QToolBar的
感觉你的显示有问题
根据你的描述
是视频遮住了QToolBar  检查下 是否绘制的时候关闭了Qt的双缓存机制
------------------- 视频
------------------- QToolBar
------------------   父窗口


双缓存的flag


Qt::WA_PaintOnScreen8Indicates that the widget wants to draw directly onto the screen. Widgets with this attribute set do not participate in composition management, i.e. they cannot be semi-transparent or shine through semi-transparent overlapping widgets. Note: This flag is only supported on X11 and it disables double buffering. On Qt for Embedded Linux, the flag only works when set on a top-level widget and it relies on support from the active screen driver. This flag is set or cleared by the widget's author. To render outside of Qt's paint system, e.g., if you require native painting primitives, you need to reimplement QWidget::paintEngine() to return 0 and set this flag.
[解决办法]
QToolBar->raise();

热点排行