Results 1 to 2 of 2

Thread: On iOS compiling: call to non-static member function without an object argument

  1. #1
    Join Date
    Nov 2014
    Posts
    33
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows Android

    Default On iOS compiling: call to non-static member function without an object argument

    I've this code:

    Qt Code:
    1. GPSMessages::GPSMessages(GPSManager &gpsManager): _message(nullptr)
    2. {
    3. connect(&gpsManager, GPSManager::onGpsFound, this, GPSMessages::onGpsFound);
    4. connect(&gpsManager, GPSManager::onGpsNotFound, this, GPSMessages::onGpsNotFound);
    5. }
    To copy to clipboard, switch view to plain text mode 

    Compiling for Android works well, but If compile with iOS appears this error:

    Qt Code:
    1. error: call to non-static member function without an object argument
    2. connect(&gpsManager, GPSManager::onGpsFound, this, GPSMessages::onGpsFound);
    To copy to clipboard, switch view to plain text mode 

    Qt for iOS supports this or must to use the SIGNAL and SLOT macro?

  2. #2
    Join Date
    Nov 2014
    Posts
    33
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: On iOS compiling: call to non-static member function without an object argument

    I found it!

    Is missing the & in front of method:

    Qt Code:
    1. connect(&gpsManager, &GPSManager::onGpsFound, this, &GPSMessages::onGpsFound);
    To copy to clipboard, switch view to plain text mode 
    Regards.

Similar Threads

  1. Cannot call member function without object
    By ehntun in forum Qt Programming
    Replies: 0
    Last Post: 24th October 2012, 07:09
  2. Replies: 2
    Last Post: 18th August 2012, 06:49
  3. cannot call member function without object
    By been_1990 in forum Qt Programming
    Replies: 11
    Last Post: 23rd October 2010, 17:12
  4. Replies: 2
    Last Post: 7th July 2009, 17:44
  5. Replies: 22
    Last Post: 8th October 2008, 13:54

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.