Results 1 to 3 of 3

Thread: Fatal Signal on invoke methode

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Fatal Signal on invoke methode

    When you return a QObject from a Q_INVOKABLE then the QML engine will assume that it is now the owner of the object and has to delete it.

    In your case you don't want that, you want to keep ownership with the C++ side.

    Qt Code:
    1. QQmlEngine::setObjectOwnership(item, QQmlEngine::CppOwnership);
    2. return item;
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  2. #2
    Join Date
    Feb 2008
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    1

    Default Re: Fatal Signal on invoke methode

    Hi Anda,
    you saved my day
    Many thanks,
    Patrik

Similar Threads

  1. How to invoke Mingw Compiler?
    By parulkalra14 in forum Qt Programming
    Replies: 8
    Last Post: 16th January 2014, 08:38
  2. Replies: 3
    Last Post: 29th September 2013, 11:46
  3. Can not invoke contextMenuEvent in QGraphicsView
    By chiaminhsu in forum Qt Programming
    Replies: 3
    Last Post: 29th April 2013, 21:55
  4. Invoke slot from a non-QThread
    By stephelton in forum Qt Programming
    Replies: 1
    Last Post: 14th January 2013, 10:33
  5. When and where to invoke QAbstractItemView::setIndexWidge?
    By mallun.wang in forum Qt Programming
    Replies: 1
    Last Post: 3rd December 2009, 09:48

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.