<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[UpdateLayeredWindowIndirect failed when clicking on the menu icon]]></title><description><![CDATA[<p dir="auto">Been trying to run a file (named "<a href="http://propiedadesmain.py" target="_blank" rel="noopener noreferrer nofollow ugc">propiedadesmain.py</a>" that generates a window for graphic presentation purposes.</p>
<pre><code>import os
import sys

import csv
from propiedades import *


from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from Custom_Widgets.Widgets import *
from functools import partial


shadow_elements = { "left_menu","frame_3", "frame_5", "header", "frame_8"}

class MainWindow(QMainWindow):
        def __init__(self,parent=None):
            QMainWindow.__init__(self)
            self.ui = Ui_MainWindow()
            self.ui.setupUi(self)
            
            self.setMinimumSize(850,600)
            
            loadJsonStyle(self, self.ui)
            for x in shadow_elements:
                
                effect = QtWidgets.QGraphicsDropShadowEffect(self)
                effect.setBlurRadius(18)
                effect.setXOffset(0)
                effect.setYOffset(0)
                effect.setColor(QColor(0,0,0,255))
                getattr(self.ui,x).setGraphicsEffect(effect)
            
            
            self.show()
            
if __name__ == "__main__":
    import sys
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())

</code></pre>
<p dir="auto">From the imports, it calls the "propiedades" file that was generated by QT Designer (converted the ui file into a python file) and acts as the base for the UI construction. It also calls a json file for additional style modification:</p>
<pre><code>{
    "QMainWindow":[
        {
            "tittle":"AquaSense Analytics",
            "icon":":/icons/App/8993012.png",
            "frameless": true,
            "transluscentBg": true,
            "sizeGrip": "SIZEGRIP",
            "shadow":[{
                "color": "#000",
                "blurRadius": 20,
                "xOffset": 0,
                "yOffset": 0,
                "centralWidget": "centralwidget" 
        }
    ],
    "navigation":[
        {
            "moveWindow": "header",
            "tittleBar": "header"
        }
        ]
    }
    ],
    "QStackedWidget":[
        {
            "name":"stackedWidget_2",
            "transitionAnimation":[
                {
                    "slide":[{
                        "active": true,
                        "duration":1000,
                        "direction": "horizontal",
                        "erasingCurve": "Linear"
                    }
                ]
                }
            ],
            "navigation":[{
                "navigationButtons":[
                    {
                        "pushButton_5":"percentage_bar_chart",
                        "pushButton": "nested_donuts",
                        "pushButton_2": "temperature_charts",
                        "pushButton_3": "line_charts",
                        "pushButton_4": "bar_charts"
                    }
                ]
            }]
        }],
        "QCustomSlideMenu": [{
            "name":"left_menu",
            "defaultSize": [{
                "width": 0,
                "height": "parent"
            }],
            "collapsedSize": [{
                "width": 0,
                "height": "parent"
            }],
            "expandedSize": [{
                "width": 250,
                "height": "parent"
            }],
            "toggleButton":[{
                "buttonName": "pushButton_6",
                "icons": [{
                    "whenMenuIsCollapsed": ":/icons/App/image/left_menu.png",
                    "whenMenuIsExpanded": ":/icon/3810964.png"
                }]
            }],
            "menuTransitionAnimation": [{
                "animationDuration": 500,
                "animationEasingCurve": "Linear"
            }]
        }]   
}
</code></pre>
<p dir="auto">The Json file is especially used to add a function to the menu button: when pressed, it slides to the left and hides the buttons. When pressed again, it slides to the right and shows all the buttons. This is what it supposed to show:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/9ff3b12b-349b-42a1-bb31-620f94a87995.png" alt="74b53861-e8b3-4a4a-ad43-28a4957877a3-image.png" class=" img-fluid img-markdown" /><br />
However, as I run the file, the menu button seems to be bugged (as seen in these images):<br />
<img src="https://ddgobkiprc33d.cloudfront.net/a261bccb-b8ec-492a-ba87-4e9c2fc1f96b.png" alt="a2777a17-73fd-4f0c-8ca1-61284338217a-image.png" class=" img-fluid img-markdown" /><br />
<img src="https://ddgobkiprc33d.cloudfront.net/34f04c48-caf7-4b58-a298-1a85a81d082a.png" alt="df85a420-5cdb-4258-8640-edd9c8040dbd-image.png" class=" img-fluid img-markdown" /><br />
Is there anyway to fix this? Whenever I click on the menu button, it sends an error saying "UpdateLayeredWindowIndirect failed for ptDst=(258, 56), size=(850x607), dirty=(881x627 -20, 0) (The parameter is incorrect.)". Additionally, in the mainpropiedades file, setGraphicsEffect is not highlighted like the rest of the functions:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/6b2e8724-3472-403c-ab28-43bda027f6af.png" alt="98a5a4f0-8434-40eb-b458-cc02ca6dd028-image.png" class=" img-fluid img-markdown" /><br />
I'm not sure if this porbably has something to do with error or not.</p>
]]></description><link>https://forum.qt.io/topic/155855/updatelayeredwindowindirect-failed-when-clicking-on-the-menu-icon</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 13:31:17 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/155855.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 06 Apr 2024 15:26:34 GMT</pubDate><ttl>60</ttl></channel></rss>