peakboxes with custom spinbox

This commit is contained in:
Markus Rosenstihl 2014-03-18 20:37:32 +01:00
parent dfa12bfc3c
commit 856619fea5
8 changed files with 155 additions and 534 deletions

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ConductivityGroupBox.ui' # Form implementation generated from reading ui file 'ConductivityGroupBox.ui'
# #
# Created: Sat Mar 15 21:26:00 2014 # Created: Tue Mar 18 20:24:14 2014
# by: PyQt4 UI code generator 4.10.3 # by: PyQt4 UI code generator 4.10.3
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!

View File

@ -1,5 +1,10 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'markusro' __author__ = 'markusro'
from PyQt4 import QtGui
from PyQt4.QtGui import * from PyQt4.QtGui import *
from PyQt4.QtCore import QRegExp from PyQt4.QtCore import QRegExp
import PeakWidget import PeakWidget

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'PeakGroupBox.ui' # Form implementation generated from reading ui file 'PeakGroupBox.ui'
# #
# Created: Sat Mar 15 21:26:00 2014 # Created: Tue Mar 18 20:24:14 2014
# by: PyQt4 UI code generator 4.10.3 # by: PyQt4 UI code generator 4.10.3
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!
@ -45,32 +45,27 @@ class Ui_PeakGroupBox(object):
self.gridLayout.setSpacing(5) self.gridLayout.setSpacing(5)
self.gridLayout.setContentsMargins(0, 0, -1, -1) self.gridLayout.setContentsMargins(0, 0, -1, -1)
self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.label = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 0, 3, 1, 1)
self.checkBox_1 = QtGui.QCheckBox(PeakGroupBox)
self.checkBox_1.setLayoutDirection(QtCore.Qt.LeftToRight)
self.checkBox_1.setText(_fromUtf8(""))
self.checkBox_1.setObjectName(_fromUtf8("checkBox_1"))
self.gridLayout.addWidget(self.checkBox_1, 1, 3, 1, 1)
self.checkBox_3 = QtGui.QCheckBox(PeakGroupBox)
self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
self.gridLayout.addWidget(self.checkBox_3, 3, 3, 1, 1)
self.checkBox_2 = QtGui.QCheckBox(PeakGroupBox) self.checkBox_2 = QtGui.QCheckBox(PeakGroupBox)
self.checkBox_2.setText(_fromUtf8("")) self.checkBox_2.setText(_fromUtf8(""))
self.checkBox_2.setObjectName(_fromUtf8("checkBox_2")) self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
self.gridLayout.addWidget(self.checkBox_2, 2, 4, 1, 1) self.gridLayout.addWidget(self.checkBox_2, 2, 3, 1, 1)
self.lineEdit_3 = QtGui.QLineEdit(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lineEdit_3.sizePolicy().hasHeightForWidth())
self.lineEdit_3.setSizePolicy(sizePolicy)
self.lineEdit_3.setMinimumSize(QtCore.QSize(96, 0))
self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
self.gridLayout.addWidget(self.lineEdit_3, 3, 1, 1, 1)
self.checkBox_3 = QtGui.QCheckBox(PeakGroupBox)
self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
self.gridLayout.addWidget(self.checkBox_3, 3, 4, 1, 1)
self.pushButton_7 = QtGui.QPushButton(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_7.sizePolicy().hasHeightForWidth())
self.pushButton_7.setSizePolicy(sizePolicy)
self.pushButton_7.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_7.setAutoRepeat(True)
self.pushButton_7.setObjectName(_fromUtf8("pushButton_7"))
self.gridLayout.addWidget(self.pushButton_7, 4, 2, 1, 1)
self.label_2 = QtGui.QLabel(PeakGroupBox) self.label_2 = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -80,59 +75,18 @@ class Ui_PeakGroupBox(object):
self.label_2.setAlignment(QtCore.Qt.AlignCenter) self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1) self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
self.lineEdit_4 = QtGui.QLineEdit(PeakGroupBox) self.checkBox_4 = QtGui.QCheckBox(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) self.checkBox_4.setObjectName(_fromUtf8("checkBox_4"))
sizePolicy.setHorizontalStretch(0) self.gridLayout.addWidget(self.checkBox_4, 5, 3, 1, 1)
sizePolicy.setVerticalStretch(0) self.label_5 = QtGui.QLabel(PeakGroupBox)
sizePolicy.setHeightForWidth(self.lineEdit_4.sizePolicy().hasHeightForWidth()) self.label_5.setObjectName(_fromUtf8("label_5"))
self.lineEdit_4.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.label_5, 1, 2, 1, 1)
self.lineEdit_4.setMinimumSize(QtCore.QSize(96, 0)) self.label_7 = QtGui.QLabel(PeakGroupBox)
self.lineEdit_4.setObjectName(_fromUtf8("lineEdit_4")) self.label_7.setObjectName(_fromUtf8("label_7"))
self.gridLayout.addWidget(self.lineEdit_4, 4, 1, 1, 1) self.gridLayout.addWidget(self.label_7, 3, 2, 1, 1)
self.pushButton_1 = QtGui.QPushButton(PeakGroupBox) self.label_6 = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) self.label_6.setObjectName(_fromUtf8("label_6"))
sizePolicy.setHorizontalStretch(0) self.gridLayout.addWidget(self.label_6, 2, 2, 1, 1)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_1.sizePolicy().hasHeightForWidth())
self.pushButton_1.setSizePolicy(sizePolicy)
self.pushButton_1.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_1.setBaseSize(QtCore.QSize(0, 0))
self.pushButton_1.setAutoRepeat(True)
self.pushButton_1.setAutoDefault(False)
self.pushButton_1.setDefault(False)
self.pushButton_1.setFlat(False)
self.pushButton_1.setObjectName(_fromUtf8("pushButton_1"))
self.gridLayout.addWidget(self.pushButton_1, 1, 2, 1, 1)
self.pushButton_6 = QtGui.QPushButton(PeakGroupBox)
self.pushButton_6.setEnabled(True)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_6.sizePolicy().hasHeightForWidth())
self.pushButton_6.setSizePolicy(sizePolicy)
self.pushButton_6.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_6.setAutoRepeat(True)
self.pushButton_6.setObjectName(_fromUtf8("pushButton_6"))
self.gridLayout.addWidget(self.pushButton_6, 3, 3, 1, 1)
self.label = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
self.label.setSizePolicy(sizePolicy)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 0, 4, 1, 1)
self.pushButton_5 = QtGui.QPushButton(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth())
self.pushButton_5.setSizePolicy(sizePolicy)
self.pushButton_5.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_5.setAutoRepeat(True)
self.pushButton_5.setObjectName(_fromUtf8("pushButton_5"))
self.gridLayout.addWidget(self.pushButton_5, 3, 2, 1, 1)
self.removeButton = QtGui.QPushButton(PeakGroupBox) self.removeButton = QtGui.QPushButton(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -142,37 +96,6 @@ class Ui_PeakGroupBox(object):
self.removeButton.setMinimumSize(QtCore.QSize(124, 0)) self.removeButton.setMinimumSize(QtCore.QSize(124, 0))
self.removeButton.setObjectName(_fromUtf8("removeButton")) self.removeButton.setObjectName(_fromUtf8("removeButton"))
self.gridLayout.addWidget(self.removeButton, 0, 1, 1, 1) self.gridLayout.addWidget(self.removeButton, 0, 1, 1, 1)
self.pushButton_8 = QtGui.QPushButton(PeakGroupBox)
self.pushButton_8.setEnabled(True)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_8.sizePolicy().hasHeightForWidth())
self.pushButton_8.setSizePolicy(sizePolicy)
self.pushButton_8.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_8.setAutoRepeat(True)
self.pushButton_8.setObjectName(_fromUtf8("pushButton_8"))
self.gridLayout.addWidget(self.pushButton_8, 4, 3, 1, 1)
self.label_3 = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
self.pushButton_4 = QtGui.QPushButton(PeakGroupBox)
self.pushButton_4.setEnabled(True)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_4.sizePolicy().hasHeightForWidth())
self.pushButton_4.setSizePolicy(sizePolicy)
self.pushButton_4.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_4.setAutoRepeat(True)
self.pushButton_4.setObjectName(_fromUtf8("pushButton_4"))
self.gridLayout.addWidget(self.pushButton_4, 2, 3, 1, 1)
self.label_1 = QtGui.QLabel(PeakGroupBox) self.label_1 = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -182,40 +105,18 @@ class Ui_PeakGroupBox(object):
self.label_1.setAlignment(QtCore.Qt.AlignCenter) self.label_1.setAlignment(QtCore.Qt.AlignCenter)
self.label_1.setObjectName(_fromUtf8("label_1")) self.label_1.setObjectName(_fromUtf8("label_1"))
self.gridLayout.addWidget(self.label_1, 1, 0, 1, 1) self.gridLayout.addWidget(self.label_1, 1, 0, 1, 1)
self.lineEdit_2 = QtGui.QLineEdit(PeakGroupBox) self.label_3 = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lineEdit_2.sizePolicy().hasHeightForWidth())
self.lineEdit_2.setSizePolicy(sizePolicy)
self.lineEdit_2.setMinimumSize(QtCore.QSize(96, 0))
self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
self.gridLayout.addWidget(self.lineEdit_2, 2, 1, 1, 1)
self.checkBox_1 = QtGui.QCheckBox(PeakGroupBox)
self.checkBox_1.setLayoutDirection(QtCore.Qt.LeftToRight)
self.checkBox_1.setText(_fromUtf8(""))
self.checkBox_1.setObjectName(_fromUtf8("checkBox_1"))
self.gridLayout.addWidget(self.checkBox_1, 1, 4, 1, 1)
self.lineEdit_1 = QtGui.QLineEdit(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0) sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.lineEdit_1.sizePolicy().hasHeightForWidth()) sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.lineEdit_1.setSizePolicy(sizePolicy) self.label_3.setSizePolicy(sizePolicy)
self.lineEdit_1.setMinimumSize(QtCore.QSize(96, 0)) self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.lineEdit_1.setBaseSize(QtCore.QSize(0, 0)) self.label_3.setObjectName(_fromUtf8("label_3"))
self.lineEdit_1.setObjectName(_fromUtf8("lineEdit_1")) self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
self.gridLayout.addWidget(self.lineEdit_1, 1, 1, 1, 1) self.label_8 = QtGui.QLabel(PeakGroupBox)
self.pushButton_3 = QtGui.QPushButton(PeakGroupBox) self.label_8.setObjectName(_fromUtf8("label_8"))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) self.gridLayout.addWidget(self.label_8, 5, 2, 1, 1)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pushButton_3.sizePolicy().hasHeightForWidth())
self.pushButton_3.setSizePolicy(sizePolicy)
self.pushButton_3.setMinimumSize(QtCore.QSize(56, 0))
self.pushButton_3.setAutoRepeat(True)
self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))
self.gridLayout.addWidget(self.pushButton_3, 2, 2, 1, 1)
self.label_4 = QtGui.QLabel(PeakGroupBox) self.label_4 = QtGui.QLabel(PeakGroupBox)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0) sizePolicy.setHorizontalStretch(0)
@ -224,22 +125,21 @@ class Ui_PeakGroupBox(object):
self.label_4.setSizePolicy(sizePolicy) self.label_4.setSizePolicy(sizePolicy)
self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setObjectName(_fromUtf8("label_4")) self.label_4.setObjectName(_fromUtf8("label_4"))
self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1) self.gridLayout.addWidget(self.label_4, 5, 0, 1, 1)
self.checkBox_4 = QtGui.QCheckBox(PeakGroupBox) self.doubleSpinBox_1 = QtGui.QDoubleSpinBox(PeakGroupBox)
self.checkBox_4.setObjectName(_fromUtf8("checkBox_4")) self.doubleSpinBox_1.setObjectName(_fromUtf8("doubleSpinBox_1"))
self.gridLayout.addWidget(self.checkBox_4, 4, 4, 1, 1) self.gridLayout.addWidget(self.doubleSpinBox_1, 1, 1, 1, 1)
self.pushButton_2 = QtGui.QPushButton(PeakGroupBox) self.doubleSpinBox_2 = QtGui.QDoubleSpinBox(PeakGroupBox)
self.pushButton_2.setEnabled(True) self.doubleSpinBox_2.setObjectName(_fromUtf8("doubleSpinBox_2"))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred) self.gridLayout.addWidget(self.doubleSpinBox_2, 2, 1, 1, 1)
sizePolicy.setHorizontalStretch(0) self.doubleSpinBox_3 = QtGui.QDoubleSpinBox(PeakGroupBox)
sizePolicy.setVerticalStretch(0) self.doubleSpinBox_3.setObjectName(_fromUtf8("doubleSpinBox_3"))
sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth()) self.gridLayout.addWidget(self.doubleSpinBox_3, 3, 1, 1, 1)
self.pushButton_2.setSizePolicy(sizePolicy) self.doubleSpinBox_4 = QtGui.QDoubleSpinBox(PeakGroupBox)
self.pushButton_2.setMinimumSize(QtCore.QSize(56, 0)) self.doubleSpinBox_4.setObjectName(_fromUtf8("doubleSpinBox_4"))
self.pushButton_2.setAutoRepeat(True) self.gridLayout.addWidget(self.doubleSpinBox_4, 5, 1, 1, 1)
self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
self.gridLayout.addWidget(self.pushButton_2, 1, 3, 1, 1)
self.gridLayout.setColumnStretch(1, 1) self.gridLayout.setColumnStretch(1, 1)
self.gridLayout.setColumnStretch(2, 1)
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
self.retranslateUi(PeakGroupBox) self.retranslateUi(PeakGroupBox)
@ -249,24 +149,16 @@ class Ui_PeakGroupBox(object):
def retranslateUi(self, PeakGroupBox): def retranslateUi(self, PeakGroupBox):
PeakGroupBox.setWindowTitle(_translate("PeakGroupBox", "GroupBox", None)) PeakGroupBox.setWindowTitle(_translate("PeakGroupBox", "GroupBox", None))
PeakGroupBox.setTitle(_translate("PeakGroupBox", "GroupBox", None)) PeakGroupBox.setTitle(_translate("PeakGroupBox", "GroupBox", None))
self.lineEdit_3.setText(_translate("PeakGroupBox", "0.0", None))
self.checkBox_3.setText(_translate("PeakGroupBox", "CD", None))
self.pushButton_7.setText(_translate("PeakGroupBox", "-", None))
self.label_2.setText(_translate("PeakGroupBox", "τ", None))
self.lineEdit_4.setText(_translate("PeakGroupBox", "0.0", None))
self.pushButton_1.setText(_translate("PeakGroupBox", "-", None))
self.pushButton_6.setText(_translate("PeakGroupBox", "+", None))
self.label.setText(_translate("PeakGroupBox", "Fix", None)) self.label.setText(_translate("PeakGroupBox", "Fix", None))
self.pushButton_5.setText(_translate("PeakGroupBox", "-", None)) self.checkBox_3.setText(_translate("PeakGroupBox", "CD", None))
self.removeButton.setText(_translate("PeakGroupBox", "Remove", None)) self.label_2.setText(_translate("PeakGroupBox", "τ", None))
self.pushButton_8.setText(_translate("PeakGroupBox", "+", None))
self.label_3.setText(_translate("PeakGroupBox", "γ", None))
self.pushButton_4.setText(_translate("PeakGroupBox", "+", None))
self.label_1.setText(_translate("PeakGroupBox", "Δε", None))
self.lineEdit_2.setText(_translate("PeakGroupBox", "0.00e+00", None))
self.lineEdit_1.setText(_translate("PeakGroupBox", "0.00e+00", None))
self.pushButton_3.setText(_translate("PeakGroupBox", "-", None))
self.label_4.setText(_translate("PeakGroupBox", "β", None))
self.checkBox_4.setText(_translate("PeakGroupBox", "CC", None)) self.checkBox_4.setText(_translate("PeakGroupBox", "CC", None))
self.pushButton_2.setText(_translate("PeakGroupBox", "+", None)) self.label_5.setText(_translate("PeakGroupBox", "TextLabel", None))
self.label_7.setText(_translate("PeakGroupBox", "TextLabel", None))
self.label_6.setText(_translate("PeakGroupBox", "TextLabel", None))
self.removeButton.setText(_translate("PeakGroupBox", "Remove", None))
self.label_1.setText(_translate("PeakGroupBox", "Δε", None))
self.label_3.setText(_translate("PeakGroupBox", "γ", None))
self.label_8.setText(_translate("PeakGroupBox", "TextLabel", None))
self.label_4.setText(_translate("PeakGroupBox", "β", None))

