本文整理汇总了Python中PyQt5.QtWidgets.QSplitter方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QSplitter方法的具体用法?Python QtWidgets.QSplitter怎么用?Python QtWidgets.QSplitter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QSplitter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_splitter_stylesheet
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def set_splitter_stylesheet(splitter: QSplitter):
splitter.setHandleWidth(4)
bgcolor = settings.BGCOLOR.lighter(150)
r, g, b, a = bgcolor.red(), bgcolor.green(), bgcolor.blue(), bgcolor.alpha()
splitter.setStyleSheet("QSplitter::handle:vertical {{margin: 4px 0px; "
"background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, "
"stop:0.2 rgba(255, 255, 255, 0),"
"stop:0.5 rgba({0}, {1}, {2}, {3}),"
"stop:0.8 rgba(255, 255, 255, 0));"
"image: url(:/icons/icons/splitter_handle_horizontal.svg);}}"
"QSplitter::handle:horizontal {{margin: 4px 0px; "
"background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, "
"stop:0.2 rgba(255, 255, 255, 0),"
"stop:0.5 rgba({0}, {1}, {2}, {3}),"
"stop:0.8 rgba(255, 255, 255, 0));"
"image: url(:/icons/icons/splitter_handle_vertical.svg);}}".format(r, g, b, a))
示例2: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def setupUi(self, Master):
Master.setObjectName("Master")
Master.resize(718, 477)
self.verticalLayout = QtWidgets.QVBoxLayout(Master)
self.verticalLayout.setObjectName("verticalLayout")
self.splitter = QtWidgets.QSplitter(Master)
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName("splitter")
self.tab_widget = QtWidgets.QTabWidget(self.splitter)
self.tab_widget.setObjectName("tab_widget")
self.docker = QtWidgets.QDockWidget(self.splitter)
self.docker.setObjectName("docker")
self.docker.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea)
self.log_widget = QtWidgets.QTreeWidget(self.docker)
self.log_widget.setHeaderItem(QtWidgets.QTreeWidgetItem(["date", "origin", "type", "message"]))
self.docker.setWidget(self.log_widget)
self.verticalLayout.addWidget(self.splitter)
self.tab_widget.setCurrentIndex(-1)
QtCore.QMetaObject.connectSlotsByName(Master)
Master.setWindowTitle("IDASec")
示例3: buttonsLayout
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [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: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def __init__(self, app, parent=None):
super().__init__(parent=parent)
self._app = app
self._splitter = QSplitter(self)
self.collection_toc = CollectionTOCView(self._app, self._splitter)
self.collection_body = CollectionBody(self._app, self._splitter)
self.collection_toc.show_album_needed.connect(
lambda album: aio.create_task(self.show_album(album)))
self.collection_toc.play_song_needed.connect(
self._app.player.play_song)
self.collection_body.song_list_view.play_song_needed.connect(
self._app.player.play_song)
self._layout = QHBoxLayout(self)
self._setup_ui()
示例5: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def setupUi(self, Form):
Form.setObjectName("QRangeSlider")
Form.resize(300, 30)
Form.setStyleSheet(DEFAULT_CSS)
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setContentsMargins(0, 0, 0, 0)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName("gridLayout")
self._splitter = QtWidgets.QSplitter(Form)
self._splitter.setMinimumSize(QtCore.QSize(0, 0))
self._splitter.setMaximumSize(QtCore.QSize(16777215, 16777215))
self._splitter.setOrientation(QtCore.Qt.Horizontal)
self._splitter.setObjectName("splitter")
self._head = QtWidgets.QGroupBox(self._splitter)
self._head.setTitle("")
self._head.setObjectName("Head")
self._handle = QtWidgets.QGroupBox(self._splitter)
self._handle.setTitle("")
self._handle.setObjectName("Span")
self._tail = QtWidgets.QGroupBox(self._splitter)
self._tail.setTitle("")
self._tail.setObjectName("Tail")
self.gridLayout.addWidget(self._splitter, 0, 0, 1, 1)
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例6: populate_main_form
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def populate_main_form(self):
list_view = QtWidgets.QListView()
list_view.setFixedWidth(115)
list_view.setModel(self.views_model)
select = QtCore.QItemSelectionModel.Select
list_view.selectionModel().select(self.views_model.createIndex(0, 0), select)
list_view.clicked.connect(self.view_clicked)
current_view = QtWidgets.QWidget()
view = self.view_about()
if not view:
view = QtWidgets.QBoxLayout()
current_view.setLayout(view)
self.splitter = QtWidgets.QSplitter(Qt.Horizontal)
self.splitter.addWidget(list_view)
self.splitter.addWidget(current_view)
self.splitter.setChildrenCollapsible(False)
self.splitter.show()
outer_layout = QtWidgets.QHBoxLayout()
outer_layout.addWidget(self.splitter)
self.parent.setLayout(outer_layout)
示例7: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def setupUi(self, IDAngrSavedsDialog):
IDAngrSavedsDialog.setObjectName("IDAngrSavedsDialog")
IDAngrSavedsDialog.resize(941, 569)
self.gridLayout = QtWidgets.QGridLayout(IDAngrSavedsDialog)
self.gridLayout.setObjectName("gridLayout")
self.splitter = QtWidgets.QSplitter(IDAngrSavedsDialog)
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.splitter.setObjectName("splitter")
self.selectorList = QtWidgets.QListView(self.splitter)
self.selectorList.setMaximumSize(QtCore.QSize(270, 16777215))
self.selectorList.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.selectorList.setObjectName("selectorList")
self.codeView = QtWidgets.QPlainTextEdit(self.splitter)
self.codeView.setReadOnly(True)
self.codeView.setObjectName("codeView")
self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrSavedsDialog)
self.buttonBox.setMaximumSize(QtCore.QSize(16777215, 48))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
self.retranslateUi(IDAngrSavedsDialog)
self.buttonBox.accepted.connect(IDAngrSavedsDialog.accept)
self.buttonBox.rejected.connect(IDAngrSavedsDialog.reject)
QtCore.QMetaObject.connectSlotsByName(IDAngrSavedsDialog)
示例8: restore_splitter_sizes
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def restore_splitter_sizes(window: QDialog, splitter: QSplitter):
global cache
if cache:
symbol = window.__class__.__name__ + '_' + splitter.objectName()
sizes = cache.get_value(symbol, None, list)
if not isinstance(sizes, list) or len(sizes) != 2:
sizes = [100, 100]
if splitter.parent():
if splitter.orientation() == Qt.Vertical:
sizes[0], sizes[1] = round(splitter.parent().height() / 2), round(splitter.parent().height() / 2)
else:
sizes[0], sizes[1] = round(splitter.parent().width() / 2), round(splitter.parent().width() / 2)
splitter.setSizes(sizes)
示例9: save_splitter_sizes
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def save_splitter_sizes(window: QDialog, splitter: QSplitter):
global cache
if cache:
symbol = window.__class__.__name__ + '_' + splitter.objectName()
cache.set_value(symbol, splitter.sizes())
示例10: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def setupUi(self, Form):
Form.setObjectName("QRangeSlider")
Form.resize(300, 30)
Form.setStyleSheet(DEFAULT_CSS)
self.gridLayout = QtWidgets.QGridLayout(Form)
# self.gridLayout.setMargin(0)
self.gridLayout.setSpacing(0)
self.gridLayout.setObjectName("gridLayout")
self._splitter = QtWidgets.QSplitter(Form)
self._splitter.setMinimumSize(QtCore.QSize(0, 0))
self._splitter.setMaximumSize(QtCore.QSize(16777215, 16777215))
self._splitter.setOrientation(QtCore.Qt.Horizontal)
self._splitter.setObjectName("splitter")
self._head = QtWidgets.QGroupBox(self._splitter)
self._head.setTitle("")
self._head.setObjectName("Head")
self._handle = QtWidgets.QGroupBox(self._splitter)
self._handle.setTitle("")
self._handle.setObjectName("Span")
self._tail = QtWidgets.QGroupBox(self._splitter)
self._tail.setTitle("")
self._tail.setObjectName("Tail")
self.gridLayout.addWidget(self._splitter, 0, 0, 1, 1)
# self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
示例11: get_QSplitter
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def get_QSplitter():
"""QSplitter getter."""
try:
import PySide.QtGui as QtGui
return QtGui.QSplitter
except ImportError:
import PyQt5.QtWidgets as QtWidgets
return QtWidgets.QSplitter
示例12: splitter
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def splitter(items,
stretch_factors = None,
orientation=QtCore.Qt.Horizontal):
sp = QtWidgets.QSplitter(orientation)
for item in items: sp.addWidget(item)
if stretch_factors:
for i,s in enumerate(stretch_factors):
sp.setStretchFactor(i,s)
return sp
示例13: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def setupUi(self, failed_downloads_dialog):
failed_downloads_dialog.setObjectName("failed_downloads_dialog")
failed_downloads_dialog.resize(998, 512)
font = QtGui.QFont()
font.setPointSize(10)
failed_downloads_dialog.setFont(font)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("Resources/Images/failed_download.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
failed_downloads_dialog.setWindowIcon(icon)
self.gridLayout = QtWidgets.QGridLayout(failed_downloads_dialog)
self.gridLayout.setObjectName("gridLayout")
self.auto_display_checkbox = QtWidgets.QCheckBox(failed_downloads_dialog)
self.auto_display_checkbox.setObjectName("auto_display_checkbox")
self.gridLayout.addWidget(self.auto_display_checkbox, 1, 0, 1, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(failed_downloads_dialog)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
self.splitter = QtWidgets.QSplitter(failed_downloads_dialog)
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setObjectName("splitter")
self.table_view = QtWidgets.QTableView(self.splitter)
self.table_view.setObjectName("table_view")
self.detail_table = QtWidgets.QTableView(self.splitter)
self.detail_table.setObjectName("detail_table")
self.gridLayout.addWidget(self.splitter, 0, 0, 1, 2)
self.retranslateUi(failed_downloads_dialog)
QtCore.QMetaObject.connectSlotsByName(failed_downloads_dialog)
示例14: quickSplitUI
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def quickSplitUI(self, name, part_list, type):
split_type = QtCore.Qt.Horizontal
if type == 'v':
split_type = QtCore.Qt.Vertical
self.uiList[name]=QtWidgets.QSplitter(split_type)
for each_part in part_list:
if isinstance(each_part, QtWidgets.QWidget):
self.uiList[name].addWidget(each_part)
else:
tmp_holder = QtWidgets.QWidget()
tmp_holder.setLayout(each_part)
self.uiList[name].addWidget(tmp_holder)
return self.uiList[name]
示例15: qui
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QSplitter [as 别名]
def qui(self, ui_list_string, parentObject_string='', opt=''):
# pre-defined user short name syntax
type_dict = {
'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit',
'tree': 'QTreeWidget', 'table': 'QTableWidget',
'space': 'QSpacerItem',
}
# get ui_list, creation or existing ui object
ui_list = [x.strip() for x in ui_list_string.split('|')]
for i in range(len(ui_list)):
if ui_list[i] in self.uiList:
# - exisiting object
ui_list[i] = self.uiList[ui_list[i]]
else:
# - string creation:
# get part info
partInfo = ui_list[i].split(';',1)
uiName = partInfo[0].split('@')[0]
uiType = uiName.rsplit('_',1)[-1]
if uiType in type_dict:
uiType = type_dict[uiType]
# set quickUI string format
ui_list[i] = partInfo[0]+';'+uiType
if len(partInfo)==1:
# give empty button and label a place holder name
if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName
elif len(partInfo)==2:
ui_list[i]=ui_list[i]+";"+partInfo[1]
# get parentObject or exisiting object
parentObject = parentObject_string
if parentObject in self.uiList:
parentObject = self.uiList[parentObject]
# process quickUI
self.quickUI(ui_list, parentObject, opt)