• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
ktimecombobox.h
Go to the documentation of this file.
1/*
2 Copyright 2011 John Layt <john@layt.net>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KTIMECOMBOBOX_H
21#define KTIMECOMBOBOX_H
22
23#include <kdeui_export.h>
24
25#include <QtGui/QWidget>
26
27#include "kcombobox.h"
28#include "klocale.h"
29
30class KTimeComboBoxPrivate;
31
32class KDEUI_EXPORT KTimeComboBox : public KComboBox
33{
34 Q_OBJECT
35
36 Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY timeChanged USER true)
37 Q_PROPERTY(QTime minimumTime READ minimumTime WRITE setMinimumTime RESET resetMinimumTime)
38 Q_PROPERTY(QTime maximumTime READ maximumTime WRITE setMaximumTime RESET resetMaximumTime)
39 Q_PROPERTY(int timeListInterval READ timeListInterval WRITE setTimeListInterval)
40 Q_PROPERTY(Options options READ options WRITE setOptions)
41 Q_FLAGS(Options)
42
43public:
44
50 enum Option {
51 EditTime = 0x0001,
52 SelectTime = 0x0002,
53 ForceTime = 0x0004,
54 WarnOnInvalid = 0x0008
55 };
56 Q_DECLARE_FLAGS(Options, Option)
57
58
61 explicit KTimeComboBox(QWidget *parent = 0);
62
66 virtual ~KTimeComboBox();
67
73 QTime time() const;
74
83 bool isValid() const;
84
91 bool isNull() const;
92
98 Options options() const;
99
107 KLocale::TimeFormatOptions displayFormat() const;
108
114 QTime minimumTime() const;
115
119 void resetMinimumTime();
120
126 QTime maximumTime() const;
127
131 void resetMaximumTime();
132
143 void setTimeRange(const QTime &minTime,
144 const QTime &maxTime,
145 const QString &minWarnMsg = QString(),
146 const QString &maxWarnMsg = QString());
147
151 void resetTimeRange();
152
161 int timeListInterval() const;
162
171 QList<QTime> timeList() const;
172
173Q_SIGNALS:
174
182 void timeEntered(const QTime &time);
183
192 void timeChanged(const QTime &time);
193
201 void timeEdited(const QTime &time);
202
203public Q_SLOTS:
204
213 void setTime(const QTime &time);
214
220 void setOptions(Options options);
221
229 void setDisplayFormat(KLocale::TimeFormatOptions formatOptions);
230
244 void setMinimumTime(const QTime &minTime, const QString &minWarnMsg = QString());
245
259 void setMaximumTime(const QTime &maxTime, const QString &maxWarnMsg = QString());
260
280 void setTimeListInterval(int minutes);
281
299 void setTimeList(QList<QTime> timeList,
300 const QString &minWarnMsg = QString(),
301 const QString &maxWarnMsg = QString());
302
303protected:
304
305 virtual bool eventFilter(QObject *object, QEvent *event);
306 virtual void showPopup();
307 virtual void hidePopup();
308 virtual void mousePressEvent(QMouseEvent *event);
309 virtual void wheelEvent(QWheelEvent *event);
310 virtual void keyPressEvent(QKeyEvent *event);
311 virtual void focusInEvent(QFocusEvent *event);
312 virtual void focusOutEvent(QFocusEvent *event);
313 virtual void resizeEvent(QResizeEvent *event);
314
322 virtual void assignTime(const QTime &time);
323
324private:
325
326 friend class KTimeComboBoxPrivate;
327 KTimeComboBoxPrivate *const d;
328
329 Q_PRIVATE_SLOT(d, void selectTime(int index))
330 Q_PRIVATE_SLOT(d, void editTime(const QString&))
331 Q_PRIVATE_SLOT(d, void enterTime(const QTime&))
332 Q_PRIVATE_SLOT(d, void parseTime())
333
334};
335
336Q_DECLARE_OPERATORS_FOR_FLAGS(KTimeComboBox::Options)
337
338#endif // KTIMECOMBOBOX_H
KComboBox
An enhanced combo box.
Definition: kcombobox.h:149
KTimeComboBox
Definition: ktimecombobox.h:33
KTimeComboBox::Option
Option
Options provided by the widget.
Definition: ktimecombobox.h:50
KTimeComboBox::timeEntered
void timeEntered(const QTime &time)
Signal if the time has been manually entered or selected by the user.
KTimeComboBox::timeChanged
void timeChanged(const QTime &time)
Signal if the time has been changed either manually by the user or programatically.
KTimeComboBox::timeEdited
void timeEdited(const QTime &time)
Signal if the time is being manually edited by the user.
QList
QObject
QWidget
kcombobox.h
kdeui_export.h
klocale.h
Option
Option
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal