本文整理汇总了Python中PySide.QtGui.QCheckBox.hide方法的典型用法代码示例。如果您正苦于以下问题:Python QCheckBox.hide方法的具体用法?Python QCheckBox.hide怎么用?Python QCheckBox.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QCheckBox
的用法示例。
在下文中一共展示了QCheckBox.hide方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConfigDialog
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import hide [as 别名]
class ConfigDialog(QtGui.QDialog):
pressedclosebutton = False
malToggling = False
def malToggled(self):
if self.malToggling == False:
self.malToggling = True
if self.malenabledCheckbox.isChecked() and self.malenabledCheckbox.isVisible():
self.malenabledCheckbox.setChecked(False)
self.malSettingsGroup.setChecked(True)
self.malSettingsGroup.show()
self.malpasswordLabel.show()
self.malpasswordTextbox.show()
self.malusernameLabel.show()
self.malusernameTextbox.show()
self.malenabledCheckbox.hide()
else:
self.malSettingsGroup.setChecked(False)
self.malSettingsGroup.hide()
self.malpasswordLabel.hide()
self.malpasswordTextbox.hide()
self.malusernameLabel.hide()
self.malusernameTextbox.hide()
self.malenabledCheckbox.show()
self.malToggling = False
self.adjustSize()
self.setFixedSize(self.sizeHint())
def runButtonTextUpdate(self):
if (self.donotstoreCheckbox.isChecked()):
self.runButton.setText("Run Syncplay")
else:
self.runButton.setText("Store configuration and run Syncplay")
def openHelp(self):
if sys.platform.startswith('linux'):
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/linux/")
elif sys.platform.startswith('win'):
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/windows/")
else:
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/")
def _tryToFillPlayerPath(self, playerpath, playerpathlist):
foundpath = ""
if playerpath != None and playerpath != "" and os.path.isfile(playerpath):
foundpath = playerpath
self.executablepathCombobox.addItem(foundpath)
for path in playerpathlist:
if(os.path.isfile(path) and path.lower() != foundpath.lower()):
self.executablepathCombobox.addItem(path)
if foundpath == None:
foundpath = path
if foundpath:
return(foundpath)
else:
return("")
def browsePlayerpath(self):
options = QtGui.QFileDialog.Options()
defaultdirectory = ""
browserfilter = "All Files (*)"
if os.name == 'nt':
browserfilter = "Executable files (*.exe);;All Files (*)"
if "PROGRAMFILES(X86)" in os.environ:
defaultdirectory = os.environ["ProgramFiles(x86)"]
elif "PROGRAMFILES" in os.environ:
defaultdirectory = os.environ["ProgramFiles"]
elif "PROGRAMW6432" in os.environ:
defaultdirectory = os.environ["ProgramW6432"]
elif sys.platform.startswith('linux'):
defaultdirectory = "/usr/bin"
fileName, filtr = QtGui.QFileDialog.getOpenFileName(self,
"Browse for media player executable",
defaultdirectory,
browserfilter, "", options)
if fileName:
self.executablepathCombobox.setEditText(fileName)
def loadMediaBrowseSettings(self):
settings = QSettings("Syncplay", "MediaBrowseDialog")
settings.beginGroup("MediaBrowseDialog")
self.mediadirectory = settings.value("mediadir", "")
settings.endGroup()
def saveMediaBrowseSettings(self):
settings = QSettings("Syncplay", "MediaBrowseDialog")
settings.beginGroup("MediaBrowseDialog")
settings.setValue("mediadir", self.mediadirectory)
settings.endGroup()
def browseMediapath(self):
self.loadMediaBrowseSettings()
#.........这里部分代码省略.........
示例2: ConfigDialog
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import hide [as 别名]
class ConfigDialog(QtGui.QDialog):
pressedclosebutton = False
moreToggling = False
def moreToggled(self):
if self.moreToggling == False:
self.moreToggling = True
if self.showmoreCheckbox.isChecked():
self.tabListFrame.show()
self.resetButton.show()
self.nostoreCheckbox.show()
self.alwaysshowCheckbox.show()
self.saveMoreState(True)
self.tabListWidget.setCurrentRow(0)
self.ensureTabListIsVisible()
else:
self.tabListFrame.hide()
self.resetButton.hide()
self.nostoreCheckbox.hide()
self.alwaysshowCheckbox.hide()
self.saveMoreState(False)
self.stackedLayout.setCurrentIndex(0)
self.adjustSize()
self.setFixedSize(self.sizeHint())
self.moreToggling = False
self.setFixedWidth(self.minimumSizeHint().width())
self.executablepathCombobox.setFixedWidth(self.mediapathTextbox.width())
def runButtonTextUpdate(self):
if self.nostoreCheckbox.isChecked():
self.runButton.setText(getMessage("run-label"))
else:
self.runButton.setText(getMessage("storeandrun-label"))
def openHelp(self):
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/client/")
def _tryToFillPlayerPath(self, playerpath, playerpathlist):
settings = QSettings("Syncplay", "PlayerList")
settings.beginGroup("PlayerList")
savedPlayers = settings.value("PlayerList", [])
if not isinstance(savedPlayers, list):
savedPlayers = []
playerpathlist = list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist + savedPlayers)))
settings.endGroup()
foundpath = ""
if playerpath != None and playerpath != "":
if not os.path.isfile(playerpath):
expandedpath = PlayerFactory().getExpandedPlayerPathByPath(playerpath)
if expandedpath != None and os.path.isfile(expandedpath):
playerpath = expandedpath
if os.path.isfile(playerpath):
foundpath = playerpath
self.executablepathCombobox.addItem(foundpath)
for path in playerpathlist:
if os.path.isfile(path) and os.path.normcase(os.path.normpath(path)) != os.path.normcase(os.path.normpath(foundpath)):
self.executablepathCombobox.addItem(path)
if foundpath == "":
foundpath = path
if foundpath != "":
settings.beginGroup("PlayerList")
playerpathlist.append(os.path.normcase(os.path.normpath(foundpath)))
settings.setValue("PlayerList", list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist))))
settings.endGroup()
return foundpath
def updateExecutableIcon(self):
currentplayerpath = unicode(self.executablepathCombobox.currentText())
iconpath = PlayerFactory().getPlayerIconByPath(currentplayerpath)
if iconpath != None and iconpath != "":
self.executableiconImage.load(self.resourcespath + iconpath)
self.executableiconLabel.setPixmap(QtGui.QPixmap.fromImage(self.executableiconImage))
else:
self.executableiconLabel.setPixmap(QtGui.QPixmap.fromImage(QtGui.QImage()))
def browsePlayerpath(self):
options = QtGui.QFileDialog.Options()
defaultdirectory = ""
browserfilter = "All files (*)"
if os.name == 'nt':
browserfilter = "Executable files (*.exe);;All files (*)"
if "PROGRAMFILES(X86)" in os.environ:
defaultdirectory = os.environ["ProgramFiles(x86)"]
elif "PROGRAMFILES" in os.environ:
defaultdirectory = os.environ["ProgramFiles"]
elif "PROGRAMW6432" in os.environ:
defaultdirectory = os.environ["ProgramW6432"]
elif sys.platform.startswith('linux'):
defaultdirectory = "/usr/bin"
elif sys.platform.startswith('darwin'):
defaultdirectory = "/Applications/"
#.........这里部分代码省略.........
示例3: ConfigDialog
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import hide [as 别名]
class ConfigDialog(QtGui.QDialog):
pressedclosebutton = False
moreToggling = False
def moreToggled(self):
if self.moreToggling == False:
self.moreToggling = True
if self.showmoreCheckbox.isChecked() and self.showmoreCheckbox.isVisible():
self.showmoreCheckbox.setChecked(False)
self.moreSettingsGroup.setChecked(True)
self.moreSettingsGroup.show()
self.showmoreCheckbox.hide()
self.saveMoreState(True)
else:
self.moreSettingsGroup.setChecked(False)
self.moreSettingsGroup.hide()
self.showmoreCheckbox.show()
self.saveMoreState(False)
self.moreToggling = False
self.adjustSize()
self.setFixedSize(self.sizeHint())
def runButtonTextUpdate(self):
if (self.donotstoreCheckbox.isChecked()):
self.runButton.setText(getMessage("en", "run-label"))
else:
self.runButton.setText(getMessage("en", "storeandrun-label"))
def openHelp(self):
self.QtGui.QDesktopServices.openUrl("http://syncplay.pl/guide/client/")
def _tryToFillPlayerPath(self, playerpath, playerpathlist):
settings = QSettings("Syncplay", "PlayerList")
settings.beginGroup("PlayerList")
savedPlayers = settings.value("PlayerList", [])
if(not isinstance(savedPlayers, list)):
savedPlayers = []
playerpathlist = list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist + savedPlayers)))
settings.endGroup()
foundpath = ""
if playerpath != None and playerpath != "":
if not os.path.isfile(playerpath):
expandedpath = PlayerFactory().getExpandedPlayerPathByPath(playerpath)
if expandedpath != None and os.path.isfile(expandedpath):
playerpath = expandedpath
if os.path.isfile(playerpath):
foundpath = playerpath
self.executablepathCombobox.addItem(foundpath)
for path in playerpathlist:
if(os.path.isfile(path) and os.path.normcase(os.path.normpath(path)) != os.path.normcase(os.path.normpath(foundpath))):
self.executablepathCombobox.addItem(path)
if foundpath == "":
foundpath = path
if foundpath != "":
settings.beginGroup("PlayerList")
playerpathlist.append(os.path.normcase(os.path.normpath(foundpath)))
settings.setValue("PlayerList", list(set(os.path.normcase(os.path.normpath(path)) for path in set(playerpathlist))))
settings.endGroup()
return(foundpath)
def updateExecutableIcon(self):
currentplayerpath = unicode(self.executablepathCombobox.currentText())
iconpath = PlayerFactory().getPlayerIconByPath(currentplayerpath)
if iconpath != None and iconpath != "":
self.executableiconImage.load(self.resourcespath + iconpath)
self.executableiconLabel.setPixmap(QtGui.QPixmap.fromImage(self.executableiconImage))
else:
self.executableiconLabel.setPixmap(QtGui.QPixmap.fromImage(QtGui.QImage()))
def browsePlayerpath(self):
options = QtGui.QFileDialog.Options()
defaultdirectory = ""
browserfilter = "All files (*)"
if os.name == 'nt':
browserfilter = "Executable files (*.exe);;All files (*)"
if "PROGRAMFILES(X86)" in os.environ:
defaultdirectory = os.environ["ProgramFiles(x86)"]
elif "PROGRAMFILES" in os.environ:
defaultdirectory = os.environ["ProgramFiles"]
elif "PROGRAMW6432" in os.environ:
defaultdirectory = os.environ["ProgramW6432"]
elif sys.platform.startswith('linux'):
defaultdirectory = "/usr/bin"
fileName, filtr = QtGui.QFileDialog.getOpenFileName(self,
"Browse for media player executable",
defaultdirectory,
browserfilter, "", options)
if fileName:
self.executablepathCombobox.setEditText(os.path.normpath(fileName))
#.........这里部分代码省略.........
示例4: ConfigDialog
# 需要导入模块: from PySide.QtGui import QCheckBox [as 别名]
# 或者: from PySide.QtGui.QCheckBox import hide [as 别名]
class ConfigDialog(QtGui.QDialog):
pressedclosebutton = False
moreToggling = False
def automaticUpdatePromptCheck(self):
if self.automaticupdatesCheckbox.checkState() == Qt.PartiallyChecked and not self.nostoreCheckbox.isChecked():
reply = QtGui.QMessageBox.question(self, "Syncplay",
getMessage("promptforupdate-label"), QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No)
if reply == QtGui.QMessageBox.Yes:
self.automaticupdatesCheckbox.setChecked(True)
else:
self.automaticupdatesCheckbox.setChecked(False)
def moreToggled(self):
if self.moreToggling == False:
self.moreToggling = True
if self.showmoreCheckbox.isChecked():
self.tabListFrame.show()
self.resetButton.show()
self.nostoreCheckbox.show()
self.saveMoreState(True)
self.tabListWidget.setCurrentRow(0)
self.ensureTabListIsVisible()
else:
self.tabListFrame.hide()
self.resetButton.hide()
self.nostoreCheckbox.hide()
self.saveMoreState(False)
self.stackedLayout.setCurrentIndex(0)
self.adjustSize()
self.setFixedSize(self.sizeHint())
self.moreToggling = False
self.setFixedWidth(self.minimumSizeHint().width())
self.executablepathCombobox.setFixedWidth(self.mediapathTextbox.width())
def runButtonTextUpdate(self):
if self.nostoreCheckbox.isChecked():
self.runButton.setText(getMessage("run-label"))
else:
self.runButton.setText(getMessage("storeandrun-label"))
def openHelp(self):
self.QtGui.QDesktopServices.openUrl(QUrl("http://syncplay.pl/guide/client/"))
def _isURL(self, path):
if path is None:
return False
if "http://" in path:
return True
def safenormcaseandpath(self, path):
if self._isURL(path):
return path
else:
return os.path.normcase(os.path.normpath(path))
def _tryToFillPlayerPath(self, playerpath, playerpathlist):
settings = QSettings("Syncplay", "PlayerList")
settings.beginGroup("PlayerList")
savedPlayers = settings.value("PlayerList", [])
if not isinstance(savedPlayers, list):
savedPlayers = []
else:
for i, savedPlayer in enumerate(savedPlayers):
savedPlayers[i] = self.safenormcaseandpath(savedPlayer)
playerpathlist = list(set(playerpathlist + savedPlayers))
settings.endGroup()
foundpath = ""
if playerpath != None and playerpath != "":
if self._isURL(playerpath):
foundpath = playerpath
self.executablepathCombobox.addItem(foundpath)
else:
if not os.path.isfile(playerpath):
expandedpath = PlayerFactory().getExpandedPlayerPathByPath(playerpath)
if expandedpath != None and os.path.isfile(expandedpath):
playerpath = expandedpath
if os.path.isfile(playerpath):
foundpath = playerpath
self.executablepathCombobox.addItem(foundpath)
for path in playerpathlist:
if self._isURL(path):
if foundpath == "":
foundpath = path
if path != playerpath:
self.executablepathCombobox.addItem(path)
elif os.path.isfile(path) and os.path.normcase(os.path.normpath(path)) != os.path.normcase(os.path.normpath(foundpath)):
self.executablepathCombobox.addItem(path)
if foundpath == "":
foundpath = path
#.........这里部分代码省略.........