View File

@ -40,12 +40,12 @@
<property name="checkable"> <property name="checkable">
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0"> <layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0">
<property name="margin"> <property name="margin">
<number>10</number> <number>10</number>
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0" columnstretch="0,1,0,0,0" rowminimumheight="0,0,0,0,0" columnminimumwidth="0,0,0,0,0"> <layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0" columnstretch="0,1,1,0">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
@ -58,58 +58,43 @@
<property name="spacing"> <property name="spacing">
<number>5</number> <number>5</number>
</property> </property>
<item row="2" column="4"> <item row="0" column="3">
<widget class="QCheckBox" name="checkBox_2"> <widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Fix</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="checkBox_1">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="3">
<widget class="QLineEdit" name="lineEdit_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0.0</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QCheckBox" name="checkBox_3"> <widget class="QCheckBox" name="checkBox_3">
<property name="text"> <property name="text">
<string>CD</string> <string>CD</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="2" column="3">
<widget class="QPushButton" name="pushButton_7"> <widget class="QCheckBox" name="checkBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>-</string> <string/>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -129,122 +114,31 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="5" column="3">
<widget class="QLineEdit" name="lineEdit_4"> <widget class="QCheckBox" name="checkBox_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>0.0</string> <string>CC</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QPushButton" name="pushButton_1"> <widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>-</string> <string>TextLabel</string>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QPushButton" name="pushButton_6">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>+</string>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Fix</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="3" column="2">
<widget class="QPushButton" name="pushButton_5"> <widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>-</string> <string>TextLabel</string>
</property> </property>
<property name="autoRepeat"> </widget>
<bool>true</bool> </item>
<item row="2" column="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>TextLabel</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -267,28 +161,19 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="3"> <item row="1" column="0">
<widget class="QPushButton" name="pushButton_8"> <widget class="QLabel" name="label_1">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>+</string> <string>Δε</string>
</property> </property>
<property name="autoRepeat"> <property name="alignment">
<bool>true</bool> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -308,124 +193,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="3"> <item row="5" column="2">
<widget class="QPushButton" name="pushButton_4"> <widget class="QLabel" name="label_8">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>+</string> <string>TextLabel</string>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="5" column="0">
<widget class="QLabel" name="label_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Δε</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0.00e+00</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="checkBox_1">
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_1">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0.00e+00</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="pushButton_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>-</string>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4"> <widget class="QLabel" name="label_4">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
@ -441,37 +216,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="4"> <item row="1" column="1">
<widget class="QCheckBox" name="checkBox_4"> <widget class="QDoubleSpinBox" name="doubleSpinBox_1"/>
<property name="text">
<string>CC</string>
</property>
</widget>
</item> </item>
<item row="1" column="3"> <item row="2" column="1">
<widget class="QPushButton" name="pushButton_2"> <widget class="QDoubleSpinBox" name="doubleSpinBox_2"/>
<property name="enabled"> </item>
<bool>true</bool> <item row="3" column="1">
</property> <widget class="QDoubleSpinBox" name="doubleSpinBox_3"/>
<property name="sizePolicy"> </item>
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <item row="5" column="1">
<horstretch>0</horstretch> <widget class="QDoubleSpinBox" name="doubleSpinBox_4"/>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>56</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>+</string>
</property>
<property name="autoRepeat">
<bool>true</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>

