示例#1
0
    def add_channels_list(self, s):
        tr = self.tr
        with append_widget(s, QGroupBox) as group:
            s.widget.setTitle(tr("Oscilloscope Channels"))
            set_layout(s, QVBoxLayout)

            # Button toolbar
            with append_widget(s, QHBoxLayout) as self.channelBar:
                append_stretch(s)

                with append_widget(s, ShortcutButton) as self.channelAdd:
                    pass
                with append_widget(s, ShortcutButton) as self.channelDelete:
                    pass
                with append_widget(s, ShortcutButton) as self.channelUp:
                    pass
                with append_widget(s, ShortcutButton) as self.channelDown:
                    pass

            # Spreadsheet grid
            with append_widget(s, ChannelTableView) as self.channel_view:
                pass

        return group
示例#2
0
 def add_tab_stretch(s: LayoutStack, label: str = "", **kwargs):
     """Create a tab widget,
     then append a stretch to keep GUI elements packed."""
     with add_tab(s, QWidget, label, **kwargs) as tab:
         yield tab
         append_stretch(s)