From 91241bd5c2510711e3c0c627f9e6629b9f7d5aaf Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Thu, 2 May 2024 16:01:44 +0800 Subject: [PATCH] moninj: add drag drop --- artiq/dashboard/moninj.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/artiq/dashboard/moninj.py b/artiq/dashboard/moninj.py index 70b4509bb..99a7e1164 100644 --- a/artiq/dashboard/moninj.py +++ b/artiq/dashboard/moninj.py @@ -9,7 +9,7 @@ from PyQt5 import QtCore, QtWidgets from artiq.coredevice.comm_moninj import CommMonInj, TTLOverride, TTLProbe from artiq.coredevice.ad9912_reg import AD9912_SER_CONF from artiq.gui.tools import LayoutWidget, QDockWidgetCloseDetect, DoubleClickLineEdit -from artiq.gui.flowlayout import FlowLayout +from artiq.gui.dndwidgets import VDragScrollArea, DragDropFlowLayoutWidget from artiq.gui.models import DictSyncTreeSepModel @@ -830,13 +830,11 @@ class _MonInjDock(QDockWidgetCloseDetect): self.label = DoubleClickLineEdit(name) grid.addWidget(self.label, 0, 2) - scroll_area = QtWidgets.QScrollArea() + scroll_area = VDragScrollArea(self) grid.addWidget(scroll_area, 1, 0, 1, 10) - self.flow = FlowLayout() - grid_widget = QtWidgets.QWidget() - grid_widget.setLayout(self.flow) + self.flow = DragDropFlowLayoutWidget() scroll_area.setWidgetResizable(True) - scroll_area.setWidget(grid_widget) + scroll_area.setWidget(self.flow) def add_channels(self): channels = self.channel_dialog.channels