MorrisLiang
5th May 2010, 15:22
This is how it looks like,if I comment out the code:
ui.myText->installEventFilter(this);
http://i960.photobucket.com/albums/ae82/liangmorr/withoutFilter.png
This is how it looks like,if I install the event filter:
http://i960.photobucket.com/albums/ae82/liangmorr/installedfilter.png
and the implenmentation of evetFilter is just:
bool MyWindow::eventFilter(QObject* target,QEvent* event){return true;}
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:
QFile stylesheet("myCSS.css");
stylesheet.open(QFile::ReadOnly);
qApp->setStyleSheet(stylesheet.readAll());
stylesheet.close();
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?
ui.myText->installEventFilter(this);
http://i960.photobucket.com/albums/ae82/liangmorr/withoutFilter.png
This is how it looks like,if I install the event filter:
http://i960.photobucket.com/albums/ae82/liangmorr/installedfilter.png
and the implenmentation of evetFilter is just:
bool MyWindow::eventFilter(QObject* target,QEvent* event){return true;}
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:
QFile stylesheet("myCSS.css");
stylesheet.open(QFile::ReadOnly);
qApp->setStyleSheet(stylesheet.readAll());
stylesheet.close();
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?