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

KDEUI

Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
KDateComboBox Class Reference

#include <kdatecombobox.h>

Inheritance diagram for KDateComboBox:
Inheritance graph
[legend]

Public Types

enum  Option {
  EditDate = 0x0001, SelectDate = 0x0002, DatePicker = 0x0004, DateKeywords = 0x0008,
  WarnOnInvalid = 0x0010
}
 
- Public Types inherited from KCompletionBase
typedef QMap< KeyBindingType,
KShortcut > 
KeyBindingMap
 
enum  KeyBindingType { TextCompletion, PrevCompletionMatch, NextCompletionMatch, SubstringCompletion }
 

Public Slots

void resetDateRange ()
 
void resetMaximumDate ()
 
void resetMinimumDate ()
 
void setCalendar (KCalendarSystem *calendar=0)
 
void setCalendarSystem (KLocale::CalendarSystem calendarSystem)
 
void setDate (const QDate &date)
 
void setDateMap (QMap< QDate, QString > dateMap)
 
void setDateRange (const QDate &minDate, const QDate &maxDate, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString())
 
void setDisplayFormat (KLocale::DateFormat format)
 
void setMaximumDate (const QDate &maxDate, const QString &maxWarnMsg=QString())
 
void setMinimumDate (const QDate &minTime, const QString &minWarnMsg=QString())
 
void setOptions (Options options)
 
- Public Slots inherited from KComboBox
void rotateText (KCompletionBase::KeyBindingType type)
 
void setCompletedItems (const QStringList &items, bool autosubject=true)
 
virtual void setCompletedText (const QString &)
 
void setCurrentItem (const QString &item, bool insert=false, int index=-1)
 

Signals

void dateChanged (const QDate &date)
 
void dateEdited (const QDate &date)
 
void dateEntered (const QDate &date)
 
- Signals inherited from KComboBox
void aboutToShowContextMenu (QMenu *p)
 
void completion (const QString &)
 
void completionModeChanged (KGlobalSettings::Completion)
 
void returnPressed ()
 
void returnPressed (const QString &)
 
void substringCompletion (const QString &)
 
void textRotation (KCompletionBase::KeyBindingType)
 

Public Member Functions

 KDateComboBox (QWidget *parent=0)
 
virtual ~KDateComboBox ()
 
const KCalendarSystem * calendar () const
 
KLocale::CalendarSystem calendarSystem () const
 
QDate date () const
 
QMap< QDate, QString > dateMap () const
 
KLocale::DateFormat displayFormat () const
 
bool isNull () const
 
bool isValid () const
 
QDate maximumDate () const
 
QDate minimumDate () const
 
Options options () const
 
- Public Member Functions inherited from KComboBox
 KComboBox (QWidget *parent=0)
 
 KComboBox (bool rw, QWidget *parent=0)
 
virtual ~KComboBox ()
 
void addUrl (const KUrl &url)
 
void addUrl (const QIcon &icon, const KUrl &url)
 
bool autoCompletion () const
 
void changeURL (const KUrl &url, int index)
 
void changeURL (const QPixmap &pixmap, const KUrl &url, int index)
 
void changeUrl (int index, const KUrl &url)
 
void changeUrl (int index, const QIcon &icon, const KUrl &url)
 
KCompletionBox * completionBox (bool create=true)
 
bool contains (const QString &text) const
 
int cursorPosition () const
 
void insertURL (const KUrl &url, int index=-1)
 
void insertURL (const QPixmap &pixmap, const KUrl &url, int index=-1)
 
void insertUrl (int index, const KUrl &url)
 
void insertUrl (int index, const QIcon &icon, const KUrl &url)
 
virtual void setAutoCompletion (bool autocomplete)
 
virtual void setContextMenuEnabled (bool showMenu)
 
void setEditable (bool editable)
 
void setEditUrl (const KUrl &url)
 
virtual void setLineEdit (QLineEdit *)
 
void setTrapReturnKey (bool trap)
 
void setUrlDropsEnabled (bool enable)
 
bool trapReturnKey () const
 
