Results 1 to 4 of 4

Thread: problem with winevent Function

  1. #1
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation problem with winevent Function

    Hi i am new for QT and i need to use winEvent function but an error appear when i try build my project:
    my code is :
    Qt Code:
    1. bool MainWindow::winEvent(MSG *message, long *result)
    2. {
    3. //handling message...........
    4.  
    5. return 0;
    6. }
    To copy to clipboard, switch view to plain text mode 
    this is the error prevent building:
    Qt Code:
    1. C:\Users\ETC\Documents\QTProjects\Calculator-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug\..\Calculator\mainwindow.cpp:16: error: no 'bool MainWindow::winEvent(MSG*, long int*)' member function declared in class 'MainWindow'
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,593
    Thanks
    13
    Thanked 1,587 Times in 1,516 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: problem with winevent Function

    It looks like you are missing the declaration matching this implementation in the protected section of your main window header file.

  3. #3
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem with winevent Function

    thanks for replay

    I don't think that because i find the declaration in QWidget.h by click "Switch between method declaration/definition" in the context menu.
    here is the declaration :

    #if defined(Q_WS_WIN)
    virtual bool winEvent(MSG *message, long *result);


    I built this project successfully few days ago !!!!!!!!! I don't know what happened and what is the solution !!!!!!
    please some advice may be helpful
    thanks for advanced


    Added after 6 minutes:


    please any help !!!!!!!!!!!!
    i am really need the solution
    Last edited by Mohammad; 12th November 2011 at 23:02.

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,391
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: problem with winevent Function

    ChrisW67 already answered, its basic C++ - if you want to reimplement a method in a subclass, you need to declare it again.

Similar Threads

  1. Problem with winEvent
    By franco.amato in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2016, 22:56
  2. winEvent---(MSG * message, long * result)
    By Naveen in forum Qt Programming
    Replies: 4
    Last Post: 29th June 2015, 11:05
  3. winEvent prevents opening menus...
    By supergillis in forum Qt Programming
    Replies: 0
    Last Post: 16th November 2008, 16:48
  4. Win32 MSG - winEvent()
    By AlGaN in forum Qt Programming
    Replies: 1
    Last Post: 24th September 2008, 14:19
  5. MSG not defined (winEvent)
    By December in forum Qt Programming
    Replies: 6
    Last Post: 19th February 2007, 16:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.