Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. UpdateLayeredWindowIndirect failed when clicking on the menu icon

UpdateLayeredWindowIndirect failed when clicking on the menu icon

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 584 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.
  • R Offline
    R Offline
    Rangerguy128
    wrote on last edited by
    #1

    Been trying to run a file (named "propiedadesmain.py" that generates a window for graphic presentation purposes.

    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_())
    
    

    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:

    {
        "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"
                }]
            }]   
    }
    

    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:
    74b53861-e8b3-4a4a-ad43-28a4957877a3-image.png
    However, as I run the file, the menu button seems to be bugged (as seen in these images):
    a2777a17-73fd-4f0c-8ca1-61284338217a-image.png
    df85a420-5cdb-4258-8640-edd9c8040dbd-image.png
    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:
    98a5a4f0-8434-40eb-b458-cc02ca6dd028-image.png
    I'm not sure if this porbably has something to do with error or not.

    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