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


Python QtWidgets.QSplitter类代码示例

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


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

示例1: __init__

    def __init__(self):
        super().__init__()

        # information widget
        self.plotWidget = VariantPlotWidget()
        self.infoWidget = VariantInfoWidget()

        # splitter settings
        splitter = QSplitter(Qt.Horizontal)
        splitter.addWidget(self.plotWidget)
        splitter.addWidget(self.infoWidget)
        splitter.setStretchFactor(0, 3)
        splitter.setStretchFactor(1, 1)

        # layout
        layout = QBoxLayout(QBoxLayout.TopToBottom)
        layout.addWidget(splitter)
        self.setLayout(layout)

        # connect signals
        self.plotWidget.curvePlotted.connect(self.infoWidget.updateResults)
        self.plotWidget.plotReady.connect(self.infoWidget.showResults)
        self.plotWidget.cleared.connect(self.infoWidget.clear)
        self.infoWidget.legendChanged.connect(self.plotWidget.paintCalculation)

        # translate the graphical user interface
        self.retranslateUi()
开发者ID:tobiashelfenstein,项目名称:wuchshuellenrechner,代码行数:27,代码来源:widget_plot.py

示例2: __init__

    def __init__(self, app, ui):
        QWidget.__init__(self)
        center_layout = QVBoxLayout()
        self.fwidg = QWidget()
        self.paramfunc = 0
        self.c = Communicate()
        self.c.exec_operation_signal[Myc.FuncCommand].connect(app.exec_command)
        self.application = app
        self.setLayout(center_layout)

        print('ddd')
        self.ui = ui
        self.ui.setupUi(self.fwidg)


        splitter = QSplitter(Qt.Vertical)
        splitter.addWidget(self.fwidg)

        buttonExec = QPushButton()
        buttonExec.setText("Выполнить")
        center_layout.addWidget(buttonExec)
        buttonExec.clicked.connect(self.execOperation)

        splitter.addWidget(buttonExec)
        center_layout.addWidget(splitter)
开发者ID:AlexeyNaz,项目名称:Laba,代码行数:25,代码来源:FWidgets.py

示例3: __init__

 def __init__(self, parent):
     """
     Constructor
     
     @param parent parent widget (QWidget)
     """
     self.tabWidgets = []
     
     QSplitter.__init__(self, parent)
     ViewManager.__init__(self)
     self.setChildrenCollapsible(False)
     
     tw = TabWidget(self)
     self.addWidget(tw)
     self.tabWidgets.append(tw)
     self.currentTabWidget = tw
     self.currentTabWidget.showIndicator(True)
     tw.currentChanged.connect(self.__currentChanged)
     tw.installEventFilter(self)
     tw.tabBar().installEventFilter(self)
     self.setOrientation(Qt.Vertical)
     self.__inRemoveView = False
     
     self.maxFileNameChars = Preferences.getUI(
         "TabViewManagerFilenameLength")
     self.filenameOnly = Preferences.getUI("TabViewManagerFilenameOnly")
开发者ID:paulmadore,项目名称:Eric-IDE,代码行数:26,代码来源:Tabview.py

示例4: initUI

   def initUI(self):
      self.content = QWidget()

      self.hbox = QHBoxLayout(self.content)
      self.setCentralWidget(self.content)

      self.friend_list = QListWidget()
      self.friend_list.itemClicked.connect(self.friendClicked)

      self.message_scroll = QScrollArea()
      self.message_scroll.setWidgetResizable(True)
      #TODO have a setting to disable this
      self.message_scroll.verticalScrollBar().rangeChanged.connect(self.scrollBottom)

      self.message_input = MessageInput()
      self.message_input.sendMessage.connect(self.sendMessage)

      self.message_split = QSplitter(Qt.Vertical)
      self.message_split.addWidget(self.message_scroll)
      self.message_split.addWidget(self.message_input)

      self.main_split = QSplitter(Qt.Horizontal)
      self.main_split.addWidget(self.friend_list)
      self.main_split.addWidget(self.message_split)

      self.hbox.addWidget(self.main_split)

      self.show()
