void MBubbleItem::setCentralWidget(QGraphicsWidget* centralWidget) { QGraphicsWidget *oldCentralWidget = model()->centralWidget(); if(oldCentralWidget == centralWidget) return; model()->setCentralWidget(centralWidget); if(oldCentralWidget && oldCentralWidget->parent() == this) delete oldCentralWidget; }
void GraphicImageEffectElement::onOpenClick() { QGraphicsWidget *gw = (QGraphicsWidget*)this->scene()->parent(); QWidget *qw = (QWidget*)gw->parent(); QTabWidget *tw = (QTabWidget*)qw->parentWidget()->parentWidget(); GraphicImageElementDetailedWindow *giedw = new GraphicImageElementDetailedWindow(modImage); tw->addTab(giedw, "Imagen"); }
void core::ImageEffect::openOnWindowClick() { QGraphicsWidget *gw = (QGraphicsWidget*)this->scene()->parent(); QWidget *qw = (QWidget*)gw->parent(); QTabWidget *tw = (QTabWidget*)qw->parentWidget()->parentWidget(); ImageDetailedWindow *giedw = new ImageDetailedWindow(&modImage); tw->addTab(giedw, "Imagen"); }
void HbXmlLoaderBaseActions::cleanUp() { mStack.clear(); // Create mTopObjectMap for (ObjectMap::iterator it = mObjectMap.begin(); it != mObjectMap.end(); ++it ) { QObject *object = it.value().mObject.data(); if ( it.value().mOwned ) { if (object && it.value().mType == HbXml::WIDGET) { QGraphicsWidget *asWidget = static_cast<QGraphicsWidget *>(object); if (!asWidget->parentItem() && !asWidget->parent()) { mTopObjectMap.insert(it.key(), it.value()); } } else if (object && !object->parent()) { mTopObjectMap.insert(it.key(), it.value()); } else { // not added - owned by another object. } it.value().mOwned = false; } } }