Hi,
I have a application where there is a scene(QGraphicsScene) by using toolbox we can add items to scene. I have designed two forms(hwidget.ui, vwidget.ui) now i want to add these two to scene background, how can i do this.
Hi,
I have a application where there is a scene(QGraphicsScene) by using toolbox we can add items to scene. I have designed two forms(hwidget.ui, vwidget.ui) now i want to add these two to scene background, how can i do this.
You can only add them as items, not into the background layer. Create widgets out of them and use QGraphicsScene::addWidget().
ya i have tried like that but addWidget( ) accepts QWidget object.and i have only designed two forms (hwidget.ui and vwidget.ui) do i need to create any class for that.
try
QGraphicsProxyWidget to ur application
Yes, you have to create an widget object first. Try QUiLoader. As I see in docs, it's the thing you need, but I've never tried it for myself.
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
I would advise against it. Either create proper classes based on those forms or use the direct approach which might be simpler in your case. Both are described in Using a Component in Your Application
c_srikanth1984 (30th January 2009)
I could add my hwidget.ui and vwidget.ui to my scene background using this direct approch.
thank u.
Bookmarks