PDA

View Full Version : c++ style



mickey
2nd June 2006, 23:48
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


switch (n) {
case 1: if (tab1->isEnabled()) {
tab1->setDisabled(TRUE);
break;
}

jacek
2nd June 2006, 23:53
Keep pointers to those tabs in a vector (or some other collection) or use QSignalMapper.