Questions tagged [qgraphicsscene]

A QGraphicsScene is a class from the Qt toolkit that provides a surface for managing a large number of 2D graphical items.

The QGraphicsScene class is part of Qt's Graphics View Framework and serves as a container for QGraphicsItems. It is used together with QGraphicsView for visualizing graphical items, such as lines, rectangles, text, or even custom items, on a 2D surface.

A QGraphicsScene also provides functionality which can efficiently determine both the location of items, and which items are visible within an arbitrary area on the scene. It has no visual appearance of its own; it only manages the items. A QGraphicsView widget is needed to visualize the scene.

The official Qt documentation can be found here.

874 questions
-2
votes
1 answer

How to draw QLines at startup?

I'm going to draw a QLine in a QGraphicsScene and display it via a QGraphicsView. The line is drawn during mainwindow construction, but deleted after leaving the MainWindow constructor shortly after been drawn and before reaching any slot. (I…
user7427029
  • 255
  • 2
  • 12
-2
votes
1 answer

Qt C++ Error when drawing a simple polygon

I have an old c++ program that I need to bring back to life. My task now is to draw a single Polygon. I am stuck at the very beginning since I have no experience in graphics. The points I want to use to draw a Polygen are stored in QVector <…
user3443063
  • 1,455
  • 4
  • 23
  • 37
-3
votes
2 answers

Moving object using keyboard qt

I'm trying to move an object using my arrow keys, but when I launch the app, nothing happens. Do you have an idea on how to fix it ? @Update : my rectangle only moves once to the left and to the right, but if I use qDebug it recognizes all the…
David
  • 221
  • 3
  • 13
-3
votes
1 answer

QT drawing pixels to graphics scene

I need to write a std::vector< double > values to a qGraphicsScene. (values between 0-1, each element represents a pixel - grayscale) Later i want to access the pixels of the image for replace the color (i don't have time to replace the whole…
Denes
  • 26
  • 1
  • 5
1 2 3
58
59