Spam detection software, running on the system "mx.qt-project.org",
has identified this incoming email as possible spam.  The original
message has been attached to this so you can view it or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  On 23/07/2019 02:15, Hamish Moffatt wrote: > On 22/7/19 10:56
   pm, Nikos Chantziaras wrote: >> In order to avoid calling qRegisterMetaType()
   in main() (with the >> possibility of forgetting to do so,) I instead call
   it before the >> program enters main(), in the implementation file of whoever
   is the >> owner of the type. [...] >> [...] >> It "seems to work fine," but
   is this safe though? > > Why not put them in a static function in each file,
   and use > Q_COREAPP_STARTUP_FUNCTION to have Qt call it for you at the right
   time? [...] 

Content analysis details:   (4.1 points, 4.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 0.8 BAYES_50               BODY: Bayes spam probability is 40 to 60%
                            [score: 0.4825]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail 
provider
                            (realnc[at]gmail.com)
 1.0 RDNS_DYNAMIC           Delivered to internal network by host with
                            dynamic-looking rDNS
 2.3 FORGED_MUA_MOZILLA     Forged mail pretending to be from Mozilla


--- Begin Message ---
On 23/07/2019 02:15, Hamish Moffatt wrote:
On 22/7/19 10:56 pm, Nikos Chantziaras wrote:
In order to avoid calling qRegisterMetaType() in main() (with the possibility of forgetting to do so,) I instead call it before the program enters main(), in the implementation file of whoever is the owner of the type. [...]
[...]
It "seems to work fine," but is this safe though?

Why not put them in a static function in each file, and use Q_COREAPP_STARTUP_FUNCTION to have Qt call it for you at the right time?

I didn't know about that functionality, but it seems to be the same as doing it in main(). In both cases you're opening up the possibility of leaving new types unregistered because the code that does the registering is not in front of your face anymore.

This seems to have happened a few times in Qt itself, for example. Qt devs sometimes forget to register new types. The metatype system in general breaks source code locality, so it's easy to overlook.


--- End Message ---
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest

Reply via email to