Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorIcon.qml RangeError: Maximum call stack size exceeded #140

Open
MichaelHeiser opened this issue Feb 9, 2023 · 3 comments
Open

ColorIcon.qml RangeError: Maximum call stack size exceeded #140

MichaelHeiser opened this issue Feb 9, 2023 · 3 comments

Comments

@MichaelHeiser
Copy link

I have a weird error when using Colorize and ColorOverlay from Graphical effects:

file:///D:/Qt/5.15.12/msvc2019_64/qml/QtGraphicalEffects/Colorize.qml:0: RangeError: Maximum call stack size exceeded.

The error seems to come from a ColorIcon.qml I'm using in my application:

 /**
 * Copyright (C) Olivier Le Doeuff 2019
 * Contact: olivier.ldff@gmail.com
 */

// Qt
import QtQuick 2.12
import QtGraphicalEffects 1.12 as QGE

import Qaterial 1.0 as Qaterial

Item
{
  id: root

  property color color: Qaterial.Style.colorTheme.primaryText
  property alias icon: dummyImage.source
  property real size: Qaterial.Style.smallIcon
  property bool cached: true

  readonly property real _implicitSize: icon.toString() ? size : 0
  readonly property bool isImage: color.a === 0

  implicitWidth: _implicitSize
  implicitHeight: _implicitSize

 Image
  {
    id: dummyImage

    anchors.fill: parent

    fillMode: Image.PreserveAspectFit
    sourceSize: Qt.size(root.width, root.height)
    visible: root.isImage && root.enabled
  } // Image

  QGE.ColorOverlay
  {
    anchors.fill: parent

    source: dummyImage
    readonly property color implicitColor: enabled ? root.color : Qaterial.Style.colorTheme.disabledText
    color: Qt.rgba(implicitColor.r, implicitColor.g, implicitColor.b, implicitColor.a)

    cached: root.cached
    visible: !root.isImage
  } // ColorOverlay

  QGE.Colorize
  {
    anchors.fill: parent

    source: dummyImage
    hue: 0
    saturation: 0
    lightness: -0.2

    cached: root.cached
    visible: root.isImage && !root.enabled
  } // Colorize
} // Item

Can anyone perhaps tell me how I can solve this issue? I'm not so familiar with Graphical effects...

@OlivierLDff
Copy link
Owner

This seems to be a qt error, maybe related to https://bugreports.qt.io/browse/QTBUG-27433 ?

@MichaelHeiser
Copy link
Author

But what does it mean? Do i generate too much Items? I have generated custom components based on Qaterial controls.

@OlivierLDff
Copy link
Owner

I have no idea without seeing any code, I won't have time to investigate at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants