Skip to content

Commit

Permalink
SpinBox instead of DoubleSpinBox
Browse files Browse the repository at this point in the history
  • Loading branch information
maettu committed Oct 24, 2011
1 parent 380bb1d commit b83b392
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions integrale.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ from PyQt4.QtGui import ( QApplication,
QLabel,
QBrush,
QPainter,
QDoubleSpinBox,
QSpinBox,
QMessageBox
)

Expand Down Expand Up @@ -99,7 +99,7 @@ class MainWindow( QDialog ):
self.rectanglesFunction = []
self.rectanglesIntegral = []

self.numberRectanglesSpinBox = QDoubleSpinBox()
self.numberRectanglesSpinBox = QSpinBox()
self.numberRectanglesSpinBox.setMinimum ( 1 )
self.numberRectanglesSpinBox.setValue( 10 )
self.numberRectanglesSpinBox.setSingleStep( 1 )
Expand Down Expand Up @@ -180,7 +180,7 @@ class MainWindow( QDialog ):
self.connect ( self.scaleOutButton, SIGNAL( "clicked()" ),
self.scaleOut )

self.connect (self.numberRectanglesSpinBox, SIGNAL( "valueChanged(double)" ),
self.connect (self.numberRectanglesSpinBox, SIGNAL( "valueChanged(int)" ),
self.changeFunction )


Expand Down Expand Up @@ -217,6 +217,10 @@ class MainWindow( QDialog ):
# erase bars & points
for i in self.rectanglesFunction:
self.sceneFunction.removeItem( i )
#~ while self.rectanglesFunction:
#~ item = self.rectanglesFunction.pop()
#~ self.sceneFunction.removeItem( item )
#~ del item

# TODO: really delete objects without segfaulting

Expand All @@ -231,6 +235,7 @@ class MainWindow( QDialog ):
#~ print ( float (self.end - self.start) / self.numberRectangles )

for i in range( self.numberRectangles ):
#~ for i in range( 10 ):
x = float( self.end - self.start ) / self.numberRectangles * (i + 0.5)

x1 = float( self.end - self.start ) / self.numberRectangles * ( i )
Expand Down

0 comments on commit b83b392

Please sign in to comment.