Does "like this" mean anything specific?
There is a screenshot attachment after the words "like this one". If you open the attachment you will see the screenshot and see what I am talking about. Here is the screenshot again.Image 15.jpg
I don't think you are asking how to put that screenshot in your application. So again, what exactly do you mean? If you are after putting a white rectangle in graphics view then QGraphicsScene::addRect() will add a rectangle.
Okay i am going to try and be as clear as possible. My program must add a QGraphicsTextitem into a QGraphicsScene but I want the QGraphicsTextItem to be added in form of a resizable box like in the attachment above (Please DO NOT look at the white rectangle in the attachment, I am interested in the textItem on the rectangle.) Here is an example below.
Please see this attachmentImage 16.png. This is how my textItem gets added into the scene which means I cannot resize the item by dragging the anchors.
This is what I want to achive Image 17.png. I hope this is clear.
Not really; and that is because I have no clue where to begin trying to reproduce something like this. I would greatly appreciate a push in the right direction and by that I mean what classes am I suppose to be looking at, the rest I will figure out myself with the help of the Qt documentation. thank you.
The problem is that for every feature you want to implement you are not trying to do research yourself but instead you immediately come here and ask how you should do it. How do you expect to learn this way? Looking at classes is one of the last things you should be doing. First you should have at least a general concept how to solve the problem. Then you can ask which classes would best fit your algorithm and whether it is a good approach at all.
The classes you should be looking at are QGraphicsView, QGraphicsScene and QGraphicsItem. I don't think having that list is helpful at all.
And I think if you studied the "Diagram Scene", "Elastic Nodes", and other Graphics / View examples from your Qt distribution, you would find much of what you need there...
Bookmarks