Results 1 to 6 of 6

Thread: How to create Shadow for Rectangle?

  1. #1
    Join Date
    Sep 2012
    Posts
    66
    Thanks
    21
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default How to create Shadow for Rectangle?

    I have created a Rectangle and now I want to add its shadow. How can I add it?

  2. #2
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create Shadow for Rectangle?

    U can use rectangular glow for it. you have to import QtGraphicalEffects

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to create Shadow for Rectangle?

    There is a DropShadow element in the QtGraphicalEffects module.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create Shadow for Rectangle?

    I guess DropShadow is suitable for images and is not a good choice for visual items of qml. So i think rectangularglow is best choice for qml visual items. Am i right wysota?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to create Shadow for Rectangle?

    Quote Originally Posted by alizadeh91 View Post
    I guess DropShadow is suitable for images and is not a good choice for visual items of qml. So i think rectangularglow is best choice for qml visual items. Am i right wysota?
    DropShadow uses the glow effect under the hood, so... no, you're not right
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: How to create Shadow for Rectangle?

    But when i tried to use DropShadow with qml items, It works well except that it's very sharp edges even though i've set the spread property to zero


    Added after 4 minutes:


    One more thing that the compiler get this warning: QML SourceProxy: Binding loop detected for property "output"
    Last edited by alizadeh91; 30th December 2012 at 20:40.

Similar Threads

  1. Text drop-shadow using CSS (text-shadow)
    By xtal256 in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2018, 10:08
  2. QMenu without shadow
    By furj in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2013, 21:00
  3. Create shadow view surrounding the shape.
    By Niamita in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2011, 11:47
  4. Create gradient and shadow on text?
    By Kevin Hoang in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2010, 08:41
  5. About QTreeView's shadow.
    By yangyunzhao in forum Qt Programming
    Replies: 3
    Last Post: 19th August 2009, 08:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.