Python PyQt4.QtCore.Qt.Horizontal() Examples

The following are 8 code examples of PyQt4.QtCore.Qt.Horizontal(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt4.QtCore.Qt , or try the search function .
Example #1
Source File: gui.py    From PrusaControl with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #2
Source File: qtpandas.py    From Computable with MIT License 5 votes vote down vote up
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() 
Example #3
Source File: playermodel.py    From pyqtggpo with GNU General Public License v2.0 5 votes vote down vote up
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') 
Example #4
Source File: savestatesdialog.py    From pyqtggpo with GNU General Public License v2.0 5 votes vote down vote up
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] 
Example #5
Source File: gui.py    From PrusaControl with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #6
Source File: gui.py    From PrusaControl with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, controller, parent = None):
        super(FirmwareUpdateDialog, self).__init__(parent)

        self.controller = controller
        #self.differentVersion = True
        #self.actualVersion = '1.0.2'
        #self.yourVersion = '1.0.1'

        layout = QVBoxLayout(self)


        #self.actualVersionLabel = QtGui.QLabel("Actual version of firmware is %s" % self.actualVersion)
        #self.yourVersionLabel = QtGui.QLabel("Your version of firmware is %s" % self.yourVersion)

        self.open_file_button = QPushButton(self.tr("Open file"))

        self.update_button = QPushButton(self.tr("Update"))
        #TODO:Doplnit
        #self.updateButton.clicked.connect(self.controller.updateFirmware)
        #self.updateButton.setEnabled(self.differentVersion)

        #layout.addWidget(self.actualVersionLabel)
        #layout.addWidget(self.yourVersionLabel)
        layout.addWidget(self.open_file_button)
        layout.addWidget(self.update_button)

        # Close button
        buttons = QDialogButtonBox(
            QDialogButtonBox.Close,
            Qt.Horizontal, self)
        buttons.clicked.connect(self.close)
        layout.addWidget(buttons) 
Example #7
Source File: gui.py    From PrusaControl with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, controller, parent = None):
        super(AboutDialog, self).__init__(parent)

        self.controller = controller
        self.different_version = True
        #self.actual_version = '1.0.2'
        self.your_version = self.controller.app_config.version
        self.slic3r_version = self.controller.slicer_manager.get_version()

        layout = QVBoxLayout(self)

        self.prusa_control_label = QLabel("PrusaControl")
        self.prusa_control_label.setAlignment(Qt.AlignCenter)

        self.prusa_control_text = QLabel(controller.view.tr("PrusaControl\nTibor Vavra, Prusa Research\nDominik Cisar, Prusa Research\n\nSlic3r engine\nVojtech Bubnik, Prusa Research\nAlessandro Ranellucci"))



        self.local_version_label = QLabel(controller.view.tr("PrusaControl version is ") + str(self.your_version))
        self.slic3r_engine_version_label = QLabel(controller.view.tr("Slic3r engine version is ") + str(self.slic3r_version))


        #self.check_version_button = QtGui.QPushButton(self.tr("Check version"))
        #TODO:Doplnit
        #self.checkVersionButton.clicked.connect(self.controller.checkVersion)
        #self.checkVersionButton.setEnabled(self.differentVersion)

        layout.addWidget(self.prusa_control_label)
        layout.addWidget(self.prusa_control_text)

        layout.addWidget(self.local_version_label)
        layout.addWidget(self.slic3r_engine_version_label)
        #layout.addWidget(self.check_version_button)

        # Close button
        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok,
            Qt.Horizontal, self)
        buttons.clicked.connect(self.close)
        layout.addWidget(buttons) 
Example #8
Source File: gui.py    From PrusaControl with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, controller, parent= None):
        super(PrinterInfoDialog, self).__init__(parent)

        self.controller = controller
        self.printer_name = self.controller.get_printer_name()
        self.your_firmware_version = self.controller.get_firmware_version_number()

        layout = QVBoxLayout(self)

        self.printerNameLabel = QLabel(controller.view.tr("Your printer is") + " %s" % self.printer_name)

        self.printerFirmwareText = QLabel(controller.view.tr("Version of firmware is") + " %s" % self.your_firmware_version)


        #TODO:Doplnit
        #self.checkVersionButton.clicked.connect(self.controller.checkVersion)
        #self.checkVersionButton.setEnabled(self.differentVersion)

        layout.addWidget(self.printerNameLabel)
        layout.addWidget(self.printerFirmwareText)

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok,
            Qt.Horizontal, self)
        buttons.clicked.connect(self.close)
        layout.addWidget(buttons)