This is how it looks like,if I comment out the code:
Qt Code:
  1. ui.myText->installEventFilter(this);
To copy to clipboard, switch view to plain text mode 


This is how it looks like,if I install the event filter:


and the implenmentation of evetFilter is just:
Qt Code:
  1. bool MyWindow::eventFilter(QObject* target,QEvent* event){return true;}
To copy to clipboard, switch view to plain text mode 

It's not just QTextEdit,I also test the other QWidget.All behaves the same:if I install eventfilter,then it's stylesheet is gone.

I apply the style sheet by calling:
Qt Code:
  1. QFile stylesheet("myCSS.css");
  2. stylesheet.open(QFile::ReadOnly);
  3. qApp->setStyleSheet(stylesheet.readAll());
  4. stylesheet.close();
To copy to clipboard, switch view to plain text mode 

And I also set the stylesheet directly in the qt desiner,instead loading external file.
The problem still happens.

So,anyone has come cross this weird thing?Any solution?