本文整理汇总了Python中PyQt4.QtGui.QGroupBox.setStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:Python QGroupBox.setStyleSheet方法的具体用法?Python QGroupBox.setStyleSheet怎么用?Python QGroupBox.setStyleSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGroupBox
的用法示例。
在下文中一共展示了QGroupBox.setStyleSheet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GUI
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setStyleSheet [as 别名]
#.........这里部分代码省略.........
def on_start(self):
"""
Additional procedures run on application start.
"""
# Let's initialize even some stuff!
self.al = None
self.auth_thread = None
self.init_backend()
choose_db(str(self.availableDB.currentText()))
self.showDB.setText("&Change DB (active: %s)" % self.availableDB.currentText())
self.stats = StatsUI(self.al, self)
def init_composition(self):
"""
Window composition and general params.
"""
self.setWindowTitle(NAME + ' ' + __version__)
desktop = QApplication.desktop()
self.setGeometry((desktop.width() - WIDTH)/2,
(desktop.height() - HEIGHT)/2, WIDTH, HEIGHT)
def init_contents(self):
"""
Setting up qt controls.
"""
self.changeDB.hide()
self.availableDB.hide()
self.availableDB.addItems(dbs.keys())
self.kanjiGroup.setAlignment(Qt.AlignCenter)
self.kanjiGroup.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; }")
self.day.setAlignment(Qt.AlignCenter)
self.week.setAlignment(Qt.AlignCenter)
self.month.setAlignment(Qt.AlignCenter)
self.year.setAlignment(Qt.AlignCenter)
self.dayLabel.setAlignment(Qt.AlignCenter)
self.weekLabel.setAlignment(Qt.AlignCenter)
self.monthLabel.setAlignment(Qt.AlignCenter)
self.yearLabel.setAlignment(Qt.AlignCenter)
self.day.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.week.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.month.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.year.setFont(QFont(PRETTY_FONT, KANJI_SIZE))
self.methodCombo.addItems(RandomMess.algs.keys())
self.methodCombo.setCurrentIndex(1)
self.statusMessage.setAlignment(Qt.AlignCenter)
self.statusMessage.hide()
self.statusMessage.setMaximumHeight(MESSAGE_HEIGHT)
self.statusMessage.setStyleSheet(WARNING_STYLE)
self.progressBar.setMaximum(0)
self.progressBar.setMaximumHeight(PROGRESS_HEIGHT)
self.progressBar.hide()
QToolTip.setFont(QFont(PRETTY_FONT, TOOLTIP_FONT_SIZE))
self.getAll.setToolTip('Randomly select all 4 kanji')
self.methodCombo.setToolTip('Choose algorithm for randomness')
self.authGen.setToolTip('Authorize on remote RNG services')
示例2: CommandWindow
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setStyleSheet [as 别名]
class CommandWindow (QMainWindow):
# Constructs a new CommandWindow
def __init__(self, parent = None):
QMainWindow.__init__(self, parent)
self.main_widget = QWidget()
# Builds all groups
self.build_connection_group()
self.build_source_windows()
self.build_buttons_group()
self.build_commands_group()
self.build_log_group()
# Initially the client is disconnected. Consequently, no boards
# are available
self.sources_group.setVisible(False)
self.main_layout = QGridLayout()
self.main_layout.setSpacing(10)
# Groups all components in the main widget
self.main_layout.addWidget(self.connect_group, 0, 0, 1, 3)
self.main_layout.addWidget(self.commands_group, 1, 0, 1, 5)
self.main_layout.addWidget(self.sources_group, 2, 0, 1, 5)
self.main_layout.addWidget(self.log_group, 3, 0, 1, 5)
self.main_widget.setLayout(self.main_layout)
self.statusBar().showMessage("Client started.")
self.setCentralWidget(self.main_widget)
self.setWindowTitle('Commands Window')
self.setFixedSize(QSize(720, 330))
# Constructs the objects responsible to send and receive packets
# from PROSAC
self.requester_controller = Requester(self)
self.is_closed = 0
# Sets a requester in the case it was not instantiated
def setRequester(self, r):
self.requester_controller = r
self.requester_controller.window_controller = self
# Builds text boxes, labels and buttons required to establish a connection with PROSAC
def build_connection_group (self):
self.connect_group = QGroupBox(parent = self.main_widget)
self.connect_group.setTitle('Connection')
self.connect_group.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 0.5em; } QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px;}")
self.connect_label = QLabel("IP Address")
self.connect_line = QLineEdit("10.0.6.65")
self.connect_line.setFixedWidth(100)
self.connect_button = QPushButton("Connect")
self.connect_button.clicked.connect(self.connection_handler)
self.port_label = QLabel("Port")
self.port_line = QLineEdit("4000")
self.port_line.setFixedWidth(50)
self.led_connected = QLed(parent = self.main_widget)
self.led_connected.turnOff()
self.connect_layout = QHBoxLayout()
self.connect_layout.addWidget(self.connect_label)
self.connect_layout.addWidget(self.connect_line)
self.connect_layout.addWidget(self.port_label)
self.connect_layout.addWidget(self.port_line)
self.connect_layout.addWidget(self.led_connected)
self.connect_layout.addWidget(self.connect_button)
self.connect_group.setLayout(self.connect_layout)
# Builds components to show last received and sent messages
def build_log_group (self):
self.log_group = QGroupBox(parent = self.main_widget)
self.log_group.setTitle('Messages')
self.log_group.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 0.5em; } QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px;}")
self.label_sent = QLabel("Last packet sent: ")
self.label_received = QLabel("Last packet received: ")
self.log_layout = QVBoxLayout()
self.log_layout.addWidget(self.label_received)
self.log_layout.addWidget(self.label_sent)
self.log_group.setLayout(self.log_layout)
# Adds as many buttons as the number of connected power supplies.
def build_buttons_group (self):
self.sources_group = QGroupBox(parent = self.main_widget)
self.sources_group.setTitle('Power supply')
self.sources_group.setStyleSheet("QGroupBox { border: 1px solid gray; border-radius: 3px; margin-top: 0.5em; } QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px;}")
#.........这里部分代码省略.........
示例3: mkGroupBox
# 需要导入模块: from PyQt4.QtGui import QGroupBox [as 别名]
# 或者: from PyQt4.QtGui.QGroupBox import setStyleSheet [as 别名]
def mkGroupBox(title):
group_box = QGroupBox(title)
sub_form = QFormLayout(group_box)
group_box.setStyleSheet(u"QGroupBox {font: bold italic large;}")
return group_box, sub_form