• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kalarm/lib

timespinbox.h

Go to the documentation of this file.
00001 /*
00002  *  timespinbox.h  -  time spinbox widget
00003  *  Program:  kalarm
00004  *  Copyright © 2001-2008 by David Jarvie <djarvie@kde.org>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef TIMESPINBOX_H
00022 #define TIMESPINBOX_H
00023 
00024 #include <QDateTime>
00025 #include "spinbox2.h"
00026 
00027 
00045 class TimeSpinBox : public SpinBox2
00046 {
00047         Q_OBJECT
00048     public:
00054         explicit TimeSpinBox(bool use24hour, QWidget* parent = 0);
00060         TimeSpinBox(int minMinute, int maxMinute, QWidget* parent = 0);
00064         bool            isValid() const;
00069         void            setValid(bool);
00071         virtual QValidator::State validate(QString&, int& pos) const;
00075         QTime           time() const;
00079         virtual void    setMinimum(int minutes);
00083         virtual void    setMaximum(int minutes)      { SpinBox2::setMaximum(minutes); }
00085         void            setMaximum(const QTime& t)   { SpinBox2::setMaximum(t.hour()*60 + t.minute()); }
00087         QTime           maxTime() const              { int mv = maximum();  return QTime(mv/60, mv%60); }
00091         virtual void    stepBy(int increment);
00095         static QString  shiftWhatsThis();
00096 
00097         virtual QSize   sizeHint() const;
00098         virtual QSize   minimumSizeHint() const;
00099 
00100     public slots:
00104         virtual void    setValue(int minutes);
00106         void            setValue(const QTime& t)     { setValue(t.hour()*60 + t.minute()); }
00107 
00108     protected:
00109         virtual QString textFromValue(int v) const;
00110         virtual int     valueFromText(const QString&) const;
00111     private slots:
00112         void            slotValueChanged(int value);
00113     private:
00114         int             mMinimumValue;       // real minimum value, excluding special value for "**:**"
00115         bool            m12Hour;             // use 12-hour clock
00116         bool            mPm;                 // use PM for manually entered values (with 12-hour clock)
00117         bool            mInvalid;            // value is currently invalid (asterisks)
00118         bool            mEnteredSetValue;    // to prevent infinite recursion in setValue()
00119 };
00120 
00121 #endif // TIMESPINBOX_H

kalarm/lib

Skip menu "kalarm/lib"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal