Python PyQt5.QtWidgets.QStackedLayout() Examples

The following are 23 code examples for showing how to use PyQt5.QtWidgets.QStackedLayout(). These examples are extracted from open source projects. 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 check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .

Example 1
Project: guppy-proxy   Author: roglew   File: reqlist.py    License: MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.current_entry = 0
        self.max_entries = 2
        self.text_entry = TextFilterEntry()
        dropdown_entry = DropdownFilterEntry()

        self.text_entry.filterEntered.connect(self.filterEntered)
        dropdown_entry.filterEntered.connect(self.filterEntered)

        self.entry_layout = QStackedLayout()
        self.entry_layout.addWidget(dropdown_entry)
        self.entry_layout.addWidget(self.text_entry)

        swap_button = QToolButton()
        swap_button.setText(">")
        swap_button.setToolTip("Switch between dropdown and text entry")
        swap_button.clicked.connect(self.next_entry)

        hlayout = QHBoxLayout()
        hlayout.addWidget(swap_button)
        hlayout.addLayout(self.entry_layout)
        self.setLayout(hlayout)
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(0) 
Example 2
Project: ripr   Author: pbiernat   File: gui.py    License: MIT License 5 votes vote down vote up
def __init__(self, emuchunks=None):
            self.qtAvailable = qtAvailable
            if not qtAvailable:
                return
            super(riprWidget, self).__init__('ripr')
            self.emuchunks = emuchunks
            self._table = riprTable(emuchunks=emuchunks)
    
            self.setLayout(QtWidgets.QStackedLayout())
            self.layout().addWidget(self._table)
            self.setObjectName('BNPlugin_ripr') 
