[Uml-devel] branches/work/soc-umbrello/umbrello

Gopala Krishna A krishna.ggk at gmail.com
Sat Aug 30 09:52:11 UTC 2008


SVN commit 854765 by gopala:

Added a utility method ListPopupMenu::ownerWidget() which returns the
widget if the menu is owned by widget, and returns 0 otherwise.



 M  +14 -0     listpopupmenu.cpp  
 M  +2 -0      listpopupmenu.h  


--- branches/work/soc-umbrello/umbrello/listpopupmenu.cpp #854764:854765
@@ -1618,6 +1618,20 @@
     }
 }
 
+/**
+ * Utility method to fetch owner of the menu.
+ *
+ * @return The owned NewUMLWidget if this menu is owned by a
+ *         widget. Otherwise returns 0.
+ */
+NewUMLWidget* ListPopupMenu::ownerWidget() const
+{
+    if (m_TriggerObjectType == tot_Widget) {
+        return m_TriggerObject.m_Widget;
+    }
+    return 0;
+}
+
 void ListPopupMenu::setActionChecked(Menu_Type idx, bool value)
 {
     QAction* action = getAction(idx);
--- branches/work/soc-umbrello/umbrello/listpopupmenu.h #854764:854765
@@ -273,6 +273,8 @@
 //    Menu_Type getMenuType(KAction* action);
     Menu_Type getMenuType(QAction* action);
 
+    NewUMLWidget *ownerWidget() const;
+
 private:
 
     /**




More information about the umbrello-devel mailing list