Python PyQt5.QtCore.Qt.AlignTop() Examples

The following are 30 code examples of PyQt5.QtCore.Qt.AlignTop(). 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 PyQt5.QtCore.Qt , or try the search function .
Example #1
Source File: audio_pan.py    From linux-show-player with GNU General Public License v3.0 7 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.panBox = QGroupBox(self)
        self.panBox.setGeometry(0, 0, self.width(), 80)
        self.panBox.setLayout(QHBoxLayout(self.panBox))
        self.layout().addWidget(self.panBox)

        self.panSlider = QSlider(self.panBox)
        self.panSlider.setRange(-10, 10)
        self.panSlider.setPageStep(1)
        self.panSlider.setOrientation(Qt.Horizontal)
        self.panSlider.valueChanged.connect(self.pan_changed)
        self.panBox.layout().addWidget(self.panSlider)

        self.panLabel = QLabel(self.panBox)
        self.panLabel.setAlignment(Qt.AlignCenter)
        self.panBox.layout().addWidget(self.panLabel)

        self.panBox.layout().setStretch(0, 5)
        self.panBox.layout().setStretch(1, 1)

        self.retransaleUi() 
Example #2
Source File: Event_object.py    From python with Apache License 2.0 6 votes vote down vote up
def initUI(self):      

        grid = QGridLayout()
        grid.setSpacing(10)

        x = 0
        y = 0

        self.text = "x: {0},  y: {1}".format(x, y)

        self.label = QLabel(self.text, self)
        grid.addWidget(self.label, 0, 0, Qt.AlignTop)

        self.setMouseTracking(True)

        self.setLayout(grid)

        self.setGeometry(300, 300, 350, 200)
        self.setWindowTitle('Event object')
        self.show() 
Example #3
Source File: meta.py    From FeelUOwn with GNU General Public License v3.0 6 votes vote down vote up
def _setup_ui(self):
        self.cover_label.setMaximumWidth(200)
        self._v_layout = QVBoxLayout(self)
        self._h_layout = QHBoxLayout()
        self._right_layout = QVBoxLayout()
        self._right_layout.addStretch(0)
        self._right_layout.addWidget(self.title_label)
        self._right_layout.addWidget(self.meta_label)
        self._h_layout.addWidget(self.cover_label)
        self._h_layout.setAlignment(self.cover_label, Qt.AlignTop)
        self._h_layout.addLayout(self._right_layout)
        self._h_layout.setStretchFactor(self._right_layout, 2)
        self._h_layout.setStretchFactor(self.cover_label, 1)
        self._h_layout.setContentsMargins(0, 30, 0, 0)
        self._h_layout.setSpacing(30)
        self._v_layout.addLayout(self._h_layout)

        self._right_layout.setContentsMargins(0, 0, 0, 0)
        self._right_layout.setSpacing(5)

        # left margin is same as toolbar left margin
        self.layout().setContentsMargins(30, 0, 30, 0)
        self.layout().setSpacing(0) 
Example #4
Source File: about.py    From vidcutter with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super(BaseTab, self).__init__(parent)
        self.setTextFormat(Qt.RichText)
        self.setWordWrap(True)
        self.setAlignment(Qt.AlignLeft | Qt.AlignTop)
        self.setOpenExternalLinks(True)
        if parent.theme == 'dark':
            bgcolor = 'rgba(12, 15, 16, 210)'
            pencolor = '#FFF'
        else:
            bgcolor = 'rgba(255, 255, 255, 200)'    
            pencolor = '#000'
        self.setStyleSheet('''
            QLabel {{
                background-color: {bgcolor};
                color: {pencolor};
                padding: 8px;
            }}'''.format(**locals()))


# noinspection PyBroadException 
Example #5
Source File: timecode_settings.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.groupBox = QGroupBox(self)
        self.groupBox.setLayout(QGridLayout())
        self.layout().addWidget(self.groupBox)

        self.activateBox = QCheckBox(self.groupBox)
        self.groupBox.layout().addWidget(self.activateBox, 0, 0)

        self.hresBox = QCheckBox(self.groupBox)
        self.groupBox.layout().addWidget(self.hresBox, 1, 0)

        self.formatLabel = QLabel(self.groupBox)
        self.groupBox.layout().addWidget(self.formatLabel, 2, 0)

        self.formatBox = QComboBox(self.groupBox)
        self.formatBox.addItem('FILM')
        self.formatBox.addItem('EBU')
        self.formatBox.addItem('SMPTE')
        self.groupBox.layout().addWidget(self.formatBox, 2, 1)

        self.retranslateUi() 