View File

@ -1,7 +1,7 @@
from PyQt4.QtCore import * from PyQt4.QtCore import *
from PyQt4.QtGui import * from PyQt4.QtGui import *
import PeakGroupBox import PeakGroupBox
from CustomWidgets import LogFSpinBox
class PeakWidget(QGroupBox): class PeakWidget(QGroupBox):
changedTable = pyqtSignal() changedTable = pyqtSignal()
@ -10,58 +10,37 @@ class PeakWidget(QGroupBox):
QGroupBox.__init__(self) QGroupBox.__init__(self)
super(PeakWidget, self).__init__(parent) super(PeakWidget, self).__init__(parent)
self.ui = PeakGroupBox.Ui_PeakGroupBox() self.ui = PeakGroupBox.Ui_PeakGroupBox()
# replace eps and tau with LogFSpinBox
self.ui.setupUi(self) self.ui.setupUi(self)
self.lineEdits = [self.ui.lineEdit_1, self.ui.doubleSpinBox_1.setParent(None)
self.ui.lineEdit_2, self.ui.doubleSpinBox_1 = LogFSpinBox(self)
self.ui.lineEdit_3, self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_1,1,1)
self.ui.lineEdit_4] self.ui.doubleSpinBox_2.setParent(None)
self.ui.doubleSpinBox_2 = LogFSpinBox(self)
self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_2,2,1)
self.inputs = [
self.ui.doubleSpinBox_1,
self.ui.doubleSpinBox_2,
self.ui.doubleSpinBox_3,
self.ui.doubleSpinBox_4
]
for dsb in self.inputs:
dsb.valueChanged.connect(self.changeValues)
self.fixedCheckBoxes = [self.ui.checkBox_1, self.fixedCheckBoxes = [self.ui.checkBox_1,
self.ui.checkBox_2, self.ui.checkBox_2,
self.ui.checkBox_3, self.ui.checkBox_3,
self.ui.checkBox_4] self.ui.checkBox_4]
for le in self.lineEdits:
le.editingFinished.connect(self.changedTable.emit)
self.signalMapper = QSignalMapper(self)
for i, button in enumerate([self.ui.pushButton_1,
self.ui.pushButton_2,
self.ui.pushButton_3,
self.ui.pushButton_4,
self.ui.pushButton_5,
self.ui.pushButton_6,
self.ui.pushButton_7,
self.ui.pushButton_8,
]):
self.signalMapper.setMapping(button, i)
button.clicked.connect(self.signalMapper.map)
self.signalMapper.mapped.connect(self.changeValues)
def changeValues(self, num): def changeValues(self):
logstep = 1.29154967 # 10 log even steps per decade
linstep = 0.05
# 0-3 down/up for d_eps and tau, respectively
# 4-7 down, up for a, b
if num == 0:
self.ui.lineEdit_1.setText("%.2e" % (self.ui.lineEdit_1.text().toDouble()[0] / logstep))
if num == 1:
self.ui.lineEdit_1.setText("%.2e" % (self.ui.lineEdit_1.text().toDouble()[0] * logstep))
if num == 2:
self.ui.lineEdit_2.setText("%.2e" % (self.ui.lineEdit_2.text().toDouble()[0] / logstep))
if num == 3:
self.ui.lineEdit_2.setText("%.2e" % (self.ui.lineEdit_2.text().toDouble()[0] * logstep))
if num == 4:
self.ui.lineEdit_3.setText("%.2e" % (self.ui.lineEdit_3.text().toDouble()[0] - linstep))
if num == 5:
self.ui.lineEdit_3.setText("%.2e" % (self.ui.lineEdit_3.text().toDouble()[0] + linstep))
if num == 6:
self.ui.lineEdit_4.setText("%.2e" % (self.ui.lineEdit_4.text().toDouble()[0] - linstep))
if num == 7:
self.ui.lineEdit_4.setText("%.2e" % (self.ui.lineEdit_4.text().toDouble()[0] + linstep))
self.changedTable.emit() self.changedTable.emit()
def fixedParameter(self): def fixedParameter(self):
return [0 if cb.isChecked() else 1 for cb in self.fixedCheckBoxes] return [0 if cb.isChecked() else 1 for cb in self.fixedCheckBoxes]
def setId(self, id): def setId(self, id):
self.id = id self.id = id
self.setTitle("Peak %i" % id) self.setTitle("Peak %i" % id)
@ -72,9 +51,8 @@ class PeakWidget(QGroupBox):
self.setPalette(palette) self.setPalette(palette)
def peakParameter(self): def peakParameter(self):
tmp = [i.text().toDouble()[0] # selects the number, ignores the status tmp = [i.value() # selects the number, ignores the status
for i in self.lineEdits] for i in self.inputs]
#print "peakParams:", tmp
return tmp return tmp
def update(self): def update(self):
@ -83,5 +61,5 @@ class PeakWidget(QGroupBox):
def updateTable(self, *args): def updateTable(self, *args):
#print "updateTable", args #print "updateTable", args
for i, arg in enumerate(args): for i, arg in enumerate(args):
self.lineEdits[i].setText("%g" % (args[i])) self.inputs[i].setValue(args[i])

View File

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'QDSMain.ui' # Form implementation generated from reading ui file 'QDSMain.ui'
# #
# Created: Sat Mar 15 21:26:00 2014 # Created: Tue Mar 18 20:24:14 2014
# by: PyQt4 UI code generator 4.10.3 # by: PyQt4 UI code generator 4.10.3
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!

View File

@ -63,15 +63,6 @@
<height>572</height> <height>572</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>GroupBox</string>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</widget> </widget>
<widget class="PlotWidget" name="graphicsView"> <widget class="PlotWidget" name="graphicsView">

View File

@ -2,7 +2,7 @@
# Resource object code # Resource object code
# #
# Created: Sa. Mär. 15 21:26:00 2014 # Created: Di. Mär. 18 20:24:13 2014
# by: The Resource Compiler for PyQt (Qt v4.8.5) # by: The Resource Compiler for PyQt (Qt v4.8.5)
# #
# WARNING! All changes made in this file will be lost! # WARNING! All changes made in this file will be lost!