focus events of widget children
hi, i got common widget with textarea and calendar... currently i listen for mouse over regarding whole widget (not it's children), showing calendar when over widget, hiding when mouse it's out of widget..
Code:
#include "widget.h"
#include "ui_widget.h"
ui(new Ui::Widget)
{
ui->setupUi(this);
ui->calendarWidget->hide();
}
Widget::~Widget()
{
delete ui;
}
void Widget
::changeEvent(QEvent *e
) {
switch (e->type()) {
ui->retranslateUi(this);
break;
default:
break;
}
}
void Widget
::enterEvent(QEvent *e
) {
ui->calendarWidget->show();
}
void Widget
::leaveEvent(QEvent *e
) {
ui->calendarWidget->hide();
}
but i have no clue how to listen for mouseevent if i want same functionality with focus only on textedit... that means, i wanna show calendar only when mouse is over textedit (and textedit only)...
any help appreciated.. thanks
Re: focus events of widget children
Have a look at QObject::installEventFilter().