On Wed, Jan 23, 2013 at 8:49 PM, Laszlo Papp <[email protected]> wrote: > On Wed, Jan 23, 2013 at 9:45 PM, Thiago A. Corrêa <[email protected]> > wrote: >> >> You mean filling the Combo Box with available rates right? ( >> ui->rateBox->addItem(QLatin1String("9600"), SerialPort::Rate9600); ) >> I would just fill in the numbers in the second argument of addItem. >> Other than maybe getting a compiler error in case of a typo, there >> isn't much gain in the enums themselfs. > > > That is a nice gain in my opinion to avoid the unintentional bugs thay may > take some time to debug (wrong setting, data not going through properly > towards the modem, perhaps causing random issues and so forth). > [..] > > I would assume that people prefer enumeration to raw values when possible. I
I agree completly. I was just not too convinced in this particular case, but there is a choice either way which is good. It's interesting that .Net have added Baud230400 while we have both Rate1200 and Rate2400 that they left out. In my use cases I usually have to store the port configuration in some configuration file, and the conversion between the 3rdparty library enuns (which I shouldn't assume a value for) and my serialized representation is boring. _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
