def openOptionsDialogNickname():
value = QInputDialog.getText(
mainwindow,
_("Nickname"),
_("Set nickname"),
text=qcauthor,
flags=Qt.WindowFlags(dialogwindowflags),
)[0]
if value:
setOption("nickname", value)
python类WindowFlags()的实例源码
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)
testwindowflags.py 文件源码
项目:incubator-senssoft-userale-pyqt5
作者: apache
项目源码
文件源码
阅读 21
收藏 0
点赞 0
评论 0
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()
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()
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()
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()