• 4162阅读
  • 3回复

在widget顶端画图 [复制链接]

上一主题 下一主题
离线susuki
 
只看楼主 倒序阅读 楼主  发表于: 2010-05-21
请问
如图有一widget长得如下图,上面有treeview、listview及 button

想画一个图案在上面如下图

这个图案必须在widget的顶端,不被其它元件覆盖掉,请问要怎么作呢?
谢谢!
离线luohui8891

只看该作者 1楼 发表于: 2010-05-21
在建一个widget然后raise
离线susuki
只看该作者 2楼 发表于: 2010-05-21
能否写个范例教导一下
非常感谢。
离线xtfllbl

只看该作者 3楼 发表于: 2010-05-21
自己随便写个类继承QWidget,然后在这个控件上放上你的图片。
最后在mainwindow.cpp这种文件中实例化那个类,然后摆摆位置,layout一下就万事大吉了。

至于要置顶显示,请使用:
void QWidget::raise ()   [slot]
Raises this widget to the top of the parent widget's stack.

After this call the widget will be visually in front of any overlapping sibling widgets.

Note: When using activateWindow(), you can call this function to ensure that the window is stacked on top.

See also lower() and stackUnder().
上海欢迎您
快速回复
限100 字节
 
上一个 下一个