Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Qt Widgets: Implementing a Minimap with Viewport Indicator

Qt Widgets: Implementing a Minimap with Viewport Indicator

Scheduled Pinned Locked Moved Unsolved The Lounge
2 Posts 2 Posters 95 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
    Anirudh
    wrote last edited by
    #1

    I’m working on a design tool built with Qt Widgets. I want to add a minimap widget that shows the overall layout of the design. As the user zooms or pans the main view, the minimap should update accordingly and display a red rectangle indicating the current viewport.

    If anyone has implemented something similar or can suggest an approach, examples, or relevant Qt classes to look into, I’d really appreciate the help.

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote last edited by
      #2

      Maybe with a custom QGraphicsEffect calling drawSource with a scaled/translated QPainter.

      Another solution would be to use QWidget::grab() periodically to get a QPixmap of the widget and overlaying that on top of it.

      For potential future readers looking for the minimap keyword: In Qt Quick it's pretty easy to do so with just a scaled down ShaderEffectSource.

      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