Results 1 to 3 of 3

Thread: Background Color is clippable?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2020
    Posts
    3
    Qt products
    Platforms
    Windows

    Default Background Color is clippable?

    So I made a empty widget and started adjusting its Style Sheet properties while following a tutorial and I did not get the expected result.

    the objective of this snippet should be to create a red hexagon with a white background.

    code:
    Qt Code:
    1. background: red;
    2. width: 100px;
    3. height: 100px;
    4. clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 025%);
    To copy to clipboard, switch view to plain text mode 

    however the code snippet does not clip anything and the widget results in being all red.

    is there a way to achieve the desired result?

    Why I was following this tutorial:
    I was trying to create some sort of polygon area to clip the background-color of my widget.

    Thank you for any help in advance
    Last edited by noob_user; 30th June 2020 at 18:14.

Similar Threads

  1. QTreeWidgetItem and background color
    By swiety in forum Qt Programming
    Replies: 9
    Last Post: 26th October 2016, 07:25
  2. Background color animation
    By cszawisza in forum Qt Programming
    Replies: 4
    Last Post: 25th November 2015, 12:37
  3. Background color
    By FelixB in forum Qwt
    Replies: 4
    Last Post: 24th June 2013, 07:03
  4. Setting Background Color
    By SixDegrees in forum Qt Programming
    Replies: 5
    Last Post: 16th February 2011, 18:33
  5. Background color of GLWidget
    By mullwaden in forum Qt Programming
    Replies: 3
    Last Post: 21st August 2008, 17:24

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
  •  
Qt is a trademark of The Qt Company.