QGraphicswebview and plugin
-
Hi I have one plugin which is basically a subclass of QLineEdit and QPushButton, I am using this in my application which uses QWebView it works great there. In another application we are using QGraphicsWebView and we want to use few of our existing plugin in which are QWidget based so to have these plugin widgets in our QGrpahicsWebView we are using QGraphicsProxyWidget but this is not woking good as the same plugin widget works with QWebView. I am using it same way as it says in documentation that I can set my QWidget to GraphicsProxyWidget, i.e. QGraphicsProxyWidget.setWidget(myPushButton).
I am unable to get button clicked signal in my javascript function. I am trying to figure out what step did I miss? becausae exact same plugin widget works good with QWebView. I even subclassed QGraphicsProxyWIdget and added the exact same signal "clicked" in hope that it will do that job but even this also does not work.
Can any one please let me know if I need to do somethign special to get it working.Prakash
-
onload() function is not in Qt Assistant because it is not Qt api, I am talking about JavaScript onload.
You can add your event listener and connect all your signals in that, thats the way all signals will be initialized. you can do like this
@<body>
function myFunction()
{
myObject.mysignal.connect(alert("Hello world I got my signal"));
}@update: it is like in body element you put onLoad=myFunction()
-
Thank you immii This does the trick, as well I exported my QWebPage object and did the connection for other plugin object against the signal of QWebPage::loadFinished(), that also works, I am kind of confuse now which approach is better and which one should I keep in my code. Qt Assistant does talk about loadFinished() but no where I found any thing which talks about onLoad() in body element so I am stickging wint loadFinished at the moment.
-
Well that is possible, but not guaranteed in my opinion because what if the initialization for the loadFinished() signal fails, then all of your other signals which you are connecting against this will also fail. So If I were you I would have gone with onLoad().