File indexing completed on 2024-04-21 03:41:52

0001 /***************************************************************************
0002  *   Copyright (C) 2004-2008 by Albert Astals Cid                          *
0003  *   aacid@kde.org                                                         *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef _INTEGER_INPUT_DIALOG_H
0012 #define _INTEGER_INPUT_DIALOG_H
0013 
0014 #include <QDialog>
0015 
0016 class QSpinBox;
0017 class QSlider;
0018 
0019 class IntegerInputDialog : public QDialog
0020 {
0021 Q_OBJECT
0022     public:
0023         IntegerInputDialog(QWidget *parent, const QString &title, const QString &question,
0024                    int from, int upto, int byDefault = -1);
0025         static int GetInteger(QWidget *parent, const QString &title, const QString &question,
0026                       int from, int upto, int byDefault, bool *rOK);
0027 
0028         int value() const;
0029 
0030     public Q_SLOTS:
0031         void setValue(int newValue);
0032 
0033     private Q_SLOTS:
0034         void sliderValueChanged(int newValue);
0035         void spinboxValueChanged(int newValue);
0036 
0037     private:
0038         QSpinBox *_spinBox;
0039         QSlider  *_slider;
0040 };
0041 
0042 #endif // def _INTEGER_INPUT_DIALOG_H
0043