Commit 2491d9b4 authored by payno's avatar payno

[gui][larch][pre_edge] move from QFormLayout to QGridLayout

parent a7c01d11
......@@ -41,7 +41,7 @@ class _MPreEdgeParameters(qt.QWidget):
def __init__(self, parent=None):
qt.QWidget.__init__(self, parent)
self.setLayout(qt.QFormLayout())
self.setLayout(qt.QGridLayout())
# e0
self._e0SB = _OptionalQDoubleSpinBox(parent=self)
......@@ -50,19 +50,22 @@ class _MPreEdgeParameters(qt.QWidget):
self._e0SB.setMinimum(0.0)
self._e0SB.setValue(2000.0)
self._e0SB.setValue(None)
self.layout().addRow(qt.QLabel('e0', parent=self), self._e0SB)
self.layout().addWidget(qt.QLabel('e0', parent=self), 0, 0)
self.layout().addWidget(self._e0SB, 0, 1)
# step
self._stepSP = _OptionalQDoubleSpinBox(parent=self)
self._stepSP.setToolTip('edge jump. If None, it will be determined')
self._stepSP.setValue(None)
self.layout().addRow(qt.QLabel('step', parent=self), self._stepSP)
self.layout().addWidget(qt.QLabel('step', parent=self), 1, 0)
self.layout().addWidget(self._stepSP, 1, 1)
# pre1
self._pre1SB = _OptionalQDoubleSpinBox(parent=self)
self._pre1SB.setToolTip("low E range (relative to e0) for pre-edge "
"region")
self._pre1SB.setValue(None)
self._pre1SB.setContentsMargins(0, 0, 0, 0)
self.layout().addRow(qt.QLabel('pre1', parent=self), self._pre1SB)
self.layout().addWidget(qt.QLabel('pre1', parent=self), 2, 0)
self.layout().addWidget(self._pre1SB, 2, 1)
# pre2
self._pre2SB = qt.QDoubleSpinBox(parent=self)
self._pre2SB.setToolTip("high E range (relative to e0) for pre-edge "
......@@ -71,7 +74,8 @@ class _MPreEdgeParameters(qt.QWidget):
self._pre2SB.setMaximum(99999)
self._pre2SB.setValue(-50)
self._pre2SB.setContentsMargins(0, 0, 0, 0)
self.layout().addRow(qt.QLabel('pre2', parent=self), self._pre2SB)
self.layout().addWidget(qt.QLabel('pre2', parent=self), 3, 0)
self.layout().addWidget(self._pre2SB, 3, 1)
# norm1
self._norm1SB = qt.QDoubleSpinBox(parent=self)
self._norm1SB.setToolTip("low E range (relative to e0) for post-edge "
......@@ -80,19 +84,21 @@ class _MPreEdgeParameters(qt.QWidget):
self._norm1SB.setMinimum(-99999)
self._norm1SB.setMaximum(99999)
self._norm1SB.setValue(100)
self.layout().addRow(qt.QLabel('norm1', parent=self), self._norm1SB)
self.layout().addWidget(qt.QLabel('norm1', parent=self), 4, 0)
self.layout().addWidget(self._norm1SB, 4, 1)
# norm2
self._norm2SB = _OptionalQDoubleSpinBox(parent=self)
self._norm2SB.setToolTip("high E range (relative to e0) for post-edge "
"region")
self._norm2SB.setValue(None)
self._norm2SB.setContentsMargins(0, 0, 0, 0)
self.layout().addRow(qt.QLabel('norm2', parent=self), self._norm2SB)
self.layout().addWidget(qt.QLabel('norm2', parent=self), 5, 0)
self.layout().addWidget(self._norm2SB, 5, 1)
# nvict
self._nvictSB = qt.QSpinBox(parent=self)
self._nvictSB.setValue(0)
self.layout().addRow(qt.QLabel('energy exponent', parent=self),
self._nvictSB)
self.layout().addWidget(qt.QLabel('energy exponent', parent=self), 6, 0)
self.layout().addWidget(self._nvictSB, 6, 1)
# nnorm
self._nnorm =_OptionalQIntSpinBox(parent=self)
self._nnorm.setRange(0, 3)
......@@ -102,14 +108,14 @@ class _MPreEdgeParameters(qt.QWidget):
'curve. If unset nnorm will default to 2 in '
'norm2-norm1>400, to 1 if 100>norm2-norm1>300, '
'and to 0 in norm2-norm1<100.')
self.layout().addRow(qt.QLabel('polynomial degree', parent=self),
self._nnorm)
self.layout().addWidget(qt.QLabel('polynomial degree', parent=self), 7, 0)
self.layout().addWidget(self._nnorm, 7, 1)
# make_flat
self._makeFlatCB = qt.QCheckBox('', parent=self)
self._makeFlatCB.setToolTip('to calculate flattened output')
self._makeFlatCB.setChecked(True)
self.layout().addRow(qt.QLabel('make flat', parent=self),
self._makeFlatCB)
self.layout().addWidget(qt.QLabel('make flat', parent=self), 8, 0)
self.layout().addWidget(self._makeFlatCB, 8, 1)
# emin_area
self._eminAreaSB = _OptionalQDoubleSpinBox(parent=self)
self._eminAreaSB.setMinimum(0.0)
......@@ -121,8 +127,8 @@ class _MPreEdgeParameters(qt.QWidget):
' will be set to the *nominal* edge energy '
'for the element and '
'edge - 3*core_level_width')
self.layout().addRow(qt.QLabel('e min area', parent=self),
self._eminAreaSB)
self.layout().addWidget(qt.QLabel('e min area', parent=self), 9, 0)
self.layout().addWidget(self._eminAreaSB, 9, 1)
# expose API
self.getStep = self._stepSP.getValue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment