Results 1 to 3 of 3

Thread: gang together properties

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default gang together properties

    Hi,

    I was wondering if there was a simple way to gang properties or values together on QObjects. For example, say I have a QTabWidget with three tabs. Each tab has a class that inherits QWidget in it, and each of these custom classes has a QCheckbox. What I'd like to be able to do is make it so that all those QCheckBoxes always have the same value.

    The obvious way of doing this is to set up a ton of interconnected signals and slots (which is what I have right now), except I am finding that adding new features with this setup is ugly, which is why I'm looking for an alternative.

    Another idea I had was to make an object that will act as sort of the "hub" for all three separate tabs. When something in one of the tabs changes, it could also change this "property hub". When the "property hub" changes, it could then update all the other forms.

    Does anyone have any clever ideas for this problem?

    Kyle

    PS: While I was looking into the property system, to see if I could use properties in combination with signals and slots, I noticed that the NOTIFY option is missing from the qt 4.4 documentation (but it appears in qt 4.3). Is the NOTIFY option deprecated or something?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: gang together properties

    Try this:
    http://doc.trolltech.com/qq/qq08-act...ltiplexer.html

    It's for Qt3, but applies to Qt4 as well when you upgrade object types.

  3. #3
    Join Date
    Aug 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: gang together properties

    Cool, that looks like it'll work.

    Thanks!

Similar Threads

  1. Saving properties of a QObject based class
    By ghorwin in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2007, 01:26
  2. Properties, MetaObjects, and Models
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 26th January 2007, 19:51
  3. Replies: 5
    Last Post: 16th May 2006, 20:38
  4. How to initialize properties to a custom plugin widget?
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 28th February 2006, 16:56
  5. QAxWidget Properties
    By ToddAtWSU in forum Newbie
    Replies: 1
    Last Post: 13th February 2006, 17:45

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.