Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Hamish Moffatt via Interest

On 28/2/23 12:00, Hamish Moffatt via Interest wrote:
Qt5's documentation (like Qt6's) does say "QVector's value type must 
be an assignable data type", so the mystery here is perhaps why our 
code works with Qt5. 



Even in Qt6, it compiles with other things in the struct that aren't 
assignable though, just not QVector.


struct T
{
int x = 0;
};

struct S
{
//const QVector v; // compiles if not const
const T t;
const int x = 0;
};

QVector pv;
pv.push_back({});



Hamish
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Hamish Moffatt via Interest

On 28/2/23 11:49, Thiago Macieira wrote:

On Monday, 27 February 2023 16:22:46 PST Hamish Moffatt via Interest wrote:

How and when would Qt5 show an error? We have the above code working and
in production, and I'm able resize, copy and change, force a detach -
operations where QVector would need to copy elements.

Ah, looks like it isn't going to. I expected the issue was that it didn't
happen in this test case because it never detached. If you're definitely
detaching, then this isn't the same issue.

The issue here is that you have a type that is copy/move constructible, but
cannot be copy/move assigned. That's usually a bad combination; the new QList/
QVector code uses move-assignment when moving elements in the overlapping part
of the list.

We could determine that your type is not move-assignable and use a different
strategy, but this isn't implemented right now. It might be less efficient; I
wouldn't know.



Qt5's documentation (like Qt6's) does say "QVector's value type must be 
an assignable data type", so the mystery here is perhaps why our code 
works with Qt5.



Thanks,

Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Thiago Macieira
On Monday, 27 February 2023 16:22:46 PST Hamish Moffatt via Interest wrote:
> How and when would Qt5 show an error? We have the above code working and
> in production, and I'm able resize, copy and change, force a detach -
> operations where QVector would need to copy elements.

Ah, looks like it isn't going to. I expected the issue was that it didn't 
happen in this test case because it never detached. If you're definitely 
detaching, then this isn't the same issue.

The issue here is that you have a type that is copy/move constructible, but 
cannot be copy/move assigned. That's usually a bad combination; the new QList/
QVector code uses move-assignment when moving elements in the overlapping part 
of the list.

We could determine that your type is not move-assignable and use a different 
strategy, but this isn't implemented right now. It might be less efficient; I 
wouldn't know.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Hamish Moffatt via Interest

On 28/2/23 11:14, Thiago Macieira wrote:

On Monday, 27 February 2023 13:05:01 PST Hamish Moffatt via Interest wrote:

On 28/2/23 04:14, Thiago Macieira wrote:

On Sunday, 26 February 2023 23:24:43 PST Hamish Moffatt via Interest wrote:

Is there a solution?

Remove the const in:
   struct S
   {
   
   const QVector v; // compiles if not const
   
   };


If S is not copyable, then QVector can't copy it and QVector requires
copying all its elements.

May I ask why that is? Qt5 QVector and std::vector are both OK with the
above.

Qt 5 QVector is not ok with the above, it just hasn't produced an error *yet*.
All Qt main containers are implicitly-shared and therefore must be able to
copy their elements. Therefore, your elements must be copyable.

std::vector doesn't have this requirement. It is copyable if the element is
copyable, otherwise it isn't.

How and when would Qt5 show an error? We have the above code working and 
in production, and I'm able resize, copy and change, force a detach - 
operations where QVector would need to copy elements.



Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Thiago Macieira
On Monday, 27 February 2023 13:05:01 PST Hamish Moffatt via Interest wrote:
> On 28/2/23 04:14, Thiago Macieira wrote:
> > On Sunday, 26 February 2023 23:24:43 PST Hamish Moffatt via Interest wrote:
> >> Is there a solution?
> > 
> > Remove the const in:
> >   struct S
> >   {
> >   
> >   const QVector v; // compiles if not const
> >   
> >   };
> > 
> > If S is not copyable, then QVector can't copy it and QVector requires
> > copying all its elements.
> 
> May I ask why that is? Qt5 QVector and std::vector are both OK with the
> above.

Qt 5 QVector is not ok with the above, it just hasn't produced an error *yet*. 
All Qt main containers are implicitly-shared and therefore must be able to 
copy their elements. Therefore, your elements must be copyable.

