mirror of
https://github.com/pyapp-kit/superqt.git
synced 2025-09-05 17:20:27 +02:00
* add other modules * add qtsvg * more changes for qt6 support * add qaction * more enum namespacing * more ns fixes * updating qtcompat * more minimal * wip * update typing * fix one more namespace * update types * update exports * add stubs * fix * fix exec
28 lines
826 B
Python
28 lines
826 B
Python
from superqt import QDoubleRangeSlider, QDoubleSlider, QRangeSlider
|
|
from superqt.qtcompat.QtCore import Qt
|
|
from superqt.qtcompat.QtWidgets import QApplication, QVBoxLayout, QWidget
|
|
|
|
app = QApplication([])
|
|
|
|
w = QWidget()
|
|
|
|
sld1 = QDoubleSlider(Qt.Orientation.Horizontal)
|
|
sld2 = QDoubleRangeSlider(Qt.Orientation.Horizontal)
|
|
rs = QRangeSlider(Qt.Orientation.Horizontal)
|
|
|
|
sld1.valueChanged.connect(lambda e: print("doubslider valuechanged", e))
|
|
|
|
sld2.setMaximum(1)
|
|
sld2.setValue((0.2, 0.8))
|
|
sld2.valueChanged.connect(lambda e: print("valueChanged", e))
|
|
sld2.sliderMoved.connect(lambda e: print("sliderMoved", e))
|
|
sld2.rangeChanged.connect(lambda e, f: print("rangeChanged", (e, f)))
|
|
|
|
w.setLayout(QVBoxLayout())
|
|
w.layout().addWidget(sld1)
|
|
w.layout().addWidget(sld2)
|
|
w.layout().addWidget(rs)
|
|
w.show()
|
|
w.resize(500, 150)
|
|
app.exec_()
|