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

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • widgets
ktimecombobox.cpp
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 #include "ktimecombobox.h"
21 
22 #include <QtCore/QTime>
23 #include <QtGui/QKeyEvent>
24 #include <QtGui/QLineEdit>
25 
26 #include "kglobal.h"
27 #include "kdebug.h"
28 #include "klocale.h"
29 #include "kcombobox.h"
30 #include "kmessagebox.h"
31 
32 class KTimeComboBoxPrivate
33 {
34 public:
35 
36  KTimeComboBoxPrivate(KTimeComboBox *q);
37  virtual ~KTimeComboBoxPrivate();
38 
39  QTime defaultMinTime();
40  QTime defaultMaxTime();
41 
42  QString timeFormatToInputMask(const QString &format, bool nullMask = false);
43  QTime nearestIntervalTime(const QTime &time);
44  QString formatTime(const QTime &time);
45  QString convertDigits(const QString &digits);
46 
47  void initTimeWidget();
48  void updateTimeWidget();
49 
50 // Q_PRIVATE_SLOTs
51  void selectTime(int index);
52  void editTime(const QString &text);
53  void enterTime(const QTime &time);
54  void parseTime();
55  void warnTime();
56 
57  KTimeComboBox *const q;
58 
59  QTime m_time;
60  KTimeComboBox::Options m_options;
61  QTime m_minTime;
62  QTime m_maxTime;
63  QString m_minWarnMsg;
64  QString m_maxWarnMsg;
65  QString m_nullString;
66  bool m_warningShown;
67  KLocale::TimeFormatOptions m_displayFormat;
68  int m_timeListInterval;
69  QList<QTime> m_timeList;
70 };
71 
72 KTimeComboBoxPrivate::KTimeComboBoxPrivate(KTimeComboBox *q)
73  :q(q),
74  m_time(QTime(0, 0, 0)),
75  m_warningShown(false),
76  m_displayFormat(KLocale::TimeDefault),
77  m_timeListInterval(15)
78 {
79  m_options = KTimeComboBox::EditTime | KTimeComboBox::SelectTime;
80  m_minTime = defaultMinTime();
81  m_maxTime = defaultMaxTime();
82 }
83 
84 KTimeComboBoxPrivate::~KTimeComboBoxPrivate()
85 {
86 }
87 
88 QTime KTimeComboBoxPrivate::defaultMinTime()
89 {
90  return QTime(0, 0, 0, 0);
91 }
92 
93 QTime KTimeComboBoxPrivate::defaultMaxTime()
94 {
95  return QTime(23, 59, 59, 999);
96 }
97 
98 QString KTimeComboBoxPrivate::timeFormatToInputMask(const QString &format, bool nullMask)
99 {
100  //TODO not sure this will always work, does it support DigitSets, am/pm is dodgy?
101  QString mask = formatTime(QTime(12,34,56,789));
102  QString null = mask;
103  mask.replace(convertDigits(QLatin1String("12")), QLatin1String("09"));
104  null.replace(convertDigits(QLatin1String("12")), QLatin1String(""));
105  mask.replace(convertDigits(QLatin1String("34")), QLatin1String("99"));
106  null.replace(convertDigits(QLatin1String("34")), QLatin1String(""));
107  mask.replace(convertDigits(QLatin1String("56")), QLatin1String("99"));
108  null.replace(convertDigits(QLatin1String("56")), QLatin1String(""));
109  mask.replace(convertDigits(QLatin1String("789")), QLatin1String("900"));
110  null.replace(convertDigits(QLatin1String("789")), QLatin1String(""));
111  if (format.contains(QLatin1String("%p")) ||
112  format.contains(QLatin1String("%P"))) {
113  QString am = KGlobal::locale()->dayPeriodText(QTime(0, 0, 0));
114  QString pm = KGlobal::locale()->dayPeriodText(QTime(12, 0, 0));
115  int ampmLen = qMax(am.length(), pm.length());
116  QString ampmMask;
117  for (int i = 0; i < ampmLen; ++i) {
118  ampmMask.append(QLatin1Char('a'));
119  }
120  mask.replace(pm, ampmMask);
121  null.replace(pm, QLatin1String(""));
122  }
123 
124  if (nullMask) {
125  return null;
126  } else {
127  return mask;
128  }
129 }
130 
131 QTime KTimeComboBoxPrivate::nearestIntervalTime(const QTime &time)
132 {
133  int i = 0;
134  while (q->itemData(i).toTime() < time) {
135  ++i;
136  }
137  QTime before = q->itemData(i).toTime();
138  QTime after = q->itemData(i + 1).toTime();
139  if (before.secsTo(time) <= time.secsTo(after)) {
140  return before;
141  } else {
142  return after;
143  }
144 }
145 
146 QString KTimeComboBoxPrivate::formatTime(const QTime &time)
147 {
148  return KGlobal::locale()->formatTime(time, m_displayFormat);
149 }
150 
151 QString KTimeComboBoxPrivate::convertDigits(const QString &digits)
152 {
153  return KGlobal::locale()->convertDigits(digits, KGlobal::locale()->dateTimeDigitSet());
154 }
155 
156 void KTimeComboBoxPrivate::initTimeWidget()
157 {
158  q->blockSignals(true);
159  q->clear();
160 
161  // Set the input mask from the current format
162  q->lineEdit()->setInputMask(timeFormatToInputMask(KGlobal::locale()->timeFormat()));
163  m_nullString = timeFormatToInputMask(KGlobal::locale()->timeFormat(), true);
164 
165  // If EditTime then set the line edit
166  q->lineEdit()->setReadOnly((m_options &KTimeComboBox::EditTime) != KTimeComboBox::EditTime);
167 
168  // If SelectTime then make list items visible
169  if ((m_options &KTimeComboBox::SelectTime) == KTimeComboBox::SelectTime) {
170  q->setMaxVisibleItems(10);
171  } else {
172  q->setMaxVisibleItems(0);
173  }
174 
175  // Populate the drop-down time list
176  // If no time list set the use the time interval
177  if (m_timeList.isEmpty()) {
178  QTime startTime = m_minTime;
179  QTime thisTime(startTime.hour(), 0, 0, 0);
180  while (thisTime.isValid() && thisTime <= startTime) {
181  thisTime = thisTime.addSecs(m_timeListInterval * 60);
182  }
183  QTime endTime = m_maxTime;
184  q->addItem(formatTime(startTime), startTime);
185  while (thisTime.isValid() && thisTime < endTime) {
186  q->addItem(formatTime(thisTime), thisTime);
187  QTime newTime = thisTime.addSecs(m_timeListInterval * 60);
188  if (newTime.isValid() && newTime > thisTime) {
189  thisTime = newTime;
190  } else {
191  thisTime = QTime();
192  }
193  }
194  q->addItem(formatTime(endTime), endTime);
195  } else {
196  foreach (const QTime &thisTime, m_timeList) {
197  if (thisTime.isValid() && thisTime >= m_minTime && thisTime <= m_maxTime) {
198  q->addItem(formatTime(thisTime), thisTime);
199  }
200  }
201  }
202  q->blockSignals(false);
203 }
204 
205 void KTimeComboBoxPrivate::updateTimeWidget()
206 {
207  q->blockSignals(true);
208  int pos = q->lineEdit()->cursorPosition();
209  //Set index before setting text otherwise it overwrites
210  int i = 0;
211  if (!m_time.isValid() || m_time < m_minTime) {
212  i = 0;
213  } else if (m_time > m_maxTime) {
214  i = q->count() - 1;
215  } else {
216  while (q->itemData(i).toTime() < m_time && i < q->count() - 1) {
217  ++i;
218  }
219  }
220  q->setCurrentIndex(i);
221  if (m_time.isValid()) {
222  q->lineEdit()->setText(formatTime(m_time));
223  } else {
224  q->lineEdit()->setText(QString());
225  }
226  q->lineEdit()->setCursorPosition(pos);
227  q->blockSignals(false);
228 }
229 
230 void KTimeComboBoxPrivate::selectTime(int index)
231 {
232  enterTime(q->itemData(index).toTime());
233 }
234 
235 void KTimeComboBoxPrivate::editTime(const QString &text)
236 {
237  m_warningShown = false;
238  emit q->timeEdited(KGlobal::locale()->readTime(text));
239 }
240 
241 void KTimeComboBoxPrivate::parseTime()
242 {
243  m_time = KGlobal::locale()->readTime(q->lineEdit()->text());
244 }
245 
246 void KTimeComboBoxPrivate::enterTime(const QTime &time)
247 {
248  q->setTime(time);
249  warnTime();
250  emit q->timeEntered(m_time);
251 }
252 
253 void KTimeComboBoxPrivate::warnTime()
254 {
255  if (!m_warningShown && !q->isValid() &&
256  (m_options &KTimeComboBox::WarnOnInvalid) == KTimeComboBox::WarnOnInvalid) {
257  QString warnMsg;
258  if (!m_time.isValid()) {
259  warnMsg = i18nc("@info", "The time you entered is invalid");
260  } else if (m_time < m_minTime) {
261  if (m_minWarnMsg.isEmpty()) {
262  warnMsg = i18nc("@info", "Time cannot be earlier than %1", formatTime(m_minTime));
263  } else {
264  warnMsg = m_minWarnMsg;
265  warnMsg.replace("%1", formatTime(m_minTime));
266  }
267  } else if (m_time > m_maxTime) {
268  if (m_maxWarnMsg.isEmpty()) {
269  warnMsg = i18nc("@info", "Time cannot be later than %1", formatTime(m_maxTime));
270  } else {
271  warnMsg = m_maxWarnMsg;
272  warnMsg.replace("%1", formatTime(m_maxTime));
273  }
274  }
275  m_warningShown = true;
276  KMessageBox::sorry(q, warnMsg);
277  }
278 }
279 
280 KTimeComboBox::KTimeComboBox(QWidget *parent)
281  :KComboBox(parent),
282  d(new KTimeComboBoxPrivate(this))
283 {
284  setEditable(true);
285  setInsertPolicy(QComboBox::NoInsert);
286  setSizeAdjustPolicy(QComboBox::AdjustToContents);
287  d->initTimeWidget();
288  d->updateTimeWidget();
289 
290  connect( this, SIGNAL(activated(int)),
291  this, SLOT(selectTime(int)));
292  connect( this, SIGNAL(editTextChanged(QString)),
293  this, SLOT(editTime(QString)));
294 }
295 
296 KTimeComboBox::~KTimeComboBox()
297 {
298  delete d;
299 }
300 
301 QTime KTimeComboBox::time() const
302 {
303  d->parseTime();
304  return d->m_time;
305 }
306 
307 void KTimeComboBox::setTime(const QTime &time)
308 {
309  if (time == d->m_time) {
310  return;
311  }
312 
313  if ((d->m_options &KTimeComboBox::ForceTime) == KTimeComboBox::ForceTime) {
314  assignTime(d->nearestIntervalTime(time));
315  } else {
316  assignTime(time);
317  }
318 
319  d->updateTimeWidget();
320  emit timeChanged(d->m_time);
321 }
322 
323 void KTimeComboBox::assignTime(const QTime &time)
324 {
325  d->m_time = time;
326 }
327 
328 bool KTimeComboBox::isValid() const
329 {
330  d->parseTime();
331  return d->m_time.isValid() &&
332  d->m_time >= d->m_minTime &&
333  d->m_time <= d->m_maxTime;
334 }
335 
336 bool KTimeComboBox::isNull() const
337 {
338  return lineEdit()->text() == d->m_nullString;
339 }
340 
341 KTimeComboBox::Options KTimeComboBox::options() const
342 {
343  return d->m_options;
344 }
345 
346 void KTimeComboBox::setOptions(Options options)
347 {
348  if (options != d->m_options) {
349  d->m_options = options;
350  d->initTimeWidget();
351  d->updateTimeWidget();
352  }
353 }
354 
355 QTime KTimeComboBox::minimumTime() const
356 {
357  return d->m_minTime;
358 }
359 
360 void KTimeComboBox::setMinimumTime(const QTime &minTime, const QString &minWarnMsg)
361 {
362  setTimeRange(minTime, d->m_maxTime, minWarnMsg, d->m_maxWarnMsg);
363 }
364 
365 void KTimeComboBox::resetMinimumTime()
366 {
367  setTimeRange(d->defaultMinTime(), d->m_maxTime, QString(), d->m_maxWarnMsg);
368 }
369 
370 QTime KTimeComboBox::maximumTime() const
371 {
372  return d->m_maxTime;
373 }
374 
375 void KTimeComboBox::setMaximumTime(const QTime &maxTime, const QString &maxWarnMsg)
376 {
377  setTimeRange(d->m_minTime, maxTime, d->m_minWarnMsg, maxWarnMsg);
378 }
379 
380 void KTimeComboBox::resetMaximumTime()
381 {
382  setTimeRange(d->m_minTime, d->defaultMaxTime(), d->m_minWarnMsg, QString());
383 }
384 
385 void KTimeComboBox::setTimeRange(const QTime &minTime, const QTime &maxTime,
386  const QString &minWarnMsg, const QString &maxWarnMsg)
387 {
388  if (!minTime.isValid() || !maxTime.isValid() || minTime > maxTime) {
389  return;
390  }
391 
392  if (minTime != d->m_minTime || maxTime != d->m_maxTime ||
393  minWarnMsg != d->m_minWarnMsg || maxWarnMsg != d->m_maxWarnMsg) {
394  d->m_minTime = minTime;
395  d->m_maxTime = maxTime;
396  d->m_minWarnMsg = minWarnMsg;
397  d->m_maxWarnMsg = maxWarnMsg;
398  d->initTimeWidget();
399  d->updateTimeWidget();
400  }
401 }
402 
403 void KTimeComboBox::resetTimeRange()
404 {
405  setTimeRange(d->defaultMinTime(), d->defaultMaxTime(), QString(), QString());
406 }
407 
408 KLocale::TimeFormatOptions KTimeComboBox::displayFormat() const
409 {
410  return d->m_displayFormat;
411 }
412 
413 void KTimeComboBox::setDisplayFormat(KLocale::TimeFormatOptions format)
414 {
415  if (format != d->m_displayFormat) {
416  d->m_displayFormat = format;
417  d->initTimeWidget();
418  d->updateTimeWidget();
419  }
420 }
421 
422 int KTimeComboBox::timeListInterval() const
423 {
424  return d->m_timeListInterval;
425 }
426 
427 void KTimeComboBox::setTimeListInterval(int minutes)
428 {
429  if (minutes != d->m_timeListInterval) {
430  //Must be able to exactly divide the valid time period
431  int lowMins = (d->m_minTime.hour() * 60) + d->m_minTime.minute();
432  int hiMins = (d->m_maxTime.hour() * 60) + d->m_maxTime.minute();
433  if (d->m_minTime.minute() == 0 && d->m_maxTime.minute() == 59) {
434  ++hiMins;
435  }
436  if ((hiMins - lowMins) % minutes == 0) {
437  d->m_timeListInterval = minutes;
438  d->m_timeList.clear();
439  } else {
440  return;
441  }
442  d->initTimeWidget();
443  }
444 }
445 
446 QList<QTime> KTimeComboBox::timeList() const
447 {
448  //Return the drop down list as it is what can be selected currently
449  QList<QTime> list;
450  int c = count();
451  for (int i = 0; i < c; ++i) {
452  list.append(itemData(i).toTime());
453  }
454  return list;
455 }
456 
457 void KTimeComboBox::setTimeList(QList<QTime> timeList,
458  const QString &minWarnMsg, const QString &maxWarnMsg)
459 {
460  if (timeList != d->m_timeList) {
461  d->m_timeList.clear();
462  foreach (const QTime &time, timeList) {
463  if (time.isValid() && !d->m_timeList.contains(time)) {
464  d->m_timeList.append(time);
465  }
466  }
467  qSort(d->m_timeList);
468  // Does the updateTimeWidget call for us
469  setTimeRange(d->m_timeList.first(), d->m_timeList.last(),
470  minWarnMsg, maxWarnMsg);
471  }
472 }
473 
474 bool KTimeComboBox::eventFilter(QObject *object, QEvent *event)
475 {
476  return KComboBox::eventFilter(object, event);
477 }
478 
479 void KTimeComboBox::keyPressEvent(QKeyEvent *keyEvent)
480 {
481  QTime temp;
482  switch (keyEvent->key()) {
483  case Qt::Key_Down:
484  temp = d->m_time.addSecs(-60);
485  break;
486  case Qt::Key_Up:
487  temp = d->m_time.addSecs(60);
488  break;
489  case Qt::Key_PageDown:
490  temp = d->m_time.addSecs(-3600);
491  break;
492  case Qt::Key_PageUp:
493  temp = d->m_time.addSecs(3600);
494  break;
495  default:
496  KComboBox::keyPressEvent(keyEvent);
497  return;
498  }
499  if (temp.isValid() && temp >= d->m_minTime && temp <= d->m_maxTime) {
500  d->enterTime(temp);
501  }
502 }
503 
504 void KTimeComboBox::focusOutEvent(QFocusEvent *event)
505 {
506  d->parseTime();
507  d->warnTime();
508  KComboBox::focusOutEvent(event);
509 }
510 
511 void KTimeComboBox::showPopup()
512 {
513  KComboBox::showPopup();
514 }
515 
516 void KTimeComboBox::hidePopup()
517 {
518  KComboBox::hidePopup();
519 }
520 
521 void KTimeComboBox::mousePressEvent(QMouseEvent *event)
522 {
523  KComboBox::mousePressEvent(event);
524 }
525 
526 void KTimeComboBox::wheelEvent(QWheelEvent *event)
527 {
528  KComboBox::wheelEvent(event);
529 }
530 
531 void KTimeComboBox::focusInEvent(QFocusEvent *event)
532 {
533  KComboBox::focusInEvent(event);
534 }
535 
536 void KTimeComboBox::resizeEvent(QResizeEvent *event)
537 {
538  KComboBox::resizeEvent(event);
539 }
540 
541 #include "ktimecombobox.moc"
KLocale::dayPeriodText
QString dayPeriodText(const QTime &time, DateTimeComponentFormat format=DefaultComponentFormat) const
KTimeComboBox::setDisplayFormat
void setDisplayFormat(KLocale::TimeFormatOptions formatOptions)
Sets the time format to display.
Definition: ktimecombobox.cpp:413
kcombobox.h
KTimeComboBox::showPopup
virtual void showPopup()
Definition: ktimecombobox.cpp:511
KTimeComboBox::~KTimeComboBox
virtual ~KTimeComboBox()
Destroy the widget.
Definition: ktimecombobox.cpp:296
KComboBox::setEditable
void setEditable(bool editable)
"Re-implemented" so that setEditable(true) creates a KLineEdit instead of QLineEdit.
Definition: kcombobox.cpp:386
kdebug.h
KTimeComboBox::resetTimeRange
void resetTimeRange()
Reset the minimum and maximum time to the default values.
Definition: ktimecombobox.cpp:403
KTimeComboBox::time
QTime time() const
Return the currently selected time.
mask
#define mask
KTimeComboBox::maximumTime
QTime maximumTime() const
Return the current maximum time.
KTimeComboBox::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
Definition: ktimecombobox.cpp:521
QWidget
KTimeComboBox::wheelEvent
virtual void wheelEvent(QWheelEvent *event)
Definition: ktimecombobox.cpp:526
KTimeComboBox::options
Options options() const
Return the currently set widget options.
KTimeComboBox::focusOutEvent
virtual void focusOutEvent(QFocusEvent *event)
Definition: ktimecombobox.cpp:504
KLocale::formatTime
QString formatTime(const QTime &pTime, bool includeSecs=false, bool isDuration=false) const
QString
KTimeComboBox::WarnOnInvalid
Show a warning box on focus out if the user enters an invalid time.
Definition: ktimecombobox.h:54
KTimeComboBox::isNull
bool isNull() const
Return if the current user input is null.
Definition: ktimecombobox.cpp:336
KTimeComboBox::EditTime
Allow the user to manually edit the time in the combo line edit.
Definition: ktimecombobox.h:51
QObject
klocale.h
i18nc
QString i18nc(const char *ctxt, const char *text)
KTimeComboBox::isValid
bool isValid() const
Return if the current user input is valid.
Definition: ktimecombobox.cpp:328
KLocale::convertDigits
QString convertDigits(const QString &str, DigitSet digitSet, bool ignoreContext=false) const
kglobal.h
KTimeComboBox::setMaximumTime
void setMaximumTime(const QTime &maxTime, const QString &maxWarnMsg=QString())
Set the maximum allowed time.
Definition: ktimecombobox.cpp:375
KTimeComboBox::resetMinimumTime
void resetMinimumTime()
Reset the minimum time to the default of 00:00:00.000.
Definition: ktimecombobox.cpp:365
KTimeComboBox::displayFormat
KLocale::TimeFormatOptions displayFormat() const
Return the currently set time format.
Definition: ktimecombobox.cpp:408
KMessageBox::sorry
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
Display an "Sorry" dialog.
Definition: kmessagebox.cpp:904
KTimeComboBox::setTimeListInterval
void setTimeListInterval(int minutes)
Set the interval between times able to be selected from the drop-down.
Definition: ktimecombobox.cpp:427
KTimeComboBox::minimumTime
QTime minimumTime() const
Return the current minimum time.
KTimeComboBox::setMinimumTime
void setMinimumTime(const QTime &minTime, const QString &minWarnMsg=QString())
Set the minimum allowed time.
Definition: ktimecombobox.cpp:360
KTimeComboBox::setOptions
void setOptions(Options options)
Set the new widget options.
Definition: ktimecombobox.cpp:346
KLocale::readTime
QTime readTime(const QString &str, bool *ok=0) const
ktimecombobox.h
KTimeComboBox::KTimeComboBox
KTimeComboBox(QWidget *parent=0)
Create a new KTimeComboBox widget.
Definition: ktimecombobox.cpp:280
KTimeComboBox::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
Definition: ktimecombobox.cpp:479
KTimeComboBox::SelectTime
Allow the user to select the time from a drop-down menu.
Definition: ktimecombobox.h:52
KTimeComboBox::timeChanged
void timeChanged(const QTime &time)
Signal if the time has been changed either manually by the user or programatically.
KTimeComboBox::assignTime
virtual void assignTime(const QTime &time)
Assign the time for the widget.
Definition: ktimecombobox.cpp:323
KGlobal::locale
KLocale * locale()
KTimeComboBox
Definition: ktimecombobox.h:32
KLocale
KTimeComboBox::resetMaximumTime
void resetMaximumTime()
Reset the maximum time to the default of 23:59:59.999.
Definition: ktimecombobox.cpp:380
KTimeComboBox::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Definition: ktimecombobox.cpp:536
KTimeComboBox::hidePopup
virtual void hidePopup()
Definition: ktimecombobox.cpp:516
KTimeComboBox::focusInEvent
virtual void focusInEvent(QFocusEvent *event)
Definition: ktimecombobox.cpp:531
KTimeComboBox::timeListInterval
int timeListInterval() const
Return the interval between select time list entries if set by setTimeListInterval().
KComboBox
An enhanced combo box.
Definition: kcombobox.h:148
KTimeComboBox::timeList
QList< QTime > timeList() const
Return the list of times able to be selected in the drop-down.
Definition: ktimecombobox.cpp:446
KTimeComboBox::setTimeList
void setTimeList(QList< QTime > timeList, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString())
Set the list of times able to be selected from the drop-down.
Definition: ktimecombobox.cpp:457
KTimeComboBox::eventFilter
virtual bool eventFilter(QObject *object, QEvent *event)
Re-implemented for internal reasons.
Definition: ktimecombobox.cpp:474
kmessagebox.h
KTimeComboBox::ForceTime
Any set or entered time will be forced to one of the drop-down times.
Definition: ktimecombobox.h:53
KComboBox::eventFilter
virtual bool eventFilter(QObject *, QEvent *)
Re-implemented for internal reasons.
Definition: kcombobox.cpp:183
KTimeComboBox::setTimeRange
void setTimeRange(const QTime &minTime, const QTime &maxTime, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString())
Set the minimum and maximum time range.
Definition: ktimecombobox.cpp:385
KTimeComboBox::setTime
void setTime(const QTime &time)
Set the currently selected time.
Definition: ktimecombobox.cpp:307
KComboBox::wheelEvent
virtual void wheelEvent(QWheelEvent *ev)
Definition: kcombobox.cpp:260
QList< QTime >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:15 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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