Re: [Development] RFC: Improved Q_ENUM

2015-02-19 Thread Matthew Woehlke
On 2015-02-18 16:53, Thiago Macieira wrote: On Wednesday 18 February 2015 12:16:58 Matthew Woehlke wrote: I have not tried QSettings yet, but since it works with QVariant it should work. Sure, I'd expect it to work, also :-). What I meant was, does it get written as an integer, or as a

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Matthew Woehlke
On 2015-02-18 11:44, Olivier Goffart wrote: On Wednesday 18 February 2015 11:25:54 Matthew Woehlke wrote: Sorry to jump in so late, but... *THIS IS AWESOME!* Converting enums to strings and vice versa is very common, but I'm not aware of a generic solution to the problem until now. (Yes,

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Thiago Macieira
On Wednesday 18 February 2015 17:44:05 Olivier Goffart wrote: On Wednesday 18 February 2015 11:25:54 Matthew Woehlke wrote: Sorry to jump in so late, but... *THIS IS AWESOME!* Converting enums to strings and vice versa is very common, but I'm not aware of a generic solution to the problem

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Matthew Woehlke
On 2015-02-18 12:14, Thiago Macieira wrote: On Wednesday 18 February 2015 17:44:05 Olivier Goffart wrote: On Wednesday 18 February 2015 11:25:54 Matthew Woehlke wrote: 1. How does this interact with QSettings? If I directly pass an enum to e.g. QSettings::setValue, is it written as an int or

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Thiago Macieira
On Wednesday 18 February 2015 12:16:58 Matthew Woehlke wrote: I have not tried QSettings yet, but since it works with QVariant it should work. Sure, I'd expect it to work, also :-). What I meant was, does it get written as an integer, or as a string? Neither. It's written as

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Thiago Macieira
On Wednesday 18 February 2015 12:49:55 Matthew Woehlke wrote: But if already worked, this means the new file format will be different than what it used to. We may actually have to keep the current format so old applications can read the settings file produced by new applications. (Did you

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Matthew Woehlke
On 2014-12-15 08:38, Olivier Goffart wrote: I have been working on some improvements to moc and the meta type system to improve Q_ENUM. Those changes are targeting Qt 5.5 [...] If you use Q_ENUM, you get: - Using it with qDebug prints the actual string of the value. - a QVariant

Re: [Development] RFC: Improved Q_ENUM

2015-02-18 Thread Olivier Goffart
On Wednesday 18 February 2015 11:25:54 Matthew Woehlke wrote: Sorry to jump in so late, but... *THIS IS AWESOME!* Converting enums to strings and vice versa is very common, but I'm not aware of a generic solution to the problem until now. (Yes, bidirectional; as mentioned, use in settings, UI,

Re: [Development] RFC: Improved Q_ENUM

2015-01-28 Thread Olivier Goffart
Hi, The support in moc was already merged, but I am still waiting for reviews. Mainly: https://codereview.qt-project.org/103529 QMetatype: Register the QMetaObject of a Q_ENUM or Q_FLAG https://codereview.qt-project.org/91865 Introduces QMetaEnum::fromType

Re: [Development] RFC: Improved Q_ENUM

2014-12-16 Thread Tomasz Siekierda
On 15 December 2014 at 14:38, Olivier Goffart oliv...@woboq.com wrote: Any opinions or comments? Quick and simple comment from me: this feature sounds great! A big, shiny +1 from me. It will come in handy in many projects I am involved with. ___

Re: [Development] RFC: Improved Q_ENUM

2014-12-16 Thread Dmitry Volosnykh
While I cannot come up with direct application of toString() feature in the projects I am involved in by the moment (except for debugging), I really like it, and remember myself being in a need in such features some time ago. So, me also would like to thank you, Olivier, for the job you've done. I

Re: [Development] RFC: Improved Q_ENUM

2014-12-16 Thread André Somers
Dmitry Volosnykh schreef op 16-12-2014 09:35: While I cannot come up with direct application of toString() feature in the projects I am involved in by the moment (except for debugging), I really like it, and remember myself being in a need in such features some time ago. So, me also would like

Re: [Development] RFC: Improved Q_ENUM

2014-12-16 Thread Dan Leinir Turthra Jensen
On Tuesday 16 Dec 2014 09:50:04 André Somers wrote: Dmitry Volosnykh schreef op 16-12-2014 09:35: While I cannot come up with direct application of toString() feature in the projects I am involved in by the moment (except for debugging), I really like it, and remember myself being in a need

[Development] RFC: Improved Q_ENUM

2014-12-15 Thread Olivier Goffart
Hello, I have been working on some improvements to moc and the meta type system to improve Q_ENUM. Those changes are targeting Qt 5.5 You can see the list of change there in the q_gadget topic (I put the changes in that topic even if it is an orthogonal changes to the Q_GADGET changes that