std::vector doesn't have this requirement. It is copyable if the element is 
copyable, otherwise it isn't.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Care to help us out with the Jellyfin Qt 6 port?

2023-02-27 Thread Austin via Interest
Hey everybody. The lead developer of Jellyfin Media Player and I are trying to 
port JMP to Qt 6, but we could really use your help. The rendering loop that 
worked in Qt 5 has very strange behavior now, and implementing the new api docs 
to the best of our ability has not gotten us there. If you wouldn't mind taking 
a look at the code, or, dare I say, building and running it, we would be very 
grateful for any insight. If you are not familiar, Jellyfin Media Player is a 
component of the FOSS Media Server suite, Jellyfin, and your contribution will 
go a long way in our volunteer community. Advice and/or pull requests would 
both be gratefully accepted, thanks!

https://github.com/jellyfin/jellyfin-media-player/tree/qt6


this commit shows the most recent attempt to comply with the new api, and 
clearly shows where all the relevant code bits are.


https://github.com/jellyfin/jellyfin-media-player/commit/ddc6310a8473481cbd5d079933df956f2ce1938b
 

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Hamish Moffatt via Interest

On 28/2/23 04:14, Thiago Macieira wrote:

On Sunday, 26 February 2023 23:24:43 PST Hamish Moffatt via Interest wrote:

Is there a solution?

Remove the const in:

  struct S
  {
  const QVector v; // compiles if not const
  };

If S is not copyable, then QVector can't copy it and QVector requires copying
all its elements.


May I ask why that is? Qt5 QVector and std::vector are both OK with the 
above.



Hamish

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] use of deleted function errors in QList / qarraydataops.h

2023-02-27 Thread Thiago Macieira
On Sunday, 26 February 2023 23:24:43 PST Hamish Moffatt via Interest wrote:
> Is there a solution?

Remove the const in:

 struct S
 {
 const QVector v; // compiles if not const
 };

If S is not copyable, then QVector can't copy it and QVector requires copying 
all its elements.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering


smime.p7s
Description: S/MIME cryptographic signature
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QTcpServer::setProxy meaning?

2023-02-27 Thread Alexander Dyagilev

Ooops, sorry, it's a bug in my code.

On 2/27/2023 12:38 PM, Alexander Dyagilev wrote:

Hello,

OK, thanks for the report.

It seems, there is a bug?

QNetworkProxyQuery q(32000, QString(), QNetworkProxyQuery::TcpServer);
m_proxyFactory->queryProxy(q);

returns a proxy of QNetworkProxy::HttpProxy type. In docs it's stated 
that such a proxy supports outgoing TCP connections only 
(https://doc.qt.io/qt-6/qnetworkproxy.html#ProxyType-enum).



On 2/25/2023 8:50 PM, Thiago Macieira wrote:

On Saturday, 25 February 2023 07:17:39 PST Alexander Dyagilev wrote:

Hello,

I can't understand it. Are there really proxies supporting such a mode?

Yes, SOCKS proxies for example.


I.e. QTcpServer tells a proxy to start listening on some specific port
and redirect incoming connections to QTcpServer?

Yes.


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QTcpServer::setProxy meaning?

2023-02-27 Thread Alexander Dyagilev

Hello,

OK, thanks for the report.

It seems, there is a bug?

QNetworkProxyQuery q(32000, QString(), QNetworkProxyQuery::TcpServer);
m_proxyFactory->queryProxy(q);

returns a proxy of QNetworkProxy::HttpProxy type. In docs it's stated 
that such a proxy supports outgoing TCP connections only 
(https://doc.qt.io/qt-6/qnetworkproxy.html#ProxyType-enum).



On 2/25/2023 8:50 PM, Thiago Macieira wrote:

On Saturday, 25 February 2023 07:17:39 PST Alexander Dyagilev wrote:

Hello,

I can't understand it. Are there really proxies supporting such a mode?

Yes, SOCKS proxies for example.


I.e. QTcpServer tells a proxy to start listening on some specific port
and redirect incoming connections to QTcpServer?

Yes.


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest