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


Python QtGui.QHBoxLayout方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QHBoxLayout [as 别名]
def __init__(self, parent=None):
        super().__init__(parent)
        self.setTitle('Strategy')
        self.setAlignment(QtCore.Qt.AlignCenter)
        self.layout = QtGui.QHBoxLayout(self)
        self.layout.setContentsMargins(0, 0, 0, 0)

        self.list = QtGui.QComboBox()

        self.add_btn = QtGui.QPushButton('+')
        self.add_btn.clicked.connect(self.add_strategies)

        self.start_btn = QtGui.QPushButton('Start Backtest')
        self.start_btn.clicked.connect(self.load_strategy)

        self.layout.addWidget(self.list, stretch=2)
        self.layout.addWidget(self.add_btn, stretch=0)
        self.layout.addWidget(self.start_btn, stretch=0)

        self.load_strategies_from_settings() 
开发者ID:constverum,项目名称:Quantdom,代码行数:22,代码来源:ui.py

示例2: __init__

# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QHBoxLayout [as 别名]
def __init__(self, horizontal=True, parent=None, decimals=3, step=.005,
                 slider_exponent=1):
        QtGui.QWidget.__init__(self, parent)
        self.vmin = None
        self.vmax = None
        self.slider_exponent = slider_exponent
        self.decimals = decimals
        self.step = 100
        self.valueLen = 2
        self.suffix = None
        self._value = None

        self.spin = QtGui.QDoubleSpinBox()
        self.spin.setDecimals(decimals)
        self.spin.setSingleStep(step)
        self.spin.valueChanged.connect(self._spin_updated)
        self.spin.setFrame(False)

        self.slider = QtGui.QSlider(
            QtCore.Qt.Orientation(1 if horizontal else 0), self)  # 1 = hor.
        self.slider.setTickPosition(
            QtGui.QSlider.TicksAbove if horizontal
            else QtGui.QSlider.TicksLeft)
        self.slider.setRange(0, 99)
        self.slider.sliderMoved.connect(self._slider_updated)

        layout = QtGui.QHBoxLayout() if horizontal else QtGui.QVBoxLayout()
        self.setLayout(layout)
        layout.addWidget(self.slider)
        layout.addWidget(self.spin) 
开发者ID:pyrocko,项目名称:kite,代码行数:32,代码来源:qt_utils.py

示例3: get_QHBoxLayout

# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QHBoxLayout [as 别名]
def get_QHBoxLayout():
    """QHBoxLayout getter."""

    try:
        import PySide.QtGui as QtGui
        return QtGui.QHBoxLayout
    except ImportError:
        import PyQt5.QtWidgets as QtWidgets
        return QtWidgets.QHBoxLayout 
开发者ID:AirbusCyber,项目名称:grap,代码行数:11,代码来源:QtShim.py

示例4: init_timeframes_ui

# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QHBoxLayout [as 别名]
def init_timeframes_ui(self):
        self.tf_layout = QtGui.QHBoxLayout()
        self.tf_layout.setSpacing(0)
        self.tf_layout.setContentsMargins(0, 12, 0, 0)
        time_frames = ('1M', '5M', '15M', '30M', '1H', '1D', '1W', 'MN')
        btn_prefix = 'TF'
        for tf in time_frames:
            btn_name = ''.join([btn_prefix, tf])
            btn = QtGui.QPushButton(tf)
            # TODO:
            btn.setEnabled(False)
            setattr(self, btn_name, btn)
            self.tf_layout.addWidget(btn)
        self.toolbar_layout.addLayout(self.tf_layout) 
开发者ID:constverum,项目名称:Quantdom,代码行数:16,代码来源:ui.py

示例5: setupUi

# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QHBoxLayout [as 别名]
def setupUi(self, Form,ds_type, selector_labels):
        """Sets up the general window
        
        This function coordinates the changing input from the signal slots and
        updates the attributes that are parsed to the plotting lib functions.
        update_plots() is either periodically called e.g. by the timer or once 
        on startup.
        
        Args:
            self: Object of the Ui_Form class.
            Form: PlotWindow object that inherits the used calls here from the
                underlying QWidget class.
            ds_type: Integer
            selector_labels: String list with names of the datasets on all axis
        Returns:
            No return variable. The function operates on the given object.
        """
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(750, 450)
        self.gridLayout_Top = QtGui.QGridLayout(Form)
        self.gridLayout_Top.setContentsMargins(0,0,0,0)
        self.gridLayout_Top.setObjectName(_fromUtf8("gridLayout_Top"))
        # we push for a tight layout
        self.gridLayout_Top.setContentsMargins(0,0,0,0)
        self.gridLayout_Top.setContentsMargins(QtCore.QMargins(0,0,0,0))
        self.gridLayout_Top.setSpacing(0)
        
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))

        self.horizontalLayout.setContentsMargins(0,0,0,0)
        self.horizontalLayout.setContentsMargins(QtCore.QMargins(0,0,0,0))
        self.horizontalLayout.setSpacing(0)
        

        self.gridLayout_Top.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        
        self.gridLayout_Top.addLayout(self.gridLayout, 1, 0, 1, 1)

        Form.setWindowTitle(_translate("Form", "Form", None))
        QtCore.QMetaObject.connectSlotsByName(Form)        
        
        self.selector_labels = selector_labels
        if ds_type == ds_types['coordinate']:
            self.setupCoordinate(Form)
        if ds_type == ds_types['vector']:
            self.setupVector(Form)
        if ds_type == ds_types['matrix'] or ds_type == -1:
            self.setupMatrix(Form)
        if ds_type == ds_types['box']:
            self.setupBox(Form)
        if ds_type == ds_types['txt']:
            self.setupTxt(Form)
        if ds_type == ds_types['view']:
            self.setupView(Form) 
开发者ID:qkitgroup,项目名称:qkit,代码行数:60,代码来源:plot_view.py

示例6: makeView

# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QHBoxLayout [as 别名]
def makeView(self):
        # self.central = QtGui.QWidget()
        # self.HLayout = QtGui.QHBoxLayout(self.central)
        self.central = QtWidgets.QSplitter(self)
        self.central.setOpaqueResize(False)
        self.central.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)

        self.tree = LayerWidget(self)
        # self.tree.setFixedWidth(200)
        # self.tree.setSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding)
        self.central.addWidget(self.tree)

        # self.HLayout.addItem(self.spacer)

        self.frame = QtWidgets.QWidget()
        # self.frame = DelayedUpdater()

        self.frame.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.imageLabel = QtWidgets.QLabel(self.frame)
        self.imageLabel.setBackgroundRole(QtGui.QPalette.Base)
        self.imageLabel.setStyleSheet("QLabel { background-color: #333 }")
        self.imageLabel.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.imageLabel.setScaledContents(False)
        self.imageLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.imageLabel.resize(self.frame.width(), self.frame.height())
        self.central.addWidget(self.frame)

        self.setCentralWidget(self.central)

        self.resizeframeevent = self.frame.resizeEvent
        self.frame.resizeEvent = self.resizeFrameEvent  # a bit dirtyt to overload like this...

        # self.central.move.connect(lambda: self.splitterMoved())

        # self.frame = QtGui.QWidget()
        # self.imageLabel = QtGui.QLabel(self.frame)
        # self.imageLabel.setBackgroundRole(QtGui.QPalette.Base)
        # self.imageLabel.setStyleSheet("QLabel { background-color: #333 }")
        # self.imageLabel.setSizePolicy(QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Ignored)
        # self.imageLabel.setScaledContents(False)
        # self.imageLabel.resize(self.frame.width(), self.frame.height())
        # self.setCentralWidget(self.frame)

    # def split(self, event):
    #     # QtGui.QWidget.resizeEvent(self.frame, event)
    #     # self.central.update()
    #     self.resizeEvent(event)
    #     # self.central.update()
    #     print("Event", self.frame.width(), self.frame.height()) 
开发者ID:birgander2,项目名称:PyRAT,代码行数:51,代码来源:Viewer.py


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