[Development] How qAsConst and qExchange lead to qNN

Ivan Solovev ivan.solovev at qt.io
Thu Nov 10 11:03:43 CET 2022


Hi Marc,

>> I would like to know how that is supposed to work in practice. We have a
>> lot of public API dealing with Qt containers all over. What are you
>> going to do to, for example, to
>>
>>      void addActions(const QList<QAction*> &actions);
>>
>> in qwidget.h? What should it look like when we're done and our users are
>> free to choose the best container for their needs?
>
> In this particular case, the API would be
>
>     void addActions(QSpan<QAction*> actions);
>
> This is the trivial case: setters for contiguous data. It's
> backwards-compatible, because QList implicitly converts to QSpan (and
> std::span), but now, as a user, I can also pass a C array or std::vector
> or QVLA of QAction*

I wonder how your NOI-everywhere suggestion will work with the signal/slot connections? Specially for the case when Qt::QueuedConnection is used (explicitly or implicitly).

Best regards,
Ivan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20221110/75d5bb1e/attachment.htm>


More information about the Development mailing list