qslider

Range slider in Qt (two handles in a QSlider) [closed]

房东的猫 提交于 2019-12-17 23:09:37
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . I am using Visual Studio 2010 with Qt 5.0.1 integrated. I need a range selection in QSlider . Is it possible to get two handles? Below is an image illustrating what I need. 回答1: I had the exact same problem. I thought about using the QxtSpanSlider, and although they have beautiful

QSlider with icons

谁说胖子不能爱 提交于 2019-12-13 00:17:33
问题 Given a set of images, I'd like to move a QSlider such that every step shows a little thumbnail icon just above it representing one of the images. Any tips or suggestions? 回答1: You have to use a QLabel to show the icon and the valueChanged signal of QSlider to make the icon change. import sys from PyQt4.QtCore import pyqtSlot, Qt from PyQt4.QtGui import QWidget, QVBoxLayout, QLabel, QSlider, QApplication, QPixmap class Widget(QWidget): def __init__(self): QWidget.__init__(self) self.list

How to add a tick mark to a slider if it cannot inherit QSlider

独自空忆成欢 提交于 2019-12-09 01:21:46
问题 I have a Qt dialog and there is a slider in it, when the dialog is initialized the slider will be set a value. In order to remind the user what is the default value, I want to add a mark to the slider, just draw a line or a triangle above the handle. Here, the slider should be of QSlider type, that means I can't implement a customized control derived from QSlider. Is there any way to realize it ? 回答1: I'm not clear why you can't derive a control from QSlider . You can still treat it like a

How to make a QSlider change with double values

送分小仙女□ 提交于 2019-12-07 00:17:57
问题 My problem is that I just can't seem to make my QSlider work with double values instead of integer, because I need to make it return double values to a QLineEdit and also set it's own value when I put some value in the edit. 回答1: When I was a Qt beginner I started with this tutorial. It is a little bit old (it refers to Qt4.1), but it was good enough to get me started! I have put together a simple example application that can show you where to start... Maybe you can find it helpful! #include

qt qslider not smooth

99封情书 提交于 2019-12-06 08:20:36
问题 I have a qslider to control the zooming of a map like this: connect(ui->zoomSlider, SIGNAL(valueChanged(int)), ui->map, SLOT(SetZoom(int))); However, because this online-map response relatively slow. I found that the qslider's response also becomes very slow which means when you slide the slider, it's position won't change until suddenly it jump to the position where you release your mouse. How could I solve this? 回答1: One possible solution to delay processing of your signal is to connect it

qt qslider not smooth

笑着哭i 提交于 2019-12-04 14:13:21
I have a qslider to control the zooming of a map like this: connect(ui->zoomSlider, SIGNAL(valueChanged(int)), ui->map, SLOT(SetZoom(int))); However, because this online-map response relatively slow. I found that the qslider's response also becomes very slow which means when you slide the slider, it's position won't change until suddenly it jump to the position where you release your mouse. How could I solve this? One possible solution to delay processing of your signal is to connect it with slot by using Qt::QueuedConnection. connect(ui->zoomSlider, SIGNAL(valueChanged(int)), ui->map, SLOT

QSlider Value Changed Signal

耗尽温柔 提交于 2019-12-04 08:28:21
问题 I'm using a QSlider (v4.6) for input as well as to provide feedback to the user. For the feedback I will be calling the setValue method. I'm trying to find a signal that will fire only if the user modified the value. The valueChanged signal fires when the user changed the value as well as when I call setValue. sliderMoved only fires when the user drags the slider (not when using the keyboard). I checked the API docs and can't seem to find anything. Am I missing something? This seems something

QSlider Value Changed Signal

ぐ巨炮叔叔 提交于 2019-12-02 22:05:23
I'm using a QSlider (v4.6) for input as well as to provide feedback to the user. For the feedback I will be calling the setValue method. I'm trying to find a signal that will fire only if the user modified the value. The valueChanged signal fires when the user changed the value as well as when I call setValue. sliderMoved only fires when the user drags the slider (not when using the keyboard). I checked the API docs and can't seem to find anything. Am I missing something? This seems something that would be common. If there is no other signal, how would you recommend that I simulate this

How to connect a QSlider to QDoubleSpinBox

假装没事ソ 提交于 2019-12-01 20:10:45
问题 I want to connect a QSlider to a QDoubleSpinBox but while the code compiles fine and runs for simple QSpinBox, it doesn't work for QDoubleSpinBox QSlider *horizontalSlider1 = new QSlider(); QDoubleSpinBox *spinBox1 = new QDoubleSpinBox(); connect(spinBox1, SIGNAL(valueChanged(double)),horizontalSlider1,SLOT(setValue(double)) ); connect(horizontalSlider1,SIGNAL(valueChanged(double)),spinBox1,SLOT(setValue(double)) ); 回答1: QSlider and QDoubleSpinBox take different types of arguments in

How to add a tick mark to a slider if it cannot inherit QSlider

别来无恙 提交于 2019-12-01 00:39:56
I have a Qt dialog and there is a slider in it, when the dialog is initialized the slider will be set a value. In order to remind the user what is the default value, I want to add a mark to the slider, just draw a line or a triangle above the handle. Here, the slider should be of QSlider type, that means I can't implement a customized control derived from QSlider. Is there any way to realize it ? I'm not clear why you can't derive a control from QSlider . You can still treat it like a QSlider , just override the paintEvent method. The example below is pretty cheesy, visually speaking, but you