Pyqt4 最小化与最大化按钮显示

#设置最小化与最大化按钮
self.setWindowFlags(QtCore.Qt.Window)

参考:
file:///D:/Program Files (x86)/Python27/Lib/site-packages/PyQt4/doc/html/qt.html#WindowType-enum

Qt.Widget

0x00000000  This is the default type for QWidget. Widgets of this type are child widgets if they have a parent, and independent windows if they have no parent. See also Qt.Window and Qt.SubWindow.

Qt.Window

0x00000001  Indicates that the widget is a window, usually with a window system frame and a title bar, irrespective of whether the widget has a parent or not. Note that it is not possible to unset this flag if the widget does not have a parent.

Qt.Dialog

0x00000002 | Window Indicates that the widget is a window that should be decorated as a dialog (i.e., typically no maximize or minimize buttons in the title bar). This is the default type for QDialog. If you want to use it as a modal dialog, it should be launched from another window, or have a parent and used with the QWidget.windowModality property. If you make it modal, the dialog will prevent other top-level windows in the application from getting any input. We refer to a top-level window that has a parent as a secondary window.

Qt.Sheet

0x00000004 | Window Indicates that the window is a Macintosh sheet. Since using a sheet implies window modality, the recommended way is to use QWidget.setWindowModality(), or QDialog.open(), instead.

Qt.Drawer

0x00000006 | Window Indicates that the widget is a Macintosh drawer.

Qt.Popup

0x00000008 | Window Indicates that the widget is a pop-up top-level window, i.e. that it is modal, but has a window system frame appropriate for pop-up menus.

Qt.Tool

0x0000000a | Window Indicates that the widget is a tool window. A tool window is often a small window with a smaller than usual title bar and decoration, typically used for collections of tool buttons. If there is a parent, the tool window will always be kept on top of it. If there isn't a parent, you may consider using Qt.WindowStaysOnTopHint as well. If the window system supports it, a tool window can be decorated with a somewhat lighter frame. It can also be combined with Qt.FramelessWindowHint.

你可能感兴趣的:(python)