Results 1 to 2 of 2

Thread: Grouping Widgets Together

  1. #1
    Join Date
    Aug 2008
    Location
    Iowa, USA
    Posts
    21
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question Grouping Widgets Together

    For my current project at work, I'm suppose to implement a way to group and ungroup different widgets together. I'm using QMdiArea for the windowing system right now, and right now we just fill it with QMdiSubWindows everytime they create a new widget.

    Should I just subclass QWidget, put a QGridLayout (or whatever layout I want), fill it with the individual widgets that are currently being used, then put my new subclassed QWidget into a QMdiSubWindow? Does Qt already have a widget whose sole purpose is to act as a container for lots of other widgets? Based off what I just told you, can you think of a different solution that would allow me to get the grouping capabilities my boss wants?

    I'll continue developing my container class, but I was hoping I could gain some wisdom by giong to these forums before I get too far into this project.

  2. #2
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Grouping Widgets Together

    Depending whether you need to have a group of object as a graphical representation or a data set you might think of these:
    1) use a Layout or a custom layout
    2) use a containter to keep QObjects
    3) use a groupbox
    4) you may also develop a class like QActionGroup to hold a group of objects and have the interface like this class.
    5) surely there are more ideas and surely faster, but these are just the ones that come to mind right now

    kacper
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Qt3 - Multiple transparent widgets
    By bythesea in forum Qt Programming
    Replies: 4
    Last Post: 11th September 2009, 11:24
  2. Mac OS X Top-Level Transparent Widgets
    By tinsuke in forum Qt Programming
    Replies: 0
    Last Post: 17th October 2008, 16:01
  3. Upper limit on number of widgets?
    By jdiewald in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 23:00
  4. Replies: 2
    Last Post: 16th May 2008, 14:39
  5. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 20:23

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.