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. [Solved] QML Glow and DropShadow works for Text but fails for Image
Forum Updated to NodeBB v4.3 + New Features

[Solved] QML Glow and DropShadow works for Text but fails for Image

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.8k 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.
  • E Offline
    E Offline
    elendilm
    wrote on last edited by
    #1

    Glow and DropShadow elements in QtGraphicalEffects 1.0 works for Text Elements But when applied for Images, it fails.

    I copy and pasted the Qt Example code but nothing happens. Displays the plain butterfly image.

    @import QtQuick 2.0
    import QtGraphicalEffects 1.0

    Item {
    width: 300
    height: 300

    Rectangle {
        anchors.fill: parent
    }
    
    Image {
        id: butterfly
        source: "images/butterfly.png"
        sourceSize: Qt.size(parent.width, parent.height)
        smooth: true
        visible: false
    }
    
    DropShadow {
        anchors.fill: butterfly
        horizontalOffset: 3
        verticalOffset: 3
        radius: 8.0
        samples: 16
        color: "#80000000"
        source: butterfly
    }
    

    }@

    Using Qt 5.1.1 in Linux Mint KDE
    also tested on Windows 7 with no results,

    1 Reply Last reply
    0
    • E Offline
      E Offline
      elendilm
      wrote on last edited by
      #2

      If the image contains transparent areas, then it glows, otherwise doesn't.
      Thank you

      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