Kstars

nonlineardoublespinbox.h
1/*
2 SPDX-FileCopyrightText: 2017 Robert Lancaster <rlancaste@gmail.com>
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
13class NonLinearDoubleSpinBox : public QDoubleSpinBox
14{
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
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:40 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.