Results 1 to 2 of 2

Thread: tricks to struct needed

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default tricks to struct needed

    If you have a struct say ..
    Qt Code:
    1. struct s_A
    2. {
    3. int A
    4. int B
    5. int C
    6. int D
    7. int E
    8. int F
    9. }
    To copy to clipboard, switch view to plain text mode 

    if you want to have a gui to edit some or all struct member using a QSpinBox, what is the essiest impementation (less code)?

    I Ended up with giving my widget some Id then , use QSignalMapper to put all editingFinished signal of QSpinbox and then figure out whose the sender everytime QSignalMapper emits SIGNAL mapped(), from the Id ill figure out which member of the struct to be updated.

    But still this gets vey boring if you have like 50 struct each has like 20 members, If anybody can suggest on some technique inhandling this stuff efficiently will be appereciated

    baray98

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: tricks to struct needed

    I don't know about less code but model-view would be an elegant way to handle it. You don't want to have tons of QSpinBoxes on your form but a view which keeps only one editor open at time.
    J-P Nurmi

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 11:12
  2. Make error with Qt Jambi 4.3.2_01
    By pamalite in forum Installation and Deployment
    Replies: 0
    Last Post: 22nd November 2007, 13:05

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.