Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. C++-to-QML error handling
Forum Updated to NodeBB v4.3 + New Features

C++-to-QML error handling

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 334 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Igor Baidiuk
    wrote on last edited by
    #1

    Hello!

    I have some questions regarding topic:

    1. Is there a common customization point, similar to QCoreApplication::notify, which would allow to handle/transform exceptions flying out of native code called by QML? notify allowed us to nicely handle all unexpected errors in our previous QWidgets-based project. Sadly, QML engine code seems to be not exception-neutral and crashes miserably if anything "flies" through it.
    2. Is there a way to obtain QML engine pointer from Q_INVOKABLE method which was called from QML, but its owning object was not created by QML?

    I've skimmed documentation, sources and Global exception handling with c++/QML topic regarding possible ways to properly handle errors which occur in QML+native codebase. Unfortunately it seems that error handling capabilities and overall integration between C++ and QML is rather limited, basically down to manual error codes. The closest one would have been QQmlObjectOrGadget::metacall - if I could override it globally somehow, augment with try-catch and transform caught exception into engine->throwError + return.

    Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved