You can subclass like that:
{
Q_OBJECT
public:
{
QObject::connect(this,
SIGNAL(clicked
(const QDate
&)),
this,
SLOT(checkClicked
(const QDate
&)));
}
private Q_SLOTS:
void checkClicked(const QDate& date) const
{
if (Qt::Saturday != date.dayOfWeek()
&& Qt::Sunday != date.dayOfWeek())
Q_EMIT myClicked(date);
}
Q_SIGNALS:
void myClicked(const QDate&);
};
class MyCalendarWidget: public QCalendarWidget
{
Q_OBJECT
public:
MyCalendarWidget(QWidget* parent) : QCalendarWidget(parent)
{
QObject::connect(this, SIGNAL(clicked(const QDate&)), this, SLOT(checkClicked(const QDate&)));
}
private Q_SLOTS:
void checkClicked(const QDate& date) const
{
if (Qt::Saturday != date.dayOfWeek()
&& Qt::Sunday != date.dayOfWeek())
Q_EMIT myClicked(date);
}
Q_SIGNALS:
void myClicked(const QDate&);
};
To copy to clipboard, switch view to plain text mode
Bookmarks