开发者ID:gstark31897,项目名称:Akai-Python,代码行数:28,代码来源:MainWindow.py

示例5: initUI

    def initUI(self):      

        hbox = QHBoxLayout(self)

        topleft = QFrame(self)
        topleft.setFrameShape(QFrame.StyledPanel)
 
        topright = QFrame(self)
        topright.setFrameShape(QFrame.StyledPanel)

        bottom = QFrame(self)
        bottom.setFrameShape(QFrame.StyledPanel)

        splitter1 = QSplitter(Qt.Horizontal)
        splitter1.addWidget(topleft)
        splitter1.addWidget(topright)

        splitter2 = QSplitter(Qt.Vertical)
        splitter2.addWidget(splitter1)
        splitter2.addWidget(bottom)

        hbox.addWidget(splitter2)
        self.setLayout(hbox)
        
        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('QSplitter')
        self.show()
开发者ID:mskovacic,项目名称:Projekti,代码行数:27,代码来源:QSplitter.py

示例6: setupUI

    def setupUI(self):
        """Create User Interface.
        """
        sourceWidget = self.widgetSource()
        frameWidget = self.widgetFrame()
        parametersWidget = self.widgetParameters()

        leftSide = QWidget()
        leftSide.setLayout(parametersWidget)
        rightSide = QWidget()
        rightSide.setLayout(frameWidget)
        self.hsplitter = QSplitter(QtCore.Qt.Horizontal)
        self.hsplitter.addWidget(leftSide)
        self.hsplitter.addWidget(rightSide)
        self.hsplitter.setStretchFactor(0, 1)
        self.hsplitter.setStretchFactor(1, 10)

        downSide = QWidget()
        downSide.setLayout(self.widgetDebug())
        self.vsplitter = QSplitter(QtCore.Qt.Vertical)
        self.vsplitter.addWidget(self.hsplitter)
        self.vsplitter.addWidget(downSide)
        self.vsplitter.setStretchFactor(0, 10)
        self.vsplitter.setStretchFactor(1, 1)

        mainLayout = QVBoxLayout()
        mainLayout.addLayout(sourceWidget)
        mainLayout.addWidget(self.vsplitter)
        self.setLayout(mainLayout)
        self.setGeometry(300, 300, 800, 600)
        self.show()
开发者ID:smajida,项目名称:detection,代码行数:31,代码来源:window_ui.py

示例7: initUI

    def initUI(self):
        """Create User Interface.
        """
        sourcePath = self.widgetSourcePath()
        parameters = self.widgetParameters()
        scroll = self.widgetImage()
        debug = self.widgetDebug()

        vbox1 = QVBoxLayout()
        vbox1.addLayout(sourcePath)
        hbox = QHBoxLayout()
        hbox.addLayout(parameters, 1)
        hbox.addLayout(scroll, 10)
        vbox1.addLayout(hbox)
        upSide = QWidget()
        upSide.setLayout(vbox1)

        vbox2 = QVBoxLayout()
        vbox2.addLayout(debug)
        downSide = QWidget()
        downSide.setLayout(vbox2)

        splitter = QSplitter(QtCore.Qt.Vertical)
        splitter.addWidget(upSide)
        splitter.addWidget(downSide)
        splitter.splitterMoved.connect(self.splitterMoved)

        mainLayout = QHBoxLayout()
        mainLayout.addWidget(splitter)

        self.setLayout(mainLayout)

        self.setGeometry(300, 300, 300, 150)
        self.show()
开发者ID:xsyann,项目名称:clustering,代码行数:34,代码来源:clustering.py

