当前位置: 首页>>代码示例>>Python>>正文


Python QtGui.QSplitter类代码示例

本文整理汇总了Python中guidata.qt.QtGui.QSplitter的典型用法代码示例。如果您正苦于以下问题:Python QSplitter类的具体用法?Python QSplitter怎么用?Python QSplitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QSplitter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self, package, parent=None):
     QSplitter.__init__(self, parent)
     self.setWindowTitle(_("Tests - %s module") % package.__name__)
     self.setWindowIcon(get_icon("%s.svg" % package.__name__, "guidata.svg"))
     
     test_package_name = '%s.tests' % package.__name__
     _temp = __import__(test_package_name)
     test_package = sys.modules[test_package_name]
     
     tests = get_tests(test_package)
     listwidget = QListWidget(self)
     listwidget.addItems([osp.basename(test.filename) for test in tests])
     
     self.properties = TestPropertiesWidget(self)
     
     self.addWidget(listwidget)
     self.addWidget(self.properties)
     
     self.properties.run_button.clicked.connect(
                             lambda: tests[listwidget.currentRow()].run())
     self.properties.quit_button.clicked.connect(self.close)
     listwidget.currentRowChanged.connect(
                         lambda row: self.properties.set_item(tests[row]))
     listwidget.itemActivated.connect(
                         lambda: tests[listwidget.currentRow()].run())
     listwidget.setCurrentRow(0)
     
     QShortcut(QKeySequence("Escape"), self, self.close)
         
     self.setSizes([150, 1])
     self.setStretchFactor(1, 1)
     self.resize(QSize(950, 600))
     self.properties.set_item(tests[0])
开发者ID:stonebig,项目名称:guidata,代码行数:33,代码来源:guitest.py

示例2: __init__

 def __init__(self, parent):
     QSplitter.__init__(self, parent)
     self.imagelist = QListWidget(self)
     self.addWidget(self.imagelist)
     self.properties = DataSetEditGroupBox(_("Properties"), ImageParam)
     self.properties.setEnabled(False)
     self.addWidget(self.properties)
开发者ID:HaMF,项目名称:guiqwt,代码行数:7,代码来源:simple_window.py

示例3: __init__

 def __init__(self, parent):
     QSplitter.__init__(self, parent)
     # self.lineList = QListWidget(self)
     # self.addWidget(self.lineList)
     self.properties = DataSetEditGroupBox(_("Properties"), DAQParam)
     self.properties.setEnabled(True)
     self.addWidget(self.properties)
开发者ID:bhclowers,项目名称:WIPYDAQ,代码行数:7,代码来源:wipy_gui_v3.py

示例4: __init__

    def __init__(self, parent=None):
        QSplitter.__init__(self, parent)
        self.setOrientation(Qt.Vertical)
        self.optimization_input = DataSetEditGroupBox("Optimization", OptimizationInput)
        self.addWidget(self.optimization_input)
        self.connect(self.optimization_input, SIGNAL("apply_button_clicked()"), self.start_opt)

        plot.ioff()
        figure = plot.figure()
        self.addWidget(figure.canvas.manager.window)
开发者ID:nicoddemus,项目名称:py4eng-course,代码行数:10,代码来源:gui.py

示例5: __init__

 def __init__(self, manager, parent=None):
     QSplitter.__init__(self, Qt.Horizontal, parent)
     self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     self.manager = manager
     self.plots = []
     self.itemlist = None
     main = QWidget()
     self.plotlayout = QGridLayout()
     main.setLayout(self.plotlayout)
     self.addWidget(main)
开发者ID:HaMF,项目名称:guiqwt,代码行数:10,代码来源:plot.py

