Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Paint on widget not in paintEvent and magnifier
Qt 6.12 LTS is out! See what's new in the release blog

Paint on widget not in paintEvent and magnifier

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

    I see, that "IMPORTANT! QPainter can paint on QWidget only in paintEvent(QPaintEvent*). " (from Wiki qt)
    How to draw rectangle or text on click button?
    Goal: application magnifier glass, it must

    • read pixmap from desktop : pixmap = screen->grabWindow(0);
      how to read only part of pixmap and often refreshing?
      next, I must onMouseMove, read small rectangle near mouse pointer to pixmap, next draw not in paintEvent in my application form N times greater, draw scaled bitmap.
      I must capture mouse, it must receive mouse messages, even if mouse is far from application window.
    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      The tricky part is the drag a rect outside the Qt application.
      I used the transparent window solution as talked about here
      http://www.ifnamemain.com/posts/2014/Jul/11/screen_capture_1/

      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
      • Unsolved