Example #6
Source File: cue_app_settings.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        # Interrupt
        self.interruptGroup = QGroupBox(self)
        self.interruptGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.interruptGroup)

        self.interruptFadeEdit = FadeEdit(self.interruptGroup)
        self.interruptGroup.layout().addWidget(self.interruptFadeEdit)

        # Action
        self.actionGroup = QGroupBox(self)
        self.actionGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.actionGroup)

        self.fadeActionEdit = FadeEdit(self.actionGroup)
        self.actionGroup.layout().addWidget(self.fadeActionEdit)

        self.retranslateUi() 
Example #7
Source File: command_cue.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.group = QGroupBox(self)
        self.group.setLayout(QVBoxLayout(self.group))
        self.layout().addWidget(self.group)

        self.commandLineEdit = QLineEdit(self.group)
        self.group.layout().addWidget(self.commandLineEdit)

        self.noOutputCheckBox = QCheckBox(self)
        self.layout().addWidget(self.noOutputCheckBox)

        self.noErrorCheckBox = QCheckBox(self)
        self.layout().addWidget(self.noErrorCheckBox)

        self.killCheckBox = QCheckBox(self)
        self.layout().addWidget(self.killCheckBox)

        self.retranslateUi() 
Example #8
Source File: book_config.py    From X-Ray_Calibre_Plugin with GNU General Public License v3.0 6 votes vote down vote up
def update_aliases_on_gui(self):
        '''Updates aliases on the dialog using the info in the book's aliases dict'''
        aliases_widget = QWidget()
        aliases_layout = QGridLayout(aliases_widget)
        aliases_layout.setAlignment(Qt.AlignTop)

        # add aliases for current book
        for index, (character, aliases) in enumerate(sorted(self.book.aliases.items())):
            label = QLabel(character + ':')
            label.setFixedWidth(150)
            aliases_layout.addWidget(label, index, 0)
            line_edit = QLineEdit(', '.join([self.TITLE_CASE(alias) for alias in aliases]))
            line_edit.setFixedWidth(350)
            line_edit.textEdited.connect(functools.partial(self.edit_aliases, character))
            aliases_layout.addWidget(line_edit, index, 1)

        self._scroll_area.setWidget(aliases_widget) 
Example #9
Source File: stop_all.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.group = QGroupBox(self)
        self.group.setLayout(QVBoxLayout(self.group))
        self.layout().addWidget(self.group)

        self.actionCombo = QComboBox(self.group)
        for action in [CueAction.Stop, CueAction.FadeOutStop, CueAction.Pause,
                       CueAction.FadeOutPause, CueAction.Interrupt,
                       CueAction.FadeOutInterrupt]:
            self.actionCombo.addItem(
                translate('CueAction', action.name), action.value)
        self.group.layout().addWidget(self.actionCombo)

        self.retranslateUi() 
Example #10
Source File: jack_sink.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.jackGroup = QGroupBox(self)
        self.jackGroup.setLayout(QHBoxLayout())
        self.layout().addWidget(self.jackGroup)

        self.connectionsEdit = QPushButton(self.jackGroup)
        self.connectionsEdit.clicked.connect(self.__edit_connections)
        self.jackGroup.layout().addWidget(self.connectionsEdit)

        self.__jack_client = jack.Client('LiSP_SettingsControl')
        self.connections = JackSink.default_connections(self.__jack_client)

        self.retranlsateUi() 
