Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Smooth the corners of shaped widget

Smooth the corners of shaped widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 220 Views
  • 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.
  • A Offline
    A Offline
    al072
    wrote on last edited by
    #1

    Hi dear Qt community! I need some help with shaped widget corner smooth rendering. I create shaped widget based on QPolygon using setMask function this way (QT 5.15.2):

    Widget::Widget(QWidget *parent)
        : QWidget(parent,Qt::FramelessWindowHint | Qt::WindowSystemMenuHint)
        , ui(new Ui::Widget)
    {
        QPainterPath path;
        path.addPolygon(poly);
        QRegion region(path.toFillPolygon().toPolygon());
    
        this->setMask(region);
        ui->setupUi(this);
    }
    

    Widget looks like on the screen (attached), please take a look on the left top corner it is not smoothed:
    shaped.JPG

    Could somebody give me a hint please how to make the polygon corners smooth? Thank you very much., i am new to Qt sorry if the question is not correct.

    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