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


Python QtGui.QHBoxLayout类代码示例

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


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

示例1: __init__

    def __init__(self):
        QWidget.__init__(self)

        self.setWindowTitle( 'Biofeedback' )

        self.button_start = QPushButton()
        self.button_start.setText("START")
        self.button_stop = QPushButton()
        self.button_stop.setText("STOP")

        layout = QHBoxLayout(self)
        layout.addWidget(self.button_start)
        layout.addWidget(self.button_stop)

        self.connect(self.button_start, SIGNAL("clicked(bool)"), self.start_session)
        self.connect(self.button_stop, SIGNAL("clicked(bool)"), self.stop_session)

        self.setLayout(layout)
        self.setGeometry(300,100,250,100)
        self.show()

        #self.datastorage = DataStorage()
        #settings = {'db_host':'amber','db_user':'root','db_pwd':'dbrootpass','db_dbname':'biodb'}
        #self.datastorage.enableDbStorage(settings)


        self.thread = ConnectionThread()
开发者ID:darkopetrovic,项目名称:ZephyrApp,代码行数:27,代码来源:zephyr_test_nogui.py

示例2: FitDialog

class FitDialog(QDialog, FitWidgetMixin):
    def __init__(self, wintitle=None, icon="guiqwt.svg", edit=True,
                 toolbar=False, options=None, parent=None, panels=None,
                 param_cols=1, legend_anchor='TR', auto_fit=False):
        QDialog.__init__(self, parent)
        self.edit = edit
        self.button_layout = None
        FitWidgetMixin.__init__(self, wintitle, icon, toolbar, options, panels,
                                param_cols, legend_anchor, auto_fit)
        self.setWindowFlags(Qt.Window)
        
    def setup_widget_layout(self):
        FitWidgetMixin.setup_widget_layout(self)
        if self.edit:
            self.install_button_layout()
        
    def install_button_layout(self):        
        bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
        self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
        self.button_list += [bbox.button(QDialogButtonBox.Ok)]

        self.button_layout = QHBoxLayout()
        self.button_layout.addStretch()
        self.button_layout.addWidget(bbox)
        
        vlayout = self.layout()
        vlayout.addSpacing(10)
        vlayout.addLayout(self.button_layout)
开发者ID:HaMF,项目名称:guiqwt,代码行数:29,代码来源:fit.py

示例3: CurveDialog

class CurveDialog(QDialog, CurveWidgetMixin):
    """
    Construct a CurveDialog object: plotting dialog box with integrated 
    plot manager
    
        * wintitle: window title
        * icon: window icon
        * edit: editable state
        * toolbar: show/hide toolbar
        * options: options sent to the :py:class:`guiqwt.curve.CurvePlot` object
          (dictionary)
        * parent: parent widget
        * panels (optional): additionnal panels (list, tuple)
    """
    def __init__(self, wintitle="guiqwt plot", icon="guiqwt.svg", edit=False,
                 toolbar=False, options=None, parent=None, panels=None):
        if not PYQT5:
            QDialog.__init__(self, parent)
        self.edit = edit
        self.button_box = None
        self.button_layout = None
        if PYQT5:
            super(CurveDialog, self).__init__(parent, wintitle=wintitle,
                    icon=icon, toolbar=toolbar, options=options, panels=panels)
        else:
            CurveWidgetMixin.__init__(self, wintitle=wintitle, icon=icon, 
                                      toolbar=toolbar, options=options,
                                      panels=panels)
        self.setWindowFlags(Qt.Window)
        
    def setup_widget_layout(self):
        vlayout = QVBoxLayout(self)
        vlayout.addWidget(self.toolbar)
        vlayout.addLayout(self.plot_layout)
        self.setLayout(vlayout)
        if self.edit:
            self.button_layout = QHBoxLayout()
            self.install_button_layout()
            vlayout.addLayout(self.button_layout)
        
    def install_button_layout(self):
        """
        Install standard buttons (OK, Cancel) in dialog button box layout 
        (:py:attr:`guiqwt.plot.CurveDialog.button_layout`)
        
        This method may be overriden to customize the button box
        """
        bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        bbox.accepted.connect(self.accept)
        bbox.rejected.connect(self.reject)
        self.button_layout.addWidget(bbox)
        self.button_box = bbox
