Support constructor kwargs to set QRangeSlider properties
Describe the bug On PyQt, widget properties can be set via constructor kwargs. Unfortunately, QRangeSlider silently drops these kwargs instead.
To Reproduce Steps to reproduce the behavior:
from PyQt6 import QtWidgets as QtW
from PyQt6.QtCore import Qt
from superqt import QRangeSlider
app = QtW.QApplication([])
# Standard QSlider
qslider = QtW.QSlider(Qt.Orientation.Horizontal, minimum=10, maximum=40, value=30)
print(qslider.minimum(), qslider.maximum(), qslider.value())
# QRangeSlider from SuperQt
qrangeslider = QRangeSlider(Qt.Horizontal, minimum=10, maximum=40, value=(20, 30))
print(qrangeslider.minimum(), qrangeslider.maximum(), qrangeslider.value())
(I do realize that constructor kwargs make the code non-portable to PySide, but sometimes one really only needs to develop for one Qt backend.)
Expected behavior prints
10 40 30
0.0 99.0 (20, 80)
i.e. QSlider took the kwargs into account, but QRangeSlider silently dropped them.
At least, if the feature can really not be supported (even when the underlying backend is indeed PyQt), the extra kwargs should trigger an error, I believe?
Screenshots N/A
Desktop (please complete the following information):
- OS with version [e.g macOS 10.15.7] macOS 15.5
- Qt Backend [e.g PyQt5, PySide2] PyQt6
- Python version 3.13
I'm open to supporting that, since it looks like pyside (6.9.1) is also supporting it now too. (though, I have to say... i kinda wish neither of the python wrappers added signatures that weren't in the Qt docs 😂). But, since they do, I agree it should be supported here too in the interest of drop-in