// ! [9] public SlidersGroup(Qt.Orientation orientation, String title) { slider = new QSlider(orientation); slider.setFocusPolicy(Qt.FocusPolicy.StrongFocus); slider.setTickPosition(QSlider.TickPosition.TicksBothSides); slider.setTickInterval(10); slider.setSingleStep(1); scrollBar = new QScrollBar(orientation); scrollBar.setFocusPolicy(Qt.FocusPolicy.StrongFocus); dial = new QDial(); dial.setFocusPolicy(Qt.FocusPolicy.StrongFocus); slider.valueChanged.connect(scrollBar, "setValue(int)"); scrollBar.valueChanged.connect(dial, "setValue(int)"); // ! [9] //! [10] dial.valueChanged.connect(slider, "setValue(int)"); // ! [10] //! [11] dial.valueChanged.connect(valueChanged); // ! [11] //! [12] QBoxLayout.Direction direction; // ! [12] //! [13] if (orientation == Qt.Orientation.Horizontal) direction = QBoxLayout.Direction.TopToBottom; else direction = QBoxLayout.Direction.LeftToRight; QBoxLayout slidersLayout = new QBoxLayout(direction); slidersLayout.addWidget(slider); slidersLayout.addWidget(scrollBar); slidersLayout.addWidget(dial); setLayout(slidersLayout); }
// ! [18] public void invertedKeyBindings(boolean invert) { slider.setInvertedControls(invert); scrollBar.setInvertedControls(invert); dial.setInvertedControls(invert); }
// ! [17] public void invertAppearance(boolean invert) { slider.setInvertedAppearance(invert); scrollBar.setInvertedAppearance(invert); dial.setInvertedAppearance(invert); }
// ! [16] public void setMaximum(int value) { slider.setMaximum(value); scrollBar.setMaximum(value); dial.setMaximum(value); }
// ! [14] public void setValue(int value) { slider.setValue(value); }