开发者ID:alimuldal,项目名称:guiqwt,代码行数:52,代码来源:plot.py

示例4: setup_widget_layout

 def setup_widget_layout(self):
     vlayout = QVBoxLayout(self)
     vlayout.addWidget(self.toolbar)
     vlayout.addLayout(self.plot_layout)
     self.setLayout(vlayout)
     if self.edit:
         self.button_layout = QHBoxLayout()
         self.install_button_layout()
         vlayout.addLayout(self.button_layout)
开发者ID:alimuldal,项目名称:guiqwt,代码行数:9,代码来源:plot.py

示例5: __init__

    def __init__(self, parent=None):
        super(ContrastAdjustment, self).__init__(parent)
        
        self.local_manager = None # local manager for the histogram plot
        self.manager = None # manager for the associated image plot
        
        # Storing min/max markers for each active image
        self.min_markers = {}
        self.max_markers = {}
        
        # Select point tools
        self.min_select_tool = None
        self.max_select_tool = None
        
        style = "<span style=\'color: #444444\'><b>%s</b></span>"
        layout, _label = get_image_layout(self.PANEL_ICON,
                                          style % self.PANEL_TITLE,
                                          alignment=Qt.AlignCenter)
        layout.setAlignment(Qt.AlignCenter)
        vlayout = QVBoxLayout()
        vlayout.addLayout(layout)
        self.local_manager = PlotManager(self)
        self.histogram = LevelsHistogram(parent)
        vlayout.addWidget(self.histogram)
        self.local_manager.add_plot(self.histogram)
        hlayout = QHBoxLayout()
        self.setLayout(hlayout)
        hlayout.addLayout(vlayout)
        
        self.toolbar = toolbar = QToolBar(self)
        toolbar.setOrientation(Qt.Vertical)
#        toolbar.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
        hlayout.addWidget(toolbar)
        
        # Add standard plot-related tools to the local manager
        lman = self.local_manager
        lman.add_tool(SelectTool)
        lman.add_tool(BasePlotMenuTool, "item")
        lman.add_tool(BasePlotMenuTool, "axes")
        lman.add_tool(BasePlotMenuTool, "grid")
        lman.add_tool(AntiAliasingTool)
        lman.get_default_tool().activate()
        
        self.outliers_param = EliminateOutliersParam(self.PANEL_TITLE)
开发者ID:HaMF,项目名称:guiqwt,代码行数:44,代码来源:histogram.py

示例6: _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

示例7: get_image_layout

def get_image_layout(imagename, text="", tooltip="", alignment=Qt.AlignLeft):
    """
    Construct a QHBoxLayout including image from the file with specified name,
    left-aligned text [with specified tooltip]
    Return (layout, label)
    """
    layout = QHBoxLayout()
    if alignment in (Qt.AlignCenter, Qt.AlignRight):
        layout.addStretch()
    layout.addWidget(get_image_label(imagename))
    label = QLabel(text)
    label.setToolTip(tooltip)
    layout.addWidget(label)
    if alignment in (Qt.AlignCenter, Qt.AlignLeft):
        layout.addStretch()
    return (layout, label)    
开发者ID:CARIBOuSystem,项目名称:guidata,代码行数:16,代码来源:configtools.py

示例8: install_button_layout

    def install_button_layout(self):        
        bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
        self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
        self.button_list += [bbox.button(QDialogButtonBox.Ok)]

        self.button_layout = QHBoxLayout()
        self.button_layout.addStretch()
        self.button_layout.addWidget(bbox)
        
        vlayout = self.layout()
        vlayout.addSpacing(10)
        vlayout.addLayout(self.button_layout)
开发者ID:HaMF,项目名称:guiqwt,代码行数:13,代码来源:fit.py

示例9: install_button_layout

    def install_button_layout(self):        
        bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        bbox.accepted.connect(self.accept)
        bbox.rejected.connect(self.reject)
        self.button_list += [bbox.button(QDialogButtonBox.Ok)]

        self.button_layout = QHBoxLayout()
        self.button_layout.addStretch()
        self.button_layout.addWidget(bbox)
        
        vlayout = self.layout()
        vlayout.addSpacing(10)
        vlayout.addLayout(self.button_layout)
开发者ID:CaptainAL,项目名称:Spyder,代码行数:13,代码来源:fit.py

示例10: FitDialog

class FitDialog(QDialog, FitWidgetMixin):
    def __init__(self, wintitle=None, icon="guiqwt.svg", edit=True,
                 toolbar=False, options=None, parent=None, panels=None,
                 param_cols=1, legend_anchor='TR', auto_fit=False):
        if not PYQT5:
            QDialog.__init__(self, parent)
        self.edit = edit
        self.button_layout = None
        if PYQT5:
            super(FitDialog, self).__init__(parent, wintitle=wintitle,
                    icon=icon, toolbar=toolbar, options=options, panels=panels,
                    param_cols=param_cols, legend_anchor=legend_anchor,
                    auto_fit=auto_fit)
        else:
            FitWidgetMixin.__init__(self, wintitle, icon, toolbar, options,
                                    panels, param_cols, legend_anchor,
                                    auto_fit)
        self.setWindowFlags(Qt.Window)
        
    def setup_widget_layout(self):
        FitWidgetMixin.setup_widget_layout(self)
        if self.edit:
            self.install_button_layout()
        
    def install_button_layout(self):        
        bbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        bbox.accepted.connect(self.accept)
        bbox.rejected.connect(self.reject)
        self.button_list += [bbox.button(QDialogButtonBox.Ok)]

        self.button_layout = QHBoxLayout()
        self.button_layout.addStretch()
        self.button_layout.addWidget(bbox)
        
        vlayout = self.layout()
        vlayout.addSpacing(10)
        vlayout.addLayout(self.button_layout)
开发者ID:CaptainAL,项目名称:Spyder,代码行数:37,代码来源:fit.py

示例11: setup_widget_layout

 def setup_widget_layout(self):
     self.fit_layout = QHBoxLayout()
     self.params_layout = QGridLayout()
     params_group = create_groupbox(self, _("Fit parameters"),
                                    layout=self.params_layout)
     if self.auto_fit_enabled:
         auto_group = self.create_autofit_group()
         self.fit_layout.addWidget(auto_group)
     self.fit_layout.addWidget(params_group)
     self.plot_layout.addLayout(self.fit_layout, 1, 0)
     
     vlayout = QVBoxLayout(self)
     vlayout.addWidget(self.toolbar)
     vlayout.addLayout(self.plot_layout)
     self.setLayout(vlayout)
开发者ID:CaptainAL,项目名称:Spyder,代码行数:15,代码来源:fit.py

示例12: __init__

 def __init__(self, parent):
     QWidget.__init__(self, parent)
     layout = QHBoxLayout()
     row_nb = 14
     cindex = 0
     for child in dir(QStyle):
         if child.startswith('SP_'):
             if cindex == 0:
                 col_layout = QVBoxLayout()
             icon_layout = QHBoxLayout()
             icon = get_std_icon(child)
             label = QLabel()
             label.setPixmap(icon.pixmap(32, 32))
             icon_layout.addWidget( label )
             icon_layout.addWidget( QLineEdit(child.replace('SP_', '')) )
             col_layout.addLayout(icon_layout)
             cindex = (cindex+1) % row_nb
             if cindex == 0:
                 layout.addLayout(col_layout)                    
     self.setLayout(layout)
     self.setWindowTitle('Standard Platform Icons')
     self.setWindowIcon(get_std_icon('TitleBarMenuButton'))
开发者ID:Alwnikrotikz,项目名称:guidata,代码行数:22,代码来源:qthelpers.py

