Results 1 to 3 of 3

Thread: Yet another bunch of doubts!

  1. #1
    Join Date
    Oct 2009
    Posts
    26
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Yet another bunch of doubts!

    1.use of qapplication(argc,argv)?==>why we pass the command line arguments to app object?
    2.why a heap is needed to delete automatically the child objects of a widget ,when it is deleted,and whyy it is not possible on a stack
    ie why we use new operator???
    3. clear difference between callback functions,event listeners and slot-signal concept?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Yet another bunch of doubts!

    Look, this is a Qt forum, not programming basics forum.
    All your questions are covered in the basics of programming, and basics of C programming.
    Get a good book on the subject, or find many explanations about it on Google.
    You are welcome to ask Qt related questions.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Yet another bunch of doubts!

    Quote Originally Posted by Nishant View Post
    1.use of qapplication(argc,argv)?==>why we pass the command line arguments to app object?
    Because QApplication can take some command line arguments, influencing the rendering of your program. Read this.

    Quote Originally Posted by Nishant View Post
    2.why a heap is needed to delete automatically the child objects of a widget ,when it is deleted,and whyy it is not possible on a stack
    ie why we use new operator???
    Actually you're looking at it from the wrong perspective. If you would be allocating everything on stack, you wouldn't have any reason to create an object structure. It is necessary because allocation on heap requires some sort of data management to prevent memory leaks. Allocating on the heap is much more convenient because you don't have to worry about your QObject going out of scope. A minor worry should be that you might loose the pointer to your QObject, but if you've written your program properly the object should be deleted when it shuts down.

    Quote Originally Posted by Nishant View Post
    3. clear difference between callback functions,event listeners and slot-signal concept?
    Read this and this. Maybe it clears something up for you.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. doubts regarding QT
    By sudheer168 in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2009, 09:02
  2. Some critical "QtWebKit" doubts
    By crazymoonboy in forum Newbie
    Replies: 1
    Last Post: 18th September 2008, 23:56
  3. Touch screen and QT embedded, some doubts
    By webquinty in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 30th June 2008, 10:59
  4. Please Help-->have few doubts with Static build in Windows !
    By Krish in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2008, 14:37
  5. Replies: 2
    Last Post: 28th January 2006, 14:33

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.