Re: [Development] QDateTime addDays logic

2018-12-13 Thread Thiago Macieira
On Thursday, 13 December 2018 11:57:48 PST Edward Welbourne wrote: > Indeed, the name plusDays might have been better. With any luck we can > fix this in Qt6 by deprecating the old methods, supporting std::chrono > and just allowing arithmetic with appropriate std::chrono quantities, in > the

Re: [Development] QDateTime addDays logic

2018-12-13 Thread Edward Welbourne
>>> Not saying it's correct, just stating the fact that function name is >>> confusing and potentially problematic because it doesn't do what it >>> states it does. Il 13/12/18 15:55, Edward Welbourne ha scritto: >> Aye, there's plenty that isn't perfect, especially in old APIs. None >> the

Re: [Development] QDateTime addDays logic

2018-12-13 Thread Giuseppe D'Angelo
Il 13/12/18 15:55, Edward Welbourne ha scritto: Not saying it's correct, just stating the fact that function name is confusing and potentially problematic because it doesn't do what it states it does. Aye, there's plenty that isn't perfect, especially in old APIs. None the less, the Qt project

Re: [Development] QDateTime addDays logic

2018-12-13 Thread Edward Welbourne
NIkolai Marchenko (13 December 2018 15:24) > It's not like I don't understand all that. But I am not that person who > introduced the regression and > > a) He doesn't use a compiler that supports this warning > b) ... and he wouldn't have read it in the first place. (unfortunately) > c) He

Re: [Development] QDateTime addDays logic

2018-12-13 Thread NIkolai Marchenko
It's not like I don't understand all that. But I am not that person who introduced the regression and a) He doesn't use a compiler that supports this warning b) ... and he wouldn't have read it in the first place. (unfortunately) c) He doesn't much care about docs Not saying it's correct, just

Re: [Development] QDateTime addDays logic

2018-12-13 Thread Sérgio Martins via Development
On 2018-12-13 13:48, NIkolai Marchenko wrote: This non obvious (from function name) behaviour actually caused infinite loop regression in our code just recently. The person used it inside a while loop thinking it will loop upwards and stop. If your compiler supports it, you should get a

Re: [Development] QDateTime addDays logic

2018-12-13 Thread Dmitriy Purgin
The docs [1] clearly state what the method does. Moreover, the method is const, so it can't mutate the object. [1] https://doc.qt.io/qt-5/qdatetime.html#addDays Cheers Dmitriy On Thu, Dec 13, 2018 at 3:04 PM NIkolai Marchenko wrote: > This non obvious (from function name) behaviour actually

Re: [Development] QDateTime addDays logic

2018-12-13 Thread NIkolai Marchenko
This non obvious (from function name) behaviour actually caused infinite loop regression in our code just recently. The person used it inside a while loop thinking it will loop upwards and stop. On Thu, Dec 13, 2018 at 4:45 PM Edward Welbourne wrote: > Fausto Papandrea (13 December 2018 12:48)

Re: [Development] QDateTime addDays logic

2018-12-13 Thread Edward Welbourne
Fausto Papandrea (13 December 2018 12:48) > Hi, I would like to understand the logic of the addDays function of > QDateTime. > > I mean, why doesn't it modify the calling object, but returns a copy of > a new object instead? At this point, it does what it does because it's done so for years

[Development] QDateTime addDays logic

2018-12-13 Thread Fausto Papandrea
Hi, I would like to understand the logic of the addDays function of QDateTime. I mean, why doesn't it modify the calling object, but returns a copy of a new object instead? Thank you. ___ Development mailing list Development@qt-project.org