{
if((parent
() == object
) & (event
->type
() == QEvent::MouseMove)) {
QMouseEvent * mouseEvent
= static_cast<QMouseEvent
*>
(event
);
if(mouseEvent->pos().x() < 80)
{
if(isHidden() && (mAnimation->state() != mAnimation->Running))
{
mAnimation
->setStartValue
(QRect(-3,
80,
0,
250));
mAnimation
->setEndValue
(QRect(0,
80,
70,
250));
disconnect(mAnimation, SIGNAL(finished()), this, SLOT(hide()));
mAnimation->start();
show();
}
}
else if((mouseEvent
->type
() == QEvent::Leave) && (mAnimation
->state
() != mAnimation
->Running
)) {
qDebug("Inside QEvent::Leave"); // This message is not getting printed
if(!isHidden())
{
mAnimation
->setEndValue
(QRect(-3,
80,
0,
250));
mAnimation
->setStartValue
(QRect(0,
80,
70,
250));
connect(mAnimation, SIGNAL(finished()), this, SLOT(hide()));
mAnimation->start();
}
}
}
return QWidget::eventFilter(object, event
);
}
bool eventFilter(QObject * object, QEvent * event)
{
if((parent() == object) & (event->type() == QEvent::MouseMove))
{
QMouseEvent * mouseEvent = static_cast<QMouseEvent *>(event);
if(mouseEvent->pos().x() < 80)
{
if(isHidden() && (mAnimation->state() != mAnimation->Running))
{
mAnimation->setStartValue(QRect(-3, 80, 0, 250));
mAnimation->setEndValue(QRect(0, 80, 70, 250));
disconnect(mAnimation, SIGNAL(finished()), this, SLOT(hide()));
mAnimation->start();
show();
}
}
else if((mouseEvent->type() == QEvent::Leave) && (mAnimation->state() != mAnimation->Running))
{
qDebug("Inside QEvent::Leave"); // This message is not getting printed
if(!isHidden())
{
mAnimation->setEndValue(QRect(-3, 80, 0, 250));
mAnimation->setStartValue(QRect(0, 80, 70, 250));
connect(mAnimation, SIGNAL(finished()), this, SLOT(hide()));
mAnimation->start();
}
}
}
return QWidget::eventFilter(object, event);
}
To copy to clipboard, switch view to plain text mode
I think my
Bookmarks