本文整理汇总了Python中PyQt5.QtWidgets.QDockWidget.show方法的典型用法代码示例。如果您正苦于以下问题:Python QDockWidget.show方法的具体用法?Python QDockWidget.show怎么用?Python QDockWidget.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QDockWidget
的用法示例。
在下文中一共展示了QDockWidget.show方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: new_docked
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import show [as 别名]
def new_docked(self, widget, name, title, dock_area, hiden=False):
dock = QDockWidget()
dock.setWindowTitle(title)
dock.setWidget(widget)
if hiden:
dock.hide()
else:
dock.show()
self.main_window.addDockWidget(dock_area, dock)
self.modules_dock[name] = dock
return dock
示例2: MainWindow
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import show [as 别名]
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setupUi(self)
self.centralwidget.hide()
self.parser = argparse.ArgumentParser("playground")
self.parser.add_argument("-d", "--data-dir", type=str, help="data dir")
self.parser.add_argument("-a", "--console-address", type=str, help="console address", default='localhost')
self.parser.add_argument("-p", "--console-port", type=int, help="console port", default=2222)
self.args = self.parser.parse_args()
self.data_dir = self.args.data_dir
self.console_port = self.args.console_port
self.console_address = self.args.console_address
self.project = CetechProject()
self.api = QtConsoleAPI(self.console_address, self.console_port)
self.setTabPosition(Qt.AllDockWidgetAreas, QTabWidget.North)
self.script_editor_widget = ScriptEditor(project_manager=self.project, api=self.api)
self.script_editor_dock_widget = QDockWidget(self)
self.script_editor_dock_widget.setWindowTitle("Script editor")
self.script_editor_dock_widget.hide()
self.script_editor_dock_widget.setFeatures(QDockWidget.AllDockWidgetFeatures)
self.script_editor_dock_widget.setWidget(self.script_editor_widget)
self.addDockWidget(Qt.TopDockWidgetArea, self.script_editor_dock_widget)
self.log_widget = LogWidget(self.api, self.script_editor_widget)
self.log_dock_widget = QDockWidget(self)
self.log_dock_widget.hide()
self.log_dock_widget.setWindowTitle("Log")
self.log_dock_widget.setWidget(self.log_widget)
self.addDockWidget(Qt.BottomDockWidgetArea, self.log_dock_widget)
self.assetb_widget = AssetBrowser()
self.assetb_dock_widget = QDockWidget(self)
self.assetb_dock_widget.hide()
self.assetb_dock_widget.setWindowTitle("Asset browser")
self.assetb_dock_widget.setFeatures(QDockWidget.AllDockWidgetFeatures)
self.assetb_dock_widget.setWidget(self.assetb_widget)
self.addDockWidget(Qt.LeftDockWidgetArea, self.assetb_dock_widget)
self.recorded_event_widget = RecordEventWidget(api=self.api)
self.recorded_event_dock_widget = QDockWidget(self)
self.recorded_event_dock_widget.setWindowTitle("Recorded events")
self.recorded_event_dock_widget.hide()
self.recorded_event_dock_widget.setFeatures(QDockWidget.AllDockWidgetFeatures)
self.recorded_event_dock_widget.setWidget(self.recorded_event_widget)
self.addDockWidget(Qt.RightDockWidgetArea, self.recorded_event_dock_widget)
#TODO bug #114 workaround. Disable create sub engine...
if platform.system().lower() != 'darwin':
self.ogl_widget = CetechWidget(self, self.api)
self.ogl_dock = QDockWidget(self)
self.ogl_dock.hide()
self.ogl_dock.setWidget(self.ogl_widget)
self.addDockWidget(Qt.TopDockWidgetArea, self.ogl_dock)
self.tabifyDockWidget(self.assetb_dock_widget, self.log_dock_widget)
self.assetb_widget.asset_clicked.connect(self.open_asset)
self.file_watch = QFileSystemWatcher(self)
self.file_watch.fileChanged.connect(self.file_changed)
self.file_watch.directoryChanged.connect(self.dir_changed)
self.build_file_watch = QFileSystemWatcher(self)
self.build_file_watch.fileChanged.connect(self.build_file_changed)
self.build_file_watch.directoryChanged.connect(self.build_dir_changed)
def open_asset(self, path, ext):
if self.script_editor_widget.support_ext(ext):
self.script_editor_widget.open_file(path)
self.script_editor_dock_widget.show()
self.script_editor_dock_widget.focusWidget()
def open_project(self, name, dir):
self.project.open_project(name, dir)
# self.project.run_cetech(build_type=CetechProject.BUILD_DEBUG, compile=True, continu=True, daemon=True)
if platform.system().lower() == 'darwin':
wid = None
else:
wid = self.ogl_widget.winId()
self.project.run_cetech(build_type=CetechProject.BUILD_DEBUG, compile_=True, continue_=True,
wid=wid)
self.api.start(QThread.LowPriority)
self.assetb_widget.open_project(self.project.project_dir)
self.assetb_dock_widget.show()
self.log_dock_widget.show()
#.........这里部分代码省略.........
示例3: MusicPlayer
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import show [as 别名]
#.........这里部分代码省略.........
def playback_menu(self):
"""Add a playback menu to the menu bar.
The playback menu houses
"""
self.play_playback_action = QAction('Play', self)
self.play_playback_action.setShortcut('P')
self.play_playback_action.triggered.connect(self.player.play)
self.stop_playback_action = QAction('Stop', self)
self.stop_playback_action.setShortcut('S')
self.stop_playback_action.triggered.connect(self.player.stop)
self.previous_playback_action = QAction('Previous', self)
self.previous_playback_action.setShortcut('B')
self.previous_playback_action.triggered.connect(self.previous)
self.next_playback_action = QAction('Next', self)
self.next_playback_action.setShortcut('N')
self.next_playback_action.triggered.connect(self.playlist.next)
self.playback.addAction(self.play_playback_action)
self.playback.addAction(self.stop_playback_action)
self.playback.addAction(self.previous_playback_action)
self.playback.addAction(self.next_playback_action)
def view_menu(self):
"""Add a view menu to the menu bar.
The view menu houses the Playlist, Media Library, Minimalist View, and Media
Information menu items. The Playlist item toggles the playlist dock into and
out of view. The Media Library items toggles the media library dock into and
out of view. The Minimalist View item resizes the window and shows only the
menu bar and player controls. The Media Information item opens a dialog that
shows information relevant to the currently playing song.
"""
self.dock_action = self.playlist_dock.toggleViewAction()
self.dock_action.setShortcut('CTRL+ALT+P')
self.library_dock_action = self.library_dock.toggleViewAction()
self.library_dock_action.setShortcut('CTRL+ALT+L')
self.minimalist_view_action = QAction('Minimalist View', self)
self.minimalist_view_action.setShortcut('CTRL+ALT+M')
self.minimalist_view_action.setCheckable(True)
self.minimalist_view_action.triggered.connect(self.minimalist_view)
self.view_media_info_action = QAction('Media Information', self)
self.view_media_info_action.setShortcut('CTRL+SHIFT+M')
self.view_media_info_action.triggered.connect(self.media_information_dialog)
self.view.addAction(self.dock_action)
self.view.addAction(self.library_dock_action)
self.view.addSeparator()
self.view.addAction(self.minimalist_view_action)
self.view.addSeparator()
self.view.addAction(self.view_media_info_action)
def help_menu(self):
"""Add a help menu to the menu bar.
The help menu houses the about dialog that shows the user information
related to the application.
"""
self.about_action = QAction('About', self)
示例4: show
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import show [as 别名]
def show(self):
QDockWidget.show(self)
# If floating, then active this window so it will receive keyboard
# input.
if self.isFloating():
self.activateWindow()