bool urlDropsEnabled () const
 
- Public Member Functions inherited from KCompletionBase
 KCompletionBase ()
 
virtual ~KCompletionBase ()
 
KGlobalSettings::Completion completionMode () const
 
KCompletion * completionObject (bool hsig=true)
 
KCompletion * compObj () const
 
bool emitSignals () const
 
KShortcut getKeyBinding (KeyBindingType item) const
 
bool handleSignals () const
 
bool isCompletionObjectAutoDeleted () const
 
void setAutoDeleteCompletionObject (bool autoDelete)
 
virtual void setCompletedItems (const QStringList &items, bool autoSuggest=true)=0
 
virtual void setCompletedText (const QString &text)=0
 
virtual void setCompletionMode (KGlobalSettings::Completion mode)
 
virtual void setCompletionObject (KCompletion *compObj, bool hsig=true)
 
void setEnableSignals (bool enable)
 
virtual void setHandleSignals (bool handle)
 
bool setKeyBinding (KeyBindingType item, const KShortcut &key)
 
void useGlobalKeyBindings ()
 

Protected Member Functions

virtual void assignCalendarSystem (KLocale::CalendarSystem calendarSystem)
 
virtual void assignDate (const QDate &date)
 
virtual bool eventFilter (QObject *object, QEvent *event)
 
virtual void focusInEvent (QFocusEvent *event)
 
virtual void focusOutEvent (QFocusEvent *event)
 
virtual void hidePopup ()
 
