Giter VIP home page Giter VIP logo

Comments (3)

tumic0 avatar tumic0 commented on July 18, 2024

This is a bug of mythpreviewgen, not QtPBFImagePlugin as any application using stuff from the Qt GUI API (QImage is part of the GUI module) is required to use at least QGuiApplication (or QApplication).

Apart from being stated in the documentation it was also affirmed in the Qt mailing list recently.

from qtpbfimageplugin.

paul-h avatar paul-h commented on July 18, 2024

A quick follow up for anyone who should come across this problem in the future.

If the option is open to you the easiest and undoubtedly the proper fix is to just use QGuiApplication in your application.

If you can't do that you are stuffed the only fix is to un-install this plugin and the problem will go away.

My personal view is a 3rd party Qt plugin should not be knowingly crashing applications, even if they are not following the guide lines, sometimes programmers do bend the rules slightly :)

There is a simple 3 line patch that will allow the plugin to fail gracefully rather than throwing an abort and crashing the application which in my view is a more friendly thing to do but sadly that is not a view held by tunic0 :( .

from qtpbfimageplugin.

tumic0 avatar tumic0 commented on July 18, 2024

It is not the plugin that is "crashing" (it's not even a crash) the application but an assert in Qt that detects someone is using the GUI API without a proper GUI module initialisation (using the QGuiApplication instance). Qt has however such asserts not on all GUI API use cases so QtPBFImagePlugin may be the first or even the only code that will trigger the assert.

All this means, that when your application is broken and uses the wrong base class, ANY Qt plugin or even Qt itself may trigger such assert at ANY time. So the solution is really not to request every Qt plugin or Qt self to include code like:

if (used_from_a_broken_app_like_mythpreviewgen)
    do_nothing_and_return_NULL

in front of every GUI API call (or at least in the initialisation in case of a module). The only solution is to fix your code, since otherwise you do not know who and when will trigger such an assert the next time (It may be another plugin or even a new Qt version).

from qtpbfimageplugin.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.