Results 1 to 4 of 4

Thread: when using InstallEventFilter(),QLineEdit is invisible!

  1. #1
    Join Date
    Sep 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default 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);
    }
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: when using InstallEventFilter(),QLineEdit is invisible!

    show your eventFilter() function

    EDIT:- oh.. u attached it. let me see.

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: when using InstallEventFilter(),QLineEdit is invisible!

    if this condition is false

    Qt Code:
    1. if (event->type() == QEvent::KeyPress)
    To copy to clipboard, switch view to plain text mode 

    then your function does not return anything. may be this is the issue.

  4. #4
    Join Date
    Sep 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: when using InstallEventFilter(),QLineEdit is invisible!

    Quote Originally Posted by MrDeath View Post
    if this condition is false

    Qt Code:
    1. if (event->type() == QEvent::KeyPress)
    To copy to clipboard, switch view to plain text mode 

    then your function does not return anything. may be this is the issue.
    Thanks~that's the reason~

Similar Threads

  1. Invisible characters
    By Myrgy in forum Qt Programming
    Replies: 0
    Last Post: 1st March 2010, 12:37
  2. problem in simple example for installEventFilter
    By navid in forum Qt Programming
    Replies: 2
    Last Post: 10th December 2009, 19:43
  3. set QwtPlotCurve invisible
    By gyre in forum Qwt
    Replies: 2
    Last Post: 19th December 2007, 07:53
  4. QDirmodel installeventfilter
    By babu198649 in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2007, 10:34
  5. [qt3]invisible toolbar
    By lszk in forum Qt Programming
    Replies: 2
    Last Post: 26th February 2006, 18:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.