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


Python QSplitter.addWidget方法代码示例

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


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

示例1: __init__

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    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,代码行数:15,代码来源:gui.py

示例2: __init__

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    def __init__(self, parent, toolbar):
        QSplitter.__init__(self, parent)
        # QTabWidget.__init__(self, parent)
        self.setContentsMargins(10, 10, 10, 10)
        self.setOrientation(Qt.Vertical)

        linelistwithproperties = LineListWithProperties(self)
        # self.addWidget(linelistwithproperties)
        self.lineList = linelistwithproperties.lineList
        self.connect(self.lineList, SIGNAL("currentRowChanged(int)"),
                     self.current_item_changed)
        self.connect(self.lineList, SIGNAL("itemSelectionChanged()"),
                     self.selection_changed)
        self.curveProperties = linelistwithproperties.properties
        self.connect(self.curveProperties, SIGNAL("apply_button_clicked()"),
                     self.curve_properties_changed)
        
        self.curvewidget = CurveWidget(self)
        self.curvewidget.register_all_curve_tools()
        self.curve_item = make.curve([], [], color='b')
        self.peak_item = make.curve([],[], markerfacecolor = 'r', marker = 'o', curvestyle="NoCurve")#, alpha = 0.75)
        self.curvewidget.plot.add_item(self.curve_item)
        self.curvewidget.plot.add_item(self.peak_item)
        self.curvewidget.plot.set_antialiasing(True)
        self.addWidget(self.curvewidget)
        
        self.lines = [] # List of ImageParam instances
        self.peaks = []

        
        vSplitter = QSplitter()
        vSplitter.setOrientation(Qt.Vertical)
        daqParamProperties = DAQParamsProperties(self)
        self.daqProperties = daqParamProperties.properties
        self.connect(self.daqProperties, SIGNAL("apply_button_clicked()"), self.daq_properties_changed)
        # daqButton = QPushButton("Upload DAQ Params")
        vSplitter.addWidget(daqParamProperties)
        # vSplitter.addWidget(daqButton)
        tabWidget = QTabWidget()
        tab1 = tabWidget.addTab(linelistwithproperties, "Curve Params")
        tab2 = tabWidget.addTab(vSplitter, "DAQ Params")
        
        self.addWidget(tabWidget)

        self.setStretchFactor(0, 0)
        self.setStretchFactor(1, 1)
        self.setHandleWidth(10)
        self.setSizes([1, 2])
开发者ID:bhclowers,项目名称:WIPYDAQ,代码行数:50,代码来源:wipy_gui_v3.py

示例3: __init__

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
 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,代码行数:48,代码来源:editgroupbox.py

示例4: setupMainWidget

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    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,代码行数:46,代码来源:wipy_gui_v3.py

示例5: _generateFrame

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    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,代码行数:45,代码来源:GuidataView.py

示例6: __init__

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    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,代码行数:49,代码来源:main_window.py

示例7: __init__

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    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,代码行数:103,代码来源:gui_LMratio.py

示例8: BaseImageWidget

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
class BaseImageWidget(QSplitter):
    """
    Construct a BaseImageWidget object, which includes:
        * A plot (:py:class:`guiqwt.curve.CurvePlot`)
        * An `item list` panel (:py:class:`guiqwt.curve.PlotItemList`)
        * A `contrast adjustment` panel 
          (:py:class:`guiqwt.histogram.ContrastAdjustment`)
        * An `X-axis cross section` panel
          (:py:class:`guiqwt.histogram.XCrossSection`)
        * An `Y-axis cross section` panel
          (:py:class:`guiqwt.histogram.YCrossSection`)
        
    This object does nothing in itself because plot and panels are not 
    connected to each other.
    See children class :py:class:`guiqwt.plot.ImageWidget`
    """
    def __init__(self, parent=None, title="",
                 xlabel=("", ""), ylabel=("", ""), zlabel=None,
                 xunit=("", ""), yunit=("", ""), zunit=None, yreverse=True,
                 colormap="jet", aspect_ratio=1.0, lock_aspect_ratio=True,
                 show_contrast=False, show_itemlist=False, show_xsection=False,
                 show_ysection=False, xsection_pos="top", ysection_pos="right",
                 gridparam=None, curve_antialiasing=None, **kwargs):
        if PYQT5:
            super(BaseImageWidget, self).__init__(parent, **kwargs)
            self.setOrientation(Qt.Vertical)
        else:
            QSplitter.__init__(self, Qt.Vertical, parent)
        
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        
        self.sub_splitter = QSplitter(Qt.Horizontal, self)
        self.plot = ImagePlot(parent=self, title=title,
                              xlabel=xlabel, ylabel=ylabel, zlabel=zlabel,
                              xunit=xunit, yunit=yunit, zunit=zunit,
                              yreverse=yreverse, aspect_ratio=aspect_ratio,
                              lock_aspect_ratio=lock_aspect_ratio,
                              gridparam=gridparam)
        if curve_antialiasing is not None:
            self.plot.set_antialiasing(curve_antialiasing)

        from guiqwt.cross_section import YCrossSection
        self.ycsw = YCrossSection(self, position=ysection_pos,
                                  xsection_pos=xsection_pos)
        self.ycsw.setVisible(show_ysection)
        
        from guiqwt.cross_section import XCrossSection
        self.xcsw = XCrossSection(self)
        self.xcsw.setVisible(show_xsection)
        
        self.xcsw.SIG_VISIBILITY_CHANGED.connect(self.xcsw_is_visible)
        
        self.xcsw_splitter = QSplitter(Qt.Vertical, self)
        if xsection_pos == "top":
            self.xcsw_splitter.addWidget(self.xcsw)
            self.xcsw_splitter.addWidget(self.plot)
        else:
            self.xcsw_splitter.addWidget(self.plot)
            self.xcsw_splitter.addWidget(self.xcsw)
        self.xcsw_splitter.splitterMoved.connect(
                                 lambda pos, index: self.adjust_ycsw_height())
        
        self.ycsw_splitter = QSplitter(Qt.Horizontal, self)
        if ysection_pos == "left":
            self.ycsw_splitter.addWidget(self.ycsw)
            self.ycsw_splitter.addWidget(self.xcsw_splitter)
        else:
            self.ycsw_splitter.addWidget(self.xcsw_splitter)
            self.ycsw_splitter.addWidget(self.ycsw)
            
        configure_plot_splitter(self.xcsw_splitter,
                                decreasing_size=xsection_pos == "bottom")
        configure_plot_splitter(self.ycsw_splitter,
                                decreasing_size=ysection_pos == "right")
        
        self.sub_splitter.addWidget(self.ycsw_splitter)
        
        self.itemlist = PlotItemList(self)
        self.itemlist.setVisible(show_itemlist)
        self.sub_splitter.addWidget(self.itemlist)
        
        # Contrast adjustment (Levels histogram)
        from guiqwt.histogram import ContrastAdjustment
        self.contrast = ContrastAdjustment(self)
        self.contrast.setVisible(show_contrast)
        self.addWidget(self.contrast)
        
        configure_plot_splitter(self)
        configure_plot_splitter(self.sub_splitter)
        
    def adjust_ycsw_height(self, height=None):
        if height is None:
            height = self.xcsw.height()-self.ycsw.toolbar.height()
        self.ycsw.adjust_height(height)
        if height:
            QApplication.processEvents()
        
    def xcsw_is_visible(self, state):
        if state:
            QApplication.processEvents()