示例6: __init__

    def __init__(self, parent=None):

        QSplitter.__init__(self, parent)
        self.setWindowTitle(MAIN_WINDOW_TITLE)
        self.setWindowIcon(get_icon("agent.svg"))
        
        self.sysTray = SystemTray(self)

        self.connect(self.sysTray, SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), self.__icon_activated)

        checks = get_checks()
        datadog_conf = DatadogConf(get_config_path(), description="Agent settings file: datadog.conf")
        self.log_file = LogFile()

        listwidget = QListWidget(self)
        listwidget.addItems([osp.basename(check.module_name).replace("_", " ").title() for check in checks])
        
        self.properties = PropertiesWidget(self)
        
        self.addWidget(listwidget)
        self.addWidget(self.properties)
        
        self.connect(self.properties.enable_button, SIGNAL("clicked()"),
                     lambda: enable_check(self.properties))

        self.connect(self.properties.disable_button, SIGNAL("clicked()"),
                     lambda: disable_check(self.properties))

        self.connect(self.properties.save_button, SIGNAL("clicked()"),
                     lambda: save_file(self.properties))

        self.connect(listwidget, SIGNAL('currentRowChanged(int)'),
                     lambda row: self.properties.set_item(checks[row]))

        self.connect(self.properties.edit_datadog_conf_button, SIGNAL('clicked()'),
                     lambda: self.properties.set_datadog_conf(datadog_conf))

        self.connect(self.properties.view_log_button, SIGNAL('clicked()'),
                     lambda: self.properties.set_log_file(self.log_file))

        self.manager_menu = Menu(self)
        self.connect(self.properties.menu_button, SIGNAL("clicked()"),
            lambda: self.manager_menu.popup(self.properties.menu_button.mapToGlobal(QPoint(0,0))))


        listwidget.setCurrentRow(0)
        
        self.setSizes([150, 1])
        self.setStretchFactor(1, 1)
        self.resize(QSize(950, 600))
        self.properties.set_datadog_conf(datadog_conf)

        self.do_refresh()
开发者ID:arthurnn,项目名称:dd-agent,代码行数:53,代码来源:gui.py

示例7: __init__

    def __init__(self, parent=None):
        QSplitter.__init__(self, parent)
        self.setOrientation(Qt.Vertical)
        self.curve = None
        plot.ioff() # Must call plot.draw to update
        self.figure = plot.figure()
        self.plot = self.figure.gca()

        # Set "num_of_steps" as a trigger to update the plot
        NumericalInput.num_of_steps.set_prop("display", callback=self.plot_callback)
        self.numerical_input = DataSetEditGroupBox("Numerical", NumericalInput, show_button=False)
        self.addWidget(self.numerical_input)
        self.addWidget(self.figure.canvas.manager.window)
开发者ID:ESSS,项目名称:py4eng-course,代码行数:13,代码来源:linconvection1d_gui.py

示例8: __init__

    def __init__(self):
        QMainWindow.__init__(self)
        self.setWindowIcon(get_icon('python.png'))
        self.setWindowTitle("P3 Ctrl")
        # Instantiate dataset-related widgets:
        self.group1 = DataSetEditGroupBox("Activable dataset",
                                             Processing, comment='')
        self.group1.SIG_APPLY_BUTTON_CLICKED.connect(self.group1._items[0].hi)
        splitter = QSplitter(self)
        splitter.addWidget(self.group1)

        self.setCentralWidget(splitter)
        self.setContentsMargins(10, 5, 10, 5)
开发者ID:timseed,项目名称:Elecraft-K3-Pan-Pile-Up-Settings,代码行数:13,代码来源:gui.py

示例9: __init__

    def __init__(self):
        # init main panel
        QMainWindow.__init__(self, None)
#        QMainWindow.__init__(self, None, QtCore.Qt.WindowStaysOnTopHint)
        Thread.__init__(self)
        widget = QWidget()
        self.setCentralWidget(widget)
        self.setWindowTitle('3D tracking')
        self.move(600, 150)
        # define main objects
        self.tracking = tracking_3d.Tracking3D.getInstance()
        
        # init dataset from gui_construction
        self.gb_sequence = DataSetEditGroupBox("Sequence", 
                    gui_construction.RemoteParameters, comment='')
        self.gb_sample = DataSetEditGroupBox("Sample", 
                    gui_construction.SampleParameters, comment='')
        self.gb_tracking = DataSetEditGroupBox("Tracking", 
                    gui_construction.TrackingParameters, comment='')
            
        self.btn_process = QPushButton("Start tracking", self)
        self.btn_process.clicked.connect(self.start_tracking)

        # associate events to dataset apply buttons
        self.connect(self.gb_sequence, SIGNAL("apply_button_clicked()"), 
                     self.update_remote_params)
        self.connect(self.gb_tracking, SIGNAL("apply_button_clicked()"), 
                     self.update_tracking_params)     
        self.connect(self.gb_sample, SIGNAL("apply_button_clicked()"), 
                     self.update_sample_parameters)
                     
        # organize the app panels
        splitter1 = QSplitter(QtCore.Qt.Vertical)
        splitter1.addWidget(self.gb_sequence)
        splitter1.addWidget(self.gb_sample)
        splitter1.addWidget(self.gb_tracking)
        splitter1.addWidget(self.btn_process)
        
        splitter = QSplitter(self)
        splitter.addWidget(splitter1)
        self.setCentralWidget(splitter)
        self.setContentsMargins(10, 5, 10, 5)   
        
        # get all params from datasets
        self.gb_sequence.get()
        self.gb_sample.get()
        self.gb_tracking.get()
