Important: Please read the Qt Code of Conduct -

QtQuick 2 application crashes when window too small for graphical effects elements

  • Hi,

    If I use graphical effects on Windows 7 (seems to work fine in Linux and OS X) and I resize the window so that the elements with graphical effects applied, then the application crashes and the following is written to the console:

    bq. Invalid parameter passed to C runtime function.
    ASSERT: "!m_targetRect.isEmpty()" in file scenegraph\qsgdefaultimagenode.cpp, line 392

    I assume this happens because the shaders that create the effects look up the size and the size must not be zero, but since the window is too small to fit the elements, it is zero and the assertion fails.

    Does anyone know how too solve this?

    One thing I tried that works is to detect when the element becomes too small and then to manually destroy the graphical effects elements and then recreate them when the element becomes large enough again, but this is really ugly and means I have to continuously monitor the elements size.

    Any help greatly appreciated.

  • Hmm, that appears to be a different issue, unless I'm missing something.

  • Maybe i made some confusion ... can u put some code where this error shows up ?

  • This is the simplest code that I can come up with that duplicates the problem:

    @import QtQuick 2.0
    import QtGraphicalEffects 1.0
    Rectangle {
    width: 1024
    height: 700
    Rectangle {
    id: other
    anchors.fill: parent
    anchors.margins: 100
    InnerShadow {
    anchors.fill: other
    source: other

    When the window is resized until the rectangle other no longer fits, it crashes.

  • well , i dont see any error here :(

  • i will try to reproduce this

  • I only happens on my Windows 7 machine.

    My guess is that the assertion is to prevent it from trying to create and draw to a zero-width or zero-height buffer object.

    Now, since it's an assertion, I just tried it in release mode and it doesn't seem to crash - it continues on anyway. Maybe its safe to ignore this issue?

  • hmmm , if on linux works well maybe its only a windows issue warning ... try to analyse memory leaks if this a big issue

  • Please file any crash bug at bugreports.
    Please include your minimal example, the application output, and if possible a stacktrace.


Log in to reply