Kstars

nonlineardoublespinbox.h
1 /*
2  SPDX-FileCopyrightText: 2017 Robert Lancaster <[email protected]>
3 
4  Based on an idea discussed in the QT Centre: https://www.qtcentre.org/threads/47535-QDoubleSpinBox-with-nonlinear-values
5 
6  SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include <QDoubleSpinBox>
12 
13 class NonLinearDoubleSpinBox : public QDoubleSpinBox
14 {
15  Q_OBJECT
16  public:
17  explicit NonLinearDoubleSpinBox(QWidget *parent = Q_NULLPTR);
18 
19  void stepBy(int steps) override;
20  void setRecommendedValues(QList<double> values);
21  void addRecommendedValue(double v);
22  QList<double> getRecommendedValues();
23  QString getRecommendedValuesString();
24 
25  private:
26  QList<double> m_Values;
27  int m_idx { -1 };
28  void updateRecommendedValues();
29 };
Q_OBJECTQ_OBJECT
virtual void stepBy(int steps)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:13:58 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.