开发者ID:zerodeku,项目名称:tracking3d,代码行数:47,代码来源:main_window.py

示例10: __init__

 def __init__(self):
     QMainWindow.__init__(self)
     self.setWindowIcon(get_icon('python.png'))
     self.setWindowTitle("Application example")
     
     # Instantiate dataset-related widgets:
     self.groupbox1 = DataSetShowGroupBox("Activable dataset",
                                          ExampleDataSet, comment='')
     self.groupbox2 = DataSetShowGroupBox("Standard dataset",
                                          AnotherDataSet, comment='')
     self.groupbox3 = DataSetEditGroupBox("Standard dataset",
                                          OtherDataSet, comment='')
     self.groupbox4 = DataSetEditGroupBox("Standard dataset",
                                          ExampleMultiGroupDataSet, comment='')
     self.connect(self.groupbox3, SIGNAL("apply_button_clicked()"),
                  self.update_window)
     self.update_groupboxes()
     
     splitter = QSplitter(self)
     splitter.addWidget(self.groupbox1)
     splitter.addWidget(self.groupbox2)
     splitter.addWidget(self.groupbox3)
     splitter.addWidget(self.groupbox4)
     self.setCentralWidget(splitter)
     self.setContentsMargins(10, 5, 10, 5)
     
     # File menu
     file_menu = self.menuBar().addMenu("File")
     quit_action = create_action(self, "Quit",
                                 shortcut="Ctrl+Q",
                                 icon=get_std_icon("DialogCloseButton"),
                                 tip="Quit application",
                                 triggered=self.close)
     add_actions(file_menu, (quit_action, ))
     
     # Edit menu
     edit_menu = self.menuBar().addMenu("Edit")
     editparam1_action = create_action(self, "Edit dataset 1",
                                       triggered=self.edit_dataset1)
     editparam2_action = create_action(self, "Edit dataset 2",
                                       triggered=self.edit_dataset2)
     editparam4_action = create_action(self, "Edit dataset 4",
                                       triggered=self.edit_dataset4)
     add_actions(edit_menu, (editparam1_action,
                             editparam2_action,
                             editparam4_action))
开发者ID:Alwnikrotikz,项目名称:guidata,代码行数:46,代码来源:editgroupbox.py

示例11: setupMainWidget

    def setupMainWidget(self) :
        self.main_dock = QDockWidget(_(''))
        self.addDockWidget(Qt.BottomDockWidgetArea, self.main_dock)
        self.dockTab = QTabWidget()
        dockSplitter = QSplitter()
        dockSplitter.setOrientation(Qt.Vertical)
        #-----
        toolbar = self.addToolBar("Curve")
        self.plotWidget = CentralWidget(self, toolbar)        # Set central widget:
        self.dockTab.addTab(self.plotWidget, "Plot")
        #-----
        self.statusEdit = QTextEdit()
        self.statusEdit.setText("Status updates to go here.")
        self.statusEdit.setEnabled(False)
        self.statusEdit.moveCursor(QTextCursor.End)
        #-----
        self.testButton = QPushButton("Test Button")
        self.testButton.clicked.connect(self.__testClick__)
        dockSplitter.addWidget(self.testButton)
        dockSplitter.addWidget(self.statusEdit)
        self.dockTab.addTab(dockSplitter, "Status Info")

        if DockableConsole is None:
            self.console = None
        else:
            import time, scipy.signal as sps, scipy.ndimage as spi
            import sys, os
            import numpy as np
            ns = {'np': np, 'sps': sps, 'spi': spi,
                  'os': os, 'sys': sys, 'time': time}
            msg = "Example: np.arange(20)\n"\
                  "Modules imported at startup: "\
                  "os, sys, os.path as osp, time, "\
                  "numpy as np, scipy.signal as sps, scipy.ndimage as spi"
            self.console = DockableConsole(self, namespace=ns, message=msg)
            # console_dock = QDockWidget(_('Console'))
            # self.addDockWidget(Qt.BottomDockWidgetArea, console_dock)
            # console_dock.setWidget(self.console)
            self.dockTab.addTab(self.console, "Console")
            # dockSplitter.addWidget(self.console)


        # main_dock.setWidget(dockSplitter)
        self.main_dock.setWidget(self.dockTab)
开发者ID:bhclowers,项目名称:WIPYDAQ,代码行数:44,代码来源:wipy_gui_v3.py

