QGraphicsView Performance
-
I am creating a node editor and using QGraphicsView to implement nodes, their connection ports, and the lines connecting them. The problem I encountered is that if I generate a lot of nodes but do not use wires to connect them, the situation is fine, but if I use wires to connect between ports, it will be very sluggish
My QGraphicsView Configuration:
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);I tried to pass the level of anti aliasing, but it didn't have much effect
-
I am creating a node editor and using QGraphicsView to implement nodes, their connection ports, and the lines connecting them. The problem I encountered is that if I generate a lot of nodes but do not use wires to connect them, the situation is fine, but if I use wires to connect between ports, it will be very sluggish
My QGraphicsView Configuration:
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);I tried to pass the level of anti aliasing, but it didn't have much effect
@BoLin
If you use cosmetic pens with non-zero width, this is extremely slow.
Otherwise I don't know enough about your use case to make suggestions. -
I am creating a node editor and using QGraphicsView to implement nodes, their connection ports, and the lines connecting them. The problem I encountered is that if I generate a lot of nodes but do not use wires to connect them, the situation is fine, but if I use wires to connect between ports, it will be very sluggish
My QGraphicsView Configuration:
setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
setCacheMode(QGraphicsView::CacheBackground);
setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);I tried to pass the level of anti aliasing, but it didn't have much effect