Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

pyqt5 - How can I change QSlider value with play?

I'm trying to change Slider value with pushbutton I did some but it is not exactly what I wanted here is some of my code

def button_change_value(self):
    self.ui.slider.setRange(0, len(self.brg1_x)-1)
    self.ui.slider.setTickInterval(1)
    self.size = self.ui.slider.value()

    for i in range(len(self.brg1_x)-1):
        self.size = self.size + 1
        print(self.size)
        self.ui.slider.setValue(self.size)

len (self.brg1_x)-1 is 9 if I connect button_change_value function to Qpushbutton I can see only that the slider.setValue is 9 not for 1,2,3,4,5,6,7,8.

I give you some picture for more explanation enter image description here

After I click the top right play button enter image description here

I can not see the slidervalue (1~8) on the Mainwindow.

How can I figure it out?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...