• 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
kdatecombobox.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 KDATECOMBOBOX_H
21 #define KDATECOMBOBOX_H
22 
23 #include <kdeui_export.h>
24 
25 #include <QtGui/QWidget>
26 
27 #include "kcombobox.h"
28 #include "klocale.h"
29 #include "kdatetime.h"
30 
31 class KDateComboBoxPrivate;
32 class KCalendarSystem;
33 
34 class KDEUI_EXPORT KDateComboBox : public KComboBox
35 {
36  Q_OBJECT
37 
38  Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged USER true)
39  Q_PROPERTY(QDate minimumDate READ minimumDate WRITE setMinimumDate RESET resetMinimumDate)
40  Q_PROPERTY(QDate maximumDate READ maximumDate WRITE setMaximumDate RESET resetMaximumDate)
41  Q_PROPERTY(Options options READ options WRITE setOptions)
42  Q_FLAGS(Options)
43 
44 public:
45 
51  enum Option {
52  EditDate = 0x0001,
53  SelectDate = 0x0002,
54  DatePicker = 0x0004,
55  DateKeywords = 0x0008,
56  WarnOnInvalid = 0x0010
57  };
58  Q_DECLARE_FLAGS(Options, Option)
59 
60 
67  explicit KDateComboBox(QWidget *parent = 0);
68 
72  virtual ~KDateComboBox();
73 
79  QDate date() const;
80 
88  KLocale::CalendarSystem calendarSystem() const;
89 
103  const KCalendarSystem *calendar() const;
104 
113  bool isValid() const;
114 
121  bool isNull() const;
122 
128  Options options() const;
129 
137  KLocale::DateFormat displayFormat() const;
138 
144  QDate minimumDate() const;
145 
151  QDate maximumDate() const;
152 
160  QMap<QDate, QString> dateMap() const;
161 
162 Q_SIGNALS:
163 
171  void dateEntered(const QDate &date);
172 
181  void dateChanged(const QDate &date);
182 
190  void dateEdited(const QDate &date);
191 
192 public Q_SLOTS:
193 
202  void setDate(const QDate &date);
203 
211  void setCalendarSystem(KLocale::CalendarSystem calendarSystem);
212 
220  void setCalendar(KCalendarSystem *calendar = 0);
221 
227  void setOptions(Options options);
228 
236  void setDisplayFormat(KLocale::DateFormat format);
237 
249  void setDateRange(const QDate &minDate,
250  const QDate &maxDate,
251  const QString &minWarnMsg = QString(),
252  const QString &maxWarnMsg = QString());
253 
258  void resetDateRange();
259 
273  void setMinimumDate(const QDate &minTime, const QString &minWarnMsg = QString());
274 
278  void resetMinimumDate();
279 
293  void setMaximumDate(const QDate &maxDate, const QString &maxWarnMsg = QString());
294 
298  void resetMaximumDate();
299 
315  void setDateMap(QMap<QDate, QString> dateMap);
316 
317 protected:
318 
319  virtual bool eventFilter(QObject *object, QEvent *event);
320  virtual void showPopup();
321  virtual void hidePopup();
322  virtual void mousePressEvent(QMouseEvent *event);
323  virtual void wheelEvent(QWheelEvent *event);
324  virtual void keyPressEvent(QKeyEvent *event);
325  virtual void focusInEvent(QFocusEvent *event);
326  virtual void focusOutEvent(QFocusEvent *event);
327  virtual void resizeEvent(QResizeEvent *event);
328 
336  virtual void assignDate(const QDate &date);
337 
345  virtual void assignCalendarSystem(KLocale::CalendarSystem calendarSystem);
346 
347 private:
348 
349  friend class KDateComboBoxPrivate;
350  KDateComboBoxPrivate *const d;
351 
352  Q_PRIVATE_SLOT(d, void clickDate())
353  Q_PRIVATE_SLOT(d, void selectDate(QAction*))
354  Q_PRIVATE_SLOT(d, void editDate(const QString&))
355  Q_PRIVATE_SLOT(d, void enterDate(const QDate&))
356  Q_PRIVATE_SLOT(d, void parseDate())
357 
358 };
359 
360 Q_DECLARE_OPERATORS_FOR_FLAGS(KDateComboBox::Options)
361 
362 #endif // KDATECOMBOBOX_H
kcombobox.h
kdatetime.h
KDateComboBox::Option
Option
Options provided by the widget.
Definition: kdatecombobox.h:51
QWidget
KDateComboBox
Definition: kdatecombobox.h:34
QString
QObject
klocale.h
KCalendarSystem
KLocale
KComboBox
An enhanced combo box.
Definition: kcombobox.h:148
kdeui_export.h
Option
Option
QAction
QMap
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:14 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