本文整理匯總了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)