Results 1 to 6 of 6

Thread: how to create multiple childs of a widget

  1. #1
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Exclamation how to create multiple childs of a widget

    Hello everyone,

    I am asking you a general Qt question which puzzled my mind. Hope i will got some experts review.
    Currently i am working on a project which need to create a widget contain some tabs (~30 tabs) and each tab contains ~10-30 options.
    If i do the total child widgets count then it goes around 450 child widgets.

    My problen is how to implement this kind of widget which contains such a huge number of childs.
    Should i use Qt Designer which is preferable or there is something interesting which i don't know yet???

    Please help me to get out of this problem and clear my thoughts.
    Thanks
    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

  2. #2
    Join Date
    Feb 2012
    Location
    Warsaw, Poland
    Posts
    37
    Thanks
    3
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: how to create multiple childs of a widget

    Write some code generator

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to create multiple childs of a widget

    I would design each tab individually and then add their instances to the tab widget in code.

    The tab widget itself in its window can of course be a made in designer as well.

    Cheers,
    _

  4. #4
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to create multiple childs of a widget

    Hi anda_skoa,

    According to you i have to create each 25-30 tabs individually in designer and then create its instance according to the option selection?
    OR does a dynamic code generator as west said will work??


    If i use Qt Designer then i have to drag each 400 input elements and its labels etc, will be time consuming.
    i just don't want to spend more time in dragging and dropping. May be what you have said would be the right answer but if there is any other solution then it will be the pain killer of my current project.
    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to create multiple childs of a widget

    You didn't give any indication on what these tabs will look like.

    If they are just contain repetitions of the same element, then this can easily be done in code.
    Otherwise they are normal widgets and can be created in designer, but you can always also code them.

    Cheers,
    _

  6. The following user says thank you to anda_skoa for this useful post:

    karankumar1609 (13th August 2014)

  7. #6
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: how to create multiple childs of a widget

    Thanks anda_skoa for your reply.

    Actually all the widgets are different ai i decide to create all widgets dynamically..
    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

Similar Threads

  1. how to create multiple cubes in opengl
    By PHANI in forum Newbie
    Replies: 3
    Last Post: 6th March 2012, 09:48
  2. Replies: 2
    Last Post: 19th October 2011, 09:30
  3. Get Childs from a Widget in a inherited class
    By Roman in forum Qt Programming
    Replies: 3
    Last Post: 23rd April 2010, 12:36
  4. how to create multiple windows in QT
    By durgarao in forum Qt Tools
    Replies: 1
    Last Post: 9th January 2009, 14:47
  5. Replies: 0
    Last Post: 21st December 2006, 11:48

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.