Re: [Interest] QTranslator.load and builtin translations

2020-08-18 Thread Jérôme Laheurte


> Le 18 août 2020 à 17:06, Giuseppe D'Angelo via Interest 
>  a écrit :
> 
> Il 18/08/20 16:28, Jérôme Laheurte ha scritto:
>> The « split(‘-‘)[0] » part looks like a big code smell to me, but what 
>> should I do ?
> 
> There's no need, load() should already do the split internally and search for 
> the right thing. Maybe you just need to load "qtbase_" (or specify "_" as the 
> prefix string). See
> 
>> https://doc.qt.io/qt-5/internationalization.html#example-basic-qt-modules

This. How the hell did I miss this after two hours of googling. Still had to 
explicitely specify the path to QLibraryInfo.TranslationsPath; the example 
could be a little better, but everything’s fine now.

Thanks!

Best regards
Jérôme Laheurte

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


Re: [Interest] QTranslator.load and builtin translations

2020-08-18 Thread Giuseppe D'Angelo via Interest

Il 18/08/20 16:28, Jérôme Laheurte ha scritto:

The « split(‘-‘)[0] » part looks like a big code smell to me, but what should I 
do ?


There's no need, load() should already do the split internally and 
search for the right thing. Maybe you just need to load "qtbase_" (or 
specify "_" as the prefix string). See



https://doc.qt.io/qt-5/qtranslator.html#load-1



https://doc.qt.io/qt-5/internationalization.html#example-basic-qt-modules



https://www.kdab.com/fixing-a-common-antipattern-when-loading-translations-in-qt/


HTH,

--
Giuseppe D'Angelo | giuseppe.dang...@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



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


[Interest] QTranslator.load and builtin translations

2020-08-18 Thread Jérôme Laheurte
Hello. Is there a way to load the « builtin » translation, say for qtbase, 
without having to specify a filename ? I expected the QTranslator.load(QLocale, 
…) method to do just that, but alas, I still need to specify that I want to 
load, say, « qtbase_fr ». My problem is that I don’t see any nice way to find 
the filename based on the current locale. QLocale.uiLanguages()[0] is « fr-FR » 
for a French system for example, so right now I’m doing

path = 
QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
trans = QtCore.QTranslator(self)
name = QtCore.QLocale.system().uiLanguages()[0].split('-')[0]
trans.load('qtbase_%s' % name, path)
self.installTranslator(trans)

The « split(‘-‘)[0] » part looks like a big code smell to me, but what should I 
do ? I tried a number of variations using both load() methods, to no avail.

Best regards
Jérôme Laheurte

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


Re: [Interest] BLE : Bonding and ble security

2020-08-18 Thread Simon FEUTRIER
Hi Jérôme,

I did it and it is working with this Windows app. Thus, it seems to be Qt
related. I have specified it in the bug report.
Thank you for your help.

Regards,

Simon Feutrier


Le mar. 18 août 2020 à 15:07, Jérôme Godbout  a écrit :

> Hi,
>
> Just to put aside the Windows, you could try to connect using Bluetooth LE
> Explorer application:
> https://www.microsoft.com/en-us/p/bluetooth-le-explorer/9n0ztkf1qd98
>
> It could tell if the Window BLE can perform the connection properly on his
> own.
>
>
>
> Jerome
>
>
>
> *From:* Simon FEUTRIER 
> *Sent:* August 18, 2020 4:09 AM
> *To:* Alex Blasche 
> *Cc:* Jérôme Godbout ; interest@qt-project.org
> *Subject:* Re: [Interest] BLE : Bonding and ble security
>
>
>
> If you are interested to follow this problem, there is now also a bug
> ticket here :  https://bugreports.qt.io/browse/QTBUG-86095
>
>
> Regards,
>
>
>
> Simon Feutrier
>
>
>
>
>
> Le mar. 18 août 2020 à 09:15, Simon FEUTRIER  a
> écrit :
>
> Hi !
>
>
>
> Jérôme, yes it is well secured, very well, even I cannot communicate :D.
>
> For your questions, Qt is supported on Windows, Bluetooth LE as well.
> About the security I am not sure I did not receive a clear reply to that
> question but it seems yes.
>
> My ble device and my Windows are recent enough yes !
>
> Currently in my ble device I am just activating "Just Work" security. And
> on Windows...I just cannot set the security level, so... ^^
>
>
>
> Alex, I will create an issue then.
>
>
>
> Thank you for your help.
>
>
>
> Cordialement,
>
>
>
> Simon Feutrier - Ingénieur systèmes embarqués
>
>
>
> BLUEGRioT
>
>
>
>
>
> Le lun. 17 août 2020 à 22:13, Alex Blasche  a
> écrit :
>
>
>
> 
> From: Interest  on behalf of Simon
> FEUTRIER 
> Sent: Monday, 17 August 2020 16:31
> To: Jérôme Godbout
>
> >Alex, thank you for your quick reply. I just tried with the pre-release
> 5.15.1 and this is the same behavior.
>
> Since you revealed that you are on Windows only, the patch I sent makes no
> sense. It is an Android only patch. This needs a proper bug report now.
>
> --
> Alex___
> 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] BLE : Bonding and ble security