#.........这里部分代码省略.........
开发者ID:alimuldal,项目名称:guiqwt,代码行数:103,代码来源:plot.py

示例9: __init__

# 需要导入模块: from guidata.qt.QtGui import QSplitter [as 别名]
# 或者: from guidata.qt.QtGui.QSplitter import addWidget [as 别名]
    def __init__(self):
        # init main panel
        QMainWindow.__init__(self)
        Thread.__init__(self)
        widget = QWidget()
        self.setCentralWidget(widget)

        # define main objects
        self.remoteKoala = None
        self.aberrationCorrection = None
        self.stackDistance = None
        self.tracking = None
        self.db = None
        self.focusPoint = None
        self.trackingMode = 0 # 0 - Automatic, 1 - Single
        self.unwrapK = None
        self.setWindowTitle('3D tracking')
        
        # init dataset from gui_construction
        self.gb_dhm = DataSetEditGroupBox("DHM", 
                    gui_construction.DHMParameters, comment='')
        self.gb_sample = DataSetEditGroupBox("Sample", 
                    gui_construction.SampleParameters, comment='')
        self.gb_remote = DataSetEditGroupBox("Sequence", 
                    gui_construction.RemoteParameters, comment='')       
        self.gb_holder = DataSetEditGroupBox("Focus", 
                    gui_construction.HolderParameters, comment='')
        self.gb_rec = DataSetEditGroupBox("Preprocessing Parameters", 
                    gui_construction.ReconstructionParameters, comment='')
#        self.gb_proc = DataSetEditGroupBox("Process", 
#                    gui_construction.ProcessParameters, comment='')
#        self.gb_partchoice = DataSetEditGroupBox("Particle Choice", 
#                    gui_construction.ParticuleChoice, comment='')
                    
        # associate events to dataset apply buttons
        self.connect(self.gb_dhm, SIGNAL("apply_button_clicked()"), 
                     self.update_dhm_params)
        self.connect(self.gb_sample, SIGNAL("apply_button_clicked()"), 
                     self.update_sample_params)
        self.connect(self.gb_remote, SIGNAL("apply_button_clicked()"), 
                     self.update_remote_params)
        self.connect(self.gb_holder, SIGNAL("apply_button_clicked()"), 
                     self.update_holder_params)
        
        # organize the subpanels
        splitter1 = QSplitter(QtCore.Qt.Vertical)
        splitter1.addWidget(self.gb_dhm)
        splitter1.addWidget(self.gb_sample)
        splitter1.addWidget(self.gb_remote)
        splitter1.addWidget(self.gb_holder)
        
        splitter2 = QSplitter(QtCore.Qt.Vertical)
        
        splitter = QSplitter(self)
        splitter.addWidget(splitter1)
        splitter.addWidget(splitter2)
        self.setCentralWidget(splitter)
        self.setContentsMargins(10, 5, 10, 5)   
        
        # get all params from datasets
        self.gb_dhm.get()
开发者ID:zerodeku,项目名称:tracking3d,代码行数:63,代码来源:main_window_old.py


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