Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Issue with Windows Style - PySide2 / QML



  • Hi all,

    I have a little issue with Windows style and icon in QML ToolBar. Here an example of my code :

    ToolButton{
            display: AbstractButton.IconOnly
            action: actionNew
            }
    
    Action {
            id: actionNew
            text: qsTr("New Project")
            icon.source: "../icons/newDoc_2.png"
        }
    

    With Fusion style, the icon appear correctly. But if I choose Windows style, the icon become all black.

    With Fusion Style
    2b1e005b-93fb-4611-a5b9-e397a624dd05-image.png

    With Windows Style
    5425a817-815d-4157-a850-21938ec9c345-image.png

    I tried a lot modifications of my code : height, file type of icon, ... but I can't get a correct result.
    Have you an idea ? Could you help me ?

    Thank in advance.

    Charles-Elie


Log in to reply