qslider

Use float for QSlider

主宰稳场 提交于 2020-01-23 03:29:25
问题 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

Connect Qslider and MatplotlibWidget

瘦欲@ 提交于 2020-01-16 06:02:31
问题 I am a real beginner in python and try to connect a qslider to a matplotlibwidget. That means if I change the value of the slider the graph should change. It seems that the value changes correctly, while the graph stays the same. Can anyone tell me how to connect the change of the slider with the graph? Here is my algorithm so far: # -*- coding: utf-8 -*- """ Created on Tue Feb 04 16:48:12 2014 @author: Christoph """ from PyQt4 import QtGui, QtCore from matplotlib.backends.backend_qt4agg

Connect Qslider and MatplotlibWidget

 ̄綄美尐妖づ 提交于 2020-01-16 06:01:25
问题 I am a real beginner in python and try to connect a qslider to a matplotlibwidget. That means if I change the value of the slider the graph should change. It seems that the value changes correctly, while the graph stays the same. Can anyone tell me how to connect the change of the slider with the graph? Here is my algorithm so far: # -*- coding: utf-8 -*- """ Created on Tue Feb 04 16:48:12 2014 @author: Christoph """ from PyQt4 import QtGui, QtCore from matplotlib.backends.backend_qt4agg

Maximum value of QSlider?

北慕城南 提交于 2020-01-06 04:59:19
问题 What is the maximum value of QSlider, in the datasheet, it is just mentioned as int. I tried with "1000000". but the Slider starts bugging. QSlider.setMaximum(1000000); Image with the bug, the blue color and the cursor don't move well at same speed, if the number is at max : 999999999, the cursor don't move at all. when I put : max at : 650000 that works very well. That is perhaps an OS problem, I am using IOS.. By the way, here is an update of code, works fine with 100000 x 2 possible values

tick marks disappear on styled QSlider

爱⌒轻易说出口 提交于 2020-01-01 18:14:11
问题 I'm using Qt 5.3 and trying to style a QSlider . However, when I apply my style-sheet, the tick marks disappear. Does anyone know how to keep the styling without affecting the tick marks? Here is the style sheet: QSlider::groove:horizontal { border: 1px inset #B0B0B0; background-color: #EAEAEA; height: 2px; } QSlider::Handle { border: 1px solid black; background: #B0B0B0; background-image: url(:/metal_background_small); width: 12px; margin: -8px 0; } QSlider::Handle:Hover { border: 1px solid

QSlider and Key Press Event

徘徊边缘 提交于 2019-12-24 01:01:10
问题 I currently have a QSlider that scrolls through frames of image data using the mouse. I would like to be able to use the arrow keys to scroll through a single step (one frame). This is my current sliderMoved code: def sliderMoved(self,val): """ retrieves the data array for the index value specified by the slider """ if self.fileheader is None: print "[DEBUG] change_image_index(): self.fileheader is None" return idx=val self.x=idx frame=self.fileheader.frameAtIndex(idx) image=scipy.ndimage

Is it possible to change the color of a QSlider's handle according to its position?

北慕城南 提交于 2019-12-23 08:00:56
问题 I pretty well understood how to customize a QSlider through style sheets, but I am wondering if it is possible to do the following thing: I'd like the handle of the slider to go from blue to yellow. When set on the left, it's blue; and when you move it to the right, it will have a gradient from blue to yellow. If it is possible through the style sheets, how? And if not, how can I implement that in the paintEvent of a subclass of a QSlider? 回答1: Actually you don't really have to do anything