PDA

View Full Version : CHIP Demo



alitoh
6th April 2011, 20:29
Hello,

I'm trying to follow the chip demo as a guideline on how to work with the Graphics Scene / View.

My problem now is that I can't seem to embed the view into a dlg window. That is, I CAN instantiate the view object, I CAN instantiate the SCENE object and I'm trying to follow most of the CHIP demo on most of the code. But I just can't make it show in my dialog window.

If I use the view->show(); line it appears as A NEW WINDOW (which kinda makes sense), but I just can't seem to figure how how to make it be embebed INTO the dialog.

Also, I seem to have a problem with either the scene, the view or both being of a massive size, and I don't know how to resize them.

I'm attaching a screenshot of how it looks, so you know why it's wrong.

wysota
6th April 2011, 21:08
Insert the view into the dialog's layout or pass a pointer to the dialog as a parent to the view's constructor.

alitoh
7th April 2011, 13:56
Man, you are a damn god. Hope you know that.

"Insert the view into the dialog's layout" I did this by downright copying the demo, but I don't really understand the procedure, care to explain or direct me to the proper documentation?

Thanks!

Zlatomir
7th April 2011, 14:03
Read here (http://doc.qt.nokia.com/4.7/layout.html)
Also this (http://doc.qt.nokia.com/4.7/widgets-and-layouts.html) example is useful.

And then,if you don't understand a specific thing, ask and we will try to explain it ;)
//also CHIP Demo should have comments that explain how it works

alitoh
7th April 2011, 14:36
//also CHIP Demo should have comments that explain how it works
I don't know it that's more of a general comment or pointed out at me. But the CHIP files I downloaded are not commented... at all.

It should be heavily commented in my opinion. Specially considering it is one of the most powerful and appealing demos QT has right now.