Results 1 to 1 of 1

Thread: How to implement "var rep = new Report("Report-1",9)" to QtScript?

  1. #1
    Join Date
    Oct 2009
    Location
    Russia, South Ural, Chelyabinsk
    Posts
    42
    Thanks
    1
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to implement "var rep = new Report("Report-1",9)" to QtScript?

    Hi!

    For example I have my own objects Report, Catalogue, Document, ...

    //---------------------------------------------------------------------------------------------------------
    class Report : public QObject
    {
    private:
    QString name;
    int id;

    public:
    Report(QString name, int id) { ... }
    ....

    public slots:
    bool execReport() {...}
    QString getReportName() {...}

    };

    class Catalogue : public QObject
    { ... };

    class Document : public QObject
    { ... };


    Is it possible to use it in QtScript such as I write below:
    //---------------------------------------------------------------------------------------------------------
    //qt script lang
    var rep = new Report("Report-1",1000);
    var isOk = rep.execReport();

    var cat = new Catalogue("Clients",true);
    var cat = new Document("Doc-1");


    Thank for help!
    Last edited by sergey_85; 17th November 2009 at 21:03.

  2. The following 2 users say thank you to sergey_85 for this useful post:


Tags for this Thread

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.