Example #11
Source File: lateral_menu.py    From CvStudio with MIT License 6 votes vote down vote up
def __init__(self, parent=None):
        super(LateralMenu, self).__init__(parent)
        self.setLayout(QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.top_frame = QFrame()
        # size_policy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
        # self.frame.setSizePolicy(size_policy)
        # self.top_frame.setFixedWidth(90)
        self.top_frame.setFrameStyle(QFrame.NoFrame)
        self.top_frame_layout = QVBoxLayout()
        self.top_frame_layout.setContentsMargins(2, 2, 2, 2)
        self.top_frame_layout.setAlignment(Qt.AlignTop)
        self.top_frame.setLayout(self.top_frame_layout)

        self.bottom_frame = QFrame()
        # self.bottom_frame.setFixedWidth(90)
        self.bottom_frame.setFrameStyle(QFrame.NoFrame)
        self.bottom_frame_layout = QVBoxLayout()
        self.bottom_frame_layout.setContentsMargins(2, 2, 2, 2)
        self.bottom_frame_layout.setAlignment(Qt.AlignBottom)
        self.bottom_frame.setLayout(self.bottom_frame_layout)

        self.layout().addWidget(self.top_frame)
        self.layout().addWidget(self.bottom_frame)
        self.items = [] 
Example #12
Source File: preset_src.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.functionGroup = QGroupBox(self)
        self.functionGroup.setTitle(translate('PresetSrcSettings', 'Presets'))
        self.functionGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.functionGroup)

        self.functionCombo = QComboBox(self.functionGroup)
        self.functionGroup.layout().addWidget(self.functionCombo)

        for function in sorted(PresetSrc.PRESETS.keys()):
            self.functionCombo.addItem(function)

        self.functionDuration = QTimeEdit(self.functionGroup)
        self.functionDuration.setDisplayFormat('HH.mm.ss.zzz')
        self.functionGroup.layout().addWidget(self.functionDuration) 
Example #13
Source File: first.py    From FIRST-plugin-ida with GNU General Public License v2.0 6 votes vote down vote up
def init_middle_layout(self):
            if not self.should_show:
                return

            vbox = QtWidgets.QVBoxLayout()
            self.select_all = QtWidgets.QCheckBox('Select All ')
            self.filter_sub_funcs = QtWidgets.QCheckBox('Filter Out "sub_" functions ')
            vbox.addWidget(self.filter_sub_funcs)
            vbox.addWidget(self.select_all)

            format_str = '{} functions'.format(self.total_functions)
            self.function_number = QtWidgets.QLabel(format_str)
            self.function_number.setAlignment(Qt.AlignTop)
            self.middle_layout.addWidget(self.function_number)
            self.middle_layout.addStretch()
            self.middle_layout.addLayout(vbox) 
Example #14
Source File: first.py    From FIRST-plugin-ida with GNU General Public License v2.0 6 votes vote down vote up
def init_middle_layout(self):
            found = len(self.groups)
            total = len(FIRST.Metadata.get_non_jmp_wrapped_functions())
            s = 's' if 1 != total else ''
            label = 'Matched {0} out of {1} function{2}'

            self.select_highest_ranked = QtWidgets.QCheckBox('Select Highest Ranked ')
            self.filter_sub_funcs_only = QtWidgets.QCheckBox('Show only "sub_" functions')

            vbox = QtWidgets.QVBoxLayout()
            vbox.addWidget(self.filter_sub_funcs_only)
            vbox.addWidget(self.select_highest_ranked)

            self.found_format = label.format('{}', total, s)
            self.found_label = QtWidgets.QLabel(self.found_format.format(found))
            self.found_label.setAlignment(Qt.AlignTop)

            self.middle_layout.addWidget(self.found_label)
            self.middle_layout.addStretch()
            self.middle_layout.addLayout(vbox) 
Example #15
Source File: CustomXYaxis.py    From PyQt with GNU General Public License v3.0 6 votes vote down vote up
def customTopAxisX(chart):
    # 自定义top x轴
    series = chart.series()
    if not series:
        return
    category = ["%d月" % i for i in range(1, 9)]  # 1-8月
    axisx = QCategoryAxis(
        chart, labelsPosition=QCategoryAxis.AxisLabelsPositionOnValue)
    axisx.setGridLineVisible(False)  # 隐藏网格线条
    axisx.setTickCount(len(category))  # 设置刻度个数
    chart.axisX().setTickCount(len(category))  # 强制修改x轴的刻度个数一致
    minx = chart.axisX().min()
    maxx = chart.axisX().max()
    tickc = chart.axisX().tickCount()
    step = (maxx - minx) / (tickc - 1)  # tickc>=2
    for i in range(0, tickc):
        axisx.append(category[i], minx + i * step)
    chart.addAxis(axisx, Qt.AlignTop)  # 添加到右侧
    series[-1].attachAxis(axisx)  # 附加到series上 
Example #16
Source File: crafting_editor.py    From mhw_armor_edit with The Unlicense 5 votes vote down vote up
def add_row_edit(self, row, mapping1, mapping2):
        id_editor = QComboBox(self)
        id_editor.setModel(self.t9n_item_model)
        id_editor.setEditable(True)
        qty_editor = QSpinBox(self)
        qty_editor.setMinimum(0)
        qty_editor.setMaximum(0xff)
        self.item_mapper.addMapping(id_editor, mapping1)
        self.item_mapper.addMapping(qty_editor, mapping2)
        self.layout().addWidget(id_editor, row, 0, Qt.AlignTop)
        self.layout().addWidget(qty_editor, row, 1, Qt.AlignTop) 
Example #17
Source File: crafting_editor.py    From mhw_armor_edit with The Unlicense 5 votes vote down vote up
def add_row(self, row, value1, value2):
        self.layout().addWidget(QLabel(value1), row, 0, Qt.AlignTop)
        self.layout().addWidget(QLabel(value2), row, 1, Qt.AlignTop) 
Example #18
Source File: shell_table_editor.py    From mhw_armor_edit with The Unlicense 5 votes vote down vote up
def init_docs(self):
        box = QWidget(self)
        layout = QHBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        box.setLayout(layout)
        layout.addWidget(QLabel(DOC_CAPACITY), 0, Qt.AlignTop)
        layout.addWidget(QLabel(DOC_RECOIL), 0, Qt.AlignTop)
        layout.addWidget(QLabel(DOC_RELOAD), 1, Qt.AlignTop)
        return box 
Example #19
Source File: triggers_settings.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout(self))
        self.layout().setAlignment(Qt.AlignTop)

        self.cue_select = CueSelectDialog(cues=Application().cue_model)

        self.triggersModel = TriggersModel()

        self.triggersView = TriggersView(self.cue_select, parent=self)
        self.triggersView.setModel(self.triggersModel)
        self.layout().addWidget(self.triggersView)

        self.dialogButtons = QDialogButtonBox(self)
        self.dialogButtons.setSizePolicy(QSizePolicy.Minimum,
                                         QSizePolicy.Minimum)
        self.layout().addWidget(self.dialogButtons)

        self.addButton = self.dialogButtons.addButton(
            translate('TriggersSettings', 'Add'), QDialogButtonBox.ActionRole)
        self.addButton.clicked.connect(self._add_trigger)

        self.delButton = self.dialogButtons.addButton(
            translate('TriggersSettings', 'Remove'),
            QDialogButtonBox.ActionRole)
        self.delButton.clicked.connect(self._remove_trigger) 
Example #20
Source File: timecode_settings.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, cue_class, **kwargs):
        super().__init__(cue_class, **kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.groupBox = QGroupBox(self)
        self.groupBox.setLayout(QGridLayout())
        self.layout().addWidget(self.groupBox)

        # enable / disable timecode
        self.enableCheck = QCheckBox(self.groupBox)
        self.enableCheck.setChecked(False)
        self.groupBox.layout().addWidget(self.enableCheck, 0, 0)

        # Hours can be replaced by cue number h:m:s:frames -> CUE:m:s:frames
        self.useHoursCheck = QCheckBox(self.groupBox)
        self.useHoursCheck.setChecked(True)
        self.groupBox.layout().addWidget(self.useHoursCheck, 1, 0)

        self.trackSpin = QSpinBox(self)
        self.trackSpin.setMinimum(0)
        self.trackSpin.setMaximum(99)
        self.useHoursCheck.stateChanged.connect(self.trackSpin.setEnabled)
        self.groupBox.layout().addWidget(self.trackSpin, 2, 0)

        self.trackLabel = QLabel(self.groupBox)
        self.trackLabel.setAlignment(Qt.AlignCenter)
        self.groupBox.layout().addWidget(self.trackLabel, 2, 1)

        self.layout().addSpacing(50)

        self.warnLabel = QLabel(self)
        self.warnLabel.setAlignment(Qt.AlignCenter)
        self.warnLabel.setStyleSheet('color: #FFA500; font-weight: bold')
        self.layout().addWidget(self.warnLabel)

        self.retranslateUi() 
Example #21
Source File: keyboard.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, cue_class, **kwargs):
        super().__init__(cue_class, **kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.keyGroup = QGroupBox(self)
        self.keyGroup.setLayout(QGridLayout())
        self.layout().addWidget(self.keyGroup)

        self.keyboardModel = SimpleTableModel([
            translate('ControllerKeySettings', 'Key'),
            translate('ControllerKeySettings', 'Action')])

        self.keyboardView = KeyboardView(cue_class, parent=self.keyGroup)
        self.keyboardView.setModel(self.keyboardModel)
        self.keyGroup.layout().addWidget(self.keyboardView, 0, 0, 1, 2)

        self.addButton = QPushButton(self.keyGroup)
        self.addButton.clicked.connect(self.__new_key)
        self.keyGroup.layout().addWidget(self.addButton, 1, 0)

        self.removeButton = QPushButton(self.keyGroup)
        self.removeButton.clicked.connect(self.__remove_key)
        self.keyGroup.layout().addWidget(self.removeButton, 1, 1)

        self.retranslateUi() 
Example #22
Source File: app_general.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        # Startup layout
        self.layoutGroup = QGroupBox(self)
        self.layoutGroup.setTitle(
            translate('AppGeneralSettings', 'Startup layout'))
        self.layoutGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.layoutGroup)

        self.startupDialogCheck = QCheckBox(self.layoutGroup)
        self.startupDialogCheck.setText(
            translate('AppGeneralSettings', 'Use startup dialog'))
        self.layoutGroup.layout().addWidget(self.startupDialogCheck)

        self.layoutCombo = QComboBox(self.layoutGroup)
        self.layoutCombo.addItems([lay.NAME for lay in layouts.get_layouts()])
        self.layoutGroup.layout().addWidget(self.layoutCombo)

        self.startupDialogCheck.clicked.connect(
            lambda check: self.layoutCombo.setEnabled(not check))

        # Application style
        self.themeGroup = QGroupBox(self)
        self.themeGroup.setTitle(
            translate('AppGeneralSettings', 'Application theme'))
        self.themeGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.themeGroup)

        self.themeCombo = QComboBox(self.themeGroup)
        self.themeCombo.addItems(styles.styles())
        self.themeGroup.layout().addWidget(self.themeCombo) 
Example #23
Source File: test_debug.py    From qutebrowser with GNU General Public License v3.0 5 votes vote down vote up
def test_add_base(self):
        """Test with add_base=True."""
        flags = debug.qflags_key(Qt, Qt.AlignTop, add_base=True)
        assert flags == 'Qt.AlignTop' 
Example #24
Source File: graficoCircular.py    From PyQt5 with MIT License 5 votes vote down vote up
def crearLeyendaCaja(self):
        leyendaComboBox = QComboBox()

        leyendaComboBox.addItem("No Leyenda", 0)
        leyendaComboBox.addItem("Leyenda superior", Qt.AlignTop)
        leyendaComboBox.addItem("Leyenda inferior", Qt.AlignBottom)
        leyendaComboBox.addItem("Leyenda izquierda", Qt.AlignLeft)
        leyendaComboBox.addItem("Leyenda derecha", Qt.AlignRight)

        return leyendaComboBox 
Example #25
Source File: midi_settings.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.midiGroup = QGroupBox(self)
        self.midiGroup.setTitle(
            translate('MIDISettings', 'MIDI default devices'))
        self.midiGroup.setLayout(QGridLayout())
        self.layout().addWidget(self.midiGroup)

        self.inputLabel = QLabel(translate('MIDISettings', 'Input'),
                                 self.midiGroup)
        self.midiGroup.layout().addWidget(self.inputLabel, 0, 0)
        self.inputCombo = QComboBox(self.midiGroup)
        self.midiGroup.layout().addWidget(self.inputCombo, 0, 1)

        self.outputLabel = QLabel(translate('MIDISettings', 'Output'),
                                  self.midiGroup)
        self.midiGroup.layout().addWidget(self.outputLabel, 1, 0)
        self.outputCombo = QComboBox(self.midiGroup)
        self.midiGroup.layout().addWidget(self.outputCombo, 1, 1)

        self.midiGroup.layout().setColumnStretch(0, 2)
        self.midiGroup.layout().setColumnStretch(1, 3)

        if check_module('Midi'):
            try:
                self._load_devices()
            except Exception:
                self.setEnabled(False)
        else:
            self.setEnabled(False) 
