本文整理汇总了Python中PyQt5.QtCore.Qt.BottomDockWidgetArea方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.BottomDockWidgetArea方法的具体用法?Python Qt.BottomDockWidgetArea怎么用?Python Qt.BottomDockWidgetArea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.BottomDockWidgetArea方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_repl
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def add_repl(self, repl_pane, name):
"""
Adds the referenced REPL pane to the application.
"""
self.repl_pane = repl_pane
self.repl = QDockWidget(_("{} REPL").format(name))
self.repl.setWidget(repl_pane)
self.repl.setFeatures(QDockWidget.DockWidgetMovable)
self.repl.setAllowedAreas(
Qt.BottomDockWidgetArea
| Qt.LeftDockWidgetArea
| Qt.RightDockWidgetArea
)
self.addDockWidget(Qt.BottomDockWidgetArea, self.repl)
self.connect_zoom(self.repl_pane)
self.repl_pane.set_theme(self.theme)
self.repl_pane.setFocus()
示例2: add_plotter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def add_plotter(self, plotter_pane, name):
"""
Adds the referenced plotter pane to the application.
"""
self.plotter_pane = plotter_pane
self.plotter = QDockWidget(_("{} Plotter").format(name))
self.plotter.setWidget(plotter_pane)
self.plotter.setFeatures(QDockWidget.DockWidgetMovable)
self.plotter.setAllowedAreas(
Qt.BottomDockWidgetArea
| Qt.LeftDockWidgetArea
| Qt.RightDockWidgetArea
)
self.addDockWidget(Qt.BottomDockWidgetArea, self.plotter)
self.plotter_pane.set_theme(self.theme)
self.plotter_pane.setFocus()
示例3: add_debug_inspector
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def add_debug_inspector(self):
"""
Display a debug inspector to view the call stack.
"""
self.debug_inspector = DebugInspector()
self.debug_model = QStandardItemModel()
self.debug_inspector.setModel(self.debug_model)
self.inspector = QDockWidget(_("Debug Inspector"))
self.inspector.setWidget(self.debug_inspector)
self.inspector.setFeatures(QDockWidget.DockWidgetMovable)
self.inspector.setAllowedAreas(
Qt.BottomDockWidgetArea
| Qt.LeftDockWidgetArea
| Qt.RightDockWidgetArea
)
self.addDockWidget(Qt.RightDockWidgetArea, self.inspector)
self.connect_zoom(self.debug_inspector)
示例4: test_Window_add_repl
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def test_Window_add_repl(qtapp):
"""
Ensure the expected settings are updated.
"""
w = mu.interface.main.Window()
w.theme = mock.MagicMock()
w.connect_zoom = mock.MagicMock(return_value=None)
w.addDockWidget = mock.MagicMock()
mock_repl_pane = mock.MagicMock()
mock_repl_pane.setFocus = mock.MagicMock(return_value=None)
mock_dock = mock.MagicMock()
mock_dock_class = mock.MagicMock(return_value=mock_dock)
with mock.patch("mu.interface.main.QDockWidget", mock_dock_class):
w.add_repl(mock_repl_pane, "Test REPL")
assert w.repl_pane == mock_repl_pane
mock_repl_pane.setFocus.assert_called_once_with()
w.connect_zoom.assert_called_once_with(mock_repl_pane)
w.addDockWidget.assert_called_once_with(Qt.BottomDockWidgetArea, mock_dock)
示例5: test_Window_add_python3_runner
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def test_Window_add_python3_runner(qtapp):
"""
Ensure a Python 3 runner (to capture stdin/out/err) is displayed correctly.
"""
w = mu.interface.main.Window()
w.theme = mock.MagicMock()
w.connect_zoom = mock.MagicMock(return_value=None)
w.addDockWidget = mock.MagicMock()
mock_process_runner = mock.MagicMock()
mock_process_class = mock.MagicMock(return_value=mock_process_runner)
mock_dock = mock.MagicMock()
mock_dock_class = mock.MagicMock(return_value=mock_dock)
name = "foo"
path = "bar"
with mock.patch(
"mu.interface.main.PythonProcessPane", mock_process_class
), mock.patch("mu.interface.main.QDockWidget", mock_dock_class):
result = w.add_python3_runner(name, path)
assert result == mock_process_runner
assert w.process_runner == mock_process_runner
assert w.runner == mock_dock
w.runner.setWidget.assert_called_once_with(w.process_runner)
w.addDockWidget.assert_called_once_with(Qt.BottomDockWidgetArea, mock_dock)
示例6: add_filesystem
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def add_filesystem(self, home, file_manager, board_name="board"):
"""
Adds the file system pane to the application.
"""
self.fs_pane = FileSystemPane(home)
@self.fs_pane.open_file.connect
def on_open_file(file):
# Bubble the signal up
self.open_file.emit(file)
self.fs = QDockWidget(_("Filesystem on ") + board_name)
self.fs.setWidget(self.fs_pane)
self.fs.setFeatures(QDockWidget.DockWidgetMovable)
self.fs.setAllowedAreas(Qt.BottomDockWidgetArea)
self.addDockWidget(Qt.BottomDockWidgetArea, self.fs)
self.fs_pane.setFocus()
file_manager.on_list_files.connect(self.fs_pane.on_ls)
self.fs_pane.list_files.connect(file_manager.ls)
self.fs_pane.microbit_fs.put.connect(file_manager.put)
self.fs_pane.microbit_fs.delete.connect(file_manager.delete)
self.fs_pane.microbit_fs.list_files.connect(file_manager.ls)
self.fs_pane.local_fs.get.connect(file_manager.get)
self.fs_pane.local_fs.list_files.connect(file_manager.ls)
file_manager.on_put_file.connect(self.fs_pane.microbit_fs.on_put)
file_manager.on_delete_file.connect(self.fs_pane.microbit_fs.on_delete)
file_manager.on_get_file.connect(self.fs_pane.local_fs.on_get)
file_manager.on_list_fail.connect(self.fs_pane.on_ls_fail)
file_manager.on_put_fail.connect(self.fs_pane.on_put_fail)
file_manager.on_delete_fail.connect(self.fs_pane.on_delete_fail)
file_manager.on_get_fail.connect(self.fs_pane.on_get_fail)
self.connect_zoom(self.fs_pane)
return self.fs_pane
示例7: openConsole
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import BottomDockWidgetArea [as 别名]
def openConsole(self):
if self.device:
console_widget = ConsoleWidget(self.device)
self.mqtt.messageSignal.connect(console_widget.consoleAppend)
console_widget.sendCommand.connect(self.mqtt.publish)
self.addDockWidget(Qt.BottomDockWidgetArea, console_widget)
console_widget.command.setFocus()
self.consoles.append(console_widget)