27 #include <QtGui/QWidget>
28 #include <QtGui/QSpinBox>
35 class KNumInputPrivate;
61 #ifndef KDE_NO_DEPRECATED
87 virtual void setLabel(
const QString &
label, Qt::Alignment a = Qt::AlignLeft | Qt::AlignTop);
97 bool showSlider()
const;
105 void setSteps(
int minor,
int major);
112 virtual QSize sizeHint()
const;
119 QSlider *slider()
const;
126 void layout(
bool deep);
136 virtual void doLayout() = 0;
139 friend class KNumInputPrivate;
140 KNumInputPrivate *
const d;
175 Q_PROPERTY(
int value READ value WRITE setValue NOTIFY valueChanged USER
true )
176 Q_PROPERTY(
int minimum READ minimum WRITE setMinimum )
177 Q_PROPERTY(
int maximum READ maximum WRITE setMaximum )
178 Q_PROPERTY(
int singleStep READ singleStep WRITE setSingleStep )
179 Q_PROPERTY(
int referencePoint READ referencePoint WRITE setReferencePoint )
180 Q_PROPERTY(
double relativeValue READ relativeValue WRITE setRelativeValue )
181 Q_PROPERTY(
QString suffix READ suffix WRITE setSuffix )
182 Q_PROPERTY(
QString prefix READ prefix WRITE setPrefix )
183 Q_PROPERTY(
QString specialValueText READ specialValueText WRITE setSpecialValueText )
184 Q_PROPERTY(
bool sliderEnabled READ showSlider WRITE setSliderEnabled )
223 #ifndef KDE_NO_DEPRECATED
242 double relativeValue()
const;
247 int referencePoint()
const;
263 QString specialValueText()
const;
273 void setRange(
int min,
int max,
int singleStep=1);
278 #ifndef KDE_NO_DEPRECATED
279 KDE_DEPRECATED
void setRange(
int min,
int max,
int singleStep,
bool slider);
286 void setSliderEnabled(
bool enabled=
true);
291 void setMinimum(
int min);
299 void setMaximum(
int max);
308 int singleStep()
const;
313 void setSingleStep(
int step);
321 void setSpecialValueText(
const QString& text);
332 virtual QSize minimumSizeHint()
const;
343 void setRelativeValue(
double);
348 void setReferencePoint(
int);
359 void setSuffix(
const QString &suffix);
376 void setPrefix(
const QString &prefix);
382 void setEditFocus(
bool mark =
true );
389 void valueChanged(
int);
395 void relativeValueChanged(
double);
398 void spinValueChanged(
int);
399 void slotEmitRelativeValueChanged(
int);
409 void resizeEvent ( QResizeEvent * );
412 void init(
int value,
int _base);
415 class KIntNumInputPrivate;
416 friend class KIntNumInputPrivate;
417 KIntNumInputPrivate *
const d;
453 Q_PROPERTY(
double value READ value WRITE setValue NOTIFY valueChanged USER
true )
454 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum )
455 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum )
456 Q_PROPERTY(
double singleStep READ singleStep WRITE setSingleStep )
457 Q_PROPERTY(
QString suffix READ suffix WRITE setSuffix )
458 Q_PROPERTY(
QString prefix READ prefix WRITE setPrefix )
459 Q_PROPERTY(
QString specialValueText READ specialValueText WRITE setSpecialValueText )
460 Q_PROPERTY(
int decimals READ decimals WRITE setDecimals )
461 Q_PROPERTY(
double referencePoint READ referencePoint WRITE setReferencePoint )
462 Q_PROPERTY(
double relativeValue READ relativeValue WRITE setRelativeValue )
463 Q_PROPERTY(
bool sliderEnabled READ showSlider WRITE setSliderEnabled )
464 Q_PROPERTY(
double exponentRatio READ exponentRatio WRITE setExponentRatio )
513 #ifndef KDE_NO_DEPRECATED
515 double lower,
double upper,
double value,
QWidget *parent=0,
double singleStep=0.02,
522 double value()
const;
540 int decimals()
const;
546 QString specialValueText()
const;
554 void setRange(
double min,
double max,
double singleStep=1,
bool slider=
true);
560 void setSliderEnabled(
bool enabled);
565 void setMinimum(
double min);
569 double minimum()
const;
573 void setMaximum(
double max);
577 double maximum()
const;
582 double singleStep()
const;
587 void setSingleStep(
double singleStep);
592 void setDecimals(
int decimals);
594 #ifndef KDE_NO_DEPRECATED
595 KDE_DEPRECATED
void setPrecision(
int precision) { setDecimals(precision); }
601 double referencePoint()
const;
606 double relativeValue()
const;
614 void setSpecialValueText(
const QString& text);
617 virtual QSize minimumSizeHint()
const;
623 double exponentRatio()
const;
629 void setExponentRatio(
double dbl);
634 void setValue(
double);
639 void setRelativeValue(
double);
646 void setReferencePoint(
double ref);
655 void setSuffix(
const QString &suffix);
663 void setPrefix(
const QString &prefix);
670 void valueChanged(
double);
677 void relativeValueChanged(
double);
680 void sliderMoved(
int);
681 void spinBoxChanged(
double);
682 void slotEmitRelativeValueChanged(
double);
686 void resizeEvent ( QResizeEvent * );
688 friend class KDoubleLine;
690 void init(
double value,
double lower,
double upper,
691 double singleStep,
int precision);
692 double mapSliderToSpin(
int)
const;
693 void updateLegacyMembers();
696 class KDoubleNumInputPrivate;
697 friend class KDoubleNumInputPrivate;
698 KDoubleNumInputPrivate *
const d;
700 Q_DISABLE_COPY(KDoubleNumInput)
720 Q_PROPERTY(
int base READ base WRITE setBase )
746 KIntSpinBox(
int lower,
int upper,
int singleStep,
int value,
QWidget *parent,
int base = 10);
756 void setBase(
int base);
765 void setEditFocus(
bool mark);
775 using QSpinBox::setSuffix;
783 virtual QString textFromValue(
int)
const;
789 virtual int valueFromText(
const QString &text)
const;
792 class KIntSpinBoxPrivate;
793 friend class KIntSpinBoxPrivate;
794 KIntSpinBoxPrivate *
const d;
797 Q_PRIVATE_SLOT(d,
void updateSuffix(
int))
800 #endif // K_NUMINPUT_H
QString label(StandardShortcut id)
Returns a localized label for user-visible display.
#define KDE_CONSTRUCTOR_DEPRECATED
A QSpinBox with support for arbitrary base numbers.