本文整理汇总了Python中PyQt4.Qt.QPushButton.show方法的典型用法代码示例。如果您正苦于以下问题:Python QPushButton.show方法的具体用法?Python QPushButton.show怎么用?Python QPushButton.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.Qt.QPushButton
的用法示例。
在下文中一共展示了QPushButton.show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: LetsShareBooksDialog
# 需要导入模块: from PyQt4.Qt import QPushButton [as 别名]
# 或者: from PyQt4.Qt.QPushButton import show [as 别名]
class LetsShareBooksDialog(QDialog):
def __init__(self, gui, icon, do_user_config, qaction, us):
QDialog.__init__(self, gui)
self.gui = gui
self.do_user_config = do_user_config
self.qaction = qaction
self.us = us
self.clip = QApplication.clipboard()
self.main_gui = calibre_main()
self.urllib_thread = UrlLibThread(self.us)
self.kill_servers_thread = KillServersThread(self.us)
self.us.check_finished = True
self.pxmp = QPixmap()
self.pxmp.load('images/icon_connected.png')
self.icon_connected = QIcon(self.pxmp)
self.setStyleSheet("""
QDialog {
background-color: white;
}
QPushButton {
font-size: 16px;
border-style: solid;
border-color: red;
font-family:'BitstreamVeraSansMono',Consolas,monospace;
text-transform: uppercase;
}
QPushButton#arrow {
border-width: 16px;
border-right-color:white;
padding: -10px;
color:red;
}
QPushButton#url {
background-color: red;
min-width: 460px;
color: white;
text-align: left;
}
QPushButton#url:hover {
background-color: white;
color: red;
}
QPushButton#share {
background-color: red;
color: white;
margin-right: 10px;
}
QPushButton#share:hover {
background-color: white;
color: red;
}
QPushButton#url2 {
color: #222;
text-align: left;
}
QPushButton#url2:hover {
color: red;
}
""")
self.ll = QVBoxLayout()
#self.ll.setSpacing(1)
self.l = QHBoxLayout()
self.l.setSpacing(0)
self.l.setMargin(0)
#self.l.setContentsMargins(0,0,0,0)
self.w = QWidget()
self.w.setLayout(self.l)
self.setLayout(self.ll)
self.setWindowIcon(icon)
self.lets_share_button = QPushButton()
self.lets_share_button.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
self.lets_share_button.setObjectName("share")
self.lets_share_button.clicked.connect(self.lets_share)
self.stop_share_button = QPushButton()
self.stop_share_button.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
self.stop_share_button.setObjectName("share")
self.stop_share_button.clicked.connect(self.stop_share)
self.l.addWidget(self.lets_share_button)
self.l.addWidget(self.stop_share_button)
if self.us.button_state == "start":
self.lets_share_button.show()
self.stop_share_button.hide()
#.........这里部分代码省略.........