我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用PyQt5.QtCore.Qt.WindowFlags()。
def openOptionsDialogNickname(): value = QInputDialog.getText( mainwindow, _("Nickname"), _("Set nickname"), text=qcauthor, flags=Qt.WindowFlags(dialogwindowflags), )[0] if value: setOption("nickname", value)
def openOptionsDialogCommentTypes(): value = QInputDialog.getText( mainwindow, _("Comment Types"), _("Set comment types (comma separated list)"), text=",".join(commenttypeoptions), flags=Qt.WindowFlags(dialogwindowflags), )[0] if value: setOption("commenttypes", value)
def openOptionsDialogAutosaveInterval(): value = QInputDialog.getText( mainwindow, _("Autosave Interval"), _("Set autosave interval in minutes (0 to deactivate)"), text=str(autosaveinterval), flags=Qt.WindowFlags(dialogwindowflags), )[0] if value: setOption("autosaveinterval", value)
def openNetworkStream(url=None): exitFullscreen() if not url: url = QInputDialog.getText( mainwindow, _("Open Network Stream"), _("Enter URL"), flags=Qt.WindowFlags(dialogwindowflags), )[0] if url: mp.command("loadfile", url, "replace") setPause(False)
def updatePreview(self): flags = Qt.WindowFlags() if self.windowRadioButton.isChecked(): flags = Qt.Window elif self.dialogRadioButton.isChecked(): flags = Qt.Dialog elif self.sheetRadioButton.isChecked(): flags = Qt.Sheet elif self.drawerRadioButton.isChecked(): flags = Qt.Drawer elif self.popupRadioButton.isChecked(): flags = Qt.Popup elif self.toolRadioButton.isChecked(): flags = Qt.Tool elif self.toolTipRadioButton.isChecked(): flags = Qt.ToolTip elif self.splashScreenRadioButton.isChecked(): flags = Qt.SplashScreen if self.msWindowsFixedSizeDialogCheckBox.isChecked(): flags |= Qt.MSWindowsFixedSizeDialogHint if self.x11BypassWindowManagerCheckBox.isChecked(): flags |= Qt.X11BypassWindowManagerHint if self.framelessWindowCheckBox.isChecked(): flags |= Qt.FramelessWindowHint if self.windowTitleCheckBox.isChecked(): flags |= Qt.WindowTitleHint if self.windowSystemMenuCheckBox.isChecked(): flags |= Qt.WindowSystemMenuHint if self.windowMinimizeButtonCheckBox.isChecked(): flags |= Qt.WindowMinimizeButtonHint if self.windowMaximizeButtonCheckBox.isChecked(): flags |= Qt.WindowMaximizeButtonHint if self.windowCloseButtonCheckBox.isChecked(): flags |= Qt.WindowCloseButtonHint if self.windowContextHelpButtonCheckBox.isChecked(): flags |= Qt.WindowContextHelpButtonHint if self.windowShadeButtonCheckBox.isChecked(): flags |= Qt.WindowShadeButtonHint if self.windowStaysOnTopCheckBox.isChecked(): flags |= Qt.WindowStaysOnTopHint if self.windowStaysOnBottomCheckBox.isChecked(): flags |= Qt.WindowStaysOnBottomHint if self.customizeWindowHintCheckBox.isChecked(): flags |= Qt.CustomizeWindowHint self.previewWindow.setWindowFlags(flags) pos = self.previewWindow.pos() if pos.x() < 0: pos.setX(0) if pos.y() < 0: pos.setY(0) self.previewWindow.move(pos) self.previewWindow.show()