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

Categories

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...