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


Python QtWidgets.QFrame方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self, parent=None, frame=QtWidgets.QFrame.Box):
            super(FIRSTUI.ScrollWidget, self).__init__()

            #   Container Widget
            widget = QtWidgets.QWidget()
            #   Layout of Container Widget
            self.layout = QtWidgets.QVBoxLayout(self)
            self.layout.setContentsMargins(0, 0, 0, 0)
            widget.setLayout(self.layout)

            #   Scroll Area Properties
            scroll = QtWidgets.QScrollArea()
            scroll.setFrameShape(frame)
            scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
            scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
            scroll.setWidgetResizable(True)
            scroll.setWidget(widget)

            #   Scroll Area Layer add
            scroll_layout = QtWidgets.QVBoxLayout(self)
            scroll_layout.addWidget(scroll)
            scroll_layout.setContentsMargins(0, 0, 0, 0)
            self.setLayout(scroll_layout) 
开发者ID:vrtadmin,项目名称:FIRST-plugin-ida,代码行数:25,代码来源:first.py

示例2: paintEvent

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def paintEvent(self, event):
        QtWidgets.QFrame.paintEvent(self, event)
        painter = QtGui.QPainter()
        painter.begin(self)
        painter.setRenderHint(QtGui.QPainter.Antialiasing)
        painter.setPen(Qt.NoPen)
        # Draw the Pie
        rwidth = int(min([self.width(), self.height()]) - 2)
        x = int((self.width() / 2) - (rwidth / 2))
        y = int((self.height() / 2) - (rwidth / 2))
        rect = QtCore.QRect(x, y, rwidth, rwidth)
        angle1 = 0
        for i in range(len(self.data)):
            angle2 = angle1 + (3.6 * self.data[i])
            painter.setBrush(QtGui.QBrush(self.colors[i % len(self.colors)]))
            painter.drawPie(rect, angle1*-16, (angle2-angle1)*-16)
            angle1 = angle2
        # Draw the remainer (background)
        angle2 = 360
        painter.setBrush(QtGui.QBrush(self.bgcolor))
        painter.drawPie(rect, angle1*-16, (angle2-angle1)*-16)
        painter.end() 
开发者ID:pkkid,项目名称:pkmeter,代码行数:24,代码来源:pkcharts.py

示例3: buttonsLayout

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def buttonsLayout(self):
        self.matrix = False
        vbox = QVBoxLayout()
        interactionModeLayout = QVBoxLayout()
        self.interactionModeButton = QtWidgets.QPushButton('visma')
        self.interactionModeButton.clicked.connect(self.interactionMode)
        interactionModeLayout.addWidget(self.interactionModeButton)
        interactionModeWidget = QWidget(self)
        interactionModeWidget.setLayout(interactionModeLayout)
        interactionModeWidget.setFixedSize(275, 50)
        topButtonSplitter = QSplitter(Qt.Horizontal)
        topButtonSplitter.addWidget(interactionModeWidget)
        permanentButtons = QWidget(self)
        topButtonSplitter.addWidget(permanentButtons)
        self.bottomButton = QFrame()
        self.buttonSplitter = QSplitter(Qt.Vertical)
        self.buttonSplitter.addWidget(topButtonSplitter)
        self.buttonSplitter.addWidget(self.bottomButton)
        vbox.addWidget(self.buttonSplitter)
        return vbox 
开发者ID:aerospaceresearch,项目名称:visma,代码行数:22,代码来源:window.py

示例4: view_configuration_info

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def view_configuration_info(self):
        self.thread_stop = True
        container = QtWidgets.QVBoxLayout()

        label = QtWidgets.QLabel('Configuration Information')
        label.setStyleSheet('font: 18px;')
        container.addWidget(label)

        layout = QtWidgets.QHBoxLayout()
        self.message = QtWidgets.QLabel()
        layout.addWidget(self.message)
        layout.addStretch()
        save_button = QtWidgets.QPushButton('Save')
        layout.addWidget(save_button)

        scroll_layout = FIRSTUI.ScrollWidget(frame=QtWidgets.QFrame.NoFrame)
        FIRSTUI.SharedObjects.server_config_layout(self, scroll_layout, FIRST.config)

        container.addWidget(scroll_layout)
        container.addStretch()
        container.addLayout(layout)

        save_button.clicked.connect(self.save_config)

        return container 
开发者ID:vrtadmin,项目名称:FIRST-plugin-ida,代码行数:27,代码来源:first.py

