File indexing completed on 2024-05-19 04:29:50
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2010 Cyrille Berger <cberger@cberger.net> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef _KIS_MULTIPLIERS_DOUBLE_SLIDER_SPINBOX_H_ 0008 #define _KIS_MULTIPLIERS_DOUBLE_SLIDER_SPINBOX_H_ 0009 0010 #include <QWidget> 0011 0012 #include <kritawidgetutils_export.h> 0013 0014 0015 /** 0016 * This class add a combobox to a \ref KisDoubleSliderSpinBox which 0017 * allows to define a multiplier to let the user change the range. 0018 */ 0019 class KRITAWIDGETUTILS_EXPORT KisMultipliersDoubleSliderSpinBox : public QWidget { 0020 Q_OBJECT 0021 public: 0022 KisMultipliersDoubleSliderSpinBox(QWidget* _parent = 0); 0023 ~KisMultipliersDoubleSliderSpinBox() override; 0024 0025 void addMultiplier(double v); 0026 /** 0027 * Set the range for the 1.0 multiplier 0028 */ 0029 void setRange(qreal minimum, qreal maximum, int decimals = 0); 0030 0031 ///Get the value, don't use value() 0032 qreal value(); 0033 0034 public Q_SLOTS: 0035 ///Set the value, don't use setValue() 0036 void setValue(qreal value); 0037 0038 public: 0039 void setExponentRatio(qreal dbl); 0040 0041 void setPrefix(const QString& prefix); 0042 void setSuffix(const QString& suffix); 0043 0044 void setBlockUpdateSignalOnDrag(bool block); 0045 0046 void setSingleStep(qreal value); 0047 0048 QSize sizeHint() const override; 0049 QSize minimumSizeHint() const override; 0050 virtual QSize minimumSize() const; 0051 0052 Q_SIGNALS: 0053 void valueChanged(qreal value); 0054 0055 private: 0056 Q_PRIVATE_SLOT(d, void updateRange()) 0057 struct Private; 0058 Private* const d; 0059 }; 0060 0061 0062 #endif