summaryrefslogtreecommitdiffabout
path: root/microkde/kdeui/knuminput.h
Side-by-side diff
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
@@ -8,48 +8,53 @@
* Requires the Qt widget libraries, available at no cost at
* http://www.troll.no/
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef K_NUMINPUT_H
#define K_NUMINPUT_H
#include <qwidget.h>
#include <qspinbox.h>
+#include <QLineEdit>
+//Added by qt3to4:
+#include <QResizeEvent>
+#include <QLabel>
+#include <QEvent>
class QLabel;
class QSlider;
class QLineEdit;
class QLayout;
class QValidator;
class KIntSpinBox;
/* ------------------------------------------------------------------------ */
/**
* You need to inherit from this class if you want to implement K*NumInput
* for a different variable type
*
*/
class KNumInput : public QWidget
{
Q_OBJECT
Q_PROPERTY( QString label READ label WRITE setLabel )
public:
/**
* Default constructor
*
@@ -60,49 +65,49 @@ public:
* @param below A pointer to another KNumInput.
*
*/
KNumInput(KNumInput* below, QWidget* parent=0, const char* name=0);
~KNumInput();
/**
* Sets the text and alignment of the main description label.
*
* @param label The text of the label.
* Use QString::null to remove an existing one.
*
* @param a one of @p AlignLeft, @p AlignHCenter, YAlignRight and
* @p AlignTop, @p AlignVCenter, @p AlignBottom.
* default is @p AlignLeft | @p AlignTop.
*
* The vertical alignment flags have special meaning with this
* widget:
*
* @li @p AlignTop The label is placed above the edit/slider
* @li @p AlignVCenter The label is placed left beside the edit
* @li @p AlignBottom The label is placed below the edit/slider
*
*/
- virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop);
+ virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
/**
* @return the text of the label.
*/
QString label() const;
/**
* @return if the num input has a slider.
* @since 3.1
*/
bool showSlider() const { return m_slider; }
/**
* Sets the spacing of tickmarks for the slider.
*
* @param minor Minor tickmark separation.
* @param major Major tickmark separation.
*/
void setSteps(int minor, int major);
/**
* Specifies that this widget may stretch horizontally, but is
* fixed vertically (like @ref QSpinBox itself).
*/
@@ -281,49 +286,49 @@ public:
/**
* @return the minimum value.
*/
int minValue() const;
/**
* Sets the maximum value.
*/
void setMaxValue(int max);
/**
* @return the maximum value.
*/
int maxValue() const;
/**
* Sets the special value text. If set, the SpinBox will display
* this text instead of the numeric value whenever the current
* value is equal to minVal(). Typically this is used for indicating
* that the choice has a special (default) meaning.
*/
void setSpecialValueText(const QString& text);
/**
* @reimplemented
*/
- virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop);
+ virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
/**
* This method returns the minimum size necessary to display the
* control. The minimum size is enough to show all the labels
* in the current font (font change may invalidate the return value).
*
* @return the minimum size necessary to show the control
*/
virtual QSize minimumSizeHint() const;
public slots:
/**
* Sets the value of the control.
*/
void setValue(int);
/**
* Sets the value in units of the @ref referencePoint
* @since 3.1
*/
void setRelativeValue(double);
/**
* Sets the reference point for @ref relativeValue.
@@ -567,49 +572,49 @@ public:
/**
* @return the reference point for @ref #relativeValue calculation
* @since 3.1
*/
double referencePoint() const;
/**
* @return the current value in units of @ref #referencePoint.
* @since 3.1
*/
double relativeValue() const;
/**
* Sets the special value text. If set, the spin box will display
* this text instead of the numeric value whenever the current
* value is equal to @ref #minVal(). Typically this is used for indicating
* that the choice has a special (default) meaning.
*/
void setSpecialValueText(const QString& text);
/**
* @reimplemented
*/
- virtual void setLabel(const QString & label, int a = AlignLeft | AlignTop);
+ virtual void setLabel(const QString & label, int a = Qt::AlignLeft | Qt::AlignTop);
/**
* @reimplemented
*/
virtual QSize minimumSizeHint() const;
/**
* @reimplemented
*/
virtual bool eventFilter(QObject*, QEvent*);
public slots:
/**
* Sets the value of the control.
*/
void setValue(double);
/**
* Sets the value in units of @ref #referencePoint.
* @since 3.1
*/
void setRelativeValue(double);
/**
* Sets the reference Point to @p ref. It @p ref == 0, emitting of
* @ref #relativeValueChanged is blocked and @ref #relativeValue
@@ -737,48 +742,52 @@ public:
* @param name The Name of the widget.
*/
KIntSpinBox(int lower, int upper, int step, int value, int base = 10,
QWidget* parent = 0, const char* name = 0);
/**
* Destructor.
*/
virtual ~KIntSpinBox();
/**
* Sets the base in which the numbers in the spin box are represented.
*/
void setBase(int base);
/**
* @return the base in which numbers in the spin box are represented.
*/
int base() const;
/**
* sets focus and optionally marks all text
*
*/
void setEditFocus(bool mark);
+ void setValidator(const QValidator *v) {
+ lineEdit()->setValidator(v);
+ }
+
protected:
/**
* Overloaded the method in QSpinBox
* to make use of the base given in the constructor.
*/
virtual QString mapValueToText(int);
/**
* Overloaded the method in QSpinBox
* to make use of the base given in the constructor.
*/
virtual int mapTextToValue(bool*);
private:
int val_base;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KIntSpinBoxPrivate;
KIntSpinBoxPrivate *d;
};