[Solved] Graphic view to widget
-
Hello.
I have been learning Qt for some time now reading book C++ GUI Programming with Qt4. The book is exellent, but now I want to combine two different views. I have modified on examples of the book. Right side layout is QTextEdit and get it working.
What I want to replace QTextEdit with (some) graphical view where let say Button 1 prints out line, Button 2 square etc. How should I make it?
-
I paste my code here.
I have tried to show grbox in the place of QTextEdit. If I run OvenTimer in it's own project it is running.
-
Hi,
Do you mean you want to draw a diagram that contains circles and shapes graphics items ? -
Yes. Exactly. I want to draw let's say one simple square where the larger white box is in my widget. I think the object should be defined as QGraphicScene or so but I can't figure it out how.
-
Ok,
There is a good example in your Qt installation directory : /usr/lib/qt4/examples/graphicsview/diagramscene/It's very helpful and simple :)
"for more information":http://doc.qt.digia.com/4.7-snapshot/graphicsview-diagramscene.html
-
[quote author="issam" date="1351454122"]Ok,
There is a good example in your Qt installation directory : /usr/lib/qt4/examples/graphicsview/diagramscene/It's very helpful and simple :)
"for more information":http://doc.qt.digia.com/4.7-snapshot/graphicsview-diagramscene.html
[/quote]
Yeah.. This is a very good example and its very useful.... Thanks a lot...
-
There is a video tutorial, may be helpful from VoidRealm in Youtube. When I make a scene, it was very helpful (tutorial 81, 82, and 83).
-
Thank you for exellent links. I got it done. :)