From 3d7b54b21a47e98d1d02c7d21061a6bd43b8d1c7 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 13 Nov 2009 22:48:07 +0000 Subject: Implemented initialization of value-widgets. This allows e.g. to apply dates like "today", "last week", ... to the date-value-widgets just by specifying a search criterion. svn path=/trunk/KDE/kdebase/apps/; revision=1048771 --- src/search/searchcriterionvalue.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/search/searchcriterionvalue.h') diff --git a/src/search/searchcriterionvalue.h b/src/search/searchcriterionvalue.h index 972b95f7a..652b58a7c 100644 --- a/src/search/searchcriterionvalue.h +++ b/src/search/searchcriterionvalue.h @@ -39,8 +39,21 @@ public: SearchCriterionValue(QWidget* parent = 0); virtual ~SearchCriterionValue(); + /** + * Must be overwritten by derived classes and returns + * the string representation of the search criterion value. + */ virtual QString value() const = 0; + /** + * Initializes the widget on the base of the given value-type. + * It is in the hand of the derived classes to interprete + * the value-type string and create a corresponding value for + * the widget (@see SearchCriterionSelector::Comparator). + * The default implementation is empty. + */ + virtual void initializeValue(const QString& valueType); + signals: void valueChanged(const QString& value); }; @@ -56,7 +69,8 @@ public: DateValue(QWidget* parent = 0); virtual ~DateValue(); virtual QString value() const; - + virtual void initializeValue(const QString& valueType); + private: KDateWidget* m_dateWidget; }; -- cgit v1.3.1