javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Widget.java
changeset 61 bf7ee68962da
parent 48 e0d6e9bd3ca7
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Widget.java	Tue Jul 06 14:10:26 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Widget.java	Wed Aug 18 09:43:15 2010 +0300
@@ -50,6 +50,11 @@
  * @see #checkSubclass
  */
 public abstract class Widget {
+    // The handles of the child-most and the root-most QObject within the
+    // Widget, respectively. For Controls these are QWidgets but for some 
+    // Widgets only QObjects (e.g. QActions for MenuItems). Both can be 
+    // assigned the same QObject. If the handles are nonzero and not equal then
+    // handle is always (directly or indirectly) a QObject child of topHandle. 
     int handle, topHandle;
 
     int style, state;
@@ -312,6 +317,14 @@
     } else {
         createHandle_pp (index);
     }
+    if(Display.objectNames) {
+        if(handle != 0) {
+            OS.QObject_setObjectName(handle, this.getClass().getName() + " Widget.handle");
+        }
+        if(topHandle != 0 && topHandle != handle) {
+            OS.QObject_setObjectName(topHandle, this.getClass().getName() + " Widget.topHandle");
+        }
+    }
     // If subclasses didn't specify topHandle then it's assumed that there's
     // only one QWidget. I.e. handle is the root widget.
     if(topHandle == 0) topHandle = handle;
@@ -325,6 +338,7 @@
     } else {
         register_pp();
     }
+    fixMousePropagation();
 }
 
 void deregister_pp () {
@@ -380,6 +394,9 @@
     return Display.filters (eventType);
 }
 
+void fixMousePropagation() {
+}
+
 static final Command[] getCommands(Control control) {
     return control.getCommands();
 }
@@ -511,12 +528,6 @@
     return style;
 }
 
-// Experimental support for StyleSheets
-public String getStyleSheet(){
-    checkWidget();
-    return OS.QWidget_styleSheet(handle);
-}
-
 void hookEvents_pp () {
 }
 
@@ -1183,9 +1194,9 @@
     }
 
     if(key.equals(WidgetConstant.CSS_ID)){
-    	OS.QObject_setObjectName(topHandle,(String)value);
-    	// Do not return here and let Widget store the key
-    	// value.
+        OS.QObject_setObjectName(topHandle,(String)value);
+        // Do not return here and let Widget store the key
+        // value.
     }
 
     int index = 1;