Qt Creator 3.5.1 (opensource)
Based on Qt 5.5.1 (MSVC 2013, 32 bit)
Windows 7

Hello,

This is the first time I've used the form designer in QtCreator.
So far, so good. I have form that displays what I want.
The problem comes when I try and install an event filter on a QPushButton (bRefresh).
The button does not display, If I place the cursor where the pushbutton should be the eventFilter works.
If I do not install the event filter the button shows, but of course the eventFilter does'nt get called.
What am I doing wrong?

Regards
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
  2. {
  3. setupUi(this);
  4. ...
  5. ...
  6. bRefresh->installEventFilter(this); //is a QPushButton
  7. }
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. #include "ui_mainwindow.h"
  2.  
  3. class MainWindow : public QMainWindow, public Ui::MainWindow
  4. {
  5. Q_OBJECT
  6.  
  7. public:
  8. MainWindow(QWidget *parent=0);
  9. ~MainWindow();
  10. bool eventFilter(QObject *obj, QEvent *event);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. bool MainWindow::eventFilter(QObject *obj, QEvent *event)
  2. {
  3. if (obj == (QObject*)bRefresh)
  4. {
  5. if (event->type() == QEvent::Enter)
  6. {
  7. QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
  8. qDebug() << "enter";
  9. } else {
  10. if (event->type() == QEvent::Leave)
  11. {
  12. QApplication::restoreOverrideCursor();
  13. qDebug() << "leave";
  14. }
  15. }
  16. return true;
  17. } else {
  18. return QWidget::eventFilter(obj, event);
  19. }
  20. }
To copy to clipboard, switch view to plain text mode