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. QtQuick 2 application crashes when window too small for graphical effects elements
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved QML and Qt Quick
10 Posts 3 Posters 2.9k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    dublindan
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bjanuario
      wrote on last edited by
      #2

      There is a reported bug similar with that issue
      check this: "https://bugreports.qt-project.org/browse/QTBUG-28890":https://bugreports.qt-project.org/browse/QTBUG-28890

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dublindan
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bjanuario
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dublindan
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bjanuario
              wrote on last edited by
              #6

              well , i dont see any error here :(

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bjanuario
                wrote on last edited by
                #7

                i will try to reproduce this

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dublindan
                  wrote on last edited by
                  #8

                  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?

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bjanuario
                    wrote on last edited by
                    #9

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

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      chrisadams
                      wrote on last edited by
                      #10

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

                      Thanks!
                      Chris.

                      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