示例13: __init__

    def __init__(self, parent):
        QWidget.__init__(self, parent)
        font = QFont(get_family(MONOSPACE), 10, QFont.Normal)

        info_icon = QLabel()
        icon = get_std_icon("MessageBoxInformation").pixmap(24, 24)
        info_icon.setPixmap(icon)
        info_icon.setFixedWidth(32)
        info_icon.setAlignment(Qt.AlignTop)

        self.service_status_label = QLabel()
        self.service_status_label.setWordWrap(True)
        self.service_status_label.setAlignment(Qt.AlignTop)
        self.service_status_label.setFont(font)

        self.desc_label = QLabel()
        self.desc_label.setWordWrap(True)
        self.desc_label.setAlignment(Qt.AlignTop)
        self.desc_label.setFont(font)

        self.group_desc = QGroupBox("Description", self)
        layout = QHBoxLayout()
        layout.addWidget(info_icon)
        layout.addWidget(self.desc_label)
        layout.addStretch()
        layout.addWidget(self.service_status_label)

        self.group_desc.setLayout(layout)

        self.editor = CodeEditor(self)
        self.editor.setup_editor(linenumbers=True, font=font)
        self.editor.setReadOnly(False)
        self.group_code = QGroupBox("Source code", self)
        layout = QVBoxLayout()
        layout.addWidget(self.editor)
        self.group_code.setLayout(layout)

        self.enable_button = QPushButton(get_icon("apply.png"), "Enable", self)

        self.save_button = QPushButton(get_icon("filesave.png"), "Save", self)

        self.disable_button = QPushButton(get_icon("delete.png"), "Disable", self)

        self.refresh_button = QPushButton(get_icon("restart.png"), "Refresh", self)
        hlayout = QHBoxLayout()
        hlayout.addWidget(self.save_button)
        hlayout.addWidget(self.enable_button)
        hlayout.addWidget(self.disable_button)
        hlayout.addWidget(self.refresh_button)

        vlayout = QVBoxLayout()
        vlayout.addWidget(self.group_desc)
        vlayout.addWidget(self.group_code)
        self.html_window = HTMLWindow()
        vlayout.addWidget(self.html_window)

        vlayout.addLayout(hlayout)
        self.setLayout(vlayout)

        self.current_file = None
开发者ID:hutchic,项目名称:dd-agent,代码行数:60,代码来源:gui.py

示例14: __init__

 def __init__(self, parent):
     QWidget.__init__(self, parent)
     font = QFont(get_family(MONOSPACE), 10, QFont.Normal)
     
     info_icon = QLabel()
     icon = get_std_icon('MessageBoxInformation').pixmap(24, 24)
     info_icon.setPixmap(icon)
     info_icon.setFixedWidth(32)
     info_icon.setAlignment(Qt.AlignTop)
     self.desc_label = QLabel()
     self.desc_label.setWordWrap(True)
     self.desc_label.setAlignment(Qt.AlignTop)
     self.desc_label.setFont(font)
     group_desc = QGroupBox(_("Description"), self)
     layout = QHBoxLayout()
     layout.addWidget(info_icon)
     layout.addWidget(self.desc_label)
     group_desc.setLayout(layout)
     
     self.editor = CodeEditor(self)
     self.editor.setup_editor(linenumbers=True, font=font)
     self.editor.setReadOnly(True)
     group_code = QGroupBox(_("Source code"), self)
     layout = QVBoxLayout()
     layout.addWidget(self.editor)
     group_code.setLayout(layout)
     
     self.run_button = QPushButton(get_icon("apply.png"),
                                   _("Run this script"), self)
     self.quit_button = QPushButton(get_icon("exit.png"), _("Quit"), self)
     hlayout = QHBoxLayout()
     hlayout.addWidget(self.run_button)
     hlayout.addStretch()
     hlayout.addWidget(self.quit_button)
     
     vlayout = QVBoxLayout()
     vlayout.addWidget(group_desc)
     vlayout.addWidget(group_code)
     vlayout.addLayout(hlayout)
     self.setLayout(vlayout)
开发者ID:stonebig,项目名称:guidata,代码行数:40,代码来源:guitest.py

示例15: __init__

 def __init__(self):
     QHBoxLayout.__init__(self)
     self.widgets = []
开发者ID:artillan,项目名称:guidata,代码行数:3,代码来源:qtitemwidgets.py


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