• 11753阅读
  • 6回复

怎么去掉按钮的边框? [复制链接]

上一主题 下一主题
离线liu_ming50
 

只看楼主 倒序阅读 楼主  发表于: 2006-05-29
我要做一个窗口,上面的按钮背景色要求和窗口的背景色一致,也就是说看不到按钮的形状,(我会在按钮上加上icon来显示它),那么,问题来了,就是按钮的背景色倒是ok了,但是却有一个白色的边框,我试过调用按钮类的setwflags()里面加入noborder那个选项,但是也不行。请教列位大虾!
[ 此贴被XChinux在2006-05-29 20:37重新编辑 ]
离线jerry_zhu
只看该作者 1楼 发表于: 2006-05-29
You don't have to add a real button to the window. Instead of that , you should draw the icon on that window and judge if you clicked the icon area when mouse click event occurred.
If you do want to use the button ,I think you can try setStyle(QStyle*) or even setMask(QBitmap*) hehe.
离线liu_ming50

只看该作者 2楼 发表于: 2006-05-29
谢谢回复,我试一下
离线shiroki

只看该作者 3楼 发表于: 2006-05-29
有很多方法可以解决这个问题。 其中一个是用QButton。 还有一种是换个style
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
离线seraphliu

只看该作者 4楼 发表于: 2006-06-02
pushbotton有和方法setFlat(bool),参数用true就可以了
离线fygenius

只看该作者 5楼 发表于: 2006-06-14
楼上的正解
离线liang6
只看该作者 6楼 发表于: 2011-01-14
用设计器做出来的 怎么去掉边框呢
快速回复
限100 字节
 
上一个 下一个