本文整理汇总了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)
示例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()
示例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
示例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
示例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()
示例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()
示例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
示例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 = ""
示例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)
示例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)
示例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)
示例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)
示例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;")
示例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)
示例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]