當前位置: 首頁>>代碼示例>>Python>>正文


Python Qt.Horizontal方法代碼示例

本文整理匯總了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 
開發者ID:prusa3d,項目名稱:PrusaControl,代碼行數:22,代碼來源:gui.py

示例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() 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:17,代碼來源:qtpandas.py

示例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') 
開發者ID:doctorguile,項目名稱:pyqtggpo,代碼行數:8,代碼來源:playermodel.py

示例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] 
開發者ID:doctorguile,項目名稱:pyqtggpo,代碼行數:5,代碼來源:savestatesdialog.py

示例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) 
開發者ID:prusa3d,項目名稱:PrusaControl,代碼行數:39,代碼來源:gui.py


注:本文中的PyQt4.QtCore.Qt.Horizontal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。