示例12: _generateFrame

    def _generateFrame(self):
        '''
        Return the frame containing the presentation, check if the frame was created, otherwise it is created
        :return:
        '''
        # generate the frame if necessary
        if self._frame is None:
            # Generate frame and define the layout based on the frame
            self._frame = QFrame(self._parentFrame)
            _layout = QVBoxLayout()
            self._frame.setLayout(_layout)

            # Add the "Main" group box for this view, if present. It is rendered in foreground
            if self._generateGroupBox() is not None:
                _layout.addWidget(self._groupbox)
            else:
                self._frame.setFrameStyle(QFrame.Panel|QFrame.Raised)
                self._frame.setLineWidth(1)

            # Add to layout eventually the other subview
            if self._viewtype == 'Tabs':
                _tabs = QTabWidget()
                _layout.addWidget(_tabs)
            elif self._viewtype == 'Splitter':
                _splitter =QSplitter()
                _layout.addWidget(_splitter)
            else:
                _sub_frame = QFrame()
                _sub_frame_layout = QHBoxLayout()
                _sub_frame.setLayout(_sub_frame_layout)
                _layout.addWidget(_sub_frame)

            # Add all the sub view as sub frames in the layout
            for sw in self._subViewDictionary.values():
                sw.setParentView(self._frame)
                if self._viewtype == 'Tabs':
                    _tabs.addTab(sw.getFrame(), sw.viewname)
                elif self._viewtype == 'Splitter':
                    _splitter.addWidget(sw.getFrame())
                else:
                    _sub_frame_layout.addWidget(sw.getFrame())

        return self._frame
开发者ID:lawrence-iviani,项目名称:easy_datagui,代码行数:43,代码来源:GuidataView.py

示例13: __init__

    def __init__(self, parent=None):

        QSplitter.__init__(self, parent)
        self.setWindowTitle(MAIN_WINDOW_TITLE)
        self.setWindowIcon(get_icon("agent.svg"))

        self.sysTray = SystemTray(self)

        self.connect(self.sysTray, SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), self.__icon_activated)

        checks = get_checks()
        datadog_conf = DatadogConf(get_config_path(), description="Agent settings file: datadog.conf")

        self.forwarder_log_file = ForwarderLogFile()
        self.collector_log_file = CollectorLogFile()
        self.dogstatsd_log_file = DogstatsdLogFile()
        self.jmxfetch_log_file = JMXFetchLogFile()

        listwidget = QListWidget(self)
        listwidget.addItems([osp.basename(check.module_name).replace("_", " ").title() for check in checks])

        self.properties = PropertiesWidget(self)

        self.setting_button = QPushButton(get_icon("info.png"), "Logs and Status", self)
        self.menu_button = QPushButton(get_icon("settings.png"), "Actions", self)
        self.settings = [
            (
                "Forwarder Logs",
                lambda: [
                    self.properties.set_log_file(self.forwarder_log_file),
                    self.show_html(self.properties.group_code, self.properties.html_window, False),
                ],
            ),
            (
                "Collector Logs",
                lambda: [
                    self.properties.set_log_file(self.collector_log_file),
                    self.show_html(self.properties.group_code, self.properties.html_window, False),
                ],
            ),
            (
                "Dogstatsd Logs",
                lambda: [
                    self.properties.set_log_file(self.dogstatsd_log_file),
                    self.show_html(self.properties.group_code, self.properties.html_window, False),
                ],
            ),
            (
                "JMX Fetch Logs",
                lambda: [
                    self.properties.set_log_file(self.jmxfetch_log_file),
                    self.show_html(self.properties.group_code, self.properties.html_window, False),
                ],
            ),
            (
                "Agent Status",
                lambda: [
                    self.properties.html_window.setHtml(self.properties.html_window.latest_status()),
                    self.show_html(self.properties.group_code, self.properties.html_window, True),
                    self.properties.set_status(),
                ],
            ),
        ]

        self.agent_settings = QPushButton(get_icon("edit.png"), "Settings", self)
        self.connect(
            self.agent_settings,
            SIGNAL("clicked()"),
            lambda: [
                self.properties.set_datadog_conf(datadog_conf),
                self.show_html(self.properties.group_code, self.properties.html_window, False),
            ],
        )

        self.setting_menu = SettingMenu(self.settings)
        self.connect(
            self.setting_button,
            SIGNAL("clicked()"),
            lambda: self.setting_menu.popup(self.setting_button.mapToGlobal(QPoint(0, 0))),
        )

        self.manager_menu = Menu(self)
        self.connect(
            self.menu_button,
            SIGNAL("clicked()"),
            lambda: self.manager_menu.popup(self.menu_button.mapToGlobal(QPoint(0, 0))),
        )

        holdingBox = QGroupBox("", self)
        Box = QVBoxLayout(self)
        Box.addWidget(self.agent_settings)
        Box.addWidget(self.setting_button)
        Box.addWidget(self.menu_button)
        Box.addWidget(listwidget)
        holdingBox.setLayout(Box)

        self.addWidget(holdingBox)
        self.addWidget(self.properties)

        self.connect(self.properties.enable_button, SIGNAL("clicked()"), lambda: enable_check(self.properties))