virtual void keyPressEvent (QKeyEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void showPopup ()
 
virtual void wheelEvent (QWheelEvent *event)
 
- Protected Member Functions inherited from KComboBox
virtual void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
virtual QSize minimumSizeHint () const
 
virtual void setCompletedText (const QString &, bool)
 
- Protected Member Functions inherited from KCompletionBase
KCompletionBase * delegate () const
 
KeyBindingMap getKeyBindings () const
 
void setDelegate (KCompletionBase *delegate)
 
virtual void virtual_hook (int id, void *data)
 

Properties

QDate date
 
QDate maximumDate
 
QDate minimumDate
 
Options options
 
- Properties inherited from KComboBox
bool autoCompletion
 
bool trapReturnKey
 
bool urlDropsEnabled
 

Additional Inherited Members

- Protected Slots inherited from KComboBox
virtual void makeCompletion (const QString &)
 

Detailed Description

Definition at line 34 of file kdatecombobox.h.

Member Enumeration Documentation

enum KDateComboBox::Option

Options provided by the widget.

See also
options()
setOptions()
Enumerator
EditDate 

Allow the user to manually edit the date in the combo line edit.

SelectDate 

Allow the user to select the date from a drop-down menu.

DatePicker 

Show a date picker in the drop-down.

DateKeywords 

Show date keywords in the drop-down.

WarnOnInvalid 

Show a warning on focus out if the date is invalid.

Definition at line 51 of file kdatecombobox.h.

Constructor & Destructor Documentation

KDateComboBox::KDateComboBox ( QWidget *  parent = 0)
explicit

Create a new KDateComboBox widget.

By default the EditDate, SelectDate, DatePicker and DateKeywords options are enabled, the ShortDate format is used and the date is set to the current date.

Definition at line 278 of file kdatecombobox.cpp.

KDateComboBox::~KDateComboBox ( )
virtual

Destroy the widget.

Definition at line 299 of file kdatecombobox.cpp.

Member Function Documentation

void KDateComboBox::assignCalendarSystem ( KLocale::CalendarSystem  calendarSystem)
protectedvirtual

Assign the calendar system for the widget.

Virtual to allow sub-classes to apply extra validation rules.

Parameters
timethe new time

Definition at line 338 of file kdatecombobox.cpp.

void KDateComboBox::assignDate ( const QDate &  date)
protectedvirtual

Assign the date for the widget.

Virtual to allow sub-classes to apply extra validation rules.

Parameters
datethe new date

Definition at line 321 of file kdatecombobox.cpp.

const KCalendarSystem * KDateComboBox::calendar ( ) const

Returns a pointer to the Calendar System object used by this widget.

Usually this will be the Global Calendar System using the Global Locale, but this may have been changed to a custom Calendar System possibly using a custom Locale.

Normally you will not need to access this object.

See also
KCalendarSystem
setCalendar
Returns
the current calendar system instance

Definition at line 343 of file kdatecombobox.cpp.

KLocale::CalendarSystem KDateComboBox::calendarSystem ( ) const

Returns the Calendar System type used by the widget.

See also
KLocale::CalendarSystem
setCalendarSystem()
Returns
the Calendar System currently used

Definition at line 326 of file kdatecombobox.cpp.

QDate KDateComboBox::date ( ) const

Return the currently selected date.

Returns
the currently selected date
void KDateComboBox::dateChanged ( const QDate &  date)
signal

Signal if the date has been changed either manually by the user or programatically.

The returned date may be invalid.

Parameters
datethe new date
void KDateComboBox::dateEdited ( const QDate &  date)
signal

Signal if the date is being manually edited by the user.

The returned date may be invalid.

Parameters
datethe new date
void KDateComboBox::dateEntered ( const QDate &  date)
signal

Signal if the date has been manually entered or selected by the user.

The returned date may be invalid.

Parameters
datethe new date
QMap< QDate, QString > KDateComboBox::dateMap ( ) const

Return the map of dates listed in the drop-down and their displayed string forms.

See also
setDateMap()
Returns
the select date map

Definition at line 448 of file kdatecombobox.cpp.

KLocale::DateFormat KDateComboBox::displayFormat ( ) const

Return the currently set date display format.

By default this is the Short Date

Returns
the currently set date format

Definition at line 434 of file kdatecombobox.cpp.

bool KDateComboBox::eventFilter ( QObject *  o,
QEvent *  ev 
)
protectedvirtual

Re-implemented for internal reasons.

API not affected.

Reimplemented from KComboBox.

Definition at line 462 of file kdatecombobox.cpp.

void KDateComboBox::focusInEvent ( QFocusEvent *  event)
protectedvirtual

Definition at line 553 of file kdatecombobox.cpp.

void KDateComboBox::focusOutEvent ( QFocusEvent *  event)
protectedvirtual

Definition at line 492 of file kdatecombobox.cpp.

void KDateComboBox::hidePopup ( )
protectedvirtual

Definition at line 538 of file kdatecombobox.cpp.

bool KDateComboBox::isNull ( ) const

Return if the current user input is null.

See also
isValid()
Returns
if the current user input is null

Definition at line 361 of file kdatecombobox.cpp.

bool KDateComboBox::isValid ( ) const

Return if the current user input is valid.

If the user input is null then it is not valid

See also
isNull()
Returns
if the current user input is valid

Definition at line 353 of file kdatecombobox.cpp.

void KDateComboBox::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Definition at line 467 of file kdatecombobox.cpp.

QDate KDateComboBox::maximumDate ( ) const

Return the current maximum date.

Returns
the current maximum date
QDate KDateComboBox::minimumDate ( ) const

Return the current minimum date.

Returns
the current minimum date
void KDateComboBox::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Definition at line 543 of file kdatecombobox.cpp.

Options KDateComboBox::options ( ) const

Return the currently set widget options.

Returns
the currently set widget options
void KDateComboBox::resetDateRange ( )
slot

Reset the minimum and maximum date to the default values.

See also
setDateRange()

Definition at line 429 of file kdatecombobox.cpp.

void KDateComboBox::resetMaximumDate ( )
slot

Reset the maximum date to the default.

Definition at line 405 of file kdatecombobox.cpp.

void KDateComboBox::resetMinimumDate ( )
slot

Reset the minimum date to the default.

Definition at line 390 of file kdatecombobox.cpp.

void KDateComboBox::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Definition at line 558 of file kdatecombobox.cpp.

void KDateComboBox::setCalendar ( KCalendarSystem *  calendar = 0)
slot

Changes the calendar system to use.

Can use its own local locale if set.

You retain ownership of the calendar object, it will not be destroyed with the widget.

Parameters
calendarthe calendar system object to use, defaults to global

Definition at line 348 of file kdatecombobox.cpp.

void KDateComboBox::setCalendarSystem ( KLocale::CalendarSystem  calendarSystem)
slot

Set the Calendar System used for this widget.

Uses the global locale.

See also
KLocale::CalendarSystem
calendarSystem()
Parameters
calendarSystemthe Calendar System to use

Definition at line 331 of file kdatecombobox.cpp.

void KDateComboBox::setDate ( const QDate &  date)
slot

Set the currently selected date.

You can set an invalid date or a date outside the valid range, validity checking is only done via isValid().

Parameters
datethe new date

Definition at line 310 of file kdatecombobox.cpp.

void KDateComboBox::setDateMap ( QMap< QDate, QString >  dateMap)
slot

Set the list of dates able to be selected from the drop-down and the string form to display for those dates, e.g.

"2010-01-01" and "Yesterday".

Any invalid or duplicate dates will be used, the list will NOT be sorted, and the minimum and maximum date will not be affected.

The dateMap is keyed by the date to be listed and the value is the string to be displayed. If you want the date to be displayed in the default date format then the string should be null. If you want a separator to be displayed then set the string to "seperator".

See also
dateMap()
Parameters
dateMapthe map of dates able to be selected

Definition at line 453 of file kdatecombobox.cpp.

void KDateComboBox::setDateRange ( const QDate &  minDate,
const QDate &  maxDate,
const QString &  minWarnMsg = QString(),
const QString &  maxWarnMsg = QString() 
)
slot

Set the valid date range to be applied by isValid().

Both dates must be valid and the minimum date must be less than or equal to the maximum date, otherwise the date range will not be set.

Parameters
minDatethe minimum date
maxDatethe maximum date
minWarnMsgthe minimum warning message
maxWarnMsgthe maximum warning message

Definition at line 410 of file kdatecombobox.cpp.

void KDateComboBox::setDisplayFormat ( KLocale::DateFormat  format)
slot

Sets the date format to display.

By default is the Short Date format.

Parameters
formatthe date format to use

Definition at line 439 of file kdatecombobox.cpp.

void KDateComboBox::setMaximumDate ( const QDate &  maxDate,
const QString &  maxWarnMsg = QString() 
)
slot

Set the maximum allowed date.

If the date is invalid, or less than current minimum, then the maximum will not be set.

See also
minimumDate()
maximumDate()
setMaximumDate()
setDateRange()
Parameters
maxDatethe maximum date
maxWarnMsgthe maximum warning message

Definition at line 400 of file kdatecombobox.cpp.

void KDateComboBox::setMinimumDate ( const QDate &  minTime,
const QString &  minWarnMsg = QString() 
)
slot

Set the minimum allowed date.

If the date is invalid, or greater than current maximum, then the minimum will not be set.

See also
minimumDate()
maximumDate()
setMaximumDate()
setDateRange()
Parameters
minDatethe minimum date
minWarnMsgthe minimum warning message

Definition at line 385 of file kdatecombobox.cpp.

void KDateComboBox::setOptions ( Options  options)
slot

Set the new widget options.

Parameters
optionsthe new widget options

Definition at line 371 of file kdatecombobox.cpp.

void KDateComboBox::showPopup ( )
protectedvirtual

Definition at line 499 of file kdatecombobox.cpp.

void KDateComboBox::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Reimplemented from KComboBox.

Definition at line 548 of file kdatecombobox.cpp.

Property Documentation

QDate KDateComboBox::date
readwrite

Definition at line 38 of file kdatecombobox.h.

QDate KDateComboBox::maximumDate
readwrite

Definition at line 40 of file kdatecombobox.h.

QDate KDateComboBox::minimumDate
readwrite

Definition at line 39 of file kdatecombobox.h.

KDateComboBox::Options KDateComboBox::options
readwrite

Definition at line 41 of file kdatecombobox.h.


The documentation for this class was generated from the following files:
  • kdatecombobox.h
  • kdatecombobox.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 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