Assigning numbers to the StopBitsType enum

5 views
Skip to first unread message

Lisandro Damián Nicanor Pérez Meyer

unread,
Jul 12, 2012, 12:16:44 PM7/12/12
to qextser...@googlegroups.com
Hi! I have just realized that storing a value from the enum StopBitsType using
QSettings could be a little confusing.

It is curently defined as:

enum StopBitsType
{
STOP_1,
#if defined(Q_OS_WIN) || defined(qdoc)
STOP_1_5, //WINDOWS ONLY
#endif
STOP_2
};

What I propose is:

enum StopBitsType
{
STOP_1 = 1,
#if defined(Q_OS_WIN) || defined(qdoc)
STOP_1_5 = 3, //WINDOWS ONLY
#endif
STOP_2 = 2
};

In this way the value will have more sense if stored in using QSettings.
Also, as 1.5 can't be represented in Windows, I decided to use 3, is it at
least 1.5*2 ;)

What do you think?

Kind regards, Lisandro.

--
Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
signature.asc
Reply all
Reply to author
Forward
0 new messages