1 Attachment(s)
when using InstallEventFilter(),QLineEdit is invisible!
hi,guys!
now i meet a problem that when i use installEventFilter() function to a QLineEdit like "lineEdit->installEventFilter(this);"
if i run my program the QLineEdit is invisible! i never meet this situation before!who can give me some advice!thanks!
the code as follows:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->lineEdit->installEventFilter(this);
}
Re: when using InstallEventFilter(),QLineEdit is invisible!
show your eventFilter() function
EDIT:- oh.. u attached it. let me see.
Re: when using InstallEventFilter(),QLineEdit is invisible!
if this condition is false
Code:
if (event
->type
() == QEvent::KeyPress)
then your function does not return anything. may be this is the issue.
Re: when using InstallEventFilter(),QLineEdit is invisible!
Quote:
Originally Posted by
MrDeath
if this condition is false
Code:
if (event
->type
() == QEvent::KeyPress)
then your function does not return anything. may be this is the issue.
Thanks~that's the reason~:)