#.........这里部分代码省略.........
开发者ID:hutchic,项目名称:dd-agent,代码行数:101,代码来源:gui.py

示例14: show

 def show(self):
     QSplitter.show(self)
     self.raise_()
开发者ID:dadicool,项目名称:dd-agent,代码行数:3,代码来源:gui.py

示例15: __init__

    def __init__(self, parent):
        QSplitter.__init__(self, parent)

        self.name = 'subject'
        self.age = 26
        self.peakL = 559
        self.peakM = 530
        self.ref_LED = 10
        self.LED1 = 15
        self.LED2 = 13.9
        self.LED3 = 40.45
        self.L_OD = 0.35
        self.M_OD = 0.22

        self.setContentsMargins(10, 10, 10, 10)
        self.setOrientation(Qt.Vertical)
        
        line1 = QSplitter()
        line1.setOrientation(Qt.Horizontal)
        line2 = QSplitter()
        line2.setOrientation(Qt.Horizontal)
        line3 = QSplitter()
        line3.setOrientation(Qt.Horizontal)
        line4 = QSplitter()
        line4.setOrientation(Qt.Horizontal)
        line5 = QSplitter()
        line5.setOrientation(Qt.Horizontal)
        line6 = QSplitter()
        line6.setOrientation(Qt.Horizontal)
        line7 = QSplitter()
        line7.setOrientation(Qt.Horizontal)
        line8 = QSplitter()
        line8.setOrientation(Qt.Horizontal)

        self.txt1 = QLineEdit(str(self.name))
        self.txt1.setMaximumWidth(100)
        self.txt2 = QLineEdit(str(self.age))
        self.txt2.setMaximumWidth(100)
        self.txt3 = QLineEdit(str(self.peakL))
        self.txt3.setMaximumWidth(100)
        self.txt4 = QLineEdit(str(self.peakM))
        self.txt4.setMaximumWidth(100)
        self.txt5 = QLineEdit(str(self.ref_LED))
        self.txt5.setMaximumWidth(100)
        self.txt6 = QLineEdit()
        self.txt6.setMaximumWidth(100)
        self.txt7 = QLineEdit()
        self.txt7.setMaximumWidth(100)
        self.txt8 = QLineEdit()
        self.txt8.setMaximumWidth(100)

        label1 = QLabel('ID')
        label2 = QLabel('age')
        label3 = QLabel('peak L')
        label4 = QLabel('peak M')
        label5 = QLabel('ref LED')
        label6 = QLabel('LED1')
        label7 = QLabel('LED2')
        label8 = QLabel('LED3')

        line1.addWidget(label1)
        line2.addWidget(label2)
        line3.addWidget(label3)
        line4.addWidget(label4)
        line5.addWidget(label5)
        line6.addWidget(label6)
        line7.addWidget(label7)
        line8.addWidget(label8)

        line1.addWidget(self.txt1)
        line2.addWidget(self.txt2)
        line3.addWidget(self.txt3)
        line4.addWidget(self.txt4)
        line5.addWidget(self.txt5)
        line6.addWidget(self.txt6)
        line7.addWidget(self.txt7)
        line8.addWidget(self.txt8)

        self.load_button = QPushButton('load data')
        self.load_button.clicked.connect(self.load) 

        self.analyze_button = QPushButton('analyze')
        self.analyze_button.clicked.connect(self.analyze) 

        # add left side of the bottom panel
        left_side = QSplitter()
        left_side.setOrientation(Qt.Vertical)
        left_side.addWidget(self.load_button)
        left_side.addWidget(line1)
        left_side.addWidget(line2)
        left_side.addWidget(line3)
        left_side.addWidget(line4)
        left_side.addWidget(line5)
        left_side.addWidget(line6)
        left_side.addWidget(line7)
        left_side.addWidget(line8)
        left_side.addWidget(self.analyze_button)


        # set up right side of the bottom panel
#.........这里部分代码省略.........
开发者ID:bps10,项目名称:LM-Ratio,代码行数:101,代码来源:gui_LMratio.py


注:本文中的guidata.qt.QtGui.QSplitter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。