本文整理汇总了Python中PyQt5.Qt.QTabWidget.isHidden方法的典型用法代码示例。如果您正苦于以下问题:Python QTabWidget.isHidden方法的具体用法?Python QTabWidget.isHidden怎么用?Python QTabWidget.isHidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.Qt.QTabWidget
的用法示例。
在下文中一共展示了QTabWidget.isHidden方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Dialog
# 需要导入模块: from PyQt5.Qt import QTabWidget [as 别名]
# 或者: from PyQt5.Qt.QTabWidget import isHidden [as 别名]
class Dialog(QtWidgets.QDialog):
_layout = None
buttonBox = None
okButtonText = None
cancelButtonText = None
okButton = None
cancelButton = None
_tab = None
def __init__(self, title=None, f=None, desc=None):
# FIXME: f no lo uso , es qt.windowsflg
super(Dialog, self).__init__()
if title:
self.setWindowTitle(str(title))
self.setWindowModality(QtCore.Qt.ApplicationModal)
self._layout = QtWidgets.QVBoxLayout()
self.setLayout(self._layout)
self.buttonBox = QtWidgets.QDialogButtonBox()
self.okButton = QtWidgets.QPushButton("&Aceptar")
self.cancelButton = QtWidgets.QPushButton("&Cancelar")
self.buttonBox.addButton(
self.okButton, QtWidgets.QDialogButtonBox.AcceptRole)
self.buttonBox.addButton(
self.cancelButton, QtWidgets.QDialogButtonBox.RejectRole)
self.okButton.clicked.connect(self.accept)
self.cancelButton.clicked.connect(self.reject)
from PyQt5.Qt import QTabWidget
self._tab = QTabWidget()
self._tab.hide()
self._layout.addWidget(self._tab)
self.oKButtonText = None
self.cancelButtonText = None
def add(self, _object):
self._layout.addWidget(_object)
def exec_(self):
if self.okButtonText:
self.okButton.setText(str(self.okButtonText))
if (self.cancelButtonText):
self.cancelButton.setText(str(self.cancelButtonText))
self._layout.addWidget(self.buttonBox)
return super(Dialog, self).exec_()
def newTab(self, name):
if self._tab.isHidden():
self._tab.show()
self._tab.addTab(QtWidgets.QWidget(), str(name))
def __getattr__(self, name):
if name == "caption":
name = self.setWindowTitle
return getattr(super(Dialog, self), name)