Results 1 to 2 of 2

Thread: Can we Initialize objects of c++ class in javascript file?

  1. #1
    Join Date
    Jul 2008
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Question Can we Initialize objects of c++ class in javascript file?

    Hi all,
    If I have a class say MyApp and I am establishing a connection with a javascript file using some signal and object of this class.Now can we initialize some othe object of this class in .js file??like
    var obj1=new MyApp;
    and then access its methods??
    Is this possible and wats the right way to implement it??
    Last edited by coolmac; 16th July 2008 at 15:56.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Can we Initialize objects of c++ class in javascript file?

    See the QtScript Calculator example. You have to create QObject in C++ and make it available to the script using QScriptEngine::newQObject().

Similar Threads

  1. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.