示例5: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self):
        # === App-Init ===
        super(SidebarWindow, self).__init__()
        self._title = "Pyleecan"
        self.setWindowTitle(self._title)
        self._main = QtWidgets.QWidget()
        self.setCentralWidget(self._main)

        # === Main Widgets ===
        # Navigation Panel with Button Group
        self.nav_panel = QtWidgets.QFrame()

        self.nav_btn_grp = QtWidgets.QButtonGroup()
        self.nav_btn_grp.setExclusive(True)
        self.nav_btn_grp.buttonClicked[int].connect(self.switch_stack)
        self.btn_grp_fct = []

        self.nav_layout = QtWidgets.QVBoxLayout(self.nav_panel)
        self.nav_layout.setContentsMargins(2, 2, 2, 2)
        self.nav_layout.addStretch(1)  # add stretch first

        # Sub Window Stack
        self.io_stack = QtWidgets.QStackedWidget(self)

        # Seperator Line
        line = QtWidgets.QFrame()
        line.setStyleSheet("QFrame { background-color: rgb(200, 200, 200) }")
        line.setFixedWidth(2)

        # === Main Layout ===
        main_layout = QtWidgets.QHBoxLayout()
        main_layout.addWidget(self.nav_panel)
        main_layout.addWidget(line)
        main_layout.addWidget(self.io_stack)

        self._main.setLayout(main_layout)

        self.show()
        self.centerOnScreen() 
开发者ID:Eomys,项目名称:pyleecan,代码行数:41,代码来源:SidebarWindow.py

示例6: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self, dataitem, parent=None):
        super(otherPanel, self).__init__(parent)
        self.setFrameStyle(widgets.QFrame.Sunken)
        self.setFrameShape(widgets.QFrame.Box)
        self.data = dataitem

        layout = widgets.QGridLayout()
        labelnob = widgets.QLabel(_("Number of bytes"))
        lableunit = widgets.QLabel(_("Unit"))

        layout.addWidget(labelnob, 0, 0)
        layout.addWidget(lableunit, 1, 0)
        layout.setRowStretch(2, 1)

        self.inputnob = widgets.QSpinBox()
        self.inputnob.setRange(1, 10240)
        self.inputtype = widgets.QComboBox()
        self.inputtype.addItem("ASCII")
        self.inputtype.addItem("BCD/HEX")

        layout.addWidget(self.inputnob, 0, 1)
        layout.addWidget(self.inputtype, 1, 1)

        self.setLayout(layout)
        self.init() 
开发者ID:cedricp,项目名称:ddt4all,代码行数:27,代码来源:dataeditor.py

示例7: setup

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def setup():
        """
        Create and setup the base vtk and Qt objects for the application
        """
        renderer = vtk.vtkRenderer()
        frame = QtWidgets.QFrame()
        vtk_widget = QVTKRenderWindowInteractor()
        interactor = vtk_widget.GetRenderWindow().GetInteractor()
        render_window = vtk_widget.GetRenderWindow()

        frame.setAutoFillBackground(True)
        vtk_widget.GetRenderWindow().AddRenderer(renderer)
        render_window.AddRenderer(renderer)
        interactor.SetRenderWindow(render_window)
        interactor.SetInteractorStyle(vtk.vtkInteractorStyleTrackballCamera())

        # required to enable overlapping actors with opacity < 1.0
        # this is causing some issues with flashing objects
        # render_window.SetAlphaBitPlanes(1)
        # render_window.SetMultiSamples(0)
        # renderer.UseDepthPeelingOn()
        # renderer.SetMaximumNumberOfPeels(2)

        return renderer, frame, vtk_widget, interactor, render_window 
开发者ID:adamkwolf,项目名称:3d-nii-visualizer,代码行数:26,代码来源:MainWindow.py

示例8: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self, state=0, text="", parent=None):
        """
        state:
            0   -   Not solved
            1   -   OK
            2   -   Ignore
            3   -   Warning (Recommend: Use text parameter to explain)
            4   -   Calculating
            5   -   Error
        """
        super(Status, self).__init__(parent)
        self.setState(state)
        self.setAlignment(QtCore.Qt.AlignCenter)
        self.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.setFrameShape(QtWidgets.QFrame.Panel)
        self.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                           QtWidgets.QSizePolicy.Preferred)
        self.oldState = 0
        self.oldText = "" 
开发者ID:jjgomera,项目名称:pychemqt,代码行数:21,代码来源:widgets.py

示例9: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self, *args):
        QtWidgets.QFrame.__init__(self, *args)
 
        self.setFrameStyle(QtWidgets.QFrame.StyledPanel | QtWidgets.QFrame.Sunken)
 
        self.edit = self.PlainTextEdit()
        self.number_bar = self.NumberBar(self.edit)
 
        hbox = QtWidgets.QHBoxLayout(self)
        hbox.setSpacing(0)
        hbox.setContentsMargins(0,0,0,0) # setMargin
        hbox.addWidget(self.number_bar)
        hbox.addWidget(self.edit)
 
        self.edit.blockCountChanged.connect(self.number_bar.adjustWidth)
        self.edit.updateRequest.connect(self.number_bar.updateContents) 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:18,代码来源:LNTextEdit.py

