digiKam
|
Classes | |
class | Private |
Public Types | |
enum | BackgroundMode { NoBgMode = 0 , RectangleMode , CircleMode } |
Signals | |
void | aboutToShowContextMenu (QMenu *menu, const QDate &dt) |
void | dateChanged (const QDate &cur, const QDate &old) |
void | dateChanged (const QDate &date) |
void | tableClicked () |
Public Member Functions | |
const QDate & | date () const |
DDateTable (const QDate &dt, QWidget *const parent=nullptr) | |
DDateTable (QWidget *const parent=nullptr) | |
bool | popupMenuEnabled () const |
void | setCustomDatePainting (const QDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()) |
bool | setDate (const QDate &date) |
void | setFontSize (int size) |
void | setPopupMenuEnabled (bool enable) |
QSize | sizeHint () const override |
void | unsetCustomDatePainting (const QDate &dt) |
~DDateTable () override | |
Protected Member Functions | |
virtual QDate | dateFromPos (int pos) |
bool | event (QEvent *e) override |
void | focusInEvent (QFocusEvent *e) override |
void | focusOutEvent (QFocusEvent *e) override |
void | keyPressEvent (QKeyEvent *e) override |
void | mousePressEvent (QMouseEvent *e) override |
void | paintEvent (QPaintEvent *e) override |
virtual int | posFromDate (const QDate &dt) |
void | wheelEvent (QWheelEvent *e) override |
Properties | |
QDate | date |
bool | popupMenu |
Friends | |
class | Private |
This is a support class for the DDatePicker class. It just draws the calendar table without titles, but could theoretically be used as a standalone.
When a date is selected by the user, it emits a signal: dateSelected(QDate)
|
explicit |
|
explicit |
References date.
|
override |
|
signal |
A popup menu for a given date is about to be shown (as when the user right clicks on that date and the popup menu is enabled). Connect the slot where you fill the menu to this signal.
Referenced by mousePressEvent().
const QDate & Digikam::DDateTable::date | ( | ) | const |
References Digikam::DDateTable::Private::date.
|
signal |
This function behaves essentially like the one above. The selected date changed.
cur | The current date |
old | The date before the date was changed |
|
signal |
The selected date changed.
Referenced by setDate().
|
protectedvirtual |
calculate the date that is displayed at a given cell in the matrix. pos is the 0-based index in the matrix. Inverse function to posForDate().
References Digikam::DDateTable::Private::date, DigikamGenericINatPlugin::locale, Digikam::DDateTable::Private::numDayColumns, and Digikam::DDateTable::Private::weekDayFirstOfMonth.
Referenced by mousePressEvent().
|
overrideprotected |
Cell highlight on mouse hovering
References Digikam::DDateTable::Private::hoveredPos, Digikam::DDateTable::Private::numDayColumns, and Digikam::DDateTable::Private::numWeekRows.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
React on mouse clicks that select a date.
References aboutToShowContextMenu(), Digikam::DDateTable::Private::date, dateFromPos(), DigikamGenericINatPlugin::locale, Digikam::DDateTable::Private::numDayColumns, Digikam::DDateTable::Private::numWeekRows, Digikam::DDateTable::Private::popupMenuEnabled, setDate(), and tableClicked().
|
overrideprotected |
bool Digikam::DDateTable::popupMenuEnabled | ( | ) | const |
Returns if the popup menu is enabled or not
References Digikam::DDateTable::Private::popupMenuEnabled.
|
protectedvirtual |
calculate the position of the cell in the matrix for the given date. The result is the 0-based index.
References date, DigikamGenericINatPlugin::locale, Digikam::DDateTable::Private::numDayColumns, and Digikam::DDateTable::Private::weekDayFirstOfMonth.
void Digikam::DDateTable::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.
References Digikam::DDateTable::Private::DatePaintingMode::bgColor, Digikam::DDateTable::Private::DatePaintingMode::bgMode, Digikam::DDateTable::Private::customPaintingModes, date, Digikam::DDateTable::Private::DatePaintingMode::fgColor, unsetCustomDatePainting(), and Digikam::DDateTable::Private::useCustomColors.
bool Digikam::DDateTable::setDate | ( | const QDate & | date | ) |
Select and display this date.
References date, dateChanged(), and Digikam::DDateTable::Private::setDate().
Referenced by keyPressEvent(), mousePressEvent(), Digikam::DDatePicker::setDate(), and wheelEvent().
void Digikam::DDateTable::setFontSize | ( | int | size | ) |
Set the font size of the date table.
References Digikam::DDateTable::Private::fontsize, DigikamGenericINatPlugin::locale, and Digikam::DDateTable::Private::maxCell.
Referenced by Digikam::DDatePicker::setFontSize().
void Digikam::DDateTable::setPopupMenuEnabled | ( | bool | enable | ) |
Enables a popup menu when right clicking on a date.
When it's enabled, this object emits a aboutToShowContextMenu signal where you can fill in the menu items.
References Digikam::DDateTable::Private::popupMenuEnabled.
|
override |
Returns a recommended size for the widget. To save some time, the size of the largest used cell content is calculated in each paintCell() call, since all calculations have to be done there anyway. The size is stored in maxCell. The sizeHint() simply returns a multiple of maxCell.
References Digikam::DDateTable::Private::maxCell, Digikam::DDateTable::Private::numDayColumns, and Digikam::DDateTable::Private::numWeekRows.
|
signal |
A date has been selected by clicking on the table.
Referenced by keyPressEvent(), and mousePressEvent().
void Digikam::DDateTable::unsetCustomDatePainting | ( | const QDate & | dt | ) |
Unsets the custom painting of a date so that the date is painted as usual.
References Digikam::DDateTable::Private::customPaintingModes, date, and Digikam::DDateTable::Private::useCustomColors.
Referenced by setCustomDatePainting().
|
overrideprotected |
References Digikam::DDateTable::Private::date, and setDate().
|
friend |
|
readwrite |
Referenced by Digikam::DDateTable::Private::beginningOfMonth(), Digikam::DDateTable::Private::beginningOfWeek(), Digikam::DDatePicker::date(), DDateTable(), Digikam::DDateTable::Private::endOfMonth(), Digikam::DDateTable::Private::endOfWeek(), Digikam::DDateTable::Private::nextMonth(), posFromDate(), Digikam::DDateTable::Private::previousMonth(), setCustomDatePainting(), Digikam::DDateTable::Private::setDate(), setDate(), unsetCustomDatePainting(), Digikam::DDatePicker::yearBackwardClicked(), and Digikam::DDatePicker::yearForwardClicked().
|
readwrite |