[Qt-interest] Calling QT objects from script embedded in html pages.

jeanmichel.123 at free.fr jeanmichel.123 at free.fr
Wed May 20 17:26:44 CEST 2009


Selon jeanmichel.123 at free.fr:

(...)
> javascript code.
> I'd like to add calls to QT objects (such as QFile or QString).
>
> However, when I write javascript code such as:
>
> var a = QString ( fichier ) ;
> or
> var b = QFile (fichier );
>
> an exception is captured by the try catch block.

I just discovered the QWebSettings API:
    QWebSettings * s = QWebSettings::globalSettings () ;
    s->setAttribute( QWebSettings::JavascriptEnabled , true);
    s->setAttribute( QWebSettings::DeveloperExtrasEnabled , true);

Using debug mode, this lead me one step forward, with the error description:

message: "Can't find variable: QString"
name: "ReferenceError"

This occured in the exact following line:
var qs = new QString ( 'C:/a.obj'  );




What is the issue?
Did I miss some documentation?



More information about the Qt-interest-old mailing list