[Development] QString and related changes for Qt 6

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue May 12 16:12:30 CEST 2020


On 5/12/20 12:20 PM, Иван Комиссаров wrote:
>> * Exceptions can be done where significant performance gains can be demonstrated and the API will by design not require a copy of the data (e.g. XML writer, stream writers, date time handling)
> Let me disagree here. The decision should be taken on the fact if the object takes ownership of the string (and thus QString is used) or it only «looks» into it.

I agree. This however leaves us with questions regarding the API. E.g.:

class Attribute {
public:
   // OK: takes ownership
   void addAttribute(const QString &key, const QString &value);

   // does not take ownership
   bool hasAttribute(QStringView key) const;
};

Is it OK that you can call addAttribute("foo", "bar") but not 
hasAttribute("foo")? (And similar)

Thanks,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200512/3cf63a79/attachment.bin>


More information about the Development mailing list