Example 3
Project: mhw_armor_edit   Author: fre-sch   File: skill_point_data_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = SkillPointDataModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 4
Project: mhw_armor_edit   Author: fre-sch   File: skill_data_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = SkillDataModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 5
Project: mhw_armor_edit   Author: fre-sch   File: bbtbl_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = StructTableModel(columns, self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 6
Project: mhw_armor_edit   Author: fre-sch   File: lbm_skill_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = LbmSkillTableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 7
Project: mhw_armor_edit   Author: fre-sch   File: arm_up_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = StructTableModel(columns, self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 8
Project: mhw_armor_edit   Author: fre-sch   File: wep_saxe_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = StructTableModel(WepSaxeEntry.fields(), self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 9
Project: mhw_armor_edit   Author: fre-sch   File: kire_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = StructTableModel(KireEntry.fields(), self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 10
Project: mhw_armor_edit   Author: fre-sch   File: sed_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = SedTableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 11
Project: mhw_armor_edit   Author: fre-sch   File: wep_glan_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = StructTableModel(WepGlanEntry.fields(), self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 12
Project: mhw_armor_edit   Author: fre-sch   File: wep_wsl_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = StructTableModel(WepWslEntry.fields(), self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 13
Project: mhw_armor_edit   Author: fre-sch   File: lbm_base_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = LbmBaseTableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 14
Project: mhw_armor_edit   Author: fre-sch   File: sgpa_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = SgpaTableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 15
Project: mhw_armor_edit   Author: fre-sch   File: gmd_editor.py    License: The Unlicense 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = GmdTableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.table_view.setWordWrap(True)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 16
Project: guppy-proxy   Author: roglew   File: hexteditor.py    License: MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.headers = Headers()
        self.data = b''
        self.view = 0
        self.setLayout(QVBoxLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)

        self.stack = QStackedLayout()
        self.stack.setContentsMargins(0, 0, 0, 0)
        self.nopp_widg = QLabel("No pretty version available")
        self.stack.addWidget(self.nopp_widg)
        self.highlighted_widg = QTextEdit()
        self.highlighted_widg.setReadOnly(True)
        self.stack.addWidget(self.highlighted_widg)
        self.json_widg = QTextEdit()
        self.json_widg.setReadOnly(True)
        self.stack.addWidget(self.json_widg)
        self.htmlxml_widg = QTextEdit()
        self.htmlxml_widg.setReadOnly(True)
        self.stack.addWidget(self.htmlxml_widg)

        self.selector = QComboBox()
        self.selector.addItem("Manually Select Printer", self.VIEW_NONE)
        self.selector.addItem("Highlighted", self.VIEW_HIGHLIGHTED)
        self.selector.addItem("JSON", self.VIEW_JSON)
        self.selector.addItem("HTML/XML", self.VIEW_HTMLXML)
        self.selector.currentIndexChanged.connect(self._combo_changed)
        
        self.layout().addWidget(self.selector)
        self.layout().addLayout(self.stack) 
Example 17
Project: guppy-proxy   Author: roglew   File: reqlist.py    License: MIT License 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        layout = QHBoxLayout()
        confirm = QToolButton()
        confirm.setText("OK")
        confirm.setToolTip("Apply the entered filter")
        self.field_entry = get_field_entry()

        # stack containing widgets for string, k/v, date, daterange
        self.str_cmp_entry = StringCmpWidget()
        self.kv_cmp_entry = StringKVWidget()
        self.inv_entry = QCheckBox("inv")
        # date
        # daterange

        self.entry_layout = QStackedLayout()
        self.entry_layout.setContentsMargins(0, 0, 0, 0)
        self.current_entry = 0
        self.entry_layout.addWidget(self.str_cmp_entry)
        self.entry_layout.addWidget(self.kv_cmp_entry)
        # add date # 2
        # add daterange # 3

        confirm.clicked.connect(self.confirm_entry)
        self.str_cmp_entry.returnPressed.connect(self.confirm_entry)
        self.kv_cmp_entry.returnPressed.connect(self.confirm_entry)
        self.field_entry.currentIndexChanged.connect(self._display_value_widget)

        layout.addWidget(confirm)
        layout.addWidget(self.inv_entry)
        layout.addWidget(self.field_entry)
        layout.addLayout(self.entry_layout)

        self.setLayout(layout)
        self.setContentsMargins(0, 0, 0, 0)
        self._display_value_widget() 
Example 18
Project: guppy-proxy   Author: roglew   File: reqlist.py    License: MIT License 5 votes vote down vote up
def __init__(self, client, repeater_widget=None, macro_widget=None, *args, **kwargs):
        QWidget.__init__(self, *args, **kwargs)
        self.allow_save = False

        self.client = client
        self.repeater_widget = repeater_widget
        self.macro_widget = macro_widget
        self.query = []
        self.req_view_widget = None

        self.setLayout(QStackedLayout())
        self.layout().setContentsMargins(0, 0, 0, 0)
        
        self.tableModel = ReqListModel(self.client)
        self.tableView = QTableView()
        self.tableView.setModel(self.tableModel)

        self.tableView.verticalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
        self.tableView.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
        self.tableView.verticalHeader().hide()
        self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
        #self.tableView.setSelectionMode(QAbstractItemView.SingleSelection)
        self.tableView.horizontalHeader().setStretchLastSection(True)
        
        self.tableView.selectionModel().selectionChanged.connect(self.on_select_change)
        self.tableModel.dataChanged.connect(self._paint_view)
        self.tableModel.rowsInserted.connect(self._on_rows_inserted)
        self.requestsChanged.connect(self.set_requests)
        self.requestsSelected.connect(self._updated_selected_request)
        
        self.selected_reqs = []
        
        self.layout().addWidget(self.tableView)
        self.layout().addWidget(QLabel("<b>Loading requests from data file...</b>")) 
Example 19
Project: BinjaDock   Author: NOPDev   File: yarascan.py    License: MIT License 5 votes vote down vote up
def __init__(self):

        super(YaraWidget, self).__init__('Yara')
        self._rules = yara.compile(filepath=core.BNGetUserPluginDirectory() + SIG_FILE)
        self._table = QtWidgets.QTableWidget()
        self._table.setColumnCount(2)
        self._table.setHorizontalHeaderLabels(['Offset', 'Signature'])
        self._table.horizontalHeader().setStretchLastSection(True)
        self._table.verticalHeader().setVisible(False)
        self.setLayout(QtWidgets.QStackedLayout())
        self.layout().addWidget(self._table)
        self.setObjectName('BNPlugin_Yara')
        # self.addToolMenuAction("&Yara about", lambda: log_info('Yara scan!')) 
Example 20
Project: python-examples   Author: furas   File: main-stack-pages.py    License: MIT License 5 votes vote down vote up
def __init__(self):
        super().__init__()

        self.stack = QtWidgets.QStackedLayout(self)

        self.stack1 = FirstWidget(self)
        self.stack2 = SecondWidget(self)

        self.stack.addWidget(self.stack1)
        self.stack.addWidget(self.stack2)
        
        self.show() 
Example 21
Project: qutebrowser   Author: qutebrowser   File: bar.py    License: GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, *, win_id, private, parent=None):
        super().__init__(parent)
        self.setObjectName(self.__class__.__name__)
        self.setAttribute(Qt.WA_StyledBackground)
        stylesheet.set_register(self)

        self.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Fixed)

        self._win_id = win_id
        self._color_flags = ColorFlags()
        self._color_flags.private = private

        self._hbox = QHBoxLayout(self)
        self._set_hbox_padding()
        self._hbox.setSpacing(5)

        self._stack = QStackedLayout()
        self._hbox.addLayout(self._stack)
        self._stack.setContentsMargins(0, 0, 0, 0)

        self.cmd = command.Command(private=private, win_id=win_id)
        self._stack.addWidget(self.cmd)
        objreg.register('status-command', self.cmd, scope='window',
                        window=win_id)

        self.txt = textwidget.Text()
        self._stack.addWidget(self.txt)

        self.cmd.show_cmd.connect(self._show_cmd_widget)
        self.cmd.hide_cmd.connect(self._hide_cmd_widget)
        self._hide_cmd_widget()

        self.url = url.UrlText()
        self.percentage = percentage.Percentage()
        self.backforward = backforward.Backforward()
        self.tabindex = tabindex.TabIndex()
        self.keystring = keystring.KeyString()
        self.prog = progress.Progress(self)
        self._draw_widgets()

        config.instance.changed.connect(self._on_config_changed)
        QTimer.singleShot(0, self.maybe_hide) 
Example 22
Project: mhw_armor_edit   Author: fre-sch   File: otomo_armor_editor.py    License: The Unlicense 4 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = OtomoArmorTableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view) 
Example 23
Project: mhw_armor_edit   Author: fre-sch   File: mkex_editor.py    License: The Unlicense 4 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)
        self.model = None
        self.table_model = TableModel(self)
        self.table_view = SortFilterTableView(self)
        self.table_view.setModel(self.table_model)
        self.setLayout(QStackedLayout(self))
        self.layout().addWidget(self.table_view)