From b9bce92bbbc2cbc3adc40c6f0ecd37db30b1d41c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 15 Feb 2016 23:20:06 +0100 Subject: [PATCH] Revert "gui: Qt wants a central widget in the main window, use explorer" This reverts commit d81ce1586939794c024447d7e28ec8628bdff0f5. --- artiq/frontend/artiq_gui.py | 10 +++++----- artiq/gui/explorer.py | 11 ++++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/artiq/frontend/artiq_gui.py b/artiq/frontend/artiq_gui.py index a7b25688e..60e5d4cb6 100755 --- a/artiq/frontend/artiq_gui.py +++ b/artiq/frontend/artiq_gui.py @@ -103,10 +103,10 @@ def main(): smgr.register(expmgr) d_shortcuts = shortcuts.ShortcutsDock(main_window, expmgr) smgr.register(d_shortcuts) - d_explorer = explorer.Explorer(status_bar, expmgr, d_shortcuts, - sub_clients["explist"], - rpc_clients["schedule"], - rpc_clients["experiment_db"]) + d_explorer = explorer.ExplorerDock(status_bar, expmgr, d_shortcuts, + sub_clients["explist"], + rpc_clients["schedule"], + rpc_clients["experiment_db"]) d_datasets = datasets.DatasetsDock(sub_clients["datasets"], rpc_clients["dataset_db"]) @@ -127,7 +127,6 @@ def main(): smgr.register(logmgr) # lay out docks - main_window.setCentralWidget(d_explorer) if os.name != "nt": main_window.addDockWidget(QtCore.Qt.RightDockWidgetArea, d_ttl_dds.dds_dock) main_window.tabifyDockWidget(d_ttl_dds.dds_dock, d_ttl_dds.ttl_dock) @@ -138,6 +137,7 @@ def main(): main_window.tabifyDockWidget(d_applets, d_datasets) main_window.tabifyDockWidget(d_datasets, d_shortcuts) main_window.addDockWidget(QtCore.Qt.BottomDockWidgetArea, d_schedule) + main_window.addDockWidget(QtCore.Qt.LeftDockWidgetArea, d_explorer) # load/initialize state smgr.load() diff --git a/artiq/gui/explorer.py b/artiq/gui/explorer.py index ae3d06118..26e51ca64 100644 --- a/artiq/gui/explorer.py +++ b/artiq/gui/explorer.py @@ -115,13 +115,18 @@ class Model(DictSyncTreeSepModel): DictSyncTreeSepModel.__init__(self, "/", ["Experiment"], init) -class Explorer(QtWidgets.QWidget): +class ExplorerDock(QtWidgets.QDockWidget): def __init__(self, status_bar, exp_manager, d_shortcuts, explist_sub, schedule_ctl, experiment_db_ctl): - QtWidgets.QWidget.__init__(self) + QtWidgets.QDockWidget.__init__(self, "Explorer") + self.setObjectName("Explorer") + self.setFeatures(QtWidgets.QDockWidget.DockWidgetMovable | + QtWidgets.QDockWidget.DockWidgetFloatable) layout = QtWidgets.QGridLayout() - self.setLayout(layout) + top_widget = QtWidgets.QWidget() + top_widget.setLayout(layout) + self.setWidget(top_widget) layout.setSpacing(5) layout.setContentsMargins(5, 5, 5, 5)