如何从Qt物件删除(包含最小化,最大化和关闭按钮)窗口边框? [英] How to remove the window border (containing minimize, maximize and close buttons) from a Qt widget?

查看:482
本文介绍了如何从Qt物件删除(包含最小化,最大化和关闭按钮)窗口边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想动画一个小部件(QPushButon)跨我的应用程序屏幕上移动。对于我创建了一个新的按钮,使用QPropertyAnimation类和按钮的财产几何,我将它从顶部向下。问题是,该按钮自带的关闭,最小化,最大化按钮,等我不希望他们在那里,也不是自带的插件的边框。我该怎么办 ?

I would like to animate a widget (QPushButon) to move across my application screen. For that I create a new button and using the QPropertyAnimation class and the property "geometry" of the button, I move it from top to down. The problem is that the button comes with the close, minimize, maximize buttons, etc. I don't want them to be there, nor the border that comes with the widget. What should I do ?

推荐答案

您想要使用的功能的 QWidget的:: setWindowFlags(QT :: WindowFlags)

You want to use the function QWidget::setWindowFlags( Qt::WindowFlags ).

如果您要删除的最大化/最小化/关闭按钮,这应该为你工作:

If you want to remove the maximize/minimize/close buttons, this should work for you:

setWindowFlags(QT :: CustomizeWindowHint);

的Qt :: CustomizeWindowHint 关闭所有的默认窗口提示,如最大化,最小化,关闭按钮和标题栏。

Qt::CustomizeWindowHint turns off all the default window hints, like the maximize, minimize, close buttons, and the title bar.

下面是所有的列表的Qt :: WindowFlags

Here's a list of all Qt::WindowFlags.

这篇关于如何从Qt物件删除(包含最小化,最大化和关闭按钮)窗口边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