Results 1 to 8 of 8

Thread: what does the constructor do here?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: what does the constructor do here?

    You can use whatever code you like in the constructor, in this case various widgets are added depending on the value to pass to the constructor.

    For example, if you pass ButtonWidget::ComboBoxes, then you get ComboBoxes, if you pass ( ButtonWidget::ComboBoxes | ButtonWidget::SpinBoxes) then you'll get boith ComboBoxes and SpinBoxes, etc.

    If you really wanted to you could write an entire application in your constructor, but its not best practice to do so.

  2. The following user says thank you to squidge for this useful post:

    LB4229 (21st June 2011)

Similar Threads

  1. Replies: 13
    Last Post: 19th June 2011, 21:04
  2. class constructor
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 5th December 2008, 18:25
  3. connect in constructor?
    By McKee in forum Qt Programming
    Replies: 4
    Last Post: 13th October 2007, 21:53
  4. QImage constructor
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 12:06
  5. What default constructor?
    By bitChanger in forum General Programming
    Replies: 5
    Last Post: 15th February 2006, 19:50

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