Re: [Development] [Interest] Need help with deprecated QVariant functions

2019-02-25 Thread Edward Welbourne
Il 21/02/19 21:09, Christian Ehrlicher ha scritto:
>> the two functions qVariantFromValue() and qVariantSetValue() are
>> deprecated but the replacements QVariant::setValue() / fromValue() are
>> using exactly those two functions...
>> Those two functions are some of the last obsolete functions which did
>> not yet get decorated with QT_DEPRECATED but since this is affects a
>> major class of Qt I don't think it's a task for me.

Giuseppe D'Angelo (22 February 2019 21:38) replied:
> Could it simply be possible to move the implementation of
> qVariantSetValue to QVariant::setValue, and then have the former call
> the latter, instead of viceversa?

I have filed QTBUG-74043 to track this; feel free to take over as assignee
if you've the time to investigate.

Eddy.
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] [Interest] Need help with deprecated QVariant functions

2019-02-22 Thread Thiago Macieira
On Friday, 22 February 2019 12:38:55 PST Giuseppe D'Angelo via Development 
wrote:
> IIRC, the reason for qVariantSetValue is to work around VS2005 not
> supporting member function templates.

Almost. That wasn't VS2005 (a.k.a VS 8.0) that had the problem. It was VS 6.0, 
which predated the C++98 template definition.

You can still see a bunch of other relics of that in template functions that 
take an extra T* parameter that is defaulted to nullptr. They're usually 
#ifdef'ed out for QDoc.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] [Interest] Need help with deprecated QVariant functions

2019-02-22 Thread Giuseppe D'Angelo via Development

Il 22/02/19 21:38, Giuseppe D'Angelo via Development ha scritto:

(And, support for std::size / std::data, so
that std::span works out of the box).


Actually, taking this one back, std::span should already be working out 
of the box...


Cheers,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: Firma crittografica S/MIME
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development


Re: [Development] [Interest] Need help with deprecated QVariant functions

2019-02-22 Thread Giuseppe D'Angelo via Development

Howdy,


Il 21/02/19 21:09, Christian Ehrlicher ha scritto:

Hi,


Redirecting the discussion to development@...



the two functions qVariantFromValue() and qVariantSetValue() are
deprecated but the replacements QVariant::setValue() / fromValue() are
using exactly those two functions...
Those two functions are some of the last obsolete functions which did
not yet get decorated with QT_DEPRECATED but since this is affects a
major class of Qt I don't think it's a task for me.


Could it simply be possible to move the implementation of 
qVariantSetValue to QVariant::setValue, and then have the former call 
the latter, instead of viceversa?


IIRC, the reason for qVariantSetValue is to work around VS2005 not 
supporting member function templates.




So can someone please take a look on this and mark the two functions as
deprecated so they can be safely removed with Qt6?


The other three functions I found in qtcore and are not yet decorated
with QT_DEPRECATED are:
   - QByteArray::operator const char *() const (the last idea was to
un-deprecate this function)


Mixed feelings. I don't like decay-to-pointer, and so doesn't modern C++ 
(e.g. std::array). What's really, really, really, really missing is 
operator std::string_view(). (And, support for std::size / std::data, so 
that std::span works out of the box).




   - QByteArray::operator const void *() const


This should just go. This is C++, not C.



   - QLineF::angle(const QLineF ) const (is QLineF::angleTo() the
correct replacement?)


Probably -- angle is a bad naming choice.



   - QLocale::countriesForLanguage(Language language)
   - QMetaProperty::isEditable(const QObject *object) const (don't know
why this is deprecated/what's the replacement)


Good question... is this for QML?



btw: the examples can now be compile with QT_NO_FOREACH :)


Yay, thanks :)


Cheers,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts



smime.p7s
Description: Firma crittografica S/MIME
___
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development