digiKam
Loading...
Searching...
No Matches
monthwidget.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2005-05-02
7 * Description : a widget to perform month selection.
8 *
9 * SPDX-FileCopyrightText: 2005 by Renchi Raju <renchi dot raju at gmail dot com>
10 * SPDX-FileCopyrightText: 2006-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QWidget>
21
22// Local includes
23
24#include "iteminfo.h"
25
26class QResizeEvent;
27class QPaintEvent;
28class QMouseEvent;
29
30namespace Digikam
31{
32class ItemFilterModel;
33
34class MonthWidget : public QWidget
35{
36 Q_OBJECT
37
38public:
39
40 explicit MonthWidget(QWidget* const parent);
41 ~MonthWidget() override;
42
43 void setItemModel(ItemFilterModel* const model);
44
45 void setYearMonth(int year, int month);
46 QSize sizeHint() const override;
47
48 void setActive(bool val);
49
50protected:
51
52 void resizeEvent(QResizeEvent* e) override;
53 void paintEvent(QPaintEvent*) override;
54 void mousePressEvent(QMouseEvent* e) override;
55
56private:
57
58 void init();
59
60private Q_SLOTS:
61
62 void triggerUpdateDays();
63 void updateDays();
64 void slotModelDestroyed();
65
66private:
67
68 void resetDayCounts();
69 void connectModel();
70
71private:
72
73 class Private;
74 Private* const d = nullptr;
75};
76
77} // namespace Digikam
Definition itemfiltermodel.h:115
Definition monthwidget.h:35
void setActive(bool val)
Definition monthwidget.cpp:374
void resizeEvent(QResizeEvent *e) override
Definition monthwidget.cpp:146
QSize sizeHint() const override
Definition monthwidget.cpp:141
void paintEvent(QPaintEvent *) override
Definition monthwidget.cpp:154
void mousePressEvent(QMouseEvent *e) override
Definition monthwidget.cpp:272
void setItemModel(ItemFilterModel *const model)
Definition monthwidget.cpp:401
~MonthWidget() override
Definition monthwidget.cpp:96
void setYearMonth(int year, int month)
Definition monthwidget.cpp:117
Definition datefolderview.cpp:34