Results 1 to 12 of 12

Thread: cannot call member function without object

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Oct 2008
    Posts
    306
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    6
    Thanked 9 Times in 8 Posts

    Default Re: cannot call member function without object

    I made it static because that's the only way it would work with QAbstractEventDispatcher(). I was experiencing some difficulties with setting QAbstractEventDispatcher() filter and a thread here in QtCentre Forum said that I should make eventFilter() static, I did and it worked. Only for that reason. But if there is a better way I would really like to know.

    EDIT:
    if I remove "static" from eventFilter I get this error message:
    Qt Code:
    1. qapp.cpp: In constructor 'QApp::QApp(int&, char**)':
    2.  
    3. qapp.cpp:14: error: no matching function for call to 'QAbstractEventDispatcher::setEventFilter(<unresolved overloaded function type>)'
    4.  
    5. c:\Qt\2010.05\qt\include\QtCore/../../src/corelib/kernel/qabstracteventdispatcher.h:91: note: candidates are: bool (* QAbstractEventDispatcher::setEventFilter(bool (*)(void*)))(void*)
    To copy to clipboard, switch view to plain text mode 
    Last edited by been_1990; 23rd October 2010 at 15:30.

Similar Threads

  1. Replies: 1
    Last Post: 8th October 2010, 12:38
  2. Replies: 2
    Last Post: 7th July 2009, 18:44
  3. Replies: 10
    Last Post: 29th May 2009, 10:06
  4. How to call the C++ member function from the JScript
    By parusri in forum Qt Programming
    Replies: 1
    Last Post: 18th October 2008, 11:13
  5. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 15:55

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.