Important: Please read the Qt Code of Conduct -

BorderImages and transparency in images

  • Here is the button:

    ! button)!

    The application background is dark, when it is used in a ButtonImage, the corners are always white, not transparent. Is there something wrong with the PNG format or is it a code thing?

    @ BorderImage {
    id: buttonImage
    source: "images/ButtonBorder.sci"
    width: container.width; height: container.height


    @border.left: 4 4
    border.bottom: 4
    border.right: 4
    source: ButtonBorder.png

  • just add

    color: "transparent"

    in ButtonBorder.sci

  • Hi,

    You shouldn't need to do anything special, it should "just work" (testing with a black background on OS X, the above image in a BorderImage worked fine for me -- no white corners). What platform and graphics system (raster, opengl, etc) are you using?


Log in to reply