Example #26
Source File: ChartView.py    From PyQt with GNU General Public License v3.0 5 votes vote down vote up
def __getAlignment(self, alignment):
        '''
        :param alignment: left|top|right|bottom
        '''
        try:
            return getattr(Qt, "Align" + alignment.capitalize())
        except:
            return Qt.AlignTop
#         if alignment == "left":
#             return Qt.AlignLeft
#         if alignment == "right":
#             return Qt.AlignRight
#         if alignment == "bottom":
#             return Qt.AlignBottom
#         return Qt.AlignTop 
Example #27
Source File: midi_cue.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.msgGroup = QGroupBox(self)
        self.msgGroup.setLayout(QGridLayout())
        self.layout().addWidget(self.msgGroup)

        # Message type
        self.msgTypeLabel = QLabel(self.msgGroup)
        self.msgGroup.layout().addWidget(self.msgTypeLabel, 0, 0)
        self.msgTypeCombo = QComboBox(self.msgGroup)
        self.msgTypeCombo.addItems(sorted(MIDI_MESSAGES.keys()))
        self.msgTypeCombo.currentTextChanged.connect(self.__type_changed)
        self.msgGroup.layout().addWidget(self.msgTypeCombo, 0, 1)

        line = QFrame(self.msgGroup)
        line.setFrameShape(QFrame.HLine)
        line.setFrameShadow(QFrame.Sunken)
        self.msgGroup.layout().addWidget(line, 1, 0, 1, 2)

        # Data widgets
        self._data_widgets = []
        for n in range(2, 5):
            dataLabel = QLabel(self.msgGroup)
            dataSpin = QSpinBox(self.msgGroup)

            self.msgGroup.layout().addWidget(dataLabel, n, 0)
            self.msgGroup.layout().addWidget(dataSpin, n, 1)

            self._data_widgets.append((dataLabel, dataSpin))

        self.__type_changed(self.msgTypeCombo.currentText())

        self.retranslateUi() 
Example #28
Source File: color_map.py    From Anki-Night-Mode with GNU General Public License v3.0 5 votes vote down vote up
def init_ui(self, title):
        self.setWindowTitle(_(title))

        btn_add_mapping = create_button('+ Add colors mapping', self.on_add)
        btn_close = create_button('Close', self.close)

        buttons = QHBoxLayout()

        buttons.addWidget(btn_close)
        buttons.addWidget(btn_add_mapping)
        buttons.setAlignment(Qt.AlignBottom)

        body = QVBoxLayout()
        body.setAlignment(Qt.AlignTop)

        header = QLabel(_(
            'Specify how particular colors on your cards '
            'should be swapped when the night mode is on.'
        ))
        header.setAlignment(Qt.AlignCenter)

        mappings = QVBoxLayout()
        mappings.setAlignment(Qt.AlignTop)

        for normal_color, night_color in self.color_map.items():
            mapping = ColorMapping(self, normal_color, night_color)
            mappings.addWidget(mapping)

        self.mappings = mappings

        body.addWidget(header)
        body.addLayout(mappings)
        body.addStretch(1)
        body.addLayout(buttons)
        self.setLayout(body)

        self.setGeometry(300, 300, 350, 300)
        self.show() 
Example #29
Source File: gst_settings.py    From linux-show-player with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, **kwargs):
        super().__init__()
        self.setLayout(QVBoxLayout())
        self.layout().setAlignment(Qt.AlignTop)

        self.pipeGroup = QGroupBox(self)
        self.pipeGroup.setLayout(QVBoxLayout())
        self.layout().addWidget(self.pipeGroup)

        self.pipeEdit = GstPipeEdit([], app_mode=True)
        self.pipeGroup.layout().addWidget(self.pipeEdit)

        self.retranslateUi() 
Example #30
Source File: ChartThemes.py    From PyQt with GNU General Public License v3.0 5 votes vote down vote up
def createLegendBox(self):
        legendComboBox = QComboBox()

        legendComboBox.addItem("No Legend ", 0)
        legendComboBox.addItem("Legend Top", Qt.AlignTop)
        legendComboBox.addItem("Legend Bottom", Qt.AlignBottom)
        legendComboBox.addItem("Legend Left", Qt.AlignLeft)
        legendComboBox.addItem("Legend Right", Qt.AlignRight)

        return legendComboBox