Qt 4.8
Public Types | Public Functions | Public Variables | Protected Functions | List of all members
QCalendarDateSectionValidator Class Referenceabstract
Inheritance diagram for QCalendarDateSectionValidator:
QCalendarDayValidator QCalendarMonthValidator QCalendarYearValidator

Public Types

enum  Section { NextSection, ThisSection, PrevSection }
 

Public Functions

virtual QDate applyToDate (const QDate &date) const =0
 
virtual Section handleKey (int key)=0
 
 QCalendarDateSectionValidator ()
 
virtual void setDate (const QDate &date)=0
 
virtual QString text () const =0
 
virtual QString text (const QDate &date, int repeat) const =0
 
virtual ~QCalendarDateSectionValidator ()
 

Public Variables

QLocale m_locale
 

Protected Functions

QString highlightString (const QString &str, int pos) const
 

Detailed Description

Definition at line 75 of file qcalendarwidget.cpp.

Enumerations

◆ Section

Constructors and Destructors

◆ QCalendarDateSectionValidator()

QCalendarDateSectionValidator::QCalendarDateSectionValidator ( )
inline

Definition at line 85 of file qcalendarwidget.cpp.

85 {}

◆ ~QCalendarDateSectionValidator()

virtual QCalendarDateSectionValidator::~QCalendarDateSectionValidator ( )
inlinevirtual

Definition at line 86 of file qcalendarwidget.cpp.

86 {}

Functions

◆ applyToDate()

virtual QDate QCalendarDateSectionValidator::applyToDate ( const QDate date) const
pure virtual

◆ handleKey()

virtual Section QCalendarDateSectionValidator::handleKey ( int  key)
pure virtual

◆ highlightString()

QString QCalendarDateSectionValidator::highlightString ( const QString str,
int  pos 
) const
protected

Definition at line 100 of file qcalendarwidget.cpp.

Referenced by QCalendarDayValidator::text(), QCalendarMonthValidator::text(), and QCalendarYearValidator::text().

101 {
102  if (pos == 0)
103  return QLatin1String("<b>") + str + QLatin1String("</b>");
104  int startPos = str.length() - pos;
105  return str.mid(0, startPos) + QLatin1String("<b>") + str.mid(startPos, pos) + QLatin1String("</b>");
106 
107 }
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706

◆ setDate()

virtual void QCalendarDateSectionValidator::setDate ( const QDate date)
pure virtual

◆ text() [1/2]

virtual QString QCalendarDateSectionValidator::text ( ) const
pure virtual

◆ text() [2/2]

virtual QString QCalendarDateSectionValidator::text ( const QDate date,
int  repeat 
) const
pure virtual

Properties

◆ m_locale

QLocale QCalendarDateSectionValidator::m_locale

The documentation for this class was generated from the following file: