KDEUI
kdatetable.cpp
Go to the documentation of this file.
317 int offset = ( d->m_weekDayFirstOfMonth - calendar()->weekStartDay() + d->m_numDayColumns ) % d->m_numDayColumns;
330 int offset = ( d->m_weekDayFirstOfMonth - calendar()->weekStartDay() + d->m_numDayColumns ) % d->m_numDayColumns;
373 void KDateTable::paintCell( QPainter *painter, int row, int col, const KColorScheme &colorScheme )
474 bool customDay = ( d->m_useCustomColors && d->m_customPaintingModes.contains(cellDate.toJulianDay()) );
503 //If the cell day is the day of religious observance, then always color text red unless Custom overrides
518 } else if (cellBackgroundColor != palette().color(backgroundRole()) || pos == d->m_hoveredPos) {
649 rect = metrics.boundingRect( calendar()->weekDayName( weekday, KCalendarSystem::ShortDayName ) );
701 if( e->type() != QEvent::MouseButtonPress ) { // the KDatePicker only reacts on mouse press events:
842 void KDateTable::setCustomDatePainting( const QDate &date, const QColor &fgColor, BackgroundMode bgMode, const QColor &bgColor )
867 // JPL Shouldn't this be in own file as is used in a couple of places? Or moved to private in KDE5?
virtual QDate dateFromPos(int pos)
calculate the date that is displayed at a given cell in the matrix.
Definition: kdatetable.cpp:328
bool close()
Qt::KeyboardModifiers modifiers() const
void setShortcutContext(Qt::ShortcutContext context)
Type type() const
const QPalette & palette() const
void setShortcuts(const QList< QKeySequence > &shortcuts, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut))
Definition: kaction.cpp:224
void setPopupMenuEnabled(bool enable)
Enables a popup menu when right clicking on a date.
Definition: kdatetable.cpp:832
QRect toRect() const
Sixth color; for example, errors, untrusted content, deletions, etc.
Definition: kcolorscheme.h:234
bool popupMenuEnabled() const
Returns if the popup menu is enabled or not.
Definition: kdatetable.cpp:837
int right() const
void setFocusPolicy(Qt::FocusPolicy policy)
QStyle * style() const
virtual int weekStartDay() const
const QColor & color(ColorGroup group, ColorRole role) const
Third color; for example items which are new, active, requesting attention, etc.
Definition: kcolorscheme.h:215
KAction * prior(const QObject *recvr, const char *slot, QObject *parent)
Scroll up one page.
Definition: kstandardaction.cpp:409
int y() const
Defines platform-independent classes for keyboard shortcut handling.
void setAttribute(Qt::WidgetAttribute attribute, bool on)
virtual int day(const QDate &date) const
QAction * addAction(const QString &name, QAction *action)
Add an action under the given name to the collection.
Definition: kactioncollection.cpp:217
int height() const
static QRect desktopGeometry(const QPoint &point)
This function returns the desktop geometry for an application that needs to set the geometry of a wid...
Definition: kglobalsettings.cpp:732
Second color; for example, comments, items which are old, inactive or disabled.
Definition: kcolorscheme.h:210
int x() const
int y() const
KLocale::CalendarSystem calendarSystem() const
void setFrameStyle(int style)
QDate readDate(const QString &str, bool *ok=0) const
void drawLine(const QLineF &line)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
virtual void focusOutEvent(QFocusEvent *event)
QPalette::ColorRole foregroundRole() const
void update()
int x() const
int y() const
void initFrom(const QWidget *widget)
int dayOfWeek() const
int width() const
const QColor & color() const
void setBold(bool enable)
QSize size() const
const QRect & rect() const
void drawRect(const QRectF &rectangle)
void setFont(const QFont &font)
int toJulianDay() const
bool isEnabled() const
const QPoint & globalPos() const
QBrush foreground(ForegroundRole=NormalText) const
Retrieve the requested foreground brush.
Definition: kcolorscheme.cpp:459
CalendarSystem
void installEventFilter(QObject *filterObj)
int x() const
Qt::LayoutDirection layoutDirection() const
int exec(QFlags< QEventLoop::ProcessEventsFlag > flags)
int top() const
virtual int posFromDate(const QDate &date)
calculate the position of the cell in the matrix for the given date.
Definition: kdatetable.cpp:314
virtual QSize sizeHint() const
Returns a recommended size for the widget.
Definition: kdatetable.cpp:821
void setPen(const QColor &color)
QRectF boundingRect(const QString &text) const
const QDate & date() const
bool setCalendar(KCalendarSystem *calendar=0)
Changes the calendar system to use.
Definition: kdatetable.cpp:793
int left() const
Qt::MouseButton button() const
QPalette::ColorRole backgroundRole() const
int toJulianDay() const
virtual void focusInEvent(QFocusEvent *event)
QList< QAction * > actions() const
Returns the list of KActions which belong to this action collection.
Definition: kactioncollection.cpp:186
const KShortcut & beginningOfLine()
Goto beginning of current line.
Definition: kstandardshortcut.cpp:349
QPoint pos() const
static void beep(const QString &reason=QString(), QWidget *widget=0L)
This is a simple substitution for QApplication::beep()
Definition: knotification.cpp:352
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
virtual bool eventFilter(QObject *watched, QEvent *event)
void hide()
bool isValid() const
const KLocale * locale() const
QString formatDate(KLocale::DateFormat dateFormat=KLocale::LongDate) const
QRect rect() const
KAction * next(const QObject *recvr, const char *slot, QObject *parent)
Scroll down one page.
Definition: kstandardaction.cpp:414
void aboutToShowContextMenu(KMenu *menu, const QDate &date)
A popup menu for a given date is about to be shown (as when the user right clicks on that date and th...
int weekDayOfPray() const
void setMidLineWidth(int)
int month() const
Definition: kdatetable.h:235
int key() const
void accept()
void setCustomDatePainting(const QDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor())
Makes a given date be painted with a given foregroundColor, and background (a rectangle, or a circle/ellipse) in a given color.
Definition: kdatetable.cpp:842
const KCalendarSystem * calendar() const
Returns the currently selected calendar system.
Definition: kdatetable.cpp:788
int delta() const
void repaint()
KLocale * locale()
int dayOfWeek() const
int width() const
qreal width() const
QFontMetrics fontMetrics() const
int frameWidth() const
bool setCalendarSystem(KLocale::CalendarSystem calendarSystem)
Definition: kdatetable.cpp:805
const QPoint & pos() const
QDate currentDate()
virtual State validate(QString &text, int &e) const
Definition: kdatetable.cpp:221
virtual void mousePressEvent(QMouseEvent *e)
React on mouse clicks that select a date.
Definition: kdatetable.cpp:699
int bottom() const
void addAssociatedWidget(QWidget *widget)
Associate all actions in this collection to the given widget, including any actions added after this ...
Definition: kactioncollection.cpp:708
State date(const QString &text, QDate &date) const
Definition: kdatetable.cpp:230
void translate(const QPointF &offset)
virtual void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const =0
qreal height() const
void setAutoFillBackground(bool enabled)
void show()
KAction * quit(const QObject *recvr, const char *slot, QObject *parent)
Quit the program.
Definition: kstandardaction.cpp:279
const QPoint & pos() const
void setBackgroundRole(QPalette::ColorRole role)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
virtual bool event(QEvent *event)
void readSettings(KConfigGroup *config=0)
Read all key associations from config.
Definition: kactioncollection.cpp:413
virtual bool event(QEvent *e)
int main(int argc, char **argv)
virtual QString weekDayName(int weekDay, WeekDayNameFormat format=LongDayName) const =0
int height() const
Definition: kdatetable.h:235
bool isValid() const
QAction * addTitle(const QString &text, QAction *before=0L)
Inserts a title item with no icon.
Definition: kmenu.cpp:170
void unsetCustomDatePainting(const QDate &date)
Unsets the custom painting of a date so that the date is painted as usual.
Definition: kdatetable.cpp:859
void leaveModality()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.