From: Carlos P. <cpa...@ce...> - 2016-01-20 10:00:05
|
Hi, your patch fixes the problem, but it adds many unnecessary spacers. I will send (right now) an alternative patch based on the same idea as yours but which is much less "aggressive". It works for me, but I would prefer someonelse to try and integrate it. On Tue 12 January 2016 16:24:40 cfalcon wrote: > TaurusForm layout missalignment when using TaurusValue with an extra > widget. The error comes because there are rows with differents > columns. > > A workaround to fix the problem is create the empty placeholders > during the creation of the taurusvalue. > --- > lib/taurus/qt/qtgui/panel/taurusvalue.py | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/lib/taurus/qt/qtgui/panel/taurusvalue.py > b/lib/taurus/qt/qtgui/panel/taurusvalue.py index 543ba0e..c69b07a > 100644 > --- a/lib/taurus/qt/qtgui/panel/taurusvalue.py > +++ b/lib/taurus/qt/qtgui/panel/taurusvalue.py > @@ -350,7 +350,14 @@ class TaurusValue(Qt.QWidget, TaurusBaseWidget): > > #insert self into the 0-column > pl.addWidget(self, self._row, 0) #this widget is invisible > (except in design mode) - > + > + #Add QSpacerItem as placeholder for the subwidgets > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 1) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 2) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 3) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 4) > + pl.addItem(Qt.QSpacerItem(1, 0), self._row, 5) > + > #Create/update the subwidgets (this also inserts them in the > layout) if not self._designMode: #in design mode, no subwidgets are > created self.updateLabelWidget() -- +----------------------------------------------------+ Carlos Pascual Izarra Scientific Software Coordinator Computing Division ALBA Synchrotron [http://www.albasynchrotron.es] Carrer de la Llum 2-26 E-08290 Cerdanyola del Valles (Barcelona), Spain E-mail: cpa...@ce... Phone: +34 93 592 4428 +----------------------------------------------------+ |