Results 1 to 4 of 4

Thread: Difference between setWidget and addWidget

  1. #1
    Join Date
    Apr 2021
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Difference between setWidget and addWidget

    Is there a practical difference between the methods setWidget() and addWidget()? Or it depends only on the object which they belong?

    Thank you

  2. #2
    Join Date
    Dec 2008
    Posts
    18
    Thanks
    4
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Difference between setWidget and addWidget

    Need more information on which class's 'setWidget()' and 'addWidget()' you are talking about.

  3. #3
    Join Date
    Apr 2021
    Posts
    8
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Difference between setWidget and addWidget

    I would like to know if there are differences without considering the classes. I will be more specific soon

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Difference between setWidget and addWidget

    Maybe English is not your first language, but "set" usually means you are replacing one widget instance (which could be null) with another one. "Add" usually means that you are putting one or more widgets into a list that could be arbitrarily long.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. addWidget other place than setCentralWidget()
    By darkrptyp in forum Newbie
    Replies: 3
    Last Post: 18th November 2011, 20:35
  2. Replies: 10
    Last Post: 25th April 2010, 23:59
  3. Replies: 2
    Last Post: 24th August 2009, 13:40
  4. QGraphicsScene::addWidget on MAC OS X 10.5.8
    By marcomas in forum Qt Programming
    Replies: 4
    Last Post: 23rd August 2009, 20:37
  5. addWidget in qWidgetStack
    By mickey in forum Newbie
    Replies: 7
    Last Post: 3rd March 2006, 22: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.