本文整理汇总了Python中PySide.QtGui.QScrollArea方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QScrollArea方法的具体用法?Python QtGui.QScrollArea怎么用?Python QtGui.QScrollArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui
的用法示例。
在下文中一共展示了QtGui.QScrollArea方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: quickMsg
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def quickMsg(self, msg, block=1):
tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
tmpMsg.setWindowTitle("Info")
lineCnt = len(msg.split('\n'))
if lineCnt > 25:
scroll = QtWidgets.QScrollArea()
scroll.setWidgetResizable(1)
content = QtWidgets.QWidget()
scroll.setWidget(content)
layout = QtWidgets.QVBoxLayout(content)
tmpLabel = QtWidgets.QLabel(msg)
tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
layout.addWidget(tmpLabel)
tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
else:
tmpMsg.setText(msg)
if block == 0:
tmpMsg.setWindowModality( QtCore.Qt.NonModal )
tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
if block:
tmpMsg.exec_()
else:
tmpMsg.show()
示例2: quickMsg
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def quickMsg(self, msg, block=1):
tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
tmpMsg.setWindowTitle("Info")
lineCnt = len(msg.split('\n'))
if lineCnt > 25:
scroll = QtWidgets.QScrollArea()
scroll.setWidgetResizable(1)
content = QtWidgets.QWidget()
scroll.setWidget(content)
layout = QtWidgets.QVBoxLayout(content)
layout.addWidget(QtWidgets.QLabel(msg))
tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
else:
tmpMsg.setText(msg)
if block == 0:
tmpMsg.setWindowModality( QtCore.Qt.NonModal )
tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
if block:
tmpMsg.exec_()
else:
tmpMsg.show()
示例3: import_options_page
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def import_options_page(self):
if hasattr(self, '_import_options_page'):
return self._import_options_page
page = QtGui.QWizardPage()
page.setTitle("Options")
page.setSubTitle(
"Set the options for the products being imported.")
self._options = defaultdict(dict)
options_layout = QtGui.QVBoxLayout()
options_widget = QtGui.QWidget()
options_widget.setLayout(options_layout)
scroll_area = QtGui.QScrollArea()
scroll_area.setFocusPolicy(QtCore.Qt.NoFocus)
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(options_widget)
layout = QtGui.QVBoxLayout()
layout.addWidget(scroll_area)
page.setLayout(layout)
self._import_options_page = page
return self._import_options_page
# -------------------------------------------------------------------------
示例4: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def __init__(self, parent=None):
super(HoudiniDarkKnightDialog, self).__init__(parent=parent)
# ---- controls
controls_widget = self._setup_controls()
scroll_area = QtGui.QScrollArea()
scroll_area.setFocusPolicy(QtCore.Qt.NoFocus)
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(controls_widget)
self.main_layout.addWidget(scroll_area)
self.main_layout.setStretchFactor(scroll_area, 1000)
# ---- submit btn
cancel_btn = QtGui.QPushButton("Cancel")
cancel_btn.clicked.connect(self.close)
submit_btn = QtGui.QPushButton("Submit")
submit_btn.clicked.connect(self.accept)
btn_layout = QtGui.QHBoxLayout()
btn_layout.setContentsMargins(4, 4, 4, 4)
btn_layout.addStretch()
btn_layout.addWidget(cancel_btn)
btn_layout.addWidget(submit_btn)
btn_layout.addStretch()
self.main_layout.addLayout(btn_layout)
self.main_layout.setStretchFactor(btn_layout, 0)
self._version_note_edit.setFocus()
# -------------------------------------------------------------------------
示例5: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def __init__(self, parent=None):
super(NukeDarkKnightDialog, self).__init__(parent=parent)
# ---- controls
controls_widget = self._setup_controls()
scroll_area = QtGui.QScrollArea()
scroll_area.setFocusPolicy(QtCore.Qt.NoFocus)
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(controls_widget)
self.main_layout.addWidget(scroll_area)
self.main_layout.setStretchFactor(scroll_area, 1000)
# ---- submit btn
cancel_btn = QtGui.QPushButton("Cancel")
cancel_btn.clicked.connect(self.close)
submit_btn = QtGui.QPushButton("Submit")
submit_btn.clicked.connect(self.accept)
btn_layout = QtGui.QHBoxLayout()
btn_layout.setContentsMargins(4, 4, 4, 4)
btn_layout.addStretch()
btn_layout.addWidget(cancel_btn)
btn_layout.addWidget(submit_btn)
btn_layout.addStretch()
self.main_layout.addLayout(btn_layout)
self.main_layout.setStretchFactor(btn_layout, 0)
self._version_note_edit.setFocus()
# -------------------------------------------------------------------------
示例6: get_QScrollArea
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def get_QScrollArea():
"""QScrollArea getter."""
try:
import PySide.QtGui as QtGui
return QtGui.QScrollArea
except ImportError:
import PyQt5.QtWidgets as QtWidgets
return QtWidgets.QScrollArea
示例7: populateParameterEditor
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def populateParameterEditor(parameters):
"""Puts the proper controls in the script variable editor pane based on the parameters found"""
mw = FreeCADGui.getMainWindow()
# If the widget is open, we need to close it
dockWidgets = mw.findChildren(QtGui.QDockWidget)
for widget in dockWidgets:
if widget.objectName() == "cqVarsEditor":
gridLayout = QtGui.QGridLayout()
line = 1
# Add controls for all the parameters so that they can be edited from the GUI
for pKey, pVal in list(parameters.items()):
label = QtGui.QLabel(pKey)
# We want to keep track of this parameter value field so that we can pull its value later when executing
value = QtGui.QLineEdit()
value.setText(str(pVal.default_value))
value.setObjectName("pcontrol_" + pKey)
# Add the parameter control sets, one set per line
gridLayout.addWidget(label, line, 0)
gridLayout.addWidget(value, line, 1)
line += 1
# Create a widget we can put the layout in and add a scrollbar
newWidget = QtGui.QWidget()
newWidget.setLayout(gridLayout)
# Add a scroll bar in case there are a lot of variables in the script
scrollArea = QtGui.QScrollArea()
scrollArea.setBackgroundRole(QtGui.QPalette.Light)
scrollArea.setStyleSheet("QLabel { color : black; }");
scrollArea.setWidget(newWidget)
widget.setWidget(scrollArea)
示例8: quickMsg
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def quickMsg(self, msg, block=1, ask=0):
tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
tmpMsg.setWindowTitle("Info")
lineCnt = len(msg.split('\n'))
if lineCnt > 25:
scroll = QtWidgets.QScrollArea()
scroll.setWidgetResizable(1)
content = QtWidgets.QWidget()
scroll.setWidget(content)
layout = QtWidgets.QVBoxLayout(content)
tmpLabel = QtWidgets.QLabel(msg)
tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
layout.addWidget(tmpLabel)
tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
else:
tmpMsg.setText(msg)
if block == 0:
tmpMsg.setWindowModality( QtCore.Qt.NonModal )
if ask==0:
tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
else:
tmpMsg.setStandardButtons(QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel)
if block:
value = tmpMsg.exec_()
if value == QtWidgets.QMessageBox.Ok:
return 1
else:
return 0
else:
tmpMsg.show()
return 0
示例9: __init__
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def __init__(self, parent=None):
super(MayaDarkKnightDialog, self).__init__(parent=parent)
# ---- output options
output_options = self._output_options()
self.main_layout.addLayout(output_options)
self.main_layout.setStretchFactor(output_options, 0)
# ---- controls
controls_widget = self._setup_controls()
scroll_area = QtGui.QScrollArea()
scroll_area.setFocusPolicy(QtCore.Qt.NoFocus)
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(controls_widget)
self.main_layout.addWidget(scroll_area)
self.main_layout.setStretchFactor(scroll_area, 1000)
# ---- submit btn
cancel_btn = QtGui.QPushButton("Cancel")
cancel_btn.clicked.connect(self.close)
submit_btn = QtGui.QPushButton("Submit")
submit_btn.clicked.connect(self.accept)
btn_layout = QtGui.QHBoxLayout()
btn_layout.setContentsMargins(4, 4, 4, 4)
btn_layout.addStretch()
btn_layout.addWidget(cancel_btn)
btn_layout.addWidget(submit_btn)
btn_layout.addStretch()
self.main_layout.addLayout(btn_layout)
self.main_layout.setStretchFactor(btn_layout, 0)
# -------------------------------------------------------------------------
示例10: init_ui
# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QScrollArea [as 别名]
def init_ui(self):
self.layout = QtGui.QVBoxLayout()
# Container Widget
self.container = QtGui.QWidget()
# Layout of Container Widget
self.container_layout = QtGui.QVBoxLayout(self)
self.container.setLayout(self.container_layout)
screen_geom = QtGui.QDesktopWidget().availableGeometry()
# get max pixel value for each subwidget
widget_height = np.floor(screen_geom.height()-50/float(len(self.pilots)))
for p in self.pilots:
self.pilot_widgets[p] = Pilot_Ports(p)
self.pilot_widgets[p].setMaximumHeight(widget_height)
self.pilot_widgets[p].setMaximumWidth(screen_geom.width())
self.pilot_widgets[p].setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)
self.container_layout.addWidget(self.pilot_widgets[p])
# Scroll Area Properties
self.scroll = QtGui.QScrollArea()
self.scroll.setWidgetResizable(False)
self.scroll.setWidget(self.container)
self.layout.addWidget(self.scroll)
# ok/cancel buttons
buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel)
buttonBox.accepted.connect(self.accept)
buttonBox.rejected.connect(self.reject)
self.layout.addWidget(buttonBox)
self.setLayout(self.layout)
# prevent from expanding
# set max size to screen size
self.setMaximumHeight(screen_geom.height())
self.setMaximumWidth(screen_geom.width())
self.setSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Maximum)
self.scrollArea = QtGui.QScrollArea(self)
self.scrollArea.setWidgetResizable(True)