2020-08-18 Thread Jérôme Godbout
Hi,
Just to put aside the Windows, you could try to connect using Bluetooth LE 
Explorer application: 
https://www.microsoft.com/en-us/p/bluetooth-le-explorer/9n0ztkf1qd98
It could tell if the Window BLE can perform the connection properly on his own.

Jerome

From: Simon FEUTRIER 
Sent: August 18, 2020 4:09 AM
To: Alex Blasche 
Cc: Jérôme Godbout ; interest@qt-project.org
Subject: Re: [Interest] BLE : Bonding and ble security

If you are interested to follow this problem, there is now also a bug ticket 
here :  https://bugreports.qt.io/browse/QTBUG-86095

Regards,

Simon Feutrier


Le mar. 18 août 2020 à 09:15, Simon FEUTRIER 
mailto:sfeutr...@bluegriot.com>> a écrit :
Hi !

Jérôme, yes it is well secured, very well, even I cannot communicate :D.
For your questions, Qt is supported on Windows, Bluetooth LE as well. About the 
security I am not sure I did not receive a clear reply to that question but it 
seems yes.
My ble device and my Windows are recent enough yes !
Currently in my ble device I am just activating "Just Work" security. And on 
Windows...I just cannot set the security level, so... ^^

Alex, I will create an issue then.

Thank you for your help.

Cordialement,

Simon Feutrier - Ingénieur systèmes embarqués

BLUEGRioT


Le lun. 17 août 2020 à 22:13, Alex Blasche 
mailto:alexander.blas...@qt.io>> a écrit :



From: Interest 
mailto:interest-boun...@qt-project.org>> on 
behalf of Simon FEUTRIER 
mailto:sfeutr...@bluegriot.com>>
Sent: Monday, 17 August 2020 16:31
To: Jérôme Godbout

>Alex, thank you for your quick reply. I just tried with the pre-release 5.15.1 
>and this is the same behavior.

Since you revealed that you are on Windows only, the patch I sent makes no 
sense. It is an Android only patch. This needs a proper bug report now.

--
Alex___
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] BLE : Bonding and ble security

2020-08-18 Thread Simon FEUTRIER
If you are interested to follow this problem, there is now also a bug
ticket here :  https://bugreports.qt.io/browse/QTBUG-86095

Regards,

Simon Feutrier


Le mar. 18 août 2020 à 09:15, Simon FEUTRIER  a
écrit :

> Hi !
>
> Jérôme, yes it is well secured, very well, even I cannot communicate :D.
> For your questions, Qt is supported on Windows, Bluetooth LE as well.
> About the security I am not sure I did not receive a clear reply to that
> question but it seems yes.
> My ble device and my Windows are recent enough yes !
> Currently in my ble device I am just activating "Just Work" security. And
> on Windows...I just cannot set the security level, so... ^^
>
> Alex, I will create an issue then.
>
> Thank you for your help.
>
> Cordialement,
>
> Simon Feutrier - Ingénieur systèmes embarqués
>
> BLUEGRioT
>
>
> Le lun. 17 août 2020 à 22:13, Alex Blasche  a
> écrit :
>
>>
>>
>> 
>> From: Interest  on behalf of Simon
>> FEUTRIER 
>> Sent: Monday, 17 August 2020 16:31
>> To: Jérôme Godbout
>>
>> >Alex, thank you for your quick reply. I just tried with the pre-release
>> 5.15.1 and this is the same behavior.
>>
>> Since you revealed that you are on Windows only, the patch I sent makes
>> no sense. It is an Android only patch. This needs a proper bug report now.
>>
>> --
>> Alex___
>> 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] BLE : Bonding and ble security

2020-08-18 Thread Simon FEUTRIER
Hi !

Jérôme, yes it is well secured, very well, even I cannot communicate :D.
For your questions, Qt is supported on Windows, Bluetooth LE as well. About
the security I am not sure I did not receive a clear reply to that question
but it seems yes.
My ble device and my Windows are recent enough yes !
Currently in my ble device I am just activating "Just Work" security. And
on Windows...I just cannot set the security level, so... ^^

Alex, I will create an issue then.

Thank you for your help.

Cordialement,

Simon Feutrier - Ingénieur systèmes embarqués

BLUEGRioT


Le lun. 17 août 2020 à 22:13, Alex Blasche  a
écrit :

>
>
> 
> From: Interest  on behalf of Simon
> FEUTRIER 
> Sent: Monday, 17 August 2020 16:31
> To: Jérôme Godbout
>
> >Alex, thank you for your quick reply. I just tried with the pre-release
> 5.15.1 and this is the same behavior.
>
> Since you revealed that you are on Windows only, the patch I sent makes no
> sense. It is an Android only patch. This needs a proper bug report now.
>
> --
> Alex___
> 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