示例10: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self, etree, control, parent=None):
        QtWidgets.QFrame.__init__(self)
        self.setLayout(QtWidgets.QHBoxLayout())
        self.layout().setContentsMargins(0,0,0,0)
        self.layout().setSpacing(0)
        pkmixins.StashMixin._init(self)
        pkmixins.LayoutMixin._init(self, etree, control, parent) 
开发者ID:pkkid,项目名称:pkmeter,代码行数:9,代码来源:pkwidgets.py

示例11: paintEvent

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def paintEvent(self, event):
        QtWidgets.QFrame.paintEvent(self, event)
        return self._paint_frame(event) 
开发者ID:pkkid,项目名称:pkmeter,代码行数:5,代码来源:pkwidgets.py

示例12: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self, etree, control, parent=None):
        QtWidgets.QFrame.__init__(self)
        self.bgcolor = QtGui.QColor(255,255,255,13)     # Chart background color
        self.colors = [QtGui.QColor(255,0,0)]           # Chart line colors
        self.data = []                                  # Current plot data
        pkmixins.LayoutMixin._init(self, etree, control, parent) 
开发者ID:pkkid,项目名称:pkmeter,代码行数:8,代码来源:pkcharts.py

示例13: __init__

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def __init__(self):
        super().__init__(None, WINDOW_FLAGS)

        self.setFrameStyle(QtWidgets.QFrame.Box | QtWidgets.QFrame.Plain)
        self.setLineWidth(1)

        vbox_l2 = QtWidgets.QVBoxLayout()
        self.setLayout(vbox_l2)

        self.setMinimumHeight(MIN_HEIGHT_INT)

        self.title_qll = QtWidgets.QLabel(self.tr("Please prepare for rest"))
        vbox_l2.addWidget(self.title_qll)
        self.title_qll.setWordWrap(True)

        self.reminder_qll = QtWidgets.QLabel(self.tr("One minute left until the next rest"))
        vbox_l2.addWidget(self.reminder_qll)
        self.reminder_qll.setWordWrap(True)

        self.show()  # -done after all the widget have been added so that the right size is set
        self.raise_()
        self.showNormal()

        # Set position - done after show to get the right size hint
        screen_qrect = QtWidgets.QApplication.desktop().availableGeometry()
        xpos_int = screen_qrect.right() - self.sizeHint().width() - 30
        ypos_int = screen_qrect.top() + 30
        self.move(xpos_int, ypos_int)

        self.shown_qtimer = None
        self.start_shown_timer()

        self.setStyleSheet("background-color: #101010; color: #999999;") 
开发者ID:mindfulness-at-the-computer,项目名称:mindfulness-at-the-computer,代码行数:35,代码来源:rest_prepare.py

示例14: subtitles_base

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def subtitles_base(self):
		self.subtitles = QFrame()
		self.subtitles.setAttribute(Qt.WA_TranslucentBackground)
		self.subtitles.setWindowFlags(Qt.X11BypassWindowManagerHint)
		self.subtitles.setStyleSheet(config.style_subs)

		self.subtitles_vbox = QVBoxLayout(self.subtitles)
		self.subtitles_vbox.setSpacing(config.subs_padding_between_lines)
		self.subtitles_vbox.setContentsMargins(0, 0, 0, 0) 
开发者ID:oltodosel,项目名称:interSubs,代码行数:11,代码来源:interSubs.py

示例15: subtitles_base2

# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QFrame [as 别名]
def subtitles_base2(self):
		self.subtitles2 = QFrame()
		self.subtitles2.setAttribute(Qt.WA_TranslucentBackground)
		self.subtitles2.setWindowFlags(Qt.X11BypassWindowManagerHint)
		self.subtitles2.setStyleSheet(config.style_subs)

		self.subtitles_vbox2 = QVBoxLayout(self.subtitles2)
		self.subtitles_vbox2.setSpacing(config.subs_padding_between_lines)
		self.subtitles_vbox2.setContentsMargins(0, 0, 0, 0)

		if config.pause_during_translation_B:
			self.subtitles2.enterEvent = lambda event : [mpv_pause(), setattr(config, 'block_popup', False)][0]
			self.subtitles2.leaveEvent = lambda event : [mpv_resume(), setattr(config, 'block_popup', True)][0] if not config.avoid_resuming else [setattr(config, 'avoid_resuming', False), setattr(config, 'block_popup', True)][0] 
开发者ID:oltodosel,项目名称:interSubs,代码行数:15,代码来源:interSubs.py


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