Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Circular image area

    General and Desktop
    3
    4
    301
    Loading More Posts
    • 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.
    • T
      tovikonioput last edited by

      Hi,

      I put images in my program with the help of Pillow.
      I display the image as a QPixmap inside a QLabel, using the setPixmap() method.

      The images I display have a circular shape.
      What I want is the images to have a circluar area(?) instead of a rectangular one, so that if I put 2 images next to each other the corner of one image will not obscure the other one.

      I can`t seem to find a solution for this, I did found a simple solution in C#, here.

      Thanks.

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @tovikonioput last edited by raven-worx

        @tovikonioput
        they should be, when the images contain transparency. Is that not the case?

        you may also want to try one of those calls (on the labels):

        setAttribute( Qt::WA_TranslucentBackground, true );
        setAttribute( Qt::WA_OpaquePaintEvent, false);
        setAutoFillBackground(false);
        

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        T 1 Reply Last reply Reply Quote 1
        • T
          tovikonioput @raven-worx last edited by

          @raven-worx the images do not contain transparency, how can I add it to them?

          Cobra91151 1 Reply Last reply Reply Quote 0
          • Cobra91151
            Cobra91151 @tovikonioput last edited by

            @tovikonioput

            Hi! You need to reimplement the paintEvent of QLabel class to have circular image.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post