Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

ContextMenu walk through QWidget ?



  • The menu is the desktop's menu.
    The QWidget is like draw a border on desktop.
    https://github.com/xiaoyanLG/Qt_Gif_Creator

    alt text


  • Lifetime Qt Champion

    Hi
    You kinda forgot the question.
    but i assume you ask how ?

    Its made via a QRegion/setMask that clips out an area from the widget.
    All the magic happens here.

    void XYGifFrame::resizeEvent(QResizeEvent *)
    {
        QRect rect = this->rect();
        rect.adjust(3, 3, -3, -(ui->content->height() + 5));
        mRecordRect = rect;
    
        ui->width->setValue(mRecordRect.width());
        ui->height->setValue(mRecordRect.height());
    
        QRegion region(this->rect());
        setMask(region.xored(mRecordRect));
    
        ui->content->move(width() - ui->content->width() - 3, height() - ui->content->height() - 3);
    }
    
    

Log in to reply