Results 1 to 2 of 2

Thread: c++ style

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default c++ style

    Hi, I need to repeat 14 case like this below; but for tab2, tab3.....tab14. I there a way to reduce the number of lines (instead of repeat 14 case similar)? thanks
    Qt Code:
    1. switch (n) {
    2. case 1: if (tab1->isEnabled()) {
    3. tab1->setDisabled(TRUE);
    4. break;
    5. }
    To copy to clipboard, switch view to plain text mode 
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: c++ style

    Keep pointers to those tabs in a vector (or some other collection) or use QSignalMapper.

Similar Threads

  1. Custom Style
    By Dusdan in forum Qt Tools
    Replies: 8
    Last Post: 1st September 2006, 23:50
  2. Current KDE/Windows style
    By donmorr in forum Qt Tools
    Replies: 1
    Last Post: 19th May 2006, 18:49
  3. QToolBox and style
    By Maxilys in forum KDE Forum
    Replies: 6
    Last Post: 26th March 2006, 16:07
  4. Bugs, style changes in 4.1.0?
    By simk in forum Qt Programming
    Replies: 13
    Last Post: 13th February 2006, 12:05
  5. Qt style...
    By Sergey B. in forum Qt Programming
    Replies: 10
    Last Post: 21st January 2006, 23:48

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.