Hi

I have displayed the icons on image,when i am moving the mouse on image,

I need to hide my icons one i moved the mouse apart from the image ....

Here i have used the move move event


my code is
Qt Code:
  1. #include "widget.h"
  2. #include "ui_widget.h"
  3.  
  4. #include <QPainter>
  5.  
  6. Widget::Widget(QWidget *parent)
  7. : QWidget(parent),
  8. ui(new Ui::WidgetClass),
  9. m_currentImage(0)
  10. {
  11. ui->setupUi(this);
  12.  
  13. ui->label->setPixmap(QPixmap("C:/Documents and Settings/addu.YUVARAJ.001/Desktop/yuvaraj.png"));
  14. ui->pushButton->hide();
  15. ui->toolButton->hide();
  16. ui->pushButton_2->hide();
  17. ui->toolButton_2->hide();
  18. ui->label->setMouseTracking(true);
  19. ui->label->installEventFilter(this);
  20. }
  21.  
  22. Widget::~Widget()
  23. {
  24. delete ui;
  25. }
  26.  
  27. bool Widget::eventFilter(QObject *o, QEvent *e)
  28. {
  29. if (o == ui->label && e->type() == QEvent::MouseMove)
  30. {
  31.  
  32.  
  33. QPixmap pixmap(QString("C:/Documents and Settings/addu.YUVARAJ.001/Desktop/yuvaraj.png"));
  34.  
  35. ui->label->setPixmap(pixmap);
  36. ui->pushButton->show();
  37. ui->toolButton->show();
  38. ui->pushButton_2->show();
  39. ui->toolButton_2->show();
  40. ui->toolButton->setIcon(QIcon("C:/Documents and Settings/addu.YUVARAJ.001/Desktop/raj.png"));
  41. ui->pushButton->setIcon(QIcon("C:/Documents and Settings/addu.YUVARAJ.001/Desktop/raj.png"));
  42. ui->toolButton_2->setIcon(QIcon("C:/Documents and Settings/addu.YUVARAJ.001/Desktop/raj.png"));
  43. ui->pushButton_2->setIcon(QIcon("C:/Documents and Settings/addu.YUVARAJ.001/Desktop/raj.png"));
  44. return true;
  45. }
  46.  
  47. else
  48. {
  49.  
  50.  
  51. return QWidget::eventFilter(o, e);
  52. }
  53. }
  54.  
  55. void Widget::on_pushButton_clicked()
  56. {
  57. this-close();
  58. }
To copy to clipboard, switch view to plain text mode 



please suggest me to solve this problem.


Thanks

Yuvaraj R