Results 1 to 5 of 5

Thread: Crash in Qml destkop application.

Hybrid View

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

    Default Re: Crash in Qml destkop application.

    Are those viewmanager instances available through out the program or do they get creates/deleted on demand?

    Do you have any Q_INVOKABLE methods that return instances of QObject derived classes?

    Cheers,
    _

  2. #2
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    1

    Default Re: Crash in Qml destkop application.

    Hi,

    they are available through the entire lifetime of the application (the tabs are stored per layout in a QList<std::shared_ptr>. I have one Q_INVOKABLE method that returns a pointer to the tab.

    Qt Code:
    1. Q_INVOKABLE ViewManagerTabQMLInterface* getTab(int index);
    2.  
    3. //--------------------------------------------------------------------------------------
    4. /// Returns the tab model from the given index.
    5. //--------------------------------------------------------------------------------------
    6.  
    7. ViewManagerTabQMLInterface* ViewManagerQMLInterface::getTab(int index)
    8. {
    9. if(index >= 0 && index < (int)_tabsList.size())
    10. {
    11. return _tabsList[index].get();
    12. }
    13. return NULL;
    14. }
    To copy to clipboard, switch view to plain text mode 

    I see that at one point the destructor of the ViewManagerTabQMLInterface is called after a QDeleteDefferedEvent (just reading from the call stack).

    Qt Code:
    1. MeshingMaster.exe!ViewManagerTabQMLInterface::~ViewManagerTabQMLInterface() Line 69 C++
    2. [External Code]
    3. Qt5Cored.dll!qDeleteInEventHandler(QObject * o) Line 4482 C++
    4. > Qt5Cored.dll!QObject::event(QEvent * e) Line 1255 C++
    5. Qt5Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3799 C++
    6. Qt5Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3159 C++
    7. Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 988 C++
    8. Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231 C++
    9. Qt5Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1649 C++
    10. Qt5Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 1295 C++
    11. qwindowsd.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 82 C++
    12. Qt5Cored.dll!qt_internal_proc(HWND__ * hwnd, unsigned int message, unsigned __int64 wp, __int64 lp) Line 445 C++
    13. [External Code]
    14. Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 845 C++
    15. qwindowsd.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 74 C++
    16. Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 135 C++
    17. Qt5Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 210 C++
    18. Qt5Cored.dll!QCoreApplication::exec() Line 1261 C++
    To copy to clipboard, switch view to plain text mode 

    Any idea?
    Last edited by anda_skoa; 16th December 2016 at 10:11. Reason: fix code end tags

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

    Default Re: Crash in Qml destkop application.

    Quote Originally Posted by JanW View Post
    they are available through the entire lifetime of the application (the tabs are stored per layout in a QList<std::shared_ptr>. I have one Q_INVOKABLE method that returns a pointer to the tab.
    Do those objects have a QObject parent?
    Or, alternatively, have they been marked as owned by C++ using QQmlEngine::setObjectOwnership()?

    Cheers,
    _

  4. #4
    Join Date
    Jan 2008
    Posts
    20
    Thanks
    1

    Default Re: Crash in Qml destkop application.

    Yes, they have a qobject parent, and yes, at one point they get deleted. I removed the passing of those objects via qml to my other class and now they stay alive.
    Thanks you very much for the tips!!!!
    Regards,

    Jan

Similar Threads

  1. Crash of the Server Application
    By 8Observer8 in forum Newbie
    Replies: 5
    Last Post: 3rd September 2013, 09:36
  2. how to avoid crash of my application......
    By newb in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2010, 10:09
  3. application crash problem
    By anshul in forum Newbie
    Replies: 3
    Last Post: 25th December 2009, 12:27
  4. Application crash in Vista
    By yj... in forum Installation and Deployment
    Replies: 1
    Last Post: 5th June 2009, 08:18
  5. Weird application crash
    By MarkoSan in forum Qt Programming
    Replies: 10
    Last Post: 20th May 2008, 14:13

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.