Colored Icons not showing for Qt Quick Actions



  • Hi,
    I have a code snippet like this :

    Action {
                    id : newActionId
                    text: qsTr("&New")
                    icon.source: "images/aboutQtIcon.aboutQtIcon.png"
                    onTriggered: {console.log("Clicked on new")}
                }
    

    in my menus but I noticed that colored icons are not showing when I set them as icons. However my black and white icons are showing up. Is there anything one should do for "colored" icons to show up. Or is there anything I am missing with the Default style used by Qt Quick Apps. My imports are

    import QtQuick 2.11
    import QtQuick.Controls 2.4
    

    Any input would help.


  • Moderators

    Are you sure the paths are correct? Is the icon shown when you use plain Image component (just for test)? Are the colorful icons in the same format (PNG)?

    Are you sure you're not using resources (QRC)? Relative paths in QML are a rare sight. Nothing wrong about them, it's just not that common so I'm asking to be sure.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.