示例8: __init__

    def __init__(self, parent=None):
        super(_s_CentralWidget, self).__init__(parent)
        self.parent = parent
        #This variables are used to save the splitter sizes before hide
        self._splitterMainSizes = None
        self._splitterAreaSizes = None
        self.lateralPanel = None

        hbox = QHBoxLayout(self)
        hbox.setContentsMargins(0, 0, 0, 0)
        hbox.setSpacing(0)
        #Create Splitters to divide the UI in: MainPanel, Explorer, Misc
        self._splitterArea = QSplitter(Qt.Horizontal)
        self._splitterMain = QSplitter(Qt.Vertical)

        #Create scrollbar for follow mode
        self.scrollBar = QScrollBar(Qt.Vertical, self)
        self.scrollBar.setFixedWidth(20)
        self.scrollBar.setToolTip('Follow Mode: Scroll the Editors together')
        self.scrollBar.hide()
        self.scrollBar.valueChanged[int].connect(self.move_follow_scrolls)

        #Add to Main Layout
        hbox.addWidget(self.scrollBar)
        hbox.addWidget(self._splitterArea)
开发者ID:Salmista-94,项目名称:Ninja_PyQt5,代码行数:25,代码来源:central_widget.py

示例9: doIt

    def doIt(self):
        self.box = QHBoxLayout(self) # cria uma box para receber os widgets

        self.gridAStar = Grid(self.width, self.height) # cria um grid para admin os widgets
        self.gridAStar.changed.connect(self.reDoAStar) # quando a land muda chama o reDo
        self.gridAStar.setFrameShape(QFrame.StyledPanel) # seta o formato do frame para um quadrado

        self.gridDfs = Grid(self.width, self.height)
        self.gridDfs.changed.connect(self.reDoDfs) # quando a land muda chama o reDo
        self.dfsDestroyed = False
        self.gridDfs.setFrameShape(QFrame.StyledPanel)

        self.right = Settings(self.gridAStar, self.gridDfs)  # right rrecebe as congiguracoes de campo
        self.right.changed.connect(self.reDo) # quando a land muda chama o reDo
        self.right.setFrameShape(QFrame.StyledPanel) # seta o formato do frame para um quadrado

        self.splitterV = QSplitter(Qt.Vertical) #reorganiza os qFrame's de acordo com o splitter
        self.splitterV.addWidget(self.gridAStar)
        self.splitterV.addWidget(self.gridDfs)

        self.splitterH = QSplitter(Qt.Horizontal)
        self.splitterH.addWidget(self.splitterV)
        self.splitterH.addWidget(self.right)

        self.box.addWidget(self.splitterH) # adiciona o splitter ao boox
        self.setLayout(self.box) # organiza tudo de acordo com o layout da box
        self.setWindowTitle('Path Finder')

        self.reDo() #  chama a classe para refazer
        self.show()
开发者ID:taypi,项目名称:pathFinder,代码行数:30,代码来源:pathFinding.py

示例10: __init__

    def __init__(self, orientation=Qt.Vertical):
        QSplitter.__init__(self, orientation)
        self.pfile = None
        self._hsplitter = QSplitter(Qt.Horizontal)

        self.lateral_widget = lateral_widget.LateralWidget()
        self._hsplitter.addWidget(self.lateral_widget)
        self.table_widget = table_widget.TableWidget()
        self._hsplitter.addWidget(self.table_widget)

        self.addWidget(self._hsplitter)

        self.query_container = query_container.QueryContainer(self)
        self.addWidget(self.query_container)

        self.modified = False

        self.__nquery = 1

        # Connections
        # FIXME
        self.lateral_widget.itemClicked.connect(
            lambda: self.table_widget.stacked.setCurrentIndex(
                self.lateral_widget.row()))
        # For change table widget item when up/down
        # see issue #39
        self.lateral_widget.itemSelectionChanged.connect(
            lambda: self.table_widget.stacked.setCurrentIndex(
                self.lateral_widget.row()))
        self.query_container.saveEditor['PyQt_PyObject'].connect(
            self.save_query)
        self.setSizes([1, 1])
开发者ID:centaurialpha,项目名称:pireal,代码行数:32,代码来源:database_container.py

示例11: _setupUi

 def _setupUi(self):
     self.resize(558, 447)
     self.mainLayout = QVBoxLayout(self)
     self.mainLayout.setSpacing(0)
     self.mainLayout.setContentsMargins(0, 0, 0, 0)
     self.splitterView = QSplitter()
     self.splitterView.setChildrenCollapsible(False)
     self.splitterView.setOrientation(Qt.Vertical)
     self.subSplitterView = QSplitter()
     self.subSplitterView.setChildrenCollapsible(False)
     self.treeView = TreeView(self)
     self.treeView.setAcceptDrops(True)
     self.treeView.setFrameShape(QFrame.NoFrame)
     self.treeView.setFrameShadow(QFrame.Plain)
     self.treeView.setEditTriggers(QAbstractItemView.EditKeyPressed|QAbstractItemView.SelectedClicked)
     self.treeView.setDragEnabled(True)
     self.treeView.setDragDropMode(QAbstractItemView.InternalMove)
     self.treeView.setUniformRowHeights(True)
     self.treeView.setAllColumnsShowFocus(True)
     self.treeView.setSelectionMode(QAbstractItemView.ExtendedSelection)
     self.treeView.header().setStretchLastSection(False)
     self.subSplitterView.addWidget(self.treeView)
     self.pieChart = PieChartView(self)
     self.pieChart.setMinimumSize(300, 0)
     self.subSplitterView.addWidget(self.pieChart)
     self.splitterView.addWidget(self.subSplitterView)
     self.graphView = LineGraphView(self)
     self.graphView.setMinimumSize(0, 200)
     self.splitterView.addWidget(self.graphView)
     self.splitterView.setStretchFactor(0, 1)
     self.splitterView.setStretchFactor(1, 0)
     self.subSplitterView.setStretchFactor(0, 1)
     self.subSplitterView.setStretchFactor(1, 0)
     self.mainLayout.addWidget(self.splitterView)
开发者ID:brownnrl,项目名称:moneyguru,代码行数:34,代码来源:view.py

示例12: init_ui

    def init_ui(self):
        """Initialize all GUI elements and show window."""

        self.set_status('Welcome')
        self.create_menus()

        canvas_box = self.create_canvas()
        sequence_form = self.create_sequence_form()

        # let's have the sequence form over the canvas.
        vbox = QVBoxLayout()
        vbox.addLayout(sequence_form, stretch=0)
        vbox.setAlignment(Qt.AlignTop)

        vbox.addLayout(canvas_box, stretch=1)

        splitter = QSplitter(Qt.Horizontal)

        options = OptionPanel(self.args)

        for layout in [vbox, options]:
            widget = QWidget()
            widget.setLayout(layout)
            splitter.addWidget(widget)

        self.setCentralWidget(splitter)

        self.resize(600, 600)
        self.setWindowTitle('Dotplot')
        self.show()
开发者ID:kn-bibs,项目名称:dotplot,代码行数:30,代码来源:main_window.py

示例13: __init__

	def __init__(self):
		QWidget.__init__(self)
		self.sun=1
		hbox=QHBoxLayout(self)
		mainLayout = QSplitter(Qt.Horizontal)
       # splitter1 = QtGui.QSplitter(QtCore.Qt.Horizontal)
		self.three_d=display_widget()
		self.three_d.show()

		self.frame=layer_widget()

		self.frame.changed.connect(self.three_d.recalculate)
		
		mainLayout.addWidget(self.frame)
		mainLayout.addWidget(self.three_d)
		hbox.addWidget(mainLayout)
		
		self.setLayout(hbox)

		if enable_webupdates()==True:
			print("Looking for updates")
			self.web_update=update_thread()
			self.web_update.got_data.connect(self.got_help)
			self.web_update.start()
		self.frame.tab.itemSelectionChanged.connect(self.layer_selection_changed)
