Re: QMetaObject::invokeMethod

2018-07-07 Thread Stöger , Berthold
Hi Robert,

Still abroad, therefore very briefly:

1) At the risk of being pedantic: This has nothing to do with C++, but with 
Qt/MOC. This wouldn't even work with plain C++. There's a slightly more modern 
pointer-to-member-function version, but that didn't compile on qt5.5.

2) I use this to call a function across thread boundaries (notably to transport 
data from a worker thread to the UI thread). For unknown reasons, 
QNetworkManager and QMediaPlayer refused to work in a non-UI thread.

3) You are right: This could be done just as well by sending a signal from the 
worker thread-object to a slot in the UI thread-object. In a PR I think Lubomir 
(sorry, if I mis-attribute) noted that connecting a signal from an object to 
itself is weird and therefore in this case invokeMethod was preferred. This 
just stuck, even if in this case it's connecting different objects.

4) I don't have any problems with this being changed to signal/slot, I would 
just ask to wait until the "Video-lite" PR is in master, so that we don't step 
on each other's toes.

Berthold
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface


RE: Build fail on latest master

2018-03-22 Thread Stöger , Berthold
Hi Willem,

Can you try replacing this by
.toMSecsSinceEpoch() / 1000;

Thanks,

Berthold

From: subsurface [subsurface-boun...@subsurface-divelog.org] on behalf of 
Willem Ferguson [willemfergu...@zoology.up.ac.za]
Sent: Thursday, March 22, 2018 7:16 AM
To: Subsurface Mailing List
Subject: Build fail on latest master

Compiling the latest desktop master I get:

src/subsurface/core/qthelper.cpp:409:18: error: ‘class QDateTime’ has no
member named ‘toSecsSinceEpoch’
return created.toSecsSinceEpoch();
   ^
Is this a new Qt version problem?

Kind regards,

willem



--
This message and attachments are subject to a disclaimer.
Please refer to
http://upnet.up.ac.za/services/it/documentation/docs/004167.pdf for full
details.
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
___
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface