Results 1 to 4 of 4

Thread: Using QSA: A very basic question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using QSA: A very basic question

    Quote Originally Posted by axeljaeger
    I think "child" doesn't mean a member variable but a child in a QObject-way: You have to pass ObjectA as parent to the constructor of ObjectAA to make AA become a child of A.
    I am already doing that.

    I've attached copy of a trial app which i use for testing behaviour of QSA. You can try to look for loop-holes in the code. Doing only make will compile it. Upon executing it, you will find an editor widget which is used for executing script code. It is fairly easy.
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using QSA: A very basic question

    For those who are too lazy to look into attachment, here is code present in the constructor of base object:
    Qt Code:
    1. setObjectName("trial");
    2. editor = 0;
    3.  
    4. qsProject = new QSProject(this);
    5.  
    6. m_pButton1 = new QPushButton("First", this);
    7. m_pButton2 = new QPushButton("Second", this);
    8. m_pButton2->move(20, 0);
    9. m_pButton1->setObjectName("button");
    10. m_pButton2->setObjectName("buttons");
    11.  
    12.  
    13. widget = new MyWidget(this, qsProject);
    14. widget->setObjectName("container_");
    15. widget->resize(50, 50);
    16. widget->move(50, 50);
    17.  
    18. m_pLabel1 = new MyLabel(this);
    19. m_pLabel1->setText("Hello World!");
    20. m_pLabel1->move(100, 100);
    21.  
    22. m_pLabel2 = new MyLabel(this);
    23. m_pLabel2->setText("Are You Listning?");
    24. m_pLabel2->move(100, 105);
    25.  
    26. resize( 200, 200);
    27.  
    28. // qsProject->addObject(m_pButton1);
    29. // qsProject->addObject(m_pButton2);
    30. // qsProject->addObject(widget);
    31. qsProject->addObject(this);
    32.  
    33. editor = new ScriptEditor( qsProject );
    34. editor->show();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Basic QtScript question
    By jimboqt in forum Newbie
    Replies: 0
    Last Post: 23rd September 2008, 14:09
  2. Basic question on QComboBox
    By Raccoon29 in forum Newbie
    Replies: 2
    Last Post: 9th May 2008, 16:41
  3. Replies: 2
    Last Post: 21st February 2008, 22:35
  4. Replies: 5
    Last Post: 4th August 2006, 10:12
  5. Basic question on new and delete
    By jcr in forum General Programming
    Replies: 25
    Last Post: 14th February 2006, 15:09

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
  •  
Qt is a trademark of The Qt Company.