Results 1 to 9 of 9

Thread: Undefined reference to QWidget::event(QKeyEvent *) in custom classes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Undefined reference to QWidget::event(QKeyEvent *) in custom classes

    No virtual void event(QKeyEvent *) either in my mac Qt 5.5.0 installation either:

    Qt Code:
    1. imac01:~/Qt/5.5.0$ grep QKeyEvent /Users/jefft/Qt/5.5.0/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qwidget.h
    2. class QKeyEvent;
    3. virtual void keyPressEvent(QKeyEvent *);
    4. virtual void keyReleaseEvent(QKeyEvent *);
    To copy to clipboard, switch view to plain text mode 
    Seems something is wonky with your Qt installation. If you can't remove/install the Qt packages that installed into /usr, can you perhaps install 4.8.5 into your home directory and see if it matches what you have installed into /usr?
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

  2. The following user says thank you to jefftee for this useful post:

    Toniy (13th July 2015)

  3. #2
    Join Date
    Jul 2015
    Posts
    22
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Undefined reference to QWidget::event(QKeyEvent *) in custom classes

    All right. I have collected some statistics on different Qt versions and there is no any of these functions. How they appeared and more important how they used to work before -- here is the question.
    I'll reply here when I find source sample that was used for Qt installation on my computer and check it.

    Thanks for the quickest responses.

  4. #3
    Join Date
    Jul 2015
    Posts
    22
    Thanks
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Undefined reference to QWidget::event(QKeyEvent *) in custom classes

    I didn't find sources but deleted that function and replaced it with ones recommended in that thread (in file "qwidget.h") and problem has been solved.
    Seems like I accidentally corrupted that file myself.

    So, maybe that thread will be useful for someone and he/she will solve similar problem quicker

  5. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,321
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Undefined reference to QWidget::event(QKeyEvent *) in custom classes

    Seems like I accidentally corrupted that file myself.
    If I were you, I would re-install Qt instead of relying on your memory and hand-editing a really core Qt header file. Who knows what else you've "accidentally corrupted" that might come back to bite you later?

    You are fortunate that you seem to be using a binary distribution of Qt, and the linker caught your error.

  6. The following user says thank you to d_stranz for this useful post:

    Toniy (20th July 2015)

Similar Threads

  1. Replies: 8
    Last Post: 3rd September 2013, 09:51
  2. Replies: 4
    Last Post: 20th July 2012, 11:41
  3. Replies: 1
    Last Post: 3rd February 2011, 15:06
  4. Replies: 3
    Last Post: 4th October 2010, 15:39
  5. Replies: 6
    Last Post: 14th May 2009, 12:02

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.