本文整理汇总了Python中PyQt4.QtCore.Qt.Horizontal方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.Horizontal方法的具体用法?Python Qt.Horizontal怎么用?Python Qt.Horizontal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.Horizontal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_slider
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Horizontal [as 别名]
def create_slider(self, setterSlot, defaultValue=0, rangeMin=0, rangeMax=100, orientation=Qt.Horizontal, base_class=QSlider):
if base_class == Gcode_slider:
slider = base_class(orientation, self.controller)
else:
slider = base_class(orientation)
slider.setRange(rangeMin, rangeMax)
slider.setSingleStep(1)
slider.setPageStep(1)
slider.setTickInterval(1)
slider.setValue(defaultValue)
slider.setTickPosition(QSlider.TicksRight)
if base_class == Gcode_slider:
#self.connect(slider.slider, SIGNAL("valueChanged(int)"), setterSlot)
slider.slider.valueChanged.connect(setterSlot)
else:
#self.connect(slider, SIGNAL("valueChanged(int)"), setterSlot)
slider.valueChanged.connect(setterSlot)
return slider
示例2: headerData
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Horizontal [as 别名]
def headerData(self, section, orientation, role=Qt.DisplayRole):
if role != Qt.DisplayRole:
return QVariant()
if orientation == Qt.Horizontal:
try:
return self.df.columns.tolist()[section]
except (IndexError, ):
return QVariant()
elif orientation == Qt.Vertical:
try:
# return self.df.index.tolist()
return self.df.index.tolist()[section]
except (IndexError, ):
return QVariant()
示例3: headerData
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Horizontal [as 别名]
def headerData(self, section, Qt_Orientation, role=None):
if role == Qt.DisplayRole and Qt_Orientation == Qt.Horizontal and 0 <= section < PlayerModel.N_DISPLAY_COLS:
return PlayerModel.displayColumns[section]
if role == Qt.DecorationRole and Qt_Orientation == Qt.Horizontal:
if section == PlayerModel.IGNORE:
return QtGui.QIcon(':/assets/face-ignore.png')
示例4: headerData
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Horizontal [as 别名]
def headerData(self, section, orientation, role=None):
if role == Qt.DisplayRole and orientation == Qt.Horizontal:
return {0: 'Filename', 1: 'Manufacturer', 2: 'Year', 3: 'Description'}[section]
示例5: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import Horizontal [as 别名]
def __init__(self, controller):
super(NewOctoPrintDialog, self).__init__(controller.view, Qt.WindowSystemMenuHint | Qt.WindowTitleHint)
self.controller = controller
layout = QFormLayout(self)
# nice widget for editing the date
self.name_label = QLabel(self.tr("Name"))
self.name_edit = QLineEdit()
self.ip_address_label = QLabel(self.tr("IP"))
self.ip_address_edit = QLineEdit()
self.apikey_label = QLabel(self.tr("ApiKey"))
self.apikey_edit = QLineEdit()
#self.username_label = QLabel(self.tr("User"))
#self.username_edit = QLineEdit()
#self.password_label = QLabel(self.tr("Password"))
#self.password_edit = QLineEdit()
layout.addRow(self.name_label, self.name_edit)
layout.addRow(self.ip_address_label, self.ip_address_edit)
layout.addRow(self.apikey_label, self.apikey_edit)
#layout.addRow(self.username_label, self.username_edit)
#layout.addRow(self.password_label, self.password_edit)
# OK and Cancel buttons
buttons = QDialogButtonBox(
QDialogButtonBox.Ok | QDialogButtonBox.Cancel,
Qt.Horizontal, self)
buttons.accepted.connect(self.accept)
buttons.rejected.connect(self.reject)
layout.addWidget(buttons)