1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Use float for QSlider

Discussão em 'Python' iniciado por Stack, Setembro 13, 2024.

  1. Stack

    Stack Membro Participativo

    I have a QLineEdit and a QSlider in which it interacts with each other.

    Eg. If I set a value in the QLineEdit, the slider will be updated, or if I slide the slider across, it will updates the value in QLineEdit

    # If user change value on the slider
    self.timer_slider.valueChanged.connect(self.set_value)
    # If user sets a value in the text box instead
    self.timer_value.textChanged.connect(self.set_slider)

    def set_slider(self, value):
    self.timer_slider.setValue(int(value))

    def set_value(self, value):
    self.timer_value.setText(str(value))


    Is there anyway that I can use float instead of int values?

    Continue reading...

Compartilhe esta Página