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. QGraphicsView grid
Qt 6.11 is out! See what's new in the release blog

QGraphicsView grid

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

    Hello!

    I want to make a grid in my QGraphicView like in MS Visio, or AutoCAD software. Initially I have created class Point, subclass of QGraphicsItem, and added in the loop Points to QGraphicScene with addItem() function. So points form a grid. In this case everything looks ok, but performance issues appears. Application freeze, while adding thousand of items.

    My second idea was to use drawBackrground() function. And in this case it works fast, but artifacts appear. My algorithm of drawing Points is ok, the problem is that when I scroll View, background drawing can not get in time, and blank rows or columns appear.

    Any Ideas?

    1 Reply Last reply
    0
    • HarbH Offline
      HarbH Offline
      Harb
      wrote on last edited by
      #2

      Well, if anyone interested, I ended up with drawBackground() function. And just added + extra 10% for area which in fact has to be redrawn. Now, there no "white spaces" appear while scrolling.

      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