-
I'd like to enable the analyst to modify a value using a horizontal sliding bar / arrow feature to increase or decrease said value. I didn't see a feature for this in the 'interaction' API and was just wondering if this is something that exists in another API / if there's another out-of-the-box way to do this? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Anything fancier than the interaction methods requires using PySide2, how easy it is depends on your experience with QT, but there's a lot of code samples on the internet so it's really straight-forward. Here's a quick one I tested out using the Snippets plugin so I didn't have to make a full-blown plugin: from PySide2 import QtWidgets, QtCore
class demoSlider(QtWidgets.QDialog):
def __init__(self, parent = None):
super(demoSlider, self).__init__(parent)
self.layout = QtWidgets.QHBoxLayout(self)
self.label= QtWidgets.QLabel()
self.slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
self.slider.valueChanged.connect(self.updateSlider)
self.layout.addWidget(self.label)
self.layout.addWidget(self.slider)
self.setWindowTitle("Slider Demo")
def updateSlider(self):
self.label.setText(str(self.slider.value()))
slider = demoSlider()
slider.exec_() |
Beta Was this translation helpful? Give feedback.
Anything fancier than the interaction methods requires using PySide2, how easy it is depends on your experience with QT, but there's a lot of code samples on the internet so it's really straight-forward.
Here's a quick one I tested out using the Snippets plugin so I didn't have to make a full-blown plugin: