本文整理汇总了Python中PySide2.QtWidgets.QDockWidget方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QDockWidget方法的具体用法?Python QtWidgets.QDockWidget怎么用?Python QtWidgets.QDockWidget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide2.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QDockWidget方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createDocks
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 别名]
def createDocks(self):
self.parent.messagedock = QtWidgets.QDockWidget(self.parent)
self.parent.messagedock. \
setFeatures(QtWidgets.QDockWidget.DockWidgetMovable |
QtWidgets.QDockWidget.DockWidgetFloatable)
self.parent.messagedock.setWindowTitle('Messages')
self.parent.messagedock.setMinimumSize(100, 50)
# connect messagedock to slot
self.parent.messagedock.topLevelChanged.connect(
self.parent.slots.onLevelChanged)
self.parent.messages = QtWidgets.QTextEdit(self.parent)
self.parent.messages. \
setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse |
QtCore.Qt.TextSelectableByKeyboard)
# connect messages to scrollhandler
self.parent.messages.textChanged.connect(
self.parent.slots.onTextChanged)
self.parent.messagedock.setWidget(self.parent.messages)
place = QtCore.Qt.BottomDockWidgetArea
self.parent.addDockWidget(
QtCore.Qt.DockWidgetArea(place), self.parent.messagedock)
示例2: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 别名]
def _init_widgets(self):
window = QMainWindow()
window.setWindowFlags(Qt.Widget)
# pseudo code text box
self._textedit = QCCodeEdit(self)
self._textedit.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
self._textedit.setLineWrapMode(QCCodeEdit.NoWrap)
textedit_dock = QDockWidget('Code', self._textedit)
window.setCentralWidget(textedit_dock)
textedit_dock.setWidget(self._textedit)
# decompilation
self._options = QDecompilationOptions(self, self.workspace.instance, options=None)
options_dock = QDockWidget('Decompilation Options', self._options)
window.addDockWidget(Qt.RightDockWidgetArea, options_dock)
options_dock.setWidget(self._options)
layout = QHBoxLayout()
layout.addWidget(window)
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
示例3: test_load_ui_dockwidget
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 别名]
def test_load_ui_dockwidget():
"""Tests to see if the baseinstance loading loads a QDockWidget properly"""
import sys
from Qt import QtWidgets, QtCompat
app = QtWidgets.QApplication(sys.argv)
win = QtWidgets.QDockWidget()
QtCompat.loadUi(self.ui_qdockwidget, win)
assert hasattr(win, 'lineEdit'), \
"loadUi could not load instance to main window"
app.exit()
示例4: test_load_ui_existingLayoutOnDockWidget
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 别名]
def test_load_ui_existingLayoutOnDockWidget():
"""Tests to see if loading a ui onto a layout in a DockWidget works"""
import sys
from Qt import QtWidgets, QtCompat
msgs = 'QLayout: Attempting to add QLayout "" to QDockWidget ' \
'"", which already has a layout'
with ignoreQtMessageHandler([msgs]):
app = QtWidgets.QApplication(sys.argv)
win = QtWidgets.QDockWidget()
QtWidgets.QComboBox(win)
QtWidgets.QHBoxLayout(win)
QtCompat.loadUi(self.ui_qdockwidget, win)
app.exit()
示例5: _init_widgets
# 需要导入模块: from PySide2 import QtWidgets [as 别名]
# 或者: from PySide2.QtWidgets import QDockWidget [as 别名]
def _init_widgets(self):
main = QMainWindow()
main.setWindowFlags(Qt.Widget)
# main.setCorner(Qt.TopLeftCorner, Qt.TopDockWidgetArea)
# main.setCorner(Qt.TopRightCorner, Qt.RightDockWidgetArea)
pathtree = QPathTree(self.current_simgr, self.current_state, self, self.workspace, parent=main)
pathtree_dock = QDockWidget('PathTree', pathtree)
main.setCentralWidget(pathtree_dock)
# main.addDockWidget(Qt.BottomDockWidgetArea, pathtree_dock)
pathtree_dock.setWidget(pathtree)
simgrs = QSimulationManagers(self.workspace.instance, self.current_simgr, self.current_state, parent=main)
simgrs_dock = QDockWidget('SimulationManagers', simgrs)
main.addDockWidget(Qt.RightDockWidgetArea, simgrs_dock)
simgrs_dock.setWidget(simgrs)
state_viewer = StateInspector(self.workspace, self.current_state, parent=self)
state_viewer_dock = QDockWidget('Selected State', state_viewer)
main.addDockWidget(Qt.RightDockWidgetArea, state_viewer_dock)
state_viewer_dock.setWidget(state_viewer)
self._pathtree = pathtree
self._simgrs = simgrs
self._state_viewer = state_viewer
main_layout = QHBoxLayout()
main_layout.addWidget(main)
main_layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(main_layout)
#
# Private methods
#