Skip to content

Commit

Permalink
Solve issue OTL#27: Set double slider limits to system float limits
Browse files Browse the repository at this point in the history
This fix lets the user write slider limits that are higher than 10k or lower than -10k. The min and max spinboxes become slightly larger due to the larger limits. It would be a good feature to set a fixed spinbox length to solve this.
  • Loading branch information
JulioLP committed Aug 22, 2018
1 parent ae1728e commit e755408
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rqt_ez_publisher/widget/double_value_widget.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from python_qt_binding import QtCore
from python_qt_binding import QtWidgets
import value_widget

from sys import float_info as float_info

class DoubleValueWidget(value_widget.ValueWidget):

Expand Down Expand Up @@ -36,15 +36,15 @@ def slider_changed(self, val):

def setup_ui(self, name):
self._min_spin_box = QtWidgets.QDoubleSpinBox()
self._min_spin_box.setMaximum(10000)
self._min_spin_box.setMinimum(-10000)
self._min_spin_box.setMaximum(float_info.max)
self._min_spin_box.setMinimum(-float_info.max)
self._min_spin_box.setValue(self.DEFAULT_MIN_VALUE)
self._slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
self._slider.setTickPosition(QtWidgets.QSlider.TicksBelow)
self._slider.valueChanged.connect(self.slider_changed)
self._max_spin_box = QtWidgets.QDoubleSpinBox()
self._max_spin_box.setMaximum(10000)
self._max_spin_box.setMinimum(-10000)
self._max_spin_box.setMaximum(float_info.max)
self._max_spin_box.setMinimum(-float_info.max)
self._max_spin_box.setValue(self.DEFAULT_MAX_VALUE)
self._lcd = QtWidgets.QLCDNumber()
self._lcd.setMaximumHeight(self.LCD_HEIGHT)
Expand Down

0 comments on commit e755408

Please sign in to comment.