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. DropShadow in Qml application causes Debug error. Reproducable 100%

DropShadow in Qml application causes Debug error. Reproducable 100%

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qml dropshadowdebug error
4 Posts 2 Posters 1.6k 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.
  • A Offline
    A Offline
    avkn
    wrote on 6 Jul 2016, 17:38 last edited by A Former User 7 Jul 2016, 20:51
    #1

    Several days ago I got a "Debug error!" message box while running a QtQuick application, and the following message in Application output:

    ASSERT failure in QVector<T>::at: "index out of range", file c:\work\build\qt5_workdir\w\s\qtbase\include\qtcore../../src/corelib/tools/qvector.h, line 393

    It took a couple of hours to find out, that it is a DropShadow graphic effect, that cause this issue.

    Here is my "minimal application" (only qml files) that reproduces this case. This is a Qt Quick Application project.

    main.qml:

    import QtQuick 2.3
    import QtQuick.Window 2.2
    
    Window {
        id: root
        visible: true
    
        property int count: 0
    
        Text {
            id: text
            text: qsTr("loop count: ") + count
            anchors.horizontalCenter: parent
            anchors.top: parent.top
            anchors.topMargin: 10
        }
        Loader {
            id: loader
            anchors.top: text.bottom
            width: root.width
            height: root.height - text.height - 10
            source: "qrc:/one.qml"
        }
    
        Connections {
            target: loader.item
            onOne:{
                loader.source = "qrc:/two.qml"
            }
            onTwo: {
                loader.source = "qrc:/one.qml"
                count++
            }
        }
    }
    

    one.qml:

    import QtQuick 2.0
    import QtGraphicalEffects 1.0
    
    Item {
        id: root
        signal one ()
    
        Timer {
            interval: 1000; running: true; repeat: false
            onTriggered: root.one()
        }
    
        Rectangle {
            id: rect
            width: 100
            height: 100
            anchors.centerIn: root
            color: "red"
            border.color: "black"
            border.width: 3
            radius: 10
        }
        DropShadow {
             anchors.fill: rect
             horizontalOffset: 3
             verticalOffset: 3
             samples: 7
             color: "#80000000"
             source: rect
         }
    }
    

    The two.qml file is the same as the one.qml, it differs only in three lines:

    signal one () -> signal two ()
    onTriggered: root.one() -> onTriggered: root.two ()
    color: "red" -> color: "green"

    I get error messages short after start.
    You can experiment, commenting out DropShadow in one.qml, in two.qml, in both. If you comment out both, the application runs infinite.

    My environment:

    Qt Creator 3.6.0
    Based on Qt 5.5.1 (MSVC 2013, 32 bit)
    Built on Dec 15 2015 01:01:38
    From revision b52c2f91f5

    Kit: Desktop Qt 5.5.1 MSVC2010 32 bit

    Maybe someone knows what is happening there, and how can I use DropShadow without this errors?
    Thank you in advance!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Jul 2016, 21:11 last edited by
      #2

      Hi,

      You should check against a more recent version of Qt to see if it's still reproducible (5.6.1 or 5.7.0). If so then you should take a look a the bug report system to see if it something known. If not please consider opening a new report providing your sample application.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply 7 Jul 2016, 12:05
      0
      • S SGaist
        6 Jul 2016, 21:11

        Hi,

        You should check against a more recent version of Qt to see if it's still reproducible (5.6.1 or 5.7.0). If so then you should take a look a the bug report system to see if it something known. If not please consider opening a new report providing your sample application.

        A Offline
        A Offline
        avkn
        wrote on 7 Jul 2016, 12:05 last edited by
        #3

        @SGaist

        Thank you for your advice.
        Have changed to 5.7.0/MS VS 2015, no "Debug error!" enymore. But now it looks the same as if there were no DropShadow at all. I can not see any shadow.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 7 Jul 2016, 20:47 last edited by
          #4

          You may have found a bug then. You should check the bug report system to see if it's something known. If not please consider opening a new report with your sample application.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          6 Jul 2016, 17:38

          • Login

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