Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Non Image item as OpacityMask::maskSource
Forum Updated to NodeBB v4.3 + New Features

Non Image item as OpacityMask::maskSource

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 726 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kostyamaslyuk
    wrote on last edited by
    #1

    Following code does not show anything on desktop (windows 7 x64, Qt 5.1):

    @import QtQuick 2.0
    import QtGraphicalEffects 1.0

    Item {
    width: 300; height: 300

    Rectangle {
        id: source
    
        anchors.fill: parent
        color: 'red'
        visible: false
    }
    
    Rectangle {
        id: mask
    
        gradient: Gradient {
            GradientStop { position: 0.0; color: 'black' }
            GradientStop { position: 0.5; color: 'transparent' }
            GradientStop { position: 1.0; color: 'white' }
        }
        visible: false
    }
    
    OpacityMask {
        anchors.fill: parent
        source: source
        maskSource: mask
    }
    

    }@

    I expect it to show red gradient dissolving to the sides. If i put Image as maskSource it will work as expected. On android device, similar code as above works as expected.

    It seem to me as malfunction.

    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