summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/knuminput.h
Unidiff
Diffstat (limited to 'microkde/kdeui/knuminput.h') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kdeui/knuminput.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/microkde/kdeui/knuminput.h b/microkde/kdeui/knuminput.h
index 123fefa..9f9e200 100644
--- a/microkde/kdeui/knuminput.h
+++ b/microkde/kdeui/knuminput.h
@@ -20,24 +20,29 @@
20 * 20 *
21 * You should have received a copy of the GNU Library General Public License 21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to 22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA. 24 * Boston, MA 02111-1307, USA.
25 */ 25 */
26 26
27#ifndef K_NUMINPUT_H 27#ifndef K_NUMINPUT_H
28#define K_NUMINPUT_H 28#define K_NUMINPUT_H
29 29
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qspinbox.h> 31#include <qspinbox.h>
32#include <QLineEdit>
33//Added by qt3to4:
34#include <QResizeEvent>
35#include <QLabel>
36#include <QEvent>
32 37
33class QLabel; 38class QLabel;
34class QSlider; 39class QSlider;
35class QLineEdit; 40class QLineEdit;
36class QLayout; 41class QLayout;
37class QValidator; 42class QValidator;
38 43
39class KIntSpinBox; 44class KIntSpinBox;
40 45
41/* ------------------------------------------------------------------------ */ 46/* ------------------------------------------------------------------------ */
42 47
43/** 48/**
@@ -72,25 +77,25 @@ public:
72 * @param a one of @p AlignLeft, @p AlignHCenter, YAlignRight and 77 * @param a one of @p AlignLeft, @p AlignHCenter, YAlignRight and
73 * @p AlignTop, @p AlignVCenter, @p AlignBottom. 78 * @p AlignTop, @p AlignVCenter, @p AlignBottom.
74 * default is @p AlignLeft | @p AlignTop. 79 * default is @p AlignLeft | @p AlignTop.
75 * 80 *
76 * The vertical alignment flags have special meaning with this 81 * The vertical alignment flags have special meaning with this
77 * widget: 82 * widget:
78 * 83 *
79 * @li @p AlignTop The label is placed above the edit/slider 84 * @li @p AlignTop The label is placed above the edit/slider
80 * @li @p AlignVCenter The label is placed left beside the edit 85 * @li @p AlignVCenter The label is placed left beside the edit
81 * @li @p AlignBottom The label is placed below the edit/slider 86 * @li @p AlignBottom The label is placed below the edit/slider
82 * 87 *
83 */ 88 */
84 virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); 89 virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
85 90
86 /** 91 /**
87 * @return the text of the label. 92 * @return the text of the label.
88 */ 93 */
89 QString label() const; 94 QString label() const;
90 95
91 /** 96 /**
92 * @return if the num input has a slider. 97 * @return if the num input has a slider.
93 * @since 3.1 98 * @since 3.1
94 */ 99 */
95 bool showSlider() const { return m_slider; } 100 bool showSlider() const { return m_slider; }
96 101
@@ -293,25 +298,25 @@ public:
293 298
294 /** 299 /**
295 * Sets the special value text. If set, the SpinBox will display 300 * Sets the special value text. If set, the SpinBox will display
296 * this text instead of the numeric value whenever the current 301 * this text instead of the numeric value whenever the current
297 * value is equal to minVal(). Typically this is used for indicating 302 * value is equal to minVal(). Typically this is used for indicating
298 * that the choice has a special (default) meaning. 303 * that the choice has a special (default) meaning.
299 */ 304 */
300 void setSpecialValueText(const QString& text); 305 void setSpecialValueText(const QString& text);
301 306
302 /** 307 /**
303 * @reimplemented 308 * @reimplemented
304 */ 309 */
305 virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); 310 virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
306 311
307 /** 312 /**
308 * This method returns the minimum size necessary to display the 313 * This method returns the minimum size necessary to display the
309 * control. The minimum size is enough to show all the labels 314 * control. The minimum size is enough to show all the labels
310 * in the current font (font change may invalidate the return value). 315 * in the current font (font change may invalidate the return value).
311 * 316 *
312 * @return the minimum size necessary to show the control 317 * @return the minimum size necessary to show the control
313 */ 318 */
314 virtual QSize minimumSizeHint() const; 319 virtual QSize minimumSizeHint() const;
315 320
316public slots: 321public slots:
317 /** 322 /**
@@ -579,25 +584,25 @@ public:
579 584
580 /** 585 /**
581 * Sets the special value text. If set, the spin box will display 586 * Sets the special value text. If set, the spin box will display
582 * this text instead of the numeric value whenever the current 587 * this text instead of the numeric value whenever the current
583 * value is equal to @ref #minVal(). Typically this is used for indicating 588 * value is equal to @ref #minVal(). Typically this is used for indicating
584 * that the choice has a special (default) meaning. 589 * that the choice has a special (default) meaning.
585 */ 590 */
586 void setSpecialValueText(const QString& text); 591 void setSpecialValueText(const QString& text);
587 592
588 /** 593 /**
589 * @reimplemented 594 * @reimplemented
590 */ 595 */
591 virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop); 596 virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
592 /** 597 /**
593 * @reimplemented 598 * @reimplemented
594 */ 599 */
595 virtual QSize minimumSizeHint() const; 600 virtual QSize minimumSizeHint() const;
596 /** 601 /**
597 * @reimplemented 602 * @reimplemented
598 */ 603 */
599 virtual bool eventFilter(QObject*, QEvent*); 604 virtual bool eventFilter(QObject*, QEvent*);
600 605
601public slots: 606public slots:
602 /** 607 /**
603 * Sets the value of the control. 608 * Sets the value of the control.
@@ -749,24 +754,28 @@ public:
749 */ 754 */
750 void setBase(int base); 755 void setBase(int base);
751 /** 756 /**
752 * @return the base in which numbers in the spin box are represented. 757 * @return the base in which numbers in the spin box are represented.
753 */ 758 */
754 int base() const; 759 int base() const;
755 /** 760 /**
756 * sets focus and optionally marks all text 761 * sets focus and optionally marks all text
757 * 762 *
758 */ 763 */
759 void setEditFocus(bool mark); 764 void setEditFocus(bool mark);
760 765
766 void setValidator(const QValidator *v) {
767 lineEdit()->setValidator(v);
768 }
769
761protected: 770protected:
762 771
763 /** 772 /**
764 * Overloaded the method in QSpinBox 773 * Overloaded the method in QSpinBox
765 * to make use of the base given in the constructor. 774 * to make use of the base given in the constructor.
766 */ 775 */
767 virtual QString mapValueToText(int); 776 virtual QString mapValueToText(int);
768 777
769 /** 778 /**
770 * Overloaded the method in QSpinBox 779 * Overloaded the method in QSpinBox
771 * to make use of the base given in the constructor. 780 * to make use of the base given in the constructor.
772 */ 781 */