qt-interest@trolltech.com
[Top] [All Lists]

Re: apply tidy directly for the page loaded with webkit without saving i

Subject: Re: apply tidy directly for the page loaded with webkit without saving it on the disk
From: André Somers
Date: Mon, 9 Jun 2008 19:18:45 +0200
Hi,
 
There is some demonstration _javascript_ by default in the text edit, right? Did you notice how it uses an object called "dataObject", and a method called setData? Does that ring any bells?
Did you read the documentation on addToJavaScriptWindowObject?
 
André
 






Hello André,
finally I can  run your code, thank you well.
in fact it did not work for me  because I tested it in Linux and I have'nt connection, that is why nothing has been posted :)


   
I have understand that this instructions are used to apply the script written in plaintextedit


  QString script;
  script = plainTextEdit->toPlainText();
  QVariant v = f->evaluateJavaScript(script);
 

But, I don't understand this instructions:


if (!m_dataObject)
{
  m_dataObject = new TestObj();
  f->addToJavaScriptWindowObject("dataOutput", m_dataObject);
 }
 

And the slot setData serve for what, can you give me more explanation.
Regards.
<Prev in Thread] Current Thread [Next in Thread>