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. ContextMenu walk through QWidget ?
Forum Updated to NodeBB v4.3 + New Features

ContextMenu walk through QWidget ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 269 Views 1 Watching
  • 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.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by sonichy
    #1

    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

    https://github.com/sonichy

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      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);
      }
      
      
      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved