55from PySide2 .QtGui import *
66import numpy as np
77import os
8+ from eqt .ui .NoBorderScrollArea import NoBorderScrollArea
89
910
1011
@@ -66,19 +67,21 @@ def __str__(self):
6667 n = "subvol_points {}" .format (self .subvol_points )
6768 return "RunResults:\n {}\n {}" .format (a , n )
6869
69- def generateUIDockParameters (self , title ): #copied from dvc_configurator.py
70+
71+
72+ def generateUIDockParameters (self , title , scrollable = True ): #copied from dvc_configurator.py
7073 '''creates a dockable widget with a form layout group to add things to
7174
7275 basically you can add widget to the returned groupBoxFormLayout and paramsGroupBox
7376 The returned dockWidget must be added with
7477 self.addDockWidget(QtCore.Qt.RightDockWidgetArea, dockWidget)
78+ A scoll area can be added to the widget by setting the flag to True.
7579 '''
7680 dockWidget = QDockWidget (self )
7781 dockWidget .setFeatures (QDockWidget .NoDockWidgetFeatures )
7882 dockWidget .setWindowTitle (title )
7983 dockWidgetContents = QWidget ()
8084
81-
8285 # Add vertical layout to dock contents
8386 dockContentsVerticalLayout = QVBoxLayout (dockWidgetContents )
8487 dockContentsVerticalLayout .setContentsMargins (0 , 0 , 0 , 0 )
@@ -101,7 +104,12 @@ def generateUIDockParameters(self, title): #copied from dvc_configurator.py
101104 # Add elements to layout
102105 internalWidgetVerticalLayout .addWidget (paramsGroupBox )
103106 dockContentsVerticalLayout .addWidget (internalDockWidget )
104- dockWidget .setWidget (dockWidgetContents )
107+
108+ if scrollable == True :
109+ scrollArea = NoBorderScrollArea (dockWidgetContents )
110+ dockWidget .setWidget (scrollArea )
111+ else :
112+ dockWidget .setWidget (dockWidgetContents )
105113
106114 # self.graphWidgetVL.addWidget(self.graphParamsGroupBox)
107115 # self.graphDockVL.addWidget(self.dockWidget)
0 commit comments