开发者ID:roderickmackenzie,项目名称:gpvdm,代码行数:25,代码来源:tab_main.py

示例14: DualFrame

class DualFrame(QFrame):

    def __init__(self, plot_title, finish_creating_plot_gui, is_top_level):
        QFrame.__init__(self)

        self.setWindowTitle(plot_title)

        self.main_layout = QVBoxLayout(self)

        self.splitter = QSplitter()
        self.dnd_frame_1 = DndFrame('Output Graphs')
        self.dnd_frame_2 = DndFrame('Graphs to Display')

        self.splitter.addWidget(self.dnd_frame_1)
        self.splitter.addWidget(self.dnd_frame_2)

        self.main_layout.addWidget(self.splitter)

        self.button_layout = QHBoxLayout()

        self.dnd_close_button = PyQtExtras.CommandButton('Close')
        self.dnd_close_button.set_handler(self.on_close)

        self.dnd_accept_button = PyQtExtras.CommandButton('Accept')
        self.dnd_accept_button.set_handler(self.on_accept)

        self.button_layout.addWidget(self.dnd_close_button)
        self.button_layout.addWidget(self.dnd_accept_button)

        self.button_layout.setAlignment(Qt.AlignRight)

        self.main_layout.addLayout(self.button_layout)

        self.finish_creating_plot_gui = finish_creating_plot_gui

        self.is_top_level = is_top_level

        self.setMinimumSize(QSize(800, 640))

    def add_to_first(self, text):
        self.dnd_frame_1.add_label(text)

    def add_to_second(self, text):
        self.dnd_frame_2.add_label(text)

    def on_accept(self):
        plots_to_output = self.dnd_frame_1.get_output_plot_filenames()

        if self.finish_creating_plot_gui != None:
            self.finish_creating_plot_gui(plots_to_output)

        self.close()

    def on_close(self):

        self.hide()

        if self.is_top_level:
            QApplication.exit(0)
开发者ID:jhavstad,项目名称:model_runner,代码行数:59,代码来源:PyQtDnd.py

示例15: create_mid_group

    def create_mid_group(self):
        self.ddi_tree = QTreeWidget()
        self.ddi_tree.itemSelectionChanged.connect(self.show_ddi_details)

        ddi_details = QGroupBox()
        ddi_details_layout = QGridLayout()
        ddi_details_layout.setContentsMargins(0,0,0,0)
        ddi_details_layout.addWidget(self.create_common_ddi_details(), 0, 0, 1, 1)
        ddi_details_layout.addWidget(self.create_specific_ddi_details(), 1, 0, 3, 1)
        ddi_details.setLayout(ddi_details_layout)

        self.step_tree = QTreeWidget()
        self.step_tree.itemSelectionChanged.connect(self.show_step_details)
        step_details = QGroupBox()
        step_details_layout = QGridLayout()
        step_details_layout.setContentsMargins(0,0,0,0)
        step_details_layout.addWidget(self.create_common_step_details(), 0, 0, 1, 1)
        # step_details_layout.addWidget(self.create_specific_step_details(), 1, 0, 3, 1)
        step_details.setLayout(step_details_layout)

        splitter = QSplitter(self)
        splitter.addWidget(self.ddi_tree)
        splitter.addWidget(ddi_details)
        splitter.addWidget(self.step_tree)
        splitter.addWidget(step_details)

        hbox = QHBoxLayout()
        hbox.setContentsMargins(0,0,0,0)
        # self.__mix_to_layout(hbox, self.ddi_tree, ddi_details, self.step_tree, step_details)
        hbox.addWidget(splitter)
        # group_box.setLayout(hbox)
        return hbox
开发者ID:bobev18,项目名称:stujeditor,代码行数:32,代码来源:uj_editor_gui.py


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