I am adding html/js to my QWebView like so... and I am also adding my custom object like so... but I can't get the object to do anything inside of the javascript.

Qt Code:
  1. uiDemo.webView->setHtml(sCode.toUtf8());
  2. uiDemo.webView->page()->mainFrame()->addToJavaScriptWindowObject("QtJSObject", m_pJSObj);
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. // The javascript code that doesn't run
  2. window.alert('QtJSObject.var is:' + QtJSObject.var)
  3.  
  4. // My object properites
  5. Q_PROPERTY(int var READ getVar WRITE setVar);
To copy to clipboard, switch view to plain text mode 

When I ask for the value of "var" from the properties method in C++ it returns fine... just not in my script. Am I adding the JavaScript Object to my QWebView correctly?