mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Listen to EnabledChange to gray out the DatePicker
This small patch listens to EnabledChange to gray out the date picker when the widget is in disabled mode, and to paint the widget colored when it's on enabled state. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
be462ae1a6
commit
6ee2758e06
2 changed files with 8 additions and 0 deletions
|
@ -326,6 +326,13 @@ QDate DateWidget::date() const
|
|||
return mDate;
|
||||
}
|
||||
|
||||
void DateWidget::changeEvent(QEvent *event)
|
||||
{
|
||||
if(event->type() == QEvent::EnabledChange){
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void DateWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
static QPixmap pix = QPixmap(":/calendar").scaled(64,64);
|
||||
|
|
|
@ -103,6 +103,7 @@ protected:
|
|||
void focusInEvent(QFocusEvent *);
|
||||
void focusOutEvent(QFocusEvent *);
|
||||
void keyPressEvent(QKeyEvent *);
|
||||
void changeEvent(QEvent *);
|
||||
signals:
|
||||
void dateChanged(const QDate& date);
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue