Re: [Interest] Continued past failed assertions with MSVC

2023-05-09 Thread Scott Bloom
I will use the ignore when I expect the assertion failure but want to continue. 
 Usually when the assertion was added because something strange happened, and 
Im trying to find what assumption in the function stack was broken.



-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Tuesday, May 9, 2023 7:54 AM
To: interest@qt-project.org
Subject: Re: [Interest] Continued past failed assertions with MSVC

On Monday, 8 May 2023 16:50:51 PDT Scott Bloom wrote:
> I do on a regular basis. Not sure why you say it’s a horrible dialog, 
> it’s a message box 😊 with the assertion information.

Because it's "Abort", "Retry", "Ignore" that tells you that "Retry will launch 
the debugger", so it doesn't actually mean retrying.

Do you really mean you use the Ignore functionality?

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Continued past failed assertions with MSVC

2023-05-08 Thread Scott Bloom
I do on a regular basis. Not sure why you say it’s a horrible dialog, it’s a 
message box 😊 with the assertion information.



-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Monday, May 8, 2023 9:25 AM
To: Qt Interest 
Subject: [Interest] Continued past failed assertions with MSVC

When a Qt application fails a Q_ASSERT and was compiled against a debug-mode 
QtCore, with MSVC, it shows a debug dialog with three options: Abort, Retry, 
Ignore. It looks like https://www.google.com/search?q=_CrtDbgReport+dialog

This is a horrible dialogue that harkens back to the DOS days.

But the big problem is that "Ignore" button: it allows the application to 
ignore this condition and continue executing. I suppose people use it for 
debugging past failed assertions to see what else is going on.

So the question is: does anyone use this particular feature? Would you suffer 
terribly if we removed it? This would bring MSVC in line with the other 
compilers.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Need some help tracking down an issue

2023-04-14 Thread Scott Bloom
This is PART of the problem… I was able to fix it.

Basically, as a duplicate is found, the UI creates a QStandardItem for the 
model.  The first column if its an image file, will show an icon.

The creating of the QIcon itself was causing a gui lock up ☹  Because Qt uses 
the global threadpool to convert the files data into a qimage.

I was able to fix that by pushing the icon loading to later, but Ill likely use 
a different threadpool for my side.

But, while its loading and computing, the UI is getting updated, however its 
not responding to any clicks at all.
Scott

From: Mårten Nordheim 
Sent: Friday, April 14, 2023 11:02 AM
To: Scott Bloom ; interest@qt-project.org
Subject: RE: Need some help tracking down an issue

Hey!

It’s likely similar to the issue seen here:
https://bugreports.qt.io/browse/QTBUG-109511

Qt itself may use the global thread pool for certain parallelization, so if the
global thread-pool is fully occupied without letting any new tasks run
then you may experience some hanging.

Mårten


From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Scott Bloom
Sent: fredag 14. april 2023 19:39
To: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: [Interest] Need some help tracking down an issue

I have an opensource project that is Qt based, to find duplicate files.  It 
started as a learning experience for working with thread pools.

Its pretty much 100% functional, however, I have issues where the GUI is 
non-responsive to user activity.

If anyone has the time, and willingness to do a code review with me, please let 
me know.  You can see the project at http://github.com/towel42-com/FindDupe

Thanks in advance,

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


[Interest] Need some help tracking down an issue

2023-04-14 Thread Scott Bloom
I have an opensource project that is Qt based, to find duplicate files.  It 
started as a learning experience for working with thread pools.

Its pretty much 100% functional, however, I have issues where the GUI is 
non-responsive to user activity.

If anyone has the time, and willingness to do a code review with me, please let 
me know.  You can see the project at http://github.com/towel42-com/FindDupe

Thanks in advance,

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


Re: [Interest] QProcess unbuffered

2023-03-18 Thread Scott Bloom
Was that the core issue? Or it still isn’t working with the correct check in?

Scoitt

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Friday, March 17, 2023 6:54 PM
To: interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

On Friday, 17 March 2023 14:00:54 PDT Scott Bloom wrote:
> Maybe I missed it.  But I don’t see where you use the 
> InheritableHandleInfo template.

WTF? 

Ah, it ended up in the wrong commit in the series during rebase. Fixed.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-17 Thread Scott Bloom
Maybe I missed it.  But I don’t see where you use the InheritableHandleInfo 
template.





-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Friday, March 17, 2023 1:45 PM
To: interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

On Tuesday, 7 March 2023 18:18:53 PDT Scott Bloom wrote:
> I really want to thank Björn
> 
> With his starting point, I was able to tweak his changes, and seem to 
> have it working 😊 I have more testing to do. But it was actually 
> pretty straight forward.
> 
> * I use VS (2022) so the packing was different
> __attribute__((packed)) became  __pragma( pack( push, 1 ) ) 
> struct HackedHandlePasser * The handles are 64 bit in the existing 
> Startup Info, so I kept them as such, which changed the definition of 
> HANDLE32 using
> HANDLE32 = std::int32_t; was removed, and the standard HANDLE defined 
> in windows.h was used * The static assert was updated to reflect this
> * I copy all 3 handles from the existing startupinfo
>std::memcpy(&handles.Handles[0], &invalid, 4);
>std::memcpy(&handles.Handles[1], &pipe.Write, 4);
>std::memcpy(&handles.Handles[2], &pipe.Write, 4);
> 
>became
> 
> std::memcpy( &handles.Handles[ 0 ], 
> &args->startupInfo->hStdInput, sizeof( HANDLE ) ); std::memcpy( 
> &handles.Handles[ 1 ], &args->startupInfo->hStdOutput, sizeof( HANDLE 
> ) ); std::memcpy( &handles.Handles[ 2 ], 
> &args->startupInfo->hStdError, sizeof( HANDLE ) );

I'm trying to add this to QProcess but it's not behaving as expected on Windows.

https://codereview.qt-project.org/c/qt/qtbase/+/467281

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-08 Thread Scott Bloom
From: Björn Schäpers  
Sent: Wednesday, March 8, 2023 11:45 AM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

Am 08.03.2023 um 03:18 schrieb Scott Bloom:
> I really want to thank Björn
>
> With his starting point, I was able to tweak his changes, and seem to have it 
> working 😊 I have more testing to do. But it was actually pretty straight 
> forward.
>
> * I use VS (2022) so the packing was different
>   __attribute__((packed)) became  __pragma( pack( push, 1 ) ) struct 
> HackedHandlePasser
> * The handles are 64 bit in the existing Startup Info, so I kept them as 
> such, which changed the definition of HANDLE32
>   using HANDLE32 = std::int32_t; was removed, and the standard 
> HANDLE defined in windows.h was used
> * The static assert was updated to reflect this
> * I copy all 3 handles from the existing startupinfo
> std::memcpy(&handles.Handles[0], &invalid, 4);
> std::memcpy(&handles.Handles[1], &pipe.Write, 4);
> std::memcpy(&handles.Handles[2], &pipe.Write, 4);
>
> became
>
>  std::memcpy( &handles.Handles[ 0 ], &args->startupInfo->hStdInput, 
> sizeof( HANDLE ) );
>  std::memcpy( &handles.Handles[ 1 ], &args->startupInfo->hStdOutput, 
> sizeof( HANDLE ) );
>  std::memcpy( &handles.Handles[ 2 ], 
> &args->startupInfo->hStdError, sizeof( HANDLE ) );
>
> Then I wrapped this into a function that returns a 
> QProcess::QCreateProcessArgumentModifier.
>
> And finally in my process, I set the modifier using process-> 
> setCreateProcessArgumentsModifier( func );
>
> You can find the code
> https://github.com/towel42-com/SABUtils/blob/trunk/ForceUnbufferedProc
> essModifier.h
> and
> https://github.com/towel42-com/SABUtils/blob/trunk/ForceUnbufferedProc
> essModifier.cpp
>
> and its usage at
> https://github.com/towel42-com/MediaManager/blob/trunk/Models/DirModel
> .cpp
>
> Thanks again.
> Scott
>
>
Happy for you.
I assume you don't use write() to the process, right? Because I think if you 
want to do that, you'd have to set FOPEN for the hStdInput handle.

===

I don’t touch it, I simply copy the pointer to the new handles from the old Qt 
handles.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-07 Thread Scott Bloom
I really want to thank Björn

With his starting point, I was able to tweak his changes, and seem to have it 
working 😊 I have more testing to do. But it was actually pretty straight 
forward.

* I use VS (2022) so the packing was different
__attribute__((packed)) became  __pragma( pack( push, 1 ) ) struct 
HackedHandlePasser
* The handles are 64 bit in the existing Startup Info, so I kept them as such, 
which changed the definition of HANDLE32
 using HANDLE32 = std::int32_t; was removed, and the standard HANDLE 
defined in windows.h was used
* The static assert was updated to reflect this
* I copy all 3 handles from the existing startupinfo
   std::memcpy(&handles.Handles[0], &invalid, 4);
   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

   became

std::memcpy( &handles.Handles[ 0 ], &args->startupInfo->hStdInput, 
sizeof( HANDLE ) );
std::memcpy( &handles.Handles[ 1 ], &args->startupInfo->hStdOutput, 
sizeof( HANDLE ) );
std::memcpy( &handles.Handles[ 2 ], &args->startupInfo->hStdError, 
sizeof( HANDLE ) );

Then I wrapped this into a function that returns a 
QProcess::QCreateProcessArgumentModifier.

And finally in my process, I set the modifier using process-> 
setCreateProcessArgumentsModifier( func );

You can find the code
https://github.com/towel42-com/SABUtils/blob/trunk/ForceUnbufferedProcessModifier.h
and
https://github.com/towel42-com/SABUtils/blob/trunk/ForceUnbufferedProcessModifier.cpp

and its usage at
https://github.com/towel42-com/MediaManager/blob/trunk/Models/DirModel.cpp

Thanks again.
Scott



-Original Message-----
From: Scott Bloom  
Sent: Tuesday, March 7, 2023 5:34 PM
To: Scott Bloom ; Björn Schäpers ; 
interest@qt-project.org
Subject: RE: [Interest] QProcess unbuffered

Yeah, Im being dense.. its from the existing startupinfo.. I read that 
paragraph a dozen times and missed it each time

-Original Message-
From: Interest  On Behalf Of Scott Bloom
Sent: Tuesday, March 7, 2023 5:28 PM
To: Björn Schäpers ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

Maybe Im being dense (its been a long day)

But where is pipe defined ?

   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

-- Scott
-Original Message-
From: Björn Schäpers  
Sent: Tuesday, March 7, 2023 12:58 PM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

So here is what I have:

struct __attribute__((packed)) HackedHandlePasser {
  using HANDLE32 = std::int32_t;

  DWORD    NumberOfHandles = 3; // 4 Byte
  BYTE FlagsPerHandle[3];   // 3 * 1 Byte
  HANDLE32 Handles[3];  // 3 * 4 Byte
   };

   static_assert(sizeof(HackedHandlePasser) == 19);
   HackedHandlePasser handles;

   #ifndef FOPEN
#define FOPEN 0x01
   #endif
   #ifndef FDEV
#define FDEV 0x40
   #endif

   handles.FlagsPerHandle[0] = 0;
   std::memset(&handles.FlagsPerHandle[1], FOPEN | FDEV, 2);

   const HANDLE invalid = INVALID_HANDLE_VALUE;
   std::memcpy(&handles.Handles[0], &invalid, 4);
   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

   startInf.cbReserved2 = sizeof(HackedHandlePasser);
   startInf.lpReserved2 = reinterpret_cast(&handles);

Some explanations:
* I have the HANDLE32 because I start a 32 bit application from within a 64 
bit, as far as I understood the structure needs the right HANDLE size, thus for 
a 64 bit application it should be std:int64_t, but since I don't need that I 
never tested it.
* In cbReserved2 there is the size of the data in lpReserved2.
* The data in lpReserved2 starts with 2 bytes which indicate how many handles 
are passed to the spawned process (they may be INVALID_HANDLE_VALUE). Followed 
by one byte per handle with the opened flags - and here comes the trick: If it 
has the flag FDEV the ms runtime printf assumes it writes to a console and thus 
flushes. And then followed by the handles.
* My use case needs only stdout (and I also open stderr, in my case to the same 
handle), these are the handles number 1 and 2. Number 0 would be stdin.

So when using it with QProcess I think one should copy the handles from the 
STARTUPINFOW structure into this struct, then I think the normal QIODevice 
interface should keep working. If one should clear the STARTF_USESTDHANDLES 
flag I also don't know. I stopped my experiments when I achieved success for my 
"simple" use case.

Let me know what works for you.

And last but not least some sources:
https://stackoverflow.com/questions/40965496/windows-how-to-stop-buffering-of-redirected-stdout-using-createprocess
which apparently now also 

Re: [Interest] QProcess unbuffered

2023-03-07 Thread Scott Bloom
Yeah, Im being dense.. its from the existing startupinfo.. I read that 
paragraph a dozen times and missed it each time

-Original Message-
From: Interest  On Behalf Of Scott Bloom
Sent: Tuesday, March 7, 2023 5:28 PM
To: Björn Schäpers ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

Maybe Im being dense (its been a long day)

But where is pipe defined ?

   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

-- Scott
-Original Message-
From: Björn Schäpers  
Sent: Tuesday, March 7, 2023 12:58 PM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

So here is what I have:

struct __attribute__((packed)) HackedHandlePasser {
  using HANDLE32 = std::int32_t;

  DWORD    NumberOfHandles = 3; // 4 Byte
  BYTE FlagsPerHandle[3];   // 3 * 1 Byte
  HANDLE32 Handles[3];  // 3 * 4 Byte
   };

   static_assert(sizeof(HackedHandlePasser) == 19);
   HackedHandlePasser handles;

   #ifndef FOPEN
#define FOPEN 0x01
   #endif
   #ifndef FDEV
#define FDEV 0x40
   #endif

   handles.FlagsPerHandle[0] = 0;
   std::memset(&handles.FlagsPerHandle[1], FOPEN | FDEV, 2);

   const HANDLE invalid = INVALID_HANDLE_VALUE;
   std::memcpy(&handles.Handles[0], &invalid, 4);
   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

   startInf.cbReserved2 = sizeof(HackedHandlePasser);
   startInf.lpReserved2 = reinterpret_cast(&handles);

Some explanations:
* I have the HANDLE32 because I start a 32 bit application from within a 64 
bit, as far as I understood the structure needs the right HANDLE size, thus for 
a 64 bit application it should be std:int64_t, but since I don't need that I 
never tested it.
* In cbReserved2 there is the size of the data in lpReserved2.
* The data in lpReserved2 starts with 2 bytes which indicate how many handles 
are passed to the spawned process (they may be INVALID_HANDLE_VALUE). Followed 
by one byte per handle with the opened flags - and here comes the trick: If it 
has the flag FDEV the ms runtime printf assumes it writes to a console and thus 
flushes. And then followed by the handles.
* My use case needs only stdout (and I also open stderr, in my case to the same 
handle), these are the handles number 1 and 2. Number 0 would be stdin.

So when using it with QProcess I think one should copy the handles from the 
STARTUPINFOW structure into this struct, then I think the normal QIODevice 
interface should keep working. If one should clear the STARTF_USESTDHANDLES 
flag I also don't know. I stopped my experiments when I achieved success for my 
"simple" use case.

Let me know what works for you.

And last but not least some sources:
https://stackoverflow.com/questions/40965496/windows-how-to-stop-buffering-of-redirected-stdout-using-createprocess
which apparently now also has a C/C++ answer, when I needed it there was only 
the python code.
http://www.catch22.net/tuts/undocumented-createprocess does use the fields for 
some other stuff, but explains a bit of background.
https://github.com/cansou/msvcrt/blob/master/src/isatty.c One if the involved 
files to handle the input.

Kind Regards,
Björn.
___
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] QProcess unbuffered

2023-03-07 Thread Scott Bloom
Maybe Im being dense (its been a long day)

But where is pipe defined ?

   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

-- Scott
-Original Message-
From: Björn Schäpers  
Sent: Tuesday, March 7, 2023 12:58 PM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

So here is what I have:

struct __attribute__((packed)) HackedHandlePasser {
  using HANDLE32 = std::int32_t;

  DWORD    NumberOfHandles = 3; // 4 Byte
  BYTE FlagsPerHandle[3];   // 3 * 1 Byte
  HANDLE32 Handles[3];  // 3 * 4 Byte
   };

   static_assert(sizeof(HackedHandlePasser) == 19);
   HackedHandlePasser handles;

   #ifndef FOPEN
#define FOPEN 0x01
   #endif
   #ifndef FDEV
#define FDEV 0x40
   #endif

   handles.FlagsPerHandle[0] = 0;
   std::memset(&handles.FlagsPerHandle[1], FOPEN | FDEV, 2);

   const HANDLE invalid = INVALID_HANDLE_VALUE;
   std::memcpy(&handles.Handles[0], &invalid, 4);
   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

   startInf.cbReserved2 = sizeof(HackedHandlePasser);
   startInf.lpReserved2 = reinterpret_cast(&handles);

Some explanations:
* I have the HANDLE32 because I start a 32 bit application from within a 64 
bit, as far as I understood the structure needs the right HANDLE size, thus for 
a 64 bit application it should be std:int64_t, but since I don't need that I 
never tested it.
* In cbReserved2 there is the size of the data in lpReserved2.
* The data in lpReserved2 starts with 2 bytes which indicate how many handles 
are passed to the spawned process (they may be INVALID_HANDLE_VALUE). Followed 
by one byte per handle with the opened flags - and here comes the trick: If it 
has the flag FDEV the ms runtime printf assumes it writes to a console and thus 
flushes. And then followed by the handles.
* My use case needs only stdout (and I also open stderr, in my case to the same 
handle), these are the handles number 1 and 2. Number 0 would be stdin.

So when using it with QProcess I think one should copy the handles from the 
STARTUPINFOW structure into this struct, then I think the normal QIODevice 
interface should keep working. If one should clear the STARTF_USESTDHANDLES 
flag I also don't know. I stopped my experiments when I achieved success for my 
"simple" use case.

Let me know what works for you.

And last but not least some sources:
https://stackoverflow.com/questions/40965496/windows-how-to-stop-buffering-of-redirected-stdout-using-createprocess
which apparently now also has a C/C++ answer, when I needed it there was only 
the python code.
http://www.catch22.net/tuts/undocumented-createprocess does use the fields for 
some other stuff, but explains a bit of background.
https://github.com/cansou/msvcrt/blob/master/src/isatty.c One if the involved 
files to handle the input.

Kind Regards,
Björn.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-07 Thread Scott Bloom



-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Tuesday, March 7, 2023 2:40 PM
To: interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

On Tuesday, 7 March 2023 14:23:00 PST Björn Schäpers wrote:
>  From the code I reviewed back then (and remember it now) it unpacks 
> the handles directly to a HANDLE, which is pointer size (although it 
> only uses the lower 32 bit). But Scott will tell us what the field 
> width has to be for a 64 bit process.

Yup.

BTW, Scott, when using QProcess::setCreateProcessArgumentsModifier(), you get 
access to QProcess' standard handles so you can place them in your fd table. 
Björn's code probably predates that function (Qt 5.7).


Just getting to play with it now...

Thanks for looking at this.

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


Re: [Interest] QProcess unbuffered

2023-03-07 Thread Scott Bloom
Thanks.

Ill take a look and see what I can workup, including the testing of 64 bit (I 
no longer build 32 bit windows, so any changes will have the opposite of your 
issues)

Scott

-Original Message-
From: Björn Schäpers  
Sent: Tuesday, March 7, 2023 12:58 PM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

So here is what I have:

struct __attribute__((packed)) HackedHandlePasser {
  using HANDLE32 = std::int32_t;

  DWORD    NumberOfHandles = 3; // 4 Byte
  BYTE FlagsPerHandle[3];   // 3 * 1 Byte
  HANDLE32 Handles[3];  // 3 * 4 Byte
   };

   static_assert(sizeof(HackedHandlePasser) == 19);
   HackedHandlePasser handles;

   #ifndef FOPEN
#define FOPEN 0x01
   #endif
   #ifndef FDEV
#define FDEV 0x40
   #endif

   handles.FlagsPerHandle[0] = 0;
   std::memset(&handles.FlagsPerHandle[1], FOPEN | FDEV, 2);

   const HANDLE invalid = INVALID_HANDLE_VALUE;
   std::memcpy(&handles.Handles[0], &invalid, 4);
   std::memcpy(&handles.Handles[1], &pipe.Write, 4);
   std::memcpy(&handles.Handles[2], &pipe.Write, 4);

   startInf.cbReserved2 = sizeof(HackedHandlePasser);
   startInf.lpReserved2 = reinterpret_cast(&handles);

Some explanations:
* I have the HANDLE32 because I start a 32 bit application from within a 64 
bit, as far as I understood the structure needs the right HANDLE size, thus for 
a 64 bit application it should be std:int64_t, but since I don't need that I 
never tested it.
* In cbReserved2 there is the size of the data in lpReserved2.
* The data in lpReserved2 starts with 2 bytes which indicate how many handles 
are passed to the spawned process (they may be INVALID_HANDLE_VALUE). Followed 
by one byte per handle with the opened flags - and here comes the trick: If it 
has the flag FDEV the ms runtime printf assumes it writes to a console and thus 
flushes. And then followed by the handles.
* My use case needs only stdout (and I also open stderr, in my case to the same 
handle), these are the handles number 1 and 2. Number 0 would be stdin.

So when using it with QProcess I think one should copy the handles from the 
STARTUPINFOW structure into this struct, then I think the normal QIODevice 
interface should keep working. If one should clear the STARTF_USESTDHANDLES 
flag I also don't know. I stopped my experiments when I achieved success for my 
"simple" use case.

Let me know what works for you.

And last but not least some sources:
https://stackoverflow.com/questions/40965496/windows-how-to-stop-buffering-of-redirected-stdout-using-createprocess
which apparently now also has a C/C++ answer, when I needed it there was only 
the python code.
http://www.catch22.net/tuts/undocumented-createprocess does use the fields for 
some other stuff, but explains a bit of background.
https://github.com/cansou/msvcrt/blob/master/src/isatty.c One if the involved 
files to handle the input.

Kind Regards,
Björn.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QProcess unbuffered

2023-03-06 Thread Scott Bloom

From: Björn Schäpers 
Sent: Monday, March 6, 2023 12:18 PM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] QProcess unbuffered

Am 06.03.2023 um 02:11 schrieb Scott Bloom:
I have an external executable (mkvalidator from 
https://www.matroska.org/downloads/mkvalidator.html

It never flushes the output, and it uses linefeed without carriage returns to 
overwrite existing text on the output.

The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get zero 
output until the process ends.  As if it was buffered, and the output was 
finally flushed

When running from the command line, I do get output continuously during the 
processing.

I setup a timer to waitForRead, didn’t do anything. I cant seem to force the 
QProcess to read all stdout or stderror info.

Any thoughts?

TIA
Scott



___

Interest mailing list

Interest@qt-project.org<mailto:Interest@qt-project.org>

https://lists.qt-project.org/listinfo/interest
Hi,

I had the exact same problem (but without QProcess). You have to use a trick to 
disable the buffering, I don't know if its possible with QProcess, you will 
have to use QProcess::CreateProcessArgumentModifier or most likely 
CreateProcess directly.

If there is interest I can copy some of my data, but currently I can't access 
it.

Kind regards,
Björn.
I would love any info/data you can provide.  Feel free to email me privately if 
you want.

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


Re: [Interest] QProcess unbuffered

2023-03-05 Thread Scott Bloom
On Sunday, 5 March 2023 17:11:13 PST Scott Bloom wrote:
> I have an external executable (mkvalidator from 
> https://www.matroska.org/downloads/mkvalidator.html
> 
> It never flushes the output, and it uses linefeed without carriage 
> returns to overwrite existing text on the output.

You've described the standard for Unix processes. There's no carriage return 
and stdout is fully buffered when not connected to a terminal.

> The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I 
> get zero output until the process ends.  As if it was buffered, and 
> the output was finally flushed
> 
> When running from the command line, I do get output continuously 
> during the processing.
> 
> I setup a timer to waitForRead, didn't do anything. I cant seem to 
> force the QProcess to read all stdout or stderror info.

You don't need a timer on waitForRead because you have the readyRead() signal.

Anyway, the problem is that your process is not writing. It's buffering its 
output until later. This is not a QProcess problem; you must force the child 
process to write.

Many programs that do this type of interaction have a command-line option to 
switch back to line-buffered. For those that don't, you can use the /usr/bin/ 
stdbuf tool to change the buffering semantics, but I don't know how it works, 
just that it does on Linux, so it may not on Windows.

Since you're on Windows and this application is not part of Windows itself, it 
stands to reason you're compiling it yourself and distributing with your 
application. So just modify it to be line-buffered.

--
=
Unfortunately no, I am not building it myself.  Its built by a third party and 
distributed via mkvtoolsnix distro world on windows.

Ill take a look at try to find a switch, but its unlikely they have it

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


[Interest] QProcess unbuffered

2023-03-05 Thread Scott Bloom
I have an external executable (mkvalidator from 
https://www.matroska.org/downloads/mkvalidator.html

It never flushes the output, and it uses linefeed without carriage returns to 
overwrite existing text on the output.

The problem is, when I run it via QProcess (on windows, Qt 5.15.10), I get zero 
output until the process ends.  As if it was buffered, and the output was 
finally flushed

When running from the command line, I do get output continuously during the 
processing.

I setup a timer to waitForRead, didn't do anything. I cant seem to force the 
QProcess to read all stdout or stderror info.

Any thoughts?

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


Re: [Interest] Weird assert, how to debug?

2023-03-04 Thread Scott Bloom
As I said, im using 5.15.10, Ill try 5.15.8.

Sorry about the QRC, its an artifact of the minimization.  All that will be 
lost is an icon or two.

Scott

From: Interest  On Behalf Of Axel Spoerl via 
Interest
Sent: Saturday, March 4, 2023 3:48 AM
To: interest@qt-project.org
Subject: Re: [Interest] Weird assert, how to debug?

Hi Scott,
the assertion doesn't fire on Qt 5.15.8, 6.4, 6.5, 6.6 / Linux XCB.
Neither from any debugger, nor from the cmd line. Release build doesn't crash 
either.
Before it eventually builds, the reproducer rightfully rants about a missing 
../TestFocusAssert-trunk/MainWindow.qrc
Maybe the issue is triggered by / results from its content.
=> You could try moving that file in and out.
=> If the issue persists, please file a bug at https://bugreports.qt.io and 
include a complete reproducer.
Brgds
Axel
____
Von: Scott Bloom mailto:sc...@towel42.com>>
Gesendet: Freitag, 3. März 2023 19:42
An: Axel Spoerl mailto:axel.spo...@qt.io>>; 
interest@qt-project.org<mailto:interest@qt-project.org> 
mailto:interest@qt-project.org>>
Betreff: RE: Weird assert, how to debug?


Qt Creator? Never heard of it 😊  I use Visual Studio, but I did already try 
this.



The assert kicks off directly from the command line as well.



Scott



From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Axel Spoerl via Interest
Sent: Friday, March 3, 2023 9:43 AM
To: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Weird assert, how to debug?



Hi Scot,

Please try running the executable from outside Qt Creator to eliminate its 
debugger as the troublemaker.

Cheers

Axel



On 3 Mar 2023, at 18:33, Scott Bloom 
mailto:sc...@towel42.com>> wrote:



As you can see by the sample, Im not doing anything special, not changing any 
ownership, and not doing any individual deletes + deleteLaters with a 
processEvents (The root cause of many a “double delete in my experience”), so 
Im really stumped on this one.



Something in designer with the UI file is causing this.

Scott



From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Axel Spoerl via Interest
Sent: Thursday, March 2, 2023 10:09 PM
To: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Weird assert, how to debug?



Hi Scott,



I can't make the reproducer crash on Qt 5.15.9 or on the latest dev (6.6).

The assertion happens in QWidget's destructor, when it wants to exit from the 
focus list.

I can imagine two cases, how this assertion kicks in.

  1.  The code path in the if statement right after the assertion has been 
reached before:
if (d->focus_next != this) {
d->focus_next->d_func()->focus_prev = d->focus_prev;
d->focus_prev->d_func()->focus_next = d->focus_next;
d->focus_next = d->focus_prev = nullptr;
}

=> An already deleted widget is deleted a second time.

  1.  Focus chain has changed without events having been processed, so the 
destroyed widget doesn't know about it.
Happens in the debugger (e.g. Qt Creator) sometimes, because debugging output 
is a notirious focus thief.

Option 2 seems more likely to me, since the assertion doesn't shout in release 
builds.

Updating to the latest Qt Creator version may help. If it doesn't please file a 
bugreport in https://bugreports.qt.io,

upload the reproducer, specify the Qt and (Qt Creator if used for debugging) 
versions used.



Cheers
Axel



Von: Interest 
mailto:interest-boun...@qt-project.org>> im 
Auftrag von Scott Bloom mailto:sc...@towel42.com>>
Gesendet: Freitag, 3. März 2023 01:37
An: interest@qt-project.org<mailto:interest@qt-project.org> 
mailto:interest@qt-project.org>>
Betreff: [Interest] Weird assert, how to debug?



Im getting an assertion in qwidget.cpp

“d->focus_prev->d_func()->focus_next == this” in Qwidget.cpp line 1443 (Qt 
5.15.10)



I realize the response is going to be, create a minimal example, I created a 
repo on github with it, it’s a simple cmake based project. Any help figuring 
this out would be appreciated.



The application has a QApplication and a QDialog derived dialog.  The dialog 
has a tabwidget and a dialogbutton box.

The assertion gets thrown when the dialog is destroyed.



https://github.com/towel42-com/TestFocusAssert



This happens on Windows, I don’t have a linux box setup right now to test on 
linux.



Thanks

Scott








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


Re: [Interest] Weird assert, how to debug?

2023-03-03 Thread Scott Bloom
Qt Creator? Never heard of it 😊  I use Visual Studio, but I did already try 
this.

The assert kicks off directly from the command line as well.

Scott

From: Interest  On Behalf Of Axel Spoerl via 
Interest
Sent: Friday, March 3, 2023 9:43 AM
To: interest@qt-project.org
Subject: Re: [Interest] Weird assert, how to debug?

Hi Scot,
Please try running the executable from outside Qt Creator to eliminate its 
debugger as the troublemaker.
Cheers
Axel


On 3 Mar 2023, at 18:33, Scott Bloom 
mailto:sc...@towel42.com>> wrote:

As you can see by the sample, Im not doing anything special, not changing any 
ownership, and not doing any individual deletes + deleteLaters with a 
processEvents (The root cause of many a “double delete in my experience”), so 
Im really stumped on this one.

Something in designer with the UI file is causing this.

Scott

From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Axel Spoerl via Interest
Sent: Thursday, March 2, 2023 10:09 PM
To: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Weird assert, how to debug?

Hi Scott,

I can't make the reproducer crash on Qt 5.15.9 or on the latest dev (6.6).
The assertion happens in QWidget's destructor, when it wants to exit from the 
focus list.
I can imagine two cases, how this assertion kicks in.

  1.  The code path in the if statement right after the assertion has been 
reached before:
if (d->focus_next != this) {
d->focus_next->d_func()->focus_prev = d->focus_prev;
d->focus_prev->d_func()->focus_next = d->focus_next;
d->focus_next = d->focus_prev = nullptr;
}

=> An already deleted widget is deleted a second time.

  1.  Focus chain has changed without events having been processed, so the 
destroyed widget doesn't know about it.
Happens in the debugger (e.g. Qt Creator) sometimes, because debugging output 
is a notirious focus thief.
Option 2 seems more likely to me, since the assertion doesn't shout in release 
builds.
Updating to the latest Qt Creator version may help. If it doesn't please file a 
bugreport in https://bugreports.qt.io,
upload the reproducer, specify the Qt and (Qt Creator if used for debugging) 
versions used.

Cheers
Axel
____
Von: Interest 
mailto:interest-boun...@qt-project.org>> im 
Auftrag von Scott Bloom mailto:sc...@towel42.com>>
Gesendet: Freitag, 3. März 2023 01:37
An: interest@qt-project.org<mailto:interest@qt-project.org> 
mailto:interest@qt-project.org>>
Betreff: [Interest] Weird assert, how to debug?


Im getting an assertion in qwidget.cpp

“d->focus_prev->d_func()->focus_next == this” in Qwidget.cpp line 1443 (Qt 
5.15.10)



I realize the response is going to be, create a minimal example, I created a 
repo on github with it, it’s a simple cmake based project. Any help figuring 
this out would be appreciated.



The application has a QApplication and a QDialog derived dialog.  The dialog 
has a tabwidget and a dialogbutton box.

The assertion gets thrown when the dialog is destroyed.



https://github.com/towel42-com/TestFocusAssert



This happens on Windows, I don’t have a linux box setup right now to test on 
linux.



Thanks

Scott








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


Re: [Interest] Weird assert, how to debug?

2023-03-03 Thread Scott Bloom
As you can see by the sample, Im not doing anything special, not changing any 
ownership, and not doing any individual deletes + deleteLaters with a 
processEvents (The root cause of many a "double delete in my experience"), so 
Im really stumped on this one.

Something in designer with the UI file is causing this.

Scott

From: Interest  On Behalf Of Axel Spoerl via 
Interest
Sent: Thursday, March 2, 2023 10:09 PM
To: interest@qt-project.org
Subject: Re: [Interest] Weird assert, how to debug?

Hi Scott,

I can't make the reproducer crash on Qt 5.15.9 or on the latest dev (6.6).
The assertion happens in QWidget's destructor, when it wants to exit from the 
focus list.
I can imagine two cases, how this assertion kicks in.

  *   The code path in the if statement right after the assertion has been 
reached before:
if (d->focus_next != this) {
d->focus_next->d_func()->focus_prev = d->focus_prev;
d->focus_prev->d_func()->focus_next = d->focus_next;
d->focus_next = d->focus_prev = nullptr;
}

=> An already deleted widget is deleted a second time.

  *   Focus chain has changed without events having been processed, so the 
destroyed widget doesn't know about it.
Happens in the debugger (e.g. Qt Creator) sometimes, because debugging output 
is a notirious focus thief.
Option 2 seems more likely to me, since the assertion doesn't shout in release 
builds.
Updating to the latest Qt Creator version may help. If it doesn't please file a 
bugreport in https://bugreports.qt.io,
upload the reproducer, specify the Qt and (Qt Creator if used for debugging) 
versions used.

Cheers
Axel

Von: Interest 
mailto:interest-boun...@qt-project.org>> im 
Auftrag von Scott Bloom mailto:sc...@towel42.com>>
Gesendet: Freitag, 3. März 2023 01:37
An: interest@qt-project.org<mailto:interest@qt-project.org> 
mailto:interest@qt-project.org>>
Betreff: [Interest] Weird assert, how to debug?


Im getting an assertion in qwidget.cpp

"d->focus_prev->d_func()->focus_next == this" in Qwidget.cpp line 1443 (Qt 
5.15.10)



I realize the response is going to be, create a minimal example, I created a 
repo on github with it, it's a simple cmake based project. Any help figuring 
this out would be appreciated.



The application has a QApplication and a QDialog derived dialog.  The dialog 
has a tabwidget and a dialogbutton box.

The assertion gets thrown when the dialog is destroyed.



https://github.com/towel42-com/TestFocusAssert



This happens on Windows, I don't have a linux box setup right now to test on 
linux.



Thanks

Scott








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


[Interest] Weird assert, how to debug?

2023-03-02 Thread Scott Bloom
Im getting an assertion in qwidget.cpp
"d->focus_prev->d_func()->focus_next == this" in Qwidget.cpp line 1443 (Qt 
5.15.10)

I realize the response is going to be, create a minimal example, I created a 
repo on github with it, it's a simple cmake based project. Any help figuring 
this out would be appreciated.

The application has a QApplication and a QDialog derived dialog.  The dialog 
has a tabwidget and a dialogbutton box.

The assertion gets thrown when the dialog is destroyed.

https://github.com/towel42-com/TestFocusAssert

This happens on Windows, I don't have a linux box setup right now to test on 
linux.

Thanks
Scott




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


Re: [Interest] MSVC not-the-latest: are you using it? why?

2023-01-23 Thread Scott Bloom
-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Sunday, January 22, 2023 9:32 AM
To: interest@qt-project.org
Subject: Re: [Interest] MSVC not-the-latest: are you using it? why?

On Sunday, 22 January 2023 08:33:43 PST coroberti wrote:
> On some update of MSVC-2017 to their next minor release, we got their 
> optimization bug.
> It was a waste of time to understand what happened and to work-around it.

That just means you had to downgrade to the previous minor version of 2017.

That doesn't answer my question, though.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering
---
My groups reasoning, other 3rd party libraries.

Since MSVC 2015, its been great that a 3rd party library built can be used on 
newer versions.  However, that is not always the case on the linux side.

So when a MSVC, gcc, g++ version is moved to, we move very slowly for the new 
version.  

One of the limiting factors in general, is we would prefer NOT to have 2 
compilers with very different c++ support.  There have a been a number of " 
C++11/14/17 etc" that have been partially implemented on one, and not on the 
other.  Unfortunately, NOT always protected by the "version switch".  

The biggest one that hit me, is std::make_unique which didn't exist on g++ but 
did on windows.  So if used, when you go build on linux, you have to clean up 
your code.  There have been some others through the years.

So in general, we try to keep their abilities as close as possible,

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


Re: [Interest] QRegularExpression for replace

2022-12-05 Thread Scott Bloom
I have implemented the following replacement patterns in a stand-alone function 

It supports numbered groups, named groups, $$, and $&.  My next step is $` $' 
$+ and $_

Here is how its used in my code base (from my unit tests)


auto pattern = R"(\p{Sc}*\s?(\d+[.,]?\d*)\p{Sc}*)";
auto replacement = "$1";
auto input = R"($16.32 12.19 £16.29 €18.29  €18,29)";
auto result = NSABUtils::NStringUtils::regExReplace( input, pattern, 
replacement ); 

auto pattern = R"(\p{Sc}*\s?(?\d+[.,]?\d*)\p{Sc}*)";
auto replacement = "${amount}";
auto input = R"($16.32 12.19 £16.29 €18.29  €18,29)";
auto result = NSABUtils::NStringUtils::regExReplace( input, pattern, 
replacement );

auto pattern = R"(\p{Sc}*\s?(?\d+[.,]?\d*)\p{Sc}*)";
auto replacement = "$ $${amount}";
auto input = R"($16.32 12.19 £16.29 €18.29  €18,29)";
auto result = NSABUtils::NStringUtils::regExReplace( input, pattern, 
replacement );

auto pattern = QString( R"(\b(\d+)(%1(\d+))?)" ).arg( cSeparator );
auto replacement = "$ " + QString( "$1$2" );
EXPECT_EQ( "$ 16.35", NSABUtils::NStringUtils::regExReplace( "16.35", 
pattern, replacement ) );


I would prefer if it was something like
   Result = regex.replace( replacePattern )

Here is the notes for C#'s regular expression replacement.
https://learn.microsoft.com/en-us/dotnet/standard/base-types/substitutions-in-regular-expressions?redirectedfrom=MSDN#substituting-a-numbered-group

Yes, it can be done, but I think it should be built into QRegularExpression

-Original Message-
From: Elvis Stansvik  
Sent: Monday, December 5, 2022 5:37 AM
To: Scott Bloom 
Cc: Thiago Macieira ; interest@qt-project.org
Subject: Re: [Interest] QRegularExpression for replace

Maybe I'm dumb, but I'm still not sure what is being asked for.

If it's regular expression replacement with back-references in the replacement 
string, I think that's possible with QString::replace like I showed.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QRegularExpression for replace

2022-12-04 Thread Scott Bloom
I guess my point is, whatever happened to code less, do more 😊



-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Sunday, December 4, 2022 9:46 AM
To: interest@qt-project.org
Subject: Re: [Interest] QRegularExpression for replace

On Saturday, 3 December 2022 23:02:24 PST Scott Bloom wrote:
> That is basically what I did for the non problematic replacements.  
> The ones that not only need the captured text, but also need the rest 
> of the text I didn't bother implementing

The point is that you may do it programmatically, instead of having a parser 
for the replacement content.

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



___
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] QRegularExpression for replace

2022-12-03 Thread Scott Bloom
That is basically what I did for the non problematic replacements.  The ones 
that not only need the captured text, but also need the rest of the text I 
didn't bother implementing

Thanks.

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Thursday, December 1, 2022 8:14 PM
To: interest@qt-project.org
Subject: Re: [Interest] QRegularExpression for replace

On Thursday, 1 December 2022 11:43:39 PST Scott Bloom wrote:
> Im looking for a way using QRE to do something like the following
> 
> auto regEx = QRegularExpression( "(?.*)" ); if ( regEx.match( 
> string ) )
> auto newString = regEx.replace( string, "${name}" );

This requires having a parser for the replacer too, which is not something we 
currently have.

The QRegularExpressionMatch result gives you all the regions in the string 
where captures were found, so you can  do this yourself if you know your 
captures.

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



___
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


[Interest] QRegularExpression for replace

2022-12-01 Thread Scott Bloom
Im looking for a way using QRE to do something like the following

auto regEx = QRegularExpression( "(?.*)" );
if ( regEx.match( string ) )
auto newString = regEx.replace( string, "${name}" );


Using the standard set of regex subsitutions

Is this something anyone is looking at? Or is there a solution outthere?

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


Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom


-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Monday, November 28, 2022 1:41 PM
To: interest@qt-project.org
Subject: Re: [Interest] Qt Sql BLOB data converting

On Monday, 28 November 2022 12:39:05 PST Scott Bloom wrote:
> Strict tables were only added in Sqlite 3.37, I don't know what 
> version of
> sqlite3 is used in Qt6, my version of Qt5.15.6 doesn't support it.

Hence the rule of thumb: ALWAYS unbundle the third party content and build the 
necessary libraries yourself.

The third-party content that gets bundled into the Qt libraries should never be 
deployed to customers.

--
While this might be the expectation from the Qt side of the world 😊  On 
windows, I don’t know of anyone who does this. Not so uncommon on linux, but 
"all" 3rd party? I wouldn’t say that happens often
Scott
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom



-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Monday, November 28, 2022 12:21 PM
To: interest@qt-project.org
Subject: Re: [Interest] Qt Sql BLOB data converting

On Monday, 28 November 2022 12:07:22 PST Scott Bloom wrote:
> but if they did a  create XXX as string, insert XXX=123 (integer) and 
> Sqlite can return it as a string or an integer, the QVariant should be 
> created from an string not an integer.  The same goes if they did a 
> create XXX as integer, insert XXX='123'.  QVariant should be created 
> as from an integer type, and they can do a toString on the variant if they 
> want.
> 
> My point, dynamic types should follow C++ style "dynamic" typing not 
> "everything is a string until proven otherwise" typing of other languages.

I don't agree. Sqlite seems to have made a choice that the type is stored per 
row, but gives you the ability to choose otherwise either at table creation 
time or at selection time. Changing the behaviour right now would remove that 
possibility.

I don't know if it is surprising or not for unwary people.

But I can tell you that no action will happen because QtSql is right now 
under-maintained and there are no volunteers to understand all the implications 
of such a choice.


I understand the "understaffed" issue, however, to me its problematic that the 
record method returns a different type than the row.  It s been this way for 
sometime.  In fact, I brought this up with the Sql team back in the Qt 4 days.  

Strict tables were only added in Sqlite 3.37, I don't know what version of 
sqlite3 is used in Qt6, my version of Qt5.15.6 doesn't support it.

This issue, of a blob interpreted as a string has existed for ages.  

I just think it's a mistake to determine the type of a column in two different 
ways.  

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


Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom



-Original Message-
From: Interest  On Behalf Of Christian 
Ehrlicher
Sent: Monday, November 28, 2022 11:54 AM
To: interest@qt-project.org
Subject: Re: [Interest] Qt Sql BLOB data converting


Am 28.11.2022 um 20:31 schrieb Scott Bloom:
> -Original Message-
> From: Interest  On Behalf Of Thiago 
> Macieira
> Sent: Monday, November 28, 2022 11:21 AM
> To: interest@qt-project.org
> Subject: Re: [Interest] Qt Sql BLOB data converting
>
> On Monday, 28 November 2022 10:59:47 PST Christian Ehrlicher wrote:
>> It's because of the dynamic typing feature of sqlite ( 
>> https://www.sqlite.org/flextypegood.html ) - even a column is created 
>> as one type it can contain another one. Looks like the data was 
>> inserted with the wrong type information since your blob data is for 
>> sure no readable string.
> Thanks for the explanation, Christian. I can confirm that the type comes out 
> correctly if it is inserted into the table AS blob, not as plaintext.
> Therefore, the problem is on the insertion side, not  in the SELECT or QtSql.
>
> I've closed the task.
>
> --
> I disagree with closing it.
>
> When the cache is being created, it should use the same method for 
> determining the type of a column as the record function does.
>
> First check the name of the column type, then use the enumerated type if the 
> string name is empty.

This will not work when you fetch two rows with different dynamic types for a 
column - there is only one record per result set. But at least we should be 
consistent by directly using the already calculated values from the record 
instead calling sqlite3_column_type() again.


Christian
---
If the user/developer creates a table, where the type of a column "Actually" 
changes per row, they should use a string type for the row, and do the 
conversion outside of SQL, OR as you posted earlier cast the column on an 
individual row select command.

But if the column is defined as a BLOB the variant should be created from a 
QByteArray every time, if it's a text then QString, INT integer etc etc.

but if they did a  create XXX as string, insert XXX=123 (integer) and Sqlite 
can return it as a string or an integer, the QVariant should be created from an 
string not an integer.  The same goes if they did a create XXX as integer, 
insert XXX='123'.  QVariant should be created as from an integer type, and they 
can do a toString on the variant if they want.

My point, dynamic types should follow C++ style "dynamic" typing not 
"everything is a string until proven otherwise" typing of other languages.

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


Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Monday, November 28, 2022 11:21 AM
To: interest@qt-project.org
Subject: Re: [Interest] Qt Sql BLOB data converting

On Monday, 28 November 2022 10:59:47 PST Christian Ehrlicher wrote:
> It's because of the dynamic typing feature of sqlite ( 
> https://www.sqlite.org/flextypegood.html ) - even a column is created 
> as one type it can contain another one. Looks like the data was 
> inserted with the wrong type information since your blob data is for 
> sure no readable string.

Thanks for the explanation, Christian. I can confirm that the type comes out 
correctly if it is inserted into the table AS blob, not as plaintext. 
Therefore, the problem is on the insertion side, not  in the SELECT or QtSql.

I've closed the task.

--
I disagree with closing it.

When the cache is being created, it should use the same method for determining 
the type of a column as the record function does.

First check the name of the column type, then use the enumerated type if the 
string name is empty.

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


Re: [Interest] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
Just a POINT of note.  Since SQL Lite has moved to “flexible typing” (its been 
a while) they have also added a strict datatype table

Which I have been using myself.

For this case, rather than

CREATE TABLE IF NOT EXISTS "test" (
"value" BLOB NOT NULL
);

You would use

CREATE TABLE IF NOT EXISTS "test" (
"value" BLOB NOT NULL
) STRICT;

Then all types are returned as defined, and inserts may fail (IMO correctly) 
whereas before they would succeed.

I have found creating strict tables correct this an other issues (such as a 
string that has the value 1234 being automatically converted to an integer, 
and then the value.toString() returning “1234”)

Scott

From: Yauheni Pervenenka 
Sent: Monday, November 28, 2022 11:16 AM
To: Scott Bloom 
Cc: Christian Ehrlicher ; interest@qt-project.org
Subject: Re: [Interest] Qt Sql BLOB data converting

Scott, thanks you for your time

On Mon, Nov 28, 2022 at 10:11 PM Scott Bloom 
mailto:sc...@towel42.com>> wrote:
@Christian Ehrlicher you beat me to the punch.

If you dump out the value (not the size) you will see the QVariant is a of type 
QString not QByteArray

const auto value = query.value(0);
qDebug() << "value = " << value;
auto tmp = QVariant( value.toByteArray() );
qDebug() << "tmp = " << tmp;

value =  QVariant(QString, "v10I-F½L\u009C{░?x\u009B)δ\u001EG#?fóu??H")
tmp =  QVariant(QByteArray, 
"v10I-F\xC2\xABL\xC2\x9C{\xC2\xB0\xEF\xBF\xBDx\xC2\x9B)\xC3\xAB\x1EG#\xDE\xA6\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD""f\xC2\xA2u\xEF\xBF\xBD\xEF\xBF\xBD\xC4\xA6")

This is the root cause of the problem.

Ive hit this before, the query.value function should return a QByteArray type 
of QVariant, not a QString type when the column type is of type blob.

auto record = db.record( "test" );
qDebug() << "record =" << record;

returns the correct record type

record = QSqlRecord(1)
 0: QSqlField("value", QByteArray, tableName: "test", required: yes, generated: 
yes, autoValue: false, readOnly: false) ""

Whats interesting, is in my qsql_sqlite.cpp (the driver for the sql database,

sqlite3_column_decltype16 returns "BLOB" but sqlite3_column_type returns 
SQLITE_TEXT

in the init columns function, to determine which Qt type to use, it first gets 
the string name of the column, if empty then use  sqlite3_column_type otherwise 
it uses qGetColumnType

So the Record is correct, but the return type is of QString not QByteArray

Scott




-Original Message-
From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Christian Ehrlicher
Sent: Monday, November 28, 2022 10:41 AM
To: Yauheni Pervenenka 
mailto:yauheni.pervene...@viber.com>>; 
interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Qt Sql BLOB data converting


Am 28.11.2022 um 19:16 schrieb Yauheni Pervenenka via Interest:
> Thiago, hello, thanks for your reply, sorry have no instructions for
> create and insert, but have data base with one value which can't be
> parsed correct(db is cut to one value for provide example)
>
> https://bugreports.qt.io/browse/QTBUG-108992
>
Your database looks strange to me - even though your column type according to 
the schema is BLOB:

sqlite> .schema
CREATE TABLE IF NOT EXISTS "test" (
 "value" BLOB NOT NULL
);

the return value of sqlite3_column_type() is SQLITE_TEXT (3).

Therefore the return value is treated as string and the data is screwed up. If 
I change the return value to SQLITE_BLOB (4) in the debugger, all is correct:

qDebug() << value.toByteArray().toHex();

-->

"763130492d46ab4c9c7bb0e9789b29c3ab1e4723dea6c8e5d2f9b266a275e1fbe4a6"



Christian

___
Interest mailing list
Interest@qt-project.org<mailto: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] Qt Sql BLOB data converting

2022-11-28 Thread Scott Bloom
@Christian Ehrlicher you beat me to the punch.

If you dump out the value (not the size) you will see the QVariant is a of type 
QString not QByteArray

const auto value = query.value(0);
qDebug() << "value = " << value;
auto tmp = QVariant( value.toByteArray() );
qDebug() << "tmp = " << tmp;

value =  QVariant(QString, "v10I-F½L\u009C{░?x\u009B)δ\u001EG#?fóu??H")
tmp =  QVariant(QByteArray, 
"v10I-F\xC2\xABL\xC2\x9C{\xC2\xB0\xEF\xBF\xBDx\xC2\x9B)\xC3\xAB\x1EG#\xDE\xA6\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD""f\xC2\xA2u\xEF\xBF\xBD\xEF\xBF\xBD\xC4\xA6")

This is the root cause of the problem.

Ive hit this before, the query.value function should return a QByteArray type 
of QVariant, not a QString type when the column type is of type blob.

auto record = db.record( "test" );
qDebug() << "record =" << record;

returns the correct record type

record = QSqlRecord(1)
 0: QSqlField("value", QByteArray, tableName: "test", required: yes, generated: 
yes, autoValue: false, readOnly: false) ""

Whats interesting, is in my qsql_sqlite.cpp (the driver for the sql database, 

sqlite3_column_decltype16 returns "BLOB" but sqlite3_column_type returns 
SQLITE_TEXT

in the init columns function, to determine which Qt type to use, it first gets 
the string name of the column, if empty then use  sqlite3_column_type otherwise 
it uses qGetColumnType

So the Record is correct, but the return type is of QString not QByteArray

Scott




-Original Message-
From: Interest  On Behalf Of Christian 
Ehrlicher
Sent: Monday, November 28, 2022 10:41 AM
To: Yauheni Pervenenka ; interest@qt-project.org
Subject: Re: [Interest] Qt Sql BLOB data converting


Am 28.11.2022 um 19:16 schrieb Yauheni Pervenenka via Interest:
> Thiago, hello, thanks for your reply, sorry have no instructions for 
> create and insert, but have data base with one value which can't be 
> parsed correct(db is cut to one value for provide example)
>
> https://bugreports.qt.io/browse/QTBUG-108992
>
Your database looks strange to me - even though your column type according to 
the schema is BLOB:

sqlite> .schema
CREATE TABLE IF NOT EXISTS "test" (
     "value" BLOB NOT NULL
);

the return value of sqlite3_column_type() is SQLITE_TEXT (3).

Therefore the return value is treated as string and the data is screwed up. If 
I change the return value to SQLITE_BLOB (4) in the debugger, all is correct:

qDebug() << value.toByteArray().toHex();

-->

"763130492d46ab4c9c7bb0e9789b29c3ab1e4723dea6c8e5d2f9b266a275e1fbe4a6"



Christian

___
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] Is 6.x finally there ??

2022-10-21 Thread Scott Bloom
@Bill Jones<mailto:jo...@synergy.com>,

Thanks.  That would have been a major issue for my group

Scott

From: Bill Jones 
Sent: Friday, October 21, 2022 2:18 PM
To: interest@qt-project.org
Cc: Scott Bloom ; Volker Hilsheimer 
Subject: Re: [Interest] Is 6.x finally there ??

Hi Volker,

Another missing module in Qt 6.x that is very important to desktop applications 
is clipboard support.

https://bugreports.qt.io/browse/QTBUG-93632

Without cross platform (at least MacOS and Windows) we will never be able to 
move from 5.15.x to Qt 6. This is an absolute necessity for us and I have not 
seen any progress on this issue. I apologize if I seem a little strident, but 
my questions to support have not gotten any movement on this.

Bill



On Oct 21, 2022, at 10:00 AM, Volker Hilsheimer via Interest 
mailto:interest@qt-project.org>> wrote:

On 20 Oct 2022, at 22:35, Scott Bloom 
mailto:sc...@towel42.com>> wrote:

I haven’t been following the 6.x progress very much.  Only because it was clear 
6.0 and 6.1 were not ready to replace all the functionality of 5.x

However, with 6.4 it appears that all functionality that is going to be brought 
forward, has been completed.  Is that true? Or is there sill chunks of 5.x 
missing (that will be brought forward) ?

Scott

Hi Scott,


The only module that is not officially available in Qt 6 yet, and that we still 
want to bring back in some form, is Qt Location. Work is progressing on that 
module [1].

[1] https://bugreports.qt.io/browse/QTBUG-96795

There are some modules that currently live only in Qt5Compat, such as Qt 
Graphical Effects. We’re working on a replacement for that as well [2], 
addressing some of the deficiencies of it Qt Graphical Effects, but if you were 
happy with things in Qt 5, then the types in Qt5Compat as they are are 
perfectly fine to use.

[2] https://www.qt.io/blog/introducing-qt-quick-effect-maker


So, unless you depend on Qt Location, there’s no point in waiting. And if you 
do - we’ll soon share more updates on our blog.

Volker

___
Interest mailing list
Interest@qt-project.org<mailto: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] Is 6.x finally there ??

2022-10-21 Thread Scott Bloom
Thanks for the reply!  Ill let the team know

-Original Message-
From: Volker Hilsheimer  
Sent: Friday, October 21, 2022 7:01 AM
To: Scott Bloom 
Cc: interest@qt-project.org
Subject: Re: [Interest] Is 6.x finally there ??

> On 20 Oct 2022, at 22:35, Scott Bloom  wrote:
> 
> I haven’t been following the 6.x progress very much.  Only because it was 
> clear 6.0 and 6.1 were not ready to replace all the functionality of 5.x
>  
> However, with 6.4 it appears that all functionality that is going to be 
> brought forward, has been completed.  Is that true? Or is there sill chunks 
> of 5.x missing (that will be brought forward) ?
>  
> Scott

Hi Scott,


The only module that is not officially available in Qt 6 yet, and that we still 
want to bring back in some form, is Qt Location. Work is progressing on that 
module [1].

[1] https://bugreports.qt.io/browse/QTBUG-96795

There are some modules that currently live only in Qt5Compat, such as Qt 
Graphical Effects. We’re working on a replacement for that as well [2], 
addressing some of the deficiencies of it Qt Graphical Effects, but if you were 
happy with things in Qt 5, then the types in Qt5Compat as they are are 
perfectly fine to use.

[2] https://www.qt.io/blog/introducing-qt-quick-effect-maker


So, unless you depend on Qt Location, there’s no point in waiting. And if you 
do - we’ll soon share more updates on our blog.

Volker

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


[Interest] Is 6.x finally there ??

2022-10-20 Thread Scott Bloom
I haven't been following the 6.x progress very much.  Only because it was clear 
6.0 and 6.1 were not ready to replace all the functionality of 5.x

However, with 6.4 it appears that all functionality that is going to be brought 
forward, has been completed.  Is that true? Or is there sill chunks of 5.x 
missing (that will be brought forward) ?

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


[Interest] Convert to QMetaMethod from QObject + const char *

2022-08-16 Thread Scott Bloom
I have a function that takes in a QObject and const char * signal/slot

void func( ..., QObject * target, const char * member )
{
 logic
QObject::connect( ., target, member )
... more logic
{


So I can call it via


func( , m_target, SLOT(  )
...

it works fine

I would like to modify the function so it can also take

func( , m_target, &TargetClass::


however, I cant for the life of me figure out to convert, if its even possible

Id prefer not to have to copy all the logic in func

Is this possible?

Yes, I know I can use std::enable_if, but that just copies the function logic

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


Re: [Interest] Proper way to track mouse leaving a widgets boundary

2022-08-16 Thread Scott Bloom


Hey Scott,

This should be a job for a QWidget::leaveEvent override:

https://doc.qt.io/qt-6/qwidget.html#leaveEvent


Volker
==
How did I miss that in the 20 years of Qt coding??? dang
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Proper way to track mouse leaving a widgets boundary

2022-08-16 Thread Scott Bloom
I have a QTextEdit derived class, that sets setMouseTracking( true ) in the 
constructor.  Note, this isn't about QTextEdit and should I use QTextBrowser.  
Ive had this issue multiple times over the last 20 years of Qt development, and 
the solution has always been the same and I am not convinced it's the correct 
way.

When there is a mouseMoveEvent in which the anchor at the mouse position is not 
empty, I override the cursor.

When the anchor at the point is empty, I restore the cursor

On mouseReleaseEvent I open the URL from the anchor.

All works great (yes I know QTextBrowser should be able to be used, but there 
are some issues with that, and its not the issue)

The problem is, when the mouse leaves the widget there isn't a 
"mouseLeaveEvent" so if the mouse is able to leave with the cursor overridden, 
it stays overridden.

The workaround, I added a eventFilter on the parent widget.  If the parent 
widget receives any event and the globalPos of the cursor (using QCursor::pos() 
) is outside the widget its restores the cursor.  It works, however it seems a 
bit hackish

What is the "proper" methodology for tracking when a mouse leaves the widget? 
Ive tried various methods through the years, and this is the way that I find 
works

Full source for the widget can be found here
https://github.com/towel42-com/SABUtils/blob/trunk/HyperLinkLineEdit.cpp
https://github.com/towel42-com/SABUtils/blob/trunk/HyperLinkLineEdit.h

Thanks.

Scott



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


Re: [Interest] Official linuxdeployqt ?

2022-08-08 Thread Scott Bloom


From: Benjamin TERRIER 
Sent: Monday, August 8, 2022 9:20 AM
To: Qt Interest 
Cc: Scott Bloom 
Subject: Re: [Interest] Official linuxdeployqt ?



On Mon, 8 Aug 2022 at 18:10, Scott Bloom 
mailto:sc...@towel42.com>> wrote:


On Mon, 8 Aug 2022 at 08:10, Jörg Bornemann 
mailto:joerg.bornem...@qt.io>> wrote:
On 8/4/22 19:42, Scott Bloom wrote:

> Is there a Qt supported linuxdeployqt comparable to the windeployqt?
>
> I found the 3^rd party version, but the command line args are very
> different.

Mitch already pointed you to QTBUG-74940.  The biggest question
regarding a linuxdeployqt is: what exactly is the deployment format
going to be?  There's no standard way of deploying Linux applications.
There are many.

The community contributions create AppImage packages.  That seems to be
a reasonable choice.  Other opinions?

It seems to me that how a Qt app is actually packaged/deployed is out-of-scope 
of a linuxdeployqt tool.

It seems macdeployqt actually build bundles, but windeployqt just copy files 
next to the .exe file.
IMHO a linuxdeployqt should just copy files, like windeployqt. Given the number 
of way to package apps under Linux, the actual packaging should be left to 
other tools.

BR

Benjamin

Honestly, I would prefer a different option all together.

I would like to be able to give the tool a shared library or an executable, and 
it returns a JSON stream of data.

Where the data would include any runtime dependencies + any other Qt 
dynamically bound package files with their appropriate directories.

Then the user (or cmake function) could read in the data, and copy or build the 
bundle as necessary.

Having the option to “list” the data vs “copy and build” the bundle/application 
directory would give a very powerful resultant tool

As to “how to package” linux, honestly I would assume it would just copy the 
files into the correct location relative to the executable/shared library sent 
in.

Scott

windeployqt does have --list and --json options
I never used them, but they should be able to provide exactly what you 
described.

Benjamin
I use them exclusively with my CMake integration, my point is I don’t need (and 
don’t see the need) for more than the list/json results.

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


Re: [Interest] Official linuxdeployqt ?

2022-08-08 Thread Scott Bloom


On Mon, 8 Aug 2022 at 08:10, Jörg Bornemann 
mailto:joerg.bornem...@qt.io>> wrote:
On 8/4/22 19:42, Scott Bloom wrote:

> Is there a Qt supported linuxdeployqt comparable to the windeployqt?
>
> I found the 3^rd party version, but the command line args are very
> different.

Mitch already pointed you to QTBUG-74940.  The biggest question
regarding a linuxdeployqt is: what exactly is the deployment format
going to be?  There's no standard way of deploying Linux applications.
There are many.

The community contributions create AppImage packages.  That seems to be
a reasonable choice.  Other opinions?

It seems to me that how a Qt app is actually packaged/deployed is out-of-scope 
of a linuxdeployqt tool.

It seems macdeployqt actually build bundles, but windeployqt just copy files 
next to the .exe file.
IMHO a linuxdeployqt should just copy files, like windeployqt. Given the number 
of way to package apps under Linux, the actual packaging should be left to 
other tools.

BR

Benjamin

Honestly, I would prefer a different option all together.

I would like to be able to give the tool a shared library or an executable, and 
it returns a JSON stream of data.

Where the data would include any runtime dependencies + any other Qt 
dynamically bound package files with their appropriate directories.

Then the user (or cmake function) could read in the data, and copy or build the 
bundle as necessary.

Having the option to “list” the data vs “copy and build” the bundle/application 
directory would give a very powerful resultant tool

As to “how to package” linux, honestly I would assume it would just copy the 
files into the correct location relative to the executable/shared library sent 
in.

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


Re: [Interest] Official linuxdeployqt ?

2022-08-05 Thread Scott Bloom
Unfortunately both of these solutions (runtime dependencies and static build) 
only solve the staticly bound dynamically loaded DLLs

The runtime wont solve plugins, and the deployment tools for windows a not only 
does the runtime dlls, it also does translations, and other dynamically bound 
dlls

Scott

From: Cristian Adam 
Sent: Friday, August 5, 2022 1:46 AM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: Official linuxdeployqt ?

Hi,

CMake has since version 3.16 an extension for its file command, namely 
GET_RUNTIME_DEPENDENCIES<https://cmake.org/cmake/help/latest/command/file.html?#get-runtime-dependencies>.

I used it for Qt Creator to deploy all dependencies on Windows, Linux, macOS 
from CMake.
As it turns out Qt Creator already had python script for deployment, and the 
CMake only solution got sacked at
https://codereview.qt-project.org/c/qt-creator/qt-creator/+/322646

It took part of MSVC, or MinGW (both GCC and LLVM flavors) C++ runtime DLLs, 
but that's more on the Windows side.

Alternatively, you can do a static build and forget about deployment issues 🙂

Cheers,
Cristian.


From: Interest 
mailto:interest-boun...@qt-project.org>> on 
behalf of Scott Bloom mailto:sc...@towel42.com>>
Sent: Thursday, August 4, 2022 7:42 PM
To: interest@qt-project.org<mailto:interest@qt-project.org> 
mailto:interest@qt-project.org>>
Subject: [Interest] Official linuxdeployqt ?


Is there a Qt supported linuxdeployqt comparable to the windeployqt?

I found the 3rd party version, but the command line args are very different.



Also, is anyone on the Qt side, create a CMake function for this?



Where inside CMake, you could call “DeployQt(  )” and it would find all 
the dependencies and create a list of files in cmake etc



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


Re: [Interest] Official linuxdeployqt ?

2022-08-04 Thread Scott Bloom
I already have a cmake fuction I use for Qt deployment for windows and mac, but 
without the linux deploy application, I have nothing for linux

Scott

-Original Message-
From: Samuel Gaist  
Sent: Thursday, August 4, 2022 12:05 PM
To: Scott Bloom 
Cc: interest@qt-project.org
Subject: Re: [Interest] Official linuxdeployqt ?


> On 4 Aug 2022, at 19:42, Scott Bloom  wrote:
> 
> Is there a Qt supported linuxdeployqt comparable to the windeployqt?
> 
> I found the 3rd party version, but the command line args are very different.
> 
> Also, is anyone on the Qt side, create a CMake function for this?
> 
> Where inside CMake, you could call “DeployQt(  )” and it would find 
> all the dependencies and create a list of files in cmake etc
> 
> Scott
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

Hi Scott,

I can’t answer for the former but for the latter I had some WIP for macdeployqt 
that you can find here:

https://codereview.qt-project.org/c/qt/qttools/+/182317

I should revisit that but in the mean time it might already help.

Cheers

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


[Interest] Official linuxdeployqt ?

2022-08-04 Thread Scott Bloom
Is there a Qt supported linuxdeployqt comparable to the windeployqt?

I found the 3rd party version, but the command line args are very different.

Also, is anyone on the Qt side, create a CMake function for this?

Where inside CMake, you could call "DeployQt(  )" and it would find all 
the dependencies and create a list of files in cmake etc

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


Re: [Interest] Anyway to tell if a QModelIndex's data will be displayed with an elide?

2022-06-03 Thread Scott Bloom
That’s kind of what I figured out .

What I wound up doing, was setting elide mode to none on the view, then doing a 
resize of each column to fit, then resizing the dialog so the treeview is the 
correct size, then setting textmode back to elide right.

This way, if the customer resizes, it will still elide, but it comes up without.

Scott

-Original Message-
From: Volker Hilsheimer  
Sent: Friday, June 3, 2022 5:12 AM
To: Scott Bloom 
Cc: interest@qt-project.org
Subject: Re: [Interest] Anyway to tell if a QModelIndex's data will be 
displayed with an elide?



> On 2 Jun 2022, at 19:31, Scott Bloom  wrote:
> 
> I have a request, to open a dialog without out any eliding, which is easy 
> enough to do via the views textElideMode.
>  
> So I can resize all the columns to fit, pretty straight forward, if I don’t 
> set the textElideMode
>  
> However, they also want no the data to be full visible, and not have to 
> resize the dialog/scroll. 
>  
> However, I cant seem to find a proper “this is the size the treeview (though 
> the same issue exists for any abstractview) minimum size hnt that wont 
> require scrollbars.
>  
> Am I missing something obvious? (I must be)
> 
> Scott


There is no need for QTreeView to calculate a sizeHint for the entire tree, 
because, well, it is a scrollview :) And calculating a sizeHint would also mean 
that the view has to update layouts when data that influences the sizeHint 
changes, and that would be quite expensive (the view does have to do at least 
some of that anyway to adjust the scrollbars, but since scrolling is “per row” 
rather than “per pixel”, we can optimize that a lot; see 
QTreeViewPrivate::updateScrollBars()).

I think the best you can do is to get the visualRect of the last index, and 
then calculate the view’s sizeHint based on that. That means that the tree has 
to be fully expanded.


Volker

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


[Interest] Anyway to tell if a QModelIndex's data will be displayed with an elide?

2022-06-02 Thread Scott Bloom
I have a request, to open a dialog without out any eliding, which is easy 
enough to do via the views textElideMode.

So I can resize all the columns to fit, pretty straight forward, if I don't set 
the textElideMode

However, they also want no the data to be full visible, and not have to resize 
the dialog/scroll.

However, I cant seem to find a proper "this is the size the treeview (though 
the same issue exists for any abstractview) minimum size hnt that wont require 
scrollbars.

Am I missing something obvious? (I must be)

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


[Interest] Adding external style to Qt Designer

2022-05-26 Thread Scott Bloom
We have a custom Style shared plugin, however, I cant figure out how to have Qt 
Designer pick it up.

Im currently on windows, but the custom style's shared library also is 
available on linux.

I see the "Preview in" Windows vista, windows, or fusion.  I would like to see 
the "Scott's Style"  in that list.

Is there an environmental variable? Path setting? There doesn't appear to be 
anything in the preferences dialogs.

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


Re: [Interest] QColumnView and QTreeView using same model

2022-05-03 Thread Scott Bloom
I have found when I use a custom model, most issues using views, are tied to an 
issue of some corner case condition in the model not being handled correctly.



~~Scott



 Original message 
From: Michael Jackson 
Date: 5/3/22 3:05 PM (GMT-08:00)
To: Scott Bloom , Qt Interest List 
Subject: Re: QColumnView and QTreeView using same model

No idea that existed. Now just trying to figure out how to translate qmake 
instructions to modern CMake instructions to be able to link against it.

--
Mike Jackson

On 5/3/22, 4:41 PM, "Scott Bloom" mailto:sc...@towel42.com>> 
wrote:

Have you run the modeltest on it?

Scott

From: Interest  On Behalf Of Michael Jackson
Sent: Tuesday, May 3, 2022 12:57 PM
To: Qt Interest List 
Subject: [Interest] QColumnView and QTreeView using same model

I have a custom QAbstractItemModel implementation that works correctly when 
using a QTreeView, i.e., I can open the complete hierarchy of the tree without 
any issues. I switched up to the QColumnView due to size constraints and now 
using the same exact instance of the model I can only navigate into the first 
item that has children. Other items at the root level that have children are 
shown with the little graphic arrow as having children but none of the children 
are actually listed in the next column over. I even put both the QTreeView and 
the QColumnView into my Widget at the same time with the same instance of the 
model and the QTreeView does not have any problems displaying the various 
levels.

Has anyone else seen something like this? I took at look at the Qt bug database 
and nothing really stuck out. I tried a QFileSystemModel for giggles and that 
worked as expected. So clearly I’ve got something sort of messed up in my 
custom model that allows the treeview to work but not the columnview. Odd.
--
Mike Jackson
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QColumnView and QTreeView using same model

2022-05-03 Thread Scott Bloom
Have you run the modeltest on it?

Scott

From: Interest  On Behalf Of Michael Jackson
Sent: Tuesday, May 3, 2022 12:57 PM
To: Qt Interest List 
Subject: [Interest] QColumnView and QTreeView using same model

I have a custom QAbstractItemModel implementation that works correctly when 
using a QTreeView, i.e., I can open the complete hierarchy of the tree without 
any issues. I switched up to the QColumnView due to size constraints and now 
using the same exact instance of the model I can only navigate into the first 
item that has children. Other items at the root level that have children are 
shown with the little graphic arrow as having children but none of the children 
are actually listed in the next column over. I even put both the QTreeView and 
the QColumnView into my Widget at the same time with the same instance of the 
model and the QTreeView does not have any problems displaying the various 
levels.

Has anyone else seen something like this? I took at look at the Qt bug database 
and nothing really stuck out. I tried a QFileSystemModel for giggles and that 
worked as expected. So clearly I’ve got something sort of messed up in my 
custom model that allows the treeview to work but not the columnview. Odd.
--
Mike Jackson
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Windows: "loadlibrary failed with error 87" on a configuration with a fake video card?

2022-03-18 Thread Scott Bloom
If there is an error in LoadLibrary, qt will get the error message from the 
windows system, and then print it out.



-Original Message-
From: Interest  On Behalf Of Alexander Dyagilev
Sent: Thursday, March 17, 2022 9:20 PM
To: fro...@tungware.se; interest@qt-project.org
Subject: Re: [Interest] Windows: "loadlibrary failed with error 87" on a 
configuration with a fake video card?

Yes. But what I meant is that it has to be triggered by Qt somehow.

As a first attempt I asked the user to set QT_OPENGL env var to "software". 
This did not help. So it's probably not related to OpenGL.

Anyway, thanks to Thiago Macieira, I asked the user to send me the dump file. 
Let's see. :)


On 3/18/2022 6:52 AM, Henry Skoglund wrote:
> On 2022-03-18 04:41, Thiago Macieira wrote:
>> On Thursday, 17 March 2022 19:50:45 PDT Alexander Dyagilev wrote:
>>> This error message is shown by Windows OS when it's failed to load a
>>> library the process sayed it to load.
>>>
>>> I.e. Qt calls LoadLibrary (directly, or by loading some other modules
>>> which calls it to load another modules they depends on).
>>>
>>> Short googling tells that it's an graphics card driver related issue
>>> (e.g. https://github.com/spyder-ide/spyder/issues/10084).
>>>
>>> But, maybe there is some known work around for this...
>> If you can generate a backtrace from the application at the moment 
>> that dialog
>> is shown, it can help pinpoint what was being loaded and where from. 
>> There are
>> too many LoadLibrary in the source code to guess which one has incorrect
>> parameters.
>>
> Hi, note: it's not certain that the LoadLibrary error is from Qt, for 
> example a similar error:
> "Load Library failed with error 126: The specified module could not be 
> found." was found to be from within the bowels of Windows itself 
> (non-Qt apps also got this error).
> More here about error 126: 
> https://forum.qt.io/topic/132880/qt-creator-error-126-running-on-windows-10-via-rdp
>
> ___
> 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
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QStandardPaths on windows

2022-03-01 Thread Scott Bloom
On linux, you can overwrite most of the QStandardPaths using the XDG_ 
environment variables.

However, I don't see anyway to do the same for Windows.  Windows appears always 
goes to the systems SHGetKnownFolderPath.

In a similar manner to QSettings being able to set a specific directory, I 
would like to see the same in a OS independent manner.

QStandardPaths already has a "setTestMode" which helps, however, if you are 
running tests on a grid engine, each test having its own specific set of 
directories for the configuration files can be critical to prevent  multiple 
runs writing to the same directory.

My thoughts would be to add to QStandardPahths::setTestModeDirectory( ), so 
rather than simply adding "qttest" to the system

Is there anyway to do what I need today?

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


Re: [Interest] Individual developer license is too expensive

2022-02-22 Thread Scott Bloom
Why do you have to statically link?

Why not use the lgpl license and the dynamically bound libs?

Scott


-Original Message-
From: Interest  On Behalf Of Ben Cottrell
Sent: Tuesday, February 22, 2022 1:45 PM
To: interest@qt-project.org
Subject: [Interest] Individual developer license is too expensive

Hi,

I would like to use Qt libraries that are statically linked into my binaries, 
but the monthly license cost is too expensive, as I'm unemployed at the moment.

Is the license price negotiable for individual developers?

Thanks,
Ben Cottrell

___
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] QProcess when ^Z is called

2022-02-10 Thread Scott Bloom
Interesting, we are not seeing them go to sleep, simply by looking at the 
results we see them continue.

Ill take a look and create a sample, but it was a pretty straight forward 
qrocess->start() after setup type call.

Scott

-Original Message-
From: Thiago Macieira  
Sent: Thursday, February 10, 2022 5:58 PM
To: interest@qt-project.org
Cc: Scott Bloom 
Subject: Re: [Interest] QProcess when ^Z is called

On Thursday, 10 February 2022 16:41:48 PST Scott Bloom wrote:
> I have an issue, that if the customer hits Ctrl-Z after the executable 
> is running, but has spawned a subprocess via QProcess, when the system 
> is restarted (either in the background or foreground), the QProcess 
> finished signal is lost.
> 
> Im assuming the OS level signal of sleep/wake cant be monitored while 
> the application is a sleep.
> 
> Is there any known solution to this?

This goes into an area of process support I have yet to completely understand: 
controlling terminals, process groups and session leaders. Ctrl+Z indicates 
you're running from the shell, with job control active, which probably means 
your Qt process is the session leader. Ctrl+Z would have suspended all 
processes in the group. See:

$ (sleep 10s & read)
^Z
[1]  + 400272 suspended  ( sleep 10s & read; ) ... wait more than 10 seconds ...
$ ps ft$TTY
PID TTY  STAT   TIME COMMAND
  33201 pts/7Ss 0:02 /bin/zsh
 400272 pts/7T  0:00  \_ /bin/zsh
 400273 pts/7T  0:00  |   \_ sleep 10s
 400338 pts/7R+ 0:00  \_ ps ft/dev/pts/7

That means the child process can't exit with just what you described, because 
the child is stopped alongside everything else in that process group. There's 
something more to your problem that you need to describe.

In any case, a dead child should become a zombie until the parent process 
performs the wait() call on it. This is what happens if you continue the
child:

$ killall -CONT sleep
$ ps ft$TTY  
PID TTY  STAT   TIME COMMAND
  33201 pts/7Ss 0:02 /bin/zsh
 400394 pts/7T  0:00  \_ /bin/zsh
 400395 pts/7Z  0:00  |   \_ [sleep] 
 400412 pts/7R+ 0:00  \_ ps ft/dev/pts/7

The parent process will receive the SIGCHLD and QProcess will emit finished() 
when it resumes.

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



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


[Interest] QProcess when ^Z is called

2022-02-10 Thread Scott Bloom
I have an issue, that if the customer hits Ctrl-Z after the executable is 
running, but has spawned a subprocess via QProcess, when the system is 
restarted (either in the background or foreground), the QProcess finished 
signal is lost.

Im assuming the OS level signal of sleep/wake cant be monitored while the 
application is a sleep.

Is there any known solution to this?
Scott
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Scott Bloom
Depending on your QFuture setup, you could monitor each tile, and when it 
completes, update the min max...

Passing the manager to each tile, and when the tile is finished update the 
manager with the tiles value.  Then a simple mutex should allow you to not 
collide.  No signals, just a simple function call.

When the future watcher says all tiles are done, you will also have the min/max 
computed at that point, so you can kick off phase 2.

While I love the signal slot for "generic, I don’t know who needs this 
information" type design. Sometimes the cost/overhead of being a qobject and 
sending the signal, especially when it’s a very discrete "signal" and not 
generic in any means, it can be overkill.

To me, the manager you have doesn’t need to know "is a tile finished", ie a 
generic signal.  But rather what Is the min max of the tile when finished a 
specific signal.  For that level, a simple function works.

Scott

-Original Message-
From: Interest  On Behalf Of Murphy, Sean
Sent: Tuesday, February 1, 2022 9:32 AM
To: interest@qt-project.org
Subject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

> 😊  that definitely does.
> 
> Of course I wonder if you had removed that, but left in the 
> QObject etc etc, what would it have been.  Likely, not much worse than 15ms.

Yep, once I removed the random generator object, I had the same thought: 
"could I go back to QObject?!?!", but as you mention, I don't think there's any 
reason for me to do that, unless I can think of a reason that I need to provide 
some sort of signal down at a tile level beyond just completion progress (since 
QFutureWatcher can handle the progress part). 

The only potential signal that comes to mind is between the tile::load() and 
tile::remap() steps I do need to know the min/max raw data values to compute 
what the remap parameters are. Currently I have to wait for the 
loadFutureWatcher to report it is finished, then I take a pass through every 
tile to calculate the global min/max values, then I can kick off the remap 
process with those parameters in hand. If the tile was an QObject and it 
emitted a signal to relay that information back then the global min/max is 
getting updated as each tile completes its first step, which means as soon as 
the last tile finishes, I'm good to go with the remap step instead of taking 
that pass through all the tiles to determine the global min/max.

But I could also accomplish the same thing by modifying the loadTIle function 
that is passed to QtConcurrent to return a QPair instead of 
returning void like it currently is Does. Then I would connect the future 
watcher's resultReadyAt(int index) signal to a slot in my tile manager that 
accomplishes the same thing, without making my tile class inherit from QObject.

> 
> Why? IMO, Qt wouldn’t be what it is today, if simply allocating 60k 
> QObjects and connecting a signal to them too that long.
> 
> But I think the overall architecture of what you have now, is MUCH 
> better and will scale to a more complex "actually do the work" system 
> much better than the other.

I think I'm happy with it as a proof-of-concept design as I have it now - or at 
least once I replace the placeholder delays with the code that actually works 
on the data file. After that, I want to also implement the idea Konstantin 
suggested of just dividing the original image up into
QThread::idealThreadCount() blocks and then compare the results on actual data 
and see which performs better. I'm guessing it'll be the latter since on my 
idealThreadCount() == 8 system, there's probably way less overhead in creating 
8 things that do the work than 60,000+. 
Especially since the 60,000 items are still going to be funneled through 8 
threads anyways.

Sean
___
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] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Scott Bloom
😊  that definitely does.

Of course I wonder if you had removed that, but left in the QObject etc 
etc, what would it have been.  Likely, not much worse than 15ms.

Why? IMO, Qt wouldn’t be what it is today, if simply allocating 60k QObjects 
and connecting a signal to them too that long.

But I think the overall architecture of what you have now, is MUCH better and 
will scale to a more complex "actually do the work" system much better than the 
other.

Scott

-Original Message-
From: Interest  On Behalf Of Murphy, Sean
Sent: Tuesday, February 1, 2022 8:31 AM
To: interest@qt-project.org
Subject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

> Subject: RE: [Interest] [External]Re: How to get QtConcurrent to do 
> what I want?
> 
> Something seems off.
> 
> But without looking at the actual code that is allocation 60k tiles 
> and the constructor itself, it just seems like a very expensive 
> construction if the "new" + "moving a pointer" is taking 3ms each.

I finally figured that part out. 

Since this is just test code and doesn't do any real work yet, I was putting a 
delays in
tile::load() and tile::remap() just to simulate that those functions take time 
to execute. 
To create a little realism, I was randomizing the amount of that delay instead 
of using a fixed delay. To accomplish that, I mistakenly added a 
QRandomGenerator as a member variable of the tile class, instead of just 
calling QRandomGenerator::global()->bounded(min, max) in the tile::load() and 
tile::remap()functions. Each tile certainly doesn't need its own uniquely seed 
random number sequence...

I just made that switch - removed the QRandomGenerator member variable From the 
tile class, and calling QRandomGenerator::global()->bounded(min, max). Now 
creating  + assigning each tile plummeted from 18 seconds to 15 milliseconds.

That seems pretty acceptable to me...

Sean

___
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] [External]Re: How to get QtConcurrent to do what I want?

2022-02-01 Thread Scott Bloom
Something seems off.  

But without looking at the actual code that is allocation 60k tiles and the 
constructor itself, it just seems like a very expensive construction if the 
"new" + "moving a pointer" is taking 3ms each.

Scott

-Original Message-
From: Interest  On Behalf Of Murphy, Sean
Sent: Tuesday, February 1, 2022 7:32 AM
To: interest@qt-project.org
Subject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

> Not knowing if a partial value makes any sense to your system.
> Qt::Concurrent::mappedReduced might make more sense, if its purely a 
> speedup you are looking for, and not a "keep the GUI alive during it" 
> possibly blockingMappedReduced.

I don't think mappedReduced would help me until after the remapping step when I 
want to assemble the individual tiles into a QImage - although since the 
ultimate destination for the image is inside a QGraphicsView, I'm tempted to 
just leave it as individual tiles, but I'm not there yet as far as testing.

Regarding the keep GUI alive portion, my tileManager is already running in a 
separate thread from the UI thread, so I do have the option of making blocking 
calls in the tileManager class with the exception that I do need to fire 
progress signals out of tileManager back to MainWindow to provide progress to 
the user

> 
> If you need the gui, setting up a qfuturewatcher on the results of the 
> mapped call, would be my approach
> 
> QFutureWatcher< XXX > watcher;
> connect( &watcher, &finished, manager, &handleFinished);
> 
> auto future = QtConcurrent::mapReduced(tiles, processTile, 
> mergeFunction) watcher.setFuture( future );

I actually spent yesterday refactoring the tileManager class as you've just 
described, as well as changing out the tile class to no longer inherit from 
QObject. I've got a couple more things I want to try/clean up today but I still 
seem to be having trouble speeding up the allocation & assignment of the tiles 
themselves.

As my code currently stands, I now have to vectors, each of which will have 
60,000 items in them once they're populated:
  QVector mTileIndices;
  QList mTiles;

The mTileIndices vector is implementing Andrei's idea of quickly generating a 
list of unique tile indices, which can then be fed to a QtConcurrent::map() 
call to create & uniquely assign the tile items in parallel. The " mTiles " 
vector is obviously the tiles that will do the work.

As I build the vectors up, these are the timings I get:
  1. resizing tile index vector to 6 took 0.1514 ms
  a. This is just calling QVector::resize(6) on the ID. This takes 
less than a 
   millisecond, so no complaints here.
  2. allocated 6 indices in 0.0207 ms
  a. This is calling std::iota(mTileIndices.begin(), mTileIndices.end(), 
0). Also takes less than 
  a millisecond, still no complaints
  3. assigning 6 tiles took 18087.1 ms
  a. This timing is the result of QtConcurrent::mapped(mTiles, initTile) 
where the initTile 
  function takes in an integer from mTileIndices, and calls the tile 
constructor using the 
  combination of the tile index and tile size to do the assignment. The 
assigned tiles end 
  up in the mTiles
  b. This step takes 18 seconds, which seems excessive to me and I'd love 
to continue to 
   reduce that time.
  4. load finished in 37507.1 ms
  a. this is calling tile::load() on each tile. Right now that is just a 
dummy function that calls 
  msleep for a random amount milliseconds to simulate doing the actual 
work
  5. remapping 6 tiles took 48519.3 ms
  b. this is calling tile::remap() on each tile. Right now that is just a 
dummy function that 
  calls msleep for a random amount milliseconds to simulate doing the 
actual work

So the only step in this process that still bothers me is step 3 - creating and 
assigning each tile object takes 18 seconds. I log the total time by each tile 
spent in steps 4 & 5 and compare how long steps 4 & 5 actually take vs. the sum 
of how long each tile spent sleep and I routinely get a speedup factor of about 
7.5. QThread::idealThreadCount() reports 8 on my machine, so I think I'm 
getting what I should expect from those steps on this machine.

I'm not sure what else to try at this point. One thing I was thinking about 
measuring is that even though my tile class no longer inherits from QObject, it 
still is a class with a constructor and some getter functions. And when I look 
at the combination of steps 1 & 2 where I both resize a vector of integers AND 
assign each one a unique ID in less than a millisecond total, but then it takes 
me 18 seconds to create and assign each tile, I keep wondering if there isn't 
room for improvement there still?

And as I was typing this whole thing up, Konstantin gave me a different 
approach that I'll probably pursue, but I would like to better understand how 
to solve the question of "if you absolutely need to have

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-01-31 Thread Scott Bloom
Not knowing if a partial value makes any sense to your system.  
Qt::Concurrent::mappedReduced might make more sense, if its purely a speedup 
you are looking for, and not a "keep the GUI alive during it" possibly 
blockingMappedReduced.

If you need the gui, setting up a qfuturewatcher on the results of the mapped 
call, would be my approach

QFutureWatcher< XXX > watcher;
connect( &watcher, &finished, manager, &handleFinished);

auto future = QtConcurrent::mapReduced(tiles, processTile, mergeFunction)
watcher.setFuture( future );




-Original Message-
From: Scott Bloom 
Sent: Monday, January 31, 2022 12:35 PM
To: Murphy, Sean ; interest@qt-project.org
Subject: RE: [Interest] [External]Re: How to get QtConcurrent to do what I want?

Ahh that does fill in a bunch of holes 😊

I would definitely scrap using QSharedPointer as well as QObject, and instead 
monitoring of the QObject, montor the QFuture that is returned from your map 
call.

Scott

-Original Message-
From: Interest  On Behalf Of Murphy, Sean
Sent: Monday, January 31, 2022 9:13 AM
To: interest@qt-project.org
Subject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

Thanks for the reply, Scott. My responses below:

> Couple things I would try.
> 
> First, preallocate the size of the vector, or use a list if you don't 
> need random access into it.

I had attempted this before my original post. My sequence of attempts before I 
posted went like this:
  1. Started with QList>, and calling list.append() to 
populate. 
Noticed this was somewhat slow
  2. Switched to QVector>, still calling list.append() to 
see if that made 
any difference. It didn't.
  3. Realized that calling append() on a QVector could be slow as the vector 
keeps growing 
and is forced to reallocate, so I added a QVector::reserve() call 
beforehand to prevent that. 
Still made no appreciable difference

I neglected to add the reserve() call to the code I posted here, so that's on 
me for not painting the full picture - more on that below. From the attempts 
above it didn't seem like the type of container, nor how I build it up were the 
problem.

> Second, just send, pos, size into the tile.  Only save the values in 
> the constrctor. When the worker thread kicks off on a tile, then 
> initialize it and do any computation.  This includes the allocation of the 
> submatrix.

I think this is what I'm already doing, correct? My tile constructor only 
assigns those values and does nothing else (ACTUAL code below, not edited 
pseudocode like the previous email):
tile::tile(int id, QPoint pos, int size, QObject *parent) : QObject(parent),
mID(id),
mPos(pos),
mSize(size)
{
}

One thing to note here that I didn't include in my previous email, and as I 
keep investigating is starting to look like the real cause of slow 
allocation/assignment loop, my tile class inherits from QObject. My original 
thought was that I wanted to be able to use signals to monitor what's going on 
inside of the tile class, but I'm beginning to rethink whether I really need 
that at all, especially for the hassles that it causes: 
  1. Creating 60,000 QObjects in a single thread appears to be slow  
a. I've since tested creating a 60,000 item QVector AND looping 
through it assigning each
item the value 0-5, and using QElapsedTimer to measure that takes 
0.3 ms vs. 5 seconds or
so to execute my current loop
  2. Since QObject doesn't have a copy constructor, but QtConcurrent expects a 
container of type
T items not T* items, I chose to wrap my tile* within a QSharedPointer to 
get everything to work out. 
As you point out below, I may have chosen the wrong smart pointer type, 
since I'm not really 
sharing the pointer around, but my goal there was to satisfy what 
QtConcurrent expects of the 
container you pass in to the map() function

>
> Also, does it need to be a shared pointer?  Its clear who owns the 
> pointers, they aren't being "shared" as much as use.  For me, I only 
> use shared pointers, when multiple objects can "own" the pointer.  In this 
> case, the tile manager owns the tiles.

From this comment, I'm realizing that posting pseudocode/stripped down code 
previously was a mistake as it was only painting a partial picture. The actual 
loop is this:
// generate each tile with its assignment
for(int i=0; i < nTiles.height(); ++i)
{
for(int j=0; j < nTiles.width(); ++j)
{
int id = i * nTiles.width() + j;
QSharedPointer t(new tile(id,
   QPoint(j * tileSize, i * tileSize),
   tileSize, this));
connect(t.get(), &tile::loadingDone,
this, &tileManager::tileLoaded);
connect(t.

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-01-31 Thread Scott Bloom
Ahh that does fill in a bunch of holes 😊

I would definitely scrap using QSharedPointer as well as QObject, and instead 
monitoring of the QObject, montor the QFuture that is returned from your map 
call.

Scott

-Original Message-
From: Interest  On Behalf Of Murphy, Sean
Sent: Monday, January 31, 2022 9:13 AM
To: interest@qt-project.org
Subject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

Thanks for the reply, Scott. My responses below:

> Couple things I would try.
> 
> First, preallocate the size of the vector, or use a list if you don't 
> need random access into it.

I had attempted this before my original post. My sequence of attempts before I 
posted went like this:
  1. Started with QList>, and calling list.append() to 
populate. 
Noticed this was somewhat slow
  2. Switched to QVector>, still calling list.append() to 
see if that made 
any difference. It didn't.
  3. Realized that calling append() on a QVector could be slow as the vector 
keeps growing 
and is forced to reallocate, so I added a QVector::reserve() call 
beforehand to prevent that. 
Still made no appreciable difference

I neglected to add the reserve() call to the code I posted here, so that's on 
me for not painting the full picture - more on that below. From the attempts 
above it didn't seem like the type of container, nor how I build it up were the 
problem.

> Second, just send, pos, size into the tile.  Only save the values in 
> the constrctor. When the worker thread kicks off on a tile, then 
> initialize it and do any computation.  This includes the allocation of the 
> submatrix.

I think this is what I'm already doing, correct? My tile constructor only 
assigns those values and does nothing else (ACTUAL code below, not edited 
pseudocode like the previous email):
tile::tile(int id, QPoint pos, int size, QObject *parent) : QObject(parent),
mID(id),
mPos(pos),
mSize(size)
{
}

One thing to note here that I didn't include in my previous email, and as I 
keep investigating is starting to look like the real cause of slow 
allocation/assignment loop, my tile class inherits from QObject. My original 
thought was that I wanted to be able to use signals to monitor what's going on 
inside of the tile class, but I'm beginning to rethink whether I really need 
that at all, especially for the hassles that it causes: 
  1. Creating 60,000 QObjects in a single thread appears to be slow  
a. I've since tested creating a 60,000 item QVector AND looping 
through it assigning each
item the value 0-5, and using QElapsedTimer to measure that takes 
0.3 ms vs. 5 seconds or
so to execute my current loop
  2. Since QObject doesn't have a copy constructor, but QtConcurrent expects a 
container of type
T items not T* items, I chose to wrap my tile* within a QSharedPointer to 
get everything to work out. 
As you point out below, I may have chosen the wrong smart pointer type, 
since I'm not really 
sharing the pointer around, but my goal there was to satisfy what 
QtConcurrent expects of the 
container you pass in to the map() function

>
> Also, does it need to be a shared pointer?  Its clear who owns the 
> pointers, they aren't being "shared" as much as use.  For me, I only 
> use shared pointers, when multiple objects can "own" the pointer.  In this 
> case, the tile manager owns the tiles.

From this comment, I'm realizing that posting pseudocode/stripped down code 
previously was a mistake as it was only painting a partial picture. The actual 
loop is this:
// generate each tile with its assignment
for(int i=0; i < nTiles.height(); ++i)
{
for(int j=0; j < nTiles.width(); ++j)
{
int id = i * nTiles.width() + j;
QSharedPointer t(new tile(id,
   QPoint(j * tileSize, i * tileSize),
   tileSize, this));
connect(t.get(), &tile::loadingDone,
this, &tileManager::tileLoaded);
connect(t.get(), &tile::remappingDone,
this, &tileManager::tileRemapped);
mTiles.append(t);
}
}

So there you can see that the tileManager class owns the shared pointer to each 
tile, and I also connect up a couple signals which are used to convey status 
back to the tileManager which in turn emits status signals back up to my UI 
class so it can show progress bars to the user that something is actually 
happening since this is a lengthy operation.

>
> Mainly, do as much as possible to reduce the time in the nested loop.

I'm not sure there's anything else I can do to reduce the time in the loop, 
beyond changing the tile 
class to no longer inherit from QObject, and just have it be a pure data class, 
but I'm open to any 
suggestions.

I probably should have mentioned in an earlier email that this is my first 
attempt at using 
QtConcurrent (if that wasn't obvious already), so I'm 

Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

2022-01-30 Thread Scott Bloom
Couple things I would try.

First, preallocate the size of the vector, or use a list if you don't need 
random access into it.

Second, just send, pos, size into the tile.  Only save the values in the 
constrctor. When the worker thread kicks off on a tile, then initialize it and 
do any computation.  This includes the allocation of the submatrix.

Also, does it need to be a shared pointer?  Its clear who owns the pointers, 
they aren't being "shared" as much as use.  For me, I only use shared pointers, 
when multiple objects can "own" the pointer.  In this case, the tile manager 
owns the tiles.

Mainly, do as much as possible to reduce the time in the nested loop.

Scott

From: Interest  On Behalf Of Murphy, Sean
Sent: Sunday, January 30, 2022 4:59 PM
To: Tony Rietwyk ; interest@qt-project.org
Subject: Re: [Interest] [External]Re: How to get QtConcurrent to do what I want?

Thanks for the response, but I'm not following your suggestion - or at least 
I'm not seeing how it's different than what I'm doing? Maybe a little 
pseudocode will help. Here's what I'm currently doing:

Tile class:
private:
  QPoint mPos;

  int mSize;

tile::tile(QPoint pos, int size) :

mPos(pos),

mSize(size)

{

  // assigns this tile an mSize x mSize square

  // from the original image starting at mPos

  // pixel location in the original image

}

void tile::process()

{

  // does the work on the assigned subset

}

TileManager:
private:
  QVector> mTiles;

processTile(QSharedPointer& t)
{
  t->process();
}

tileManager::setup(QSize tileGrid, int tileSize)
{
  // generate each tile with its assignment

  for(int i=0; i < tileGrid.height(); ++i)

  {

for(int j=0; j < tileGrid.width(); ++j)

{

  // create the new tile while assign its

  // region of the original image

  QSharedPointer t(new tile(

   QPoint(j * tileSize, i * tileSize),

   tileSize));

  mTiles.append(t);

}

  }

  QtConcurrent::map(mTiles, processTile);
}

So I think I'm already doing what you're saying? Where I'm paying the penalty 
is that the allocation of each tile is happening in one thread and I'd like to 
see if I can thread out the object creation. But I don't see how to 
simultaneously thread out the tile objection creation AND correctly assign the 
tile its location since as far as I can tell, when QtConcurrent executes 
tileManager's processTile function in parallel there's nothing I can poll 
inside tileManager::processTile() that allows me to know WHICH step I'm at.

Or am I misunderstanding what you're saying?

The best thing I can come up with is that maybe I could change the type of my 
mTiles vector to be a QVector> but then I'd still need to loop through 
nested for-loop to populate all the QPoint items in the vector I want to pass 
to QtConcurrent::map(). I have tried that yet to see if generating thousands of 
QPoint objects is faster than generating the same number of tiles, but I can 
test that out.

Sean

From: Interest 
mailto:interest-boun...@qt-project.org>> on 
behalf of Tony Rietwyk mailto:t...@rightsoft.com.au>>
Sent: Sunday, January 30, 2022 7:19 PM
To: interest@qt-project.org 
mailto:interest@qt-project.org>>
Subject: [External]Re: [Interest] How to get QtConcurrent to do what I want?

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Hi Sean,



Can you use the position of the tile as a unique key?  Then the manager only 
needs to calculate each tile's position in the original image.  Each tile 
extracts the bits, processes and notifies the result with its position.



Regards, Tony




On 31/01/2022 10:06 am, Murphy, Sean wrote:
I'm hitting a design issue with the way I'm using the QtConcurrent module to do 
some image processing, and I'm wondering if someone can give some pointers?

At a high level, the software needs to do some processing on every pixel of an 
image. The processing can mostly be done in parallel, so I've created the 
following:

  1.  Tile class - responsible for doing the processing on a small subset of 
the original image

 *   Has a constructor that takes a Position and Size. From those 
parameters, the Tile knows what subset of the original image it is going to 
process
 *   Has a process() function which will do the work on those assigned 
pixels

  1.  TileManager class - responsible for managing the Tile objects

 *   Contains a for-loop that creates each Tile object, assigns it a unique 
Position, and adds it to the QVector vector
 *   Has a processTile(Tile& t) function which calls t.process() to tell a 
given Tile to begin its work
 *   Calls QtConcurrent::map(tiles, processTile) to process each tile
So far this works well, but as I was timing different parts of the codebase, I 
discovered that a large portion of the time is s

Re: [Interest] Qthread from QFuture?

2022-01-05 Thread Scott Bloom
Thanks for the info



~~Scott



 Original message 
From: Thiago Macieira 
Date: 1/5/22 4:31 AM (GMT-08:00)
To: interest@qt-project.org
Cc: Scott Bloom 
Subject: Re: [Interest] Qthread from QFuture?

On Tuesday, 4 January 2022 22:01:20 -03 Scott Bloom wrote:
> I appreciate the information.  However, I don’t understand why a QFuture
> created by QtConcurrent::run, if it can tell isRunning, why it cant return
> the QThread its using?

Because you don't have a use-case for using that pointer. What are you going
to do with it, since you don't own that thread? First of all, it's also a race
condition: the pointer may no longer be valid by the next instruction that you
run.

It belongs to the thread pool you started the job on, and the thread pool may
have more jobs to run. Obviously, the code that started that thread and is
running jobs expects the job to cleanly exit (via exceptions or return, but
still cleanly) so it can do its post-job maintenance on the thread and the job
count. If you killed the thread, that thing will go completely out of sync and
may crash or deadlock even harder.

> Unless there is simply no QThread, and its using all OS calls (which could
> make sense).

No, it's using QThread.

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



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


Re: [Interest] Qthread from QFuture?

2022-01-04 Thread Scott Bloom
I appreciate the information.  However, I don’t understand why a QFuture 
created by QtConcurrent::run, if it can tell isRunning, why it cant return the 
QThread its using?

Unless there is simply no QThread, and its using all OS calls (which could make 
sense).

::exit( 0 ) would be too abrupt, but possible.  No need for that.  Honestly, 
its mostly when running in the debugger and it "hangs" on exit.

Other questions answered inline below

-Original Message-
From: Thiago Macieira  
Sent: Tuesday, January 4, 2022 4:28 PM
To: interest@qt-project.org
Cc: Scott Bloom 
Subject: Re: [Interest] Qthread from QFuture?

On Tuesday, 4 January 2022 16:07:05 -03 Scott Bloom wrote:
> Is there anyway to get (if it even exists) a QThread from a 
> QFuture/QFutureWatcher?

You can't get it because a thread will not have been assigned until the job 
starts. The thread that ends up running your job may be any of the threads in 
the pool.

And this is assuming we were talking about QtConcurrent::run. If you meant an 
operation on a container, you will have more than one thread assigned to the 
job.

 
> The main issue, and I know this going to sound horrible, I would like to
> kill/terminate the thread, I know its safe 😊 (famous last words)..

Yeah. So do everyone a favour and refactor. This is not a valid use-case, for 
multiple reasons. If you REALLY need to do it, here's the call I recommend you 
do to stop that job:

::exit(0);

I'm not kidding. This is also the hint to solving your problem.
 
> Here is what im doing, maybe someone has a better solution (Im sure of it).
> 
> I have a Qlineedit entry that takes a path.  Often, this path is network
> based, and very often over VPN, meaning its NOT always connected.

Do you mean NFS? Or Windows SMB? Or do you mean a FUSE-based network mount on 
Unix?

=
From windows, SMB
From Linux, Ive seen it with NFS connections as well as SMB
===
 
> On the text changing, the window determines if the path is valid
> (QFileInfo::exists, isDir, isExecutable for directories, some are files). 
> Unfortunately, if the VPN is not connected, it can take up to 30 seconds
> for the OS to return “no it doesn’t exist”.  (Windows is the primary OS,
> but I have seen the same on Linux)
 
> There is no way to interrupt the single class to the OS, its frozen in the
> thread (better than also freezing the GUI).  But If I could ask the
> watcher, give me your QThread and let me terminate it, it would fix the
> issue.
 
On WIndows, exit() first kills all threads aside from the one that called 
exit() so you don't have to wait. In fact, you MUSTN'T wait, otherwise you'll 
deadlock. You must intentionally leak any resources that depend on threads.

Stop using QtConcurrent for this. If you must kill a thread, use QThread 
itself or, better yet, the low-level API for your OS. Or use QProcess.
===
Its such a nice simple interface for launching a background thread and 
asynchronously being notified when it finishes 😊
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



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


[Interest] Qthread from QFuture?

2022-01-04 Thread Scott Bloom
Is there anyway to get (if it even exists) a QThread from a 
QFuture/QFutureWatcher?

The main issue, and I know this going to sound horrible, I would like to 
kill/terminate the thread, I know its safe 😊 (famous last words)..

Here is what im doing, maybe someone has a better solution (Im sure of it).

I have a Qlineedit entry that takes a path.  Often, this path is network based, 
and very often over VPN, meaning its NOT always connected.

On the text changing, the window determines if the path is valid 
(QFileInfo::exists, isDir, isExecutable for directories, some are files).  
Unfortunately, if the VPN is not connected, it can take up to 30 seconds for 
the OS to return “no it doesn’t exist”.  (Windows is the primary OS, but I have 
seen the same on Linux)

I have created a “Delayed Line Edit” class, that derives from QLineEdit, that 
delays the “the text is edited” by a set amount of time, to minimize the check 
(ie when typing the path by hand).

However, at some point this 30 second delay hits, freezes the gui and is an 
overall miserable experience.

What I have done, is created a simple Object “Background File Check” that has 
all the File Info queries.  You set the path, set what you want checked, and 
call “checkPath”.  This calls QtConcurrent::run on the checkPath internal 
function.  There is a QResultWatcher, that emits the check has finished or 
timed out (with a single shot timer called when checkPath is set).

99% of the time time, if its not there in 5 seconds, its dead.  So a 5000 ms 
timer is used.  This works great.  Except there is one problem.

If the user tries to exit the tool before all the threads have finished, the 
tool waits for them to close.

There is no way to interrupt the single class to the OS, its frozen in the 
thread (better than also freezing the GUI).  But If I could ask the watcher, 
give me your QThread and let me terminate it, it would fix the issue.

Any ideas?

Scott


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


Re: [Interest] QImageIOWriter for multi-framed images

2022-01-03 Thread Scott Bloom
I have everything working, for Qt5 writing out static GIF.  I can also write 
out a multi-framed gif, with varying delays outside the QImage system.

The only issue, is QImageIOWriter simply doesn't have support for multi-framed 
gif files like QImageIOReader does.

Ive looked into the code, and following the same architecture (using the same 
variables/attributes) and simply having 1 QImage written after another works, 
the only issue is for GIF (and others) you also have to have a reference to the 
previous frame.  Reading doesn't require this

Scott

From: Mitch Curtis 
Sent: Monday, January 3, 2022 3:43 AM
To: Scott Bloom ; interest@qt-project.org
Subject: RE: QImageIOWriter for multi-framed images

For what it's worth, there is a task in Jira for being able to write GIFs:

https://bugreports.qt.io/browse/QTBUG-64889

From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Scott Bloom
Sent: Monday, 20 December 2021 9:20 PM
To: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: [Interest] QImageIOWriter for multi-framed images

QImageIOReader supports multi-framed images for QMovie.

However, there doesn't seem to be any support in the writer for supporting such 
images. I checked 5.15.7 and the docs in Qt6 as well.

Is there a plan for this in the works in the future?

Most of the read relies on the IO Handler supporting it.  But for the writer, 
the handler only gets the single frame QImage itself, not the multiple frames.

Am I missing something?  I don't get access to the original/source multi-framed 
IO handler, so Im not sure how to add this functionality as a plugin at all.

For some context, there is a format call BIF, which comes from ROKU (streaming 
video etc) which represents frames from a video stream at various points.  
Players use this format as a compressed version of the movie so when you use 
the mouse over various points on the players timeline, it can show the "frame". 
 Typically its once every 10 seconds, between scaling of the image and this 
allows a 2 hour movie that's 10gigs in 2160p h265 encoding, to be represented 
in 6megs of data or so.

I already have created the QImageIOReader for BIF so I can view the file using 
QMovie.  Pretty straightforward.

However, I would like to be able to load a multi frame GIF and save it as  BIF 
and vice versa.  I already have the Multi-Frame GIF writer done as a stand 
alone class.  So I can feed it multiple QImage's with a delay and it writes out 
a functional gif movie.  However, I would like to make this a IO Plugin writer 
for GIF writing only.

Any ideas?

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


[Interest] QImageIOWriter for multi-framed images

2021-12-20 Thread Scott Bloom
QImageIOReader supports multi-framed images for QMovie.

However, there doesn't seem to be any support in the writer for supporting such 
images. I checked 5.15.7 and the docs in Qt6 as well.

Is there a plan for this in the works in the future?

Most of the read relies on the IO Handler supporting it.  But for the writer, 
the handler only gets the single frame QImage itself, not the multiple frames.

Am I missing something?  I don't get access to the original/source multi-framed 
IO handler, so Im not sure how to add this functionality as a plugin at all.

For some context, there is a format call BIF, which comes from ROKU (streaming 
video etc) which represents frames from a video stream at various points.  
Players use this format as a compressed version of the movie so when you use 
the mouse over various points on the players timeline, it can show the "frame". 
 Typically its once every 10 seconds, between scaling of the image and this 
allows a 2 hour movie that's 10gigs in 2160p h265 encoding, to be represented 
in 6megs of data or so.

I already have created the QImageIOReader for BIF so I can view the file using 
QMovie.  Pretty straightforward.

However, I would like to be able to load a multi frame GIF and save it as  BIF 
and vice versa.  I already have the Multi-Frame GIF writer done as a stand 
alone class.  So I can feed it multiple QImage's with a delay and it writes out 
a functional gif movie.  However, I would like to make this a IO Plugin writer 
for GIF writing only.

Any ideas?

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


[Interest] HighDPI/Scaling windows 10

2021-11-24 Thread Scott Bloom
99% of the time, Im working on a large high resolution high dpi monitor. Where 
the physical size me to run at a 100% scaling factor.

However, when working on the laptop screen itself, Qt 5.15.6 apps look like 
garbage

Here are some example pics.  Everything but the window icons are straight Qt, 
no PNGs from me.  Both windows use layouts, nothing sets a font size 
explicitly.  The header for the listview is correct, as well as title bar text, 
the checkbox and radio buttons are fine.  But the text is way too small,

There must be something Im missing.  Also note, while you cant see it here.  
The image attached when viewed at 100% in an app (any paint program) shows as 
almost 2x the size as the actual dialogs on my computer.

Thanks
Scott
[cid:image002.png@01D7E13F.90265720]
[cid:image001.png@01D7E13E.E7D1D770]
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QFileDevice::fileTime and QFileDevice::setFielTime

2021-11-11 Thread Scott Bloom
Great,

Ill file a JIRA later today, and can provide my current implementation.

Scott

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Wednesday, November 10, 2021 8:32 PM
To: interest@qt-project.org
Subject: Re: [Interest] QFileDevice::fileTime and QFileDevice::setFielTime

On Wednesday, 10 November 2021 17:17:50 PST Scott Bloom wrote:
> I have a non qfile based solution working. The problem i see, is the 
> qt file device is too file centric for this bit of functionality.  IMO 
> it should be in qfileinfo, or on qdir as well as qfile

We can add it to QDir.

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



___
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] QFileDevice::fileTime and QFileDevice::setFielTime

2021-11-10 Thread Scott Bloom
I have a non qfile based solution working. The problem i see, is the qt file 
device is too file centric for this bit of functionality.  IMO it should be in 
qfileinfo, or on qdir as well as qfile



~~Scott


 Original message 
From: Thiago Macieira 
Date: 11/10/21 5:06 PM (GMT-08:00)
To: interest@qt-project.org
Cc: Scott Bloom 
Subject: Re: [Interest] QFileDevice::fileTime and QFileDevice::setFielTime

On Wednesday, 10 November 2021 14:33:05 PST Scott Bloom wrote:
> Is there anyway (besides fixing QFSFileEngine::setFileTime) to support
> setting the time stamp on a directory?

That won't work either. Both QFSFileEngine and QFileSystemEngine operate on an
open file handle.

You may be able to trick Qt by opening the directory with _wopen and giving
QFile that handle. You can't read or write but it might work.

I'm assuming you only care about Windows. You can't set the file's birth time
on Linux: the only way to do that is to delete the file and create another.

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



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


[Interest] QFileDevice::fileTime and QFileDevice::setFielTime

2021-11-10 Thread Scott Bloom
While QFileDevice::fileTime works on files and directories, however it doesn't 
appear it is possible to use setFileTime on a directory.

For a given paths the following works great for two files

QFile file1( path1 );
auto dt = file1.fileTime( QFileDevice::FileBirthTime );

QFile file2( path2 );
File2.open( QFile::ReadWrite | QFile::ExistingOnly );
File2.setFileTime( path2, QFileDevice::FileBirthTime );

However, when path 2 is a directory, the open fails (it's a directory after 
all) and setFileTime only works on open files.

Is there anyway (besides fixing QFSFileEngine::setFileTime) to support setting 
the time stamp on a directory?

Scott


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


Re: [Interest] win: can't trap WM_ENTER/EXITMENULOOP?

2021-10-25 Thread Scott Bloom
Ok.. here is what I came up with 😊

https://github.com/scottaronbloom/SABUtils/blob/master/MenuBarEx.cpp
and 
https://github.com/scottaronbloom/SABUtils/blob/master/MenuBarEx.h

Simply promote your menuBar in QtDesigner to CMenuBarEx or instantiate it 
rather than QMenuBa if you create the mainwindow by hand.

Then connect to the two new signals in CMenuBarEx and you are good to go.

Let me know if you have any questions.. To be fair, its not fully vetted. But 
it works for me 😊

Scott

-Original Message-
From: Interest  On Behalf Of David M. Cotter
Sent: Monday, October 25, 2021 3:15 PM
To: Qt Interest 
Subject: Re: [Interest] win: can't trap WM_ENTER/EXITMENULOOP?

> Ill poke around, Its definitely doable
cool, thanks!

-dave

___
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] win: can't trap WM_ENTER/EXITMENULOOP?

2021-10-25 Thread Scott Bloom
Ill poke around, Its definitely doable, but I don’t know any "trivial" about to 
engage, or disengage with the menubar.  Since its always visible and doesn’t 
close, that’s clearly not what you want.

Can I ask, what is the goal? As in, what do you do when its activated? What 
about when its disengaged?

Scott

-Original Message-
From: Interest  On Behalf Of David M. Cotter
Sent: Monday, October 25, 2021 2:31 PM
To: Qt Interest 
Subject: Re: [Interest] win: can't trap WM_ENTER/EXITMENULOOP?

> Ok..  So you want to know when the user "engages" the menubar and sometime 
> later when the user "disengages" it.  Engagement can come from the keyboard 
> alt key, or  the alt-XXX shortcut for an individual menu.  As well as menu 
> hovering or clicking into any of the menu items.  
> 
> Is this correct of what you need?  Just like you don’t care about any 
> individual action, you don’t care which menu is activated or any menu right? 
> Just that the menu bar has become activated right?

perfectly correct

___
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] win: can't trap WM_ENTER/EXITMENULOOP?

2021-10-25 Thread Scott Bloom
Ok..  So you want to know when the user "engages" the menubar and sometime 
later when the user "disengages" it.  Engagement can come from the keyboard alt 
key, or  the alt-XXX shortcut for an individual menu.  As well as menu hovering 
or clicking into any of the menu items.  

Is this correct of what you need?  Just like you don’t care about any 
individual action, you don’t care which menu is activated or any menu right? 
Just that the menu bar has become activated right?

Scott

-Original Message-
From: Interest  On Behalf Of David M. Cotter
Sent: Monday, October 25, 2021 1:18 PM
To: Qt Interest 
Subject: Re: [Interest] win: can't trap WM_ENTER/EXITMENULOOP?

> QMenu are just “custom drawn widgets” not native widgets. 
got it, that explains that.

>>> Instead look into QMenu::aboutToShow and QWidget::closeEvent
>> does that work for the ENTIRE menu bar browsing workflow?
>>  
>> ie: get a "start" message when the user clicks the first time in the menu 
>> bar, and the user can then browse through all available menus if they like, 
>> and when they're done, whether they click OFF the menu bar (choosing no menu 
>> item) or if they do happen to pick a menu item, then i get one "finished" 
>> event message?
>>  
>> cuz that's what i need.
> Not quite sure what you need, but you will get a signal before the 
> menu is shown
it's not about one menu. it's about the menu BAR. ie: all menus in the menu bar.

i do NOT want an "about to show" for every menu the user browses to within the 
same "menu bar browsing" session. i want one "about to browse menu bar" event, 
and then one "finished browsing menu bar" event when the user either picks a 
menu item or clicks off the menu bar.

i know i can trap all mouse DOWN events, and see if the event is in the menu 
bar. sure. part 1 solved but how do i know if the user clicks OFF the menu bar 
(not picking something)?

> You can also setup slots on the individual QActions that are added to the 
> menu.
that's exactly what i do not want to do. this is not about individual menus, 
much less individual menu items (actions) this is about the global "browse the 
menu bar" user action.

i guess my question has morphed into: how can I accomplish what i'm after here?

>> Your solution (if it worked) would only work on Windows that's all i 
>> care about. no other platform necessary.
> But all of Qt, is based on multi-platform support
it's fine if you care about that, but this is a single platform problem i'm 
solving. it works fine on mac, and i do not have a linux build anyway. (before 
you ask, the problem i'm solving is not part of this discussion)

:)

-dave
___
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] win: can't trap WM_ENTER/EXITMENULOOP?

2021-10-25 Thread Scott Bloom

You are mixing and confusing windows native Win32 messages with Qt signals.
am I?

the doc here for 
"nativeEvent()" specifically 
states that this is intended to give you windows messages (WM_*) (on windows)

to wit:
"receive native platform events identified by eventType"

Platform: Event Type Identifier:
 Message Type:
Windows "windows_generic_MSG"MSG *

note that i'm getting all kinds of OTHER "WM_" messages there, just not the 
ones i'm interested in.
Maybe “confusing” was too strong a word, but mixing is definitely true 😉 that 
combined with the incorrect assumption that Qt uses native widgets for menu’s 
is the root of the problem.


You are making the incorrect assumption that the Qt core internals are based on 
Windows native widgets.
yes well, that's true. my understanding is that Qt uses native widgets whenever 
possible. seemed to me that Menus would be a prime candidate for that


That is your mistake.
okay, so what you're saying is that, you know for a fact that the menu bar in a 
windows app built by Qt does not use native windows APIs for that? is that 
definitely true?
Yes, QMenu are just “custom drawn widgets” not native widgets.


Instead look into QMenu::aboutToShow and QWidget::closeEvent
does that work for the ENTIRE menu bar browsing workflow?

ie: get a "start" message when the user clicks the first time in the menu bar, 
and the user can then browse through all available menus if they like, and when 
they're done, whether they click OFF the menu bar (choosing no menu item) or if 
they do happen to pick a menu item, then i get one "finished" event message?

cuz that's what i need.
Not quite sure what you need, but you will get a signal before the menu is 
shown.  As well as aboutToHide (forgot that one), as well as when the menu 
actually closes QWidget::closeEvent.

You can also setup slots on the individual QActions that are added to the menu.



Your solution (if it worked) would only work on Windows
that's all i care about. no other platform necessary.
But all of Qt, is based on multi-platform support
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] win: can't trap WM_ENTER/EXITMENULOOP?

2021-10-25 Thread Scott Bloom
You are mixing and confusing windows native Win32 messages with Qt signals.

You are making the incorrect assumption that the Qt core internals are based on 
Windows native widgets.  That is your mistake.

Instead look into QMenu::aboutToShow and QWidget::closeEvent

Your solution (if it worked) would only work on Windows, not linux, mac or any 
other platform.  Using Qt's native system will work on all platforms

Scott

From: Interest  On Behalf Of David M. Cotter
Sent: Monday, October 25, 2021 9:40 AM
To: Qt Interest 
Subject: [Interest] win: can't trap WM_ENTER/EXITMENULOOP?

in the documentation 
here, it indicates 
i can get a message when the menu bar starts to be browsed, and another when 
the browsing is completed.
this is exactly what i need (the purpose is unrelated to this post).
So in my QMainWindow derived class, i override the nativeEvent() method, like 
so:

boolQBrowserWindow::nativeEvent(

const QByteArray& eventType,

void 
*messageP,

qintptr
*resultP)

{

boolhandledB(false);



if (eventType == kWindowsEventType_GENERIC) {

 MSG& 
msg(*(MSG *)messageP);



 switch (msg.message) {



 default: {


 //nothing else

 } break;



 case 
WM_ENTERMENULOOP: {


 Log("start menu browsing");


 SuspendTableUpdates(true);

 } break;



 case 
WM_EXITMENULOOP: {


 Log("end menu browsing");


 SuspendTableUpdates(false);

 } break;

 }

}



return handledB;

}
However, those messages are never sent :(
Any idea why not?

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


Re: [Interest] qt and Windows tolerance heap

2021-09-07 Thread Scott Bloom
You shouldn’t need it for a read of the registry, however it is possible that 
the IT dept of the user, or the user themselves has escalated the default 
privileges required to read from HKLM

You might want to code your check to allow for a security violation, so the is 
it enabled would be yes, no, or “I cant tell” response.

Scott

From: Interest  On Behalf Of maitai
Sent: Tuesday, September 7, 2021 7:36 AM
To: Interest@qt-project.org
Subject: Re: [Interest] qt and Windows tolerance heap


Thank you very much that is the way. Do you know if elevated privileges are 
needed to do that?

--Philippe




Le 07-09-2021 15:22, Jérôme Godbout a écrit :

You can put your aplicaiton into the exclude list, sorry though it was 
mentionned into the microowft page, but here is the registry key:



HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FTH\ExclusionList\myapp.exe



Change myapp.exe for your actual application.





From: Jérôme Godbout mailto:jgodb...@dimonoff.com>>
Date: Tuesday, September 7, 2021 at 9:07 AM
To: maitai mailto:mai...@virtual-winds.org>>, 
Interest@qt-project.org 
mailto:Interest@qt-project.org>>
Subject: Re: [Interest] qt and Windows tolerance heap

The tolerant heap only make workaround for actual bug. Disable the tolerant 
heap for your developers (this should be a system options when developer mode 
is enabled directly into Windows but sadly you have to do it manually). This 
will show where your bug is and will appear on dev workstation before they 
appear on the clients.



The "myth" of try to launch it again on windows is not really a myth, it come 
from this feature, the OS try to fix the heap allocation, but the application 
is still broken. You can also disable your application from using it during the 
installer.



To disable:

https://docs.microsoft.com/en-us/windows/win32/win7appqual/fault-tolerant-heap?redirectedfrom=MSDN





From: Interest 
mailto:interest-boun...@qt-project.org>> on 
behalf of maitai mailto:mai...@virtual-winds.org>>
Date: Tuesday, September 7, 2021 at 5:32 AM
To: Interest@qt-project.org 
mailto:Interest@qt-project.org>>
Subject: [Interest] qt and Windows tolerance heap

Hi,

I have some users (mainly beta testers) that are suffering from "Windows 
Tolerant Heap" 
(https://docs.microsoft.com/en-us/windows/win32/win7appqual/fault-tolerant-heap).
 The consequence of this being activated after some crashes is that the 
application becomes very slow, plus some mysterious crashes occur randomly deep 
inside qt event queue manager.



I know how to remove the app from Tolerant Heap with an elevated command prompt.



My question is: is there a way from inside the application to detect the app is 
running in this mode, so I can prompt the user to contact us for instance?



Thanks for any insight

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


Re: [Interest] QThreadPool wait until all queued threads are finished

2021-08-17 Thread Scott Bloom
Thanks ill give it a go 😊

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Tuesday, August 17, 2021 13:14
To: interest@qt-project.org
Subject: Re: [Interest] QThreadPool wait until all queued threads are finished

On Tuesday, 17 August 2021 12:01:25 PDT Scott Bloom wrote:
> std::list< yyy > xxx;
> for( auto && ii : xxx )
> {
>  QThreadPool::globalInstance()->start(
> [ii]()
> {
> doSomething( ii );
> } );
> }
> 
> Works great for this... However, I want the application waiting until 
> all threads are completed before exiting the tool.
> 
> while (QThreadPool::globalInstance()->activeThreadCount())
> {
> QThreadPool::globalInstance()->waitForDone(100);
> qApp->processEvents();
> }

Busy-waiting is never a good idea.

You should use QFuture/QFutureWatcher and react to the latter's signals 
indicating their jobs are done.

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



___
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] QThreadPool wait until all queued threads are finished

2021-08-17 Thread Scott Bloom
Im really trying to avoid making my own thread pool.  QTHreadPool works great 
except there is nothing I can do to wait for all queued to finish as well.

Scott

From: Jérôme Godbout 
Sent: Tuesday, August 17, 2021 12:13
To: Scott Bloom ; interest@qt-project.org
Subject: Re: QThreadPool wait until all queued threads are finished

You should make a QThreadPool for your need and call the 
QThreadPool::waitForDone() until all you started is completed.

Other side note to help if the above solution is not enough:
You could connect to each QThread finished() event and check if all thread has 
finished. You can check if the QThread is into the 
QThreadPool.contains(QThread*), but I do not have a solution to have all the 
QThread* that are running?! It's kind of odd that the QThreadPool doesn't 
return  a QThread when you start one or could at least iterate over them.


Jérôme Godbout, B. Ing.

Software / Firmware Team Lead
O: (418) 682-3636 ext.: 114
C: (581) 777-0050
godbo...@dimonoff.com<mailto:godbo...@dimonoff.com>
[signature_2038249735]<https://www.dimonoff.com/>
dimonoff.com<https://www.dimonoff.com/>
1015 Avenue Wilfrid-Pelletier,
Québec, QC G1W 0C4, 4e étage


From: Interest 
mailto:interest-boun...@qt-project.org>> on 
behalf of Scott Bloom mailto:sc...@towel42.com>>
Date: Tuesday, August 17, 2021 at 3:01 PM
To: interest@qt-project.org<mailto:interest@qt-project.org> 
mailto:interest@qt-project.org>>
Subject: [Interest] QThreadPool wait until all queued threads are finished
Here is the problem Im having.  I have background task, that is small enough to 
use a lambda on a given string.

std::list< yyy > xxx;
for( auto && ii : xxx )
{
 QThreadPool::globalInstance()->start(
[ii]()
{
doSomething( ii );
} );
}

Works great for this... However, I want the application waiting until all 
threads are completed before exiting the tool.

while (QThreadPool::globalInstance()->activeThreadCount())
{
QThreadPool::globalInstance()->waitForDone(100);
qApp->processEvents();
}

Should work.  Wait 100ms, and continue.

However, the problem Im having, is activeThreadCount does not take into account 
queued threads.

Is there a better way?  The length of the xxx can be in the millions, and is 
recursive.

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


[Interest] QThreadPool wait until all queued threads are finished

2021-08-17 Thread Scott Bloom
Here is the problem Im having.  I have background task, that is small enough to 
use a lambda on a given string.

std::list< yyy > xxx;
for( auto && ii : xxx )
{
 QThreadPool::globalInstance()->start(
[ii]()
{
doSomething( ii );
} );
}

Works great for this... However, I want the application waiting until all 
threads are completed before exiting the tool.

while (QThreadPool::globalInstance()->activeThreadCount())
{
QThreadPool::globalInstance()->waitForDone(100);
qApp->processEvents();
}

Should work.  Wait 100ms, and continue.

However, the problem Im having, is activeThreadCount does not take into account 
queued threads.

Is there a better way?  The length of the xxx can be in the millions, and is 
recursive.

Scott

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


[Interest] QColor( Qt::black ).lighter() == QColor( Qt::black )

2021-08-02 Thread Scott Bloom
While I understand the logic in the "lighter" (and darker) code, which 
basically converts to a HSV then uses the value sent into lighter (or darker) 
on the HSV value to compute the new value, then convert to RGB and return.

It fails when the color being lightened is black, is the HSV V = 0, multiplying 
it of course yields the same 0.

IMO, this is a bug, and needs a corner case  if statement (ie, if V = 0, v = 
10... ) but not being a HSV expert (heck barely a noob when it comes to HSV 
manipulation) I have no idea what the new value should be for a given V being 
sent into lighter.

Any ideas?

Scott


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


Re: [Interest] semi-modal dialog

2021-07-29 Thread Scott Bloom
This is the current path we are going down.

The problem is also the titlebar differences between windows and linux



~~Scott



 Original message 
From: John Weeks 
Date: 7/29/21 4:34 PM (GMT-08:00)
To: Giuseppe D'Angelo via Interest 
Cc: Scott Bloom 
Subject: Re: [Interest] semi-modal dialog

We do something similar- we make it possible to put up a control panel (a 
special type of window in our application) that allows the user to interact in 
certain ways with one other window and no others. We do it with some very hairy 
code that probably would make Thiago throw up.

We fake the modal nature of this partially modal window by installing an event 
filter on the application. Then we just block all the events that shouldn't get 
through. Getting the choice of events right can be very tricky! The ugliest bit 
is responding to window activation to force the active window back to the one 
we want to be active.

Hopefully, someone has a better solution to this problem!

> On Jul 29, 2021, at 3:21 PM, Scott Bloom  wrote:
>
> Here is my problem.
>
> I have a progress dialog, that I need to be able to use as a modal dialog 
> with respect to the main window (a QMainWindow class, which is also its 
> parent widget).
>
> But, I need to still be able to minimize the main application and even move 
> it.
>
> Any ideas on the best way to implement something like this?
>
> Scott
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest

-John Weeks

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


[Interest] semi-modal dialog

2021-07-29 Thread Scott Bloom
Here is my problem.

I have a progress dialog, that I need to be able to use as a modal dialog with 
respect to the main window (a QMainWindow class, which is also its parent 
widget).

But, I need to still be able to minimize the main application and even move it.

Any ideas on the best way to implement something like this?

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


Re: [Interest] make check not working (macOS)

2021-06-23 Thread Scott Bloom
> Sent: Wednesday, June 23, 2021 at 11:45 AM
> From: "Kai Köhne" 
> To: "Jason H" , "interestqt-project.org" 
> 
> Subject: RE: [Interest] make check not working (macOS)
>
> HI Jason,
> 
> It looks to me like you're trying to add a test case into your normal 
> application executable. Is that correct?

Yes.
 
> The canonical use of QTest is different: You create a separate project for 
> the tests, in a separate directory. If you e.g. check back on 
> https://doc.qt.io/qt-5/qttestlib-tutorial1-example.html , this creates a new 
> file testqstring.cpp, and then uns "qmake -project" in the directory to 
> create a completely new project.
> 
> Hope this helps.

Yes it does. Thanks!

So I have to manually maintain the modules being tested as a separate project? 
If so, that's pretty undesirable because of the manual effort to make sure that 
the test project is using the same source that the actual application uses. I 
hope I can automate that somehow? (Preferably requiring 0 maintenance)  I would 
not be opposed to a "tests" subdir to hold this project, but then, that needs 
it's own .pro, and it needs to automatically reference the parent project's 
files. Immediately I am thinking I can just use HEADERS/SOURCES files with ../ 
prefixes but that violates my 0-maintenance requirement.

I want a brain-dead, simple, 0-maintenance test kit.  The only thing the 
developers should have to worry about is adding test implementations once it is 
started.

Can this be achieved in Qt?
===

Unit tests like this should focus on testing small targeted items.  The classes 
under test should only include the limited number of items.  If you had a 
"mainwindow" directory, with 5 classes, I would recommend you have 5 or more 
test files, one for each class.  Creating 5 different executables with 5 
different testharnesses.

Once its setup, its pretty straight forward to maintain, but Ive never seen a 
brain-dead, simple, 0-maintenance test "kit".  The easiest I have used is CMake 
+ GoogleTest + QTest.  I use CMake for the test harness and either google test 
and qtest depending on what is being tested.  They both work in a very similar 
fashion.  You create a new executable for each group of tests you are testing.

For a more automated setup, I will often have the unittest directory as a 
subdir of the classes directory.  And as Thiago suggests have an include of the 
make system file into the unit test one.

Scott


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


Re: [Interest] QNetwork classes for submitting google forms

2021-06-14 Thread Scott Bloom
This has come up a couple times for me through the years (essentially make a 
network request and don’t return until the request has finished).

Is there an example anywhere of the "Thiago" (proper.. 😊 ) way to code this?  I 
see this issue in a similar vane to using QThread, when the Trolls/Nokia/TQP (I 
forget who originally wrote it) wrote up a small but very effective white paper 
on the proper method of using Qthread, it clarified a ton of questions for many 
people.

Scott

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Sunday, June 13, 2021 08:03
To: interest@qt-project.org
Subject: Re: [Interest] QNetwork classes for submitting google forms

On Friday, 11 June 2021 21:05:08 PDT Max Paperno wrote:
> > Insert a "return" here and let your slot be called when the time is right.
> 
> Right, too much Python lately... "should" have been `processEvents()` 
> which is when I realized there were no events to process w/out a Qt 
> loop in the first place.  Returning from main() wouldn't have solved 
> the issue though.

Please do as I said: insert a return and let the event loop handle calling your 
slots.

Nested event loops are an anti-pattern. Don't write code like that unless you 
really must. And if you do, use QEventLoop.

Don't use processEvents(). That's only slightly less evil than sleep().

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



___
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] L Word

2021-04-30 Thread Scott Bloom
In all seriousness, Roland does bring up many valid points, however they are 
often lost due to the demeanor use to present them.

I do think if qt had a qt-med-interest or qt-fusa-interest where the needs of 
medical device deverlopers or functional safety developers was the primary 
concern, his views would likely be less obscure and more in the majority.

Scott

From: Interest  On Behalf Of Ilya Diallo
Sent: Thursday, April 29, 2021 06:04
To: Tuukka Turunen 
Cc: interest@qt-project.org
Subject: Re: [Interest] L Word

Easy solution: create the rol...@qt-projet.org 
list and send him and his (surely numerous) followers there.
Think "separation of concerns" rather than "ban"

Le jeu. 29 avr. 2021 à 13:46, Tuukka Turunen 
mailto:tuukka.turu...@qt.io>> a écrit :
Hi,

Perhaps we have been too long tolerant for the behavior that many see 
problematic (myself included). The challenge is the mix of valid and invalid 
items. It is easier to react to things that are clear violations to our CoC: 
http://quips-qt-io.herokuapp.com/quip-0012-Code-of-Conduct.html and nothing 
else.

On the positive side, we have not had that much of these over the years. We 
have not been banning people regularly, so we also lack a bit of precedence 
with this. Technically it is a trivial thing to remove someone from a mailing 
list. The challenging part is to decide when it is time to do that.

Yours,

Tuukka



From: Interest 
mailto:interest-boun...@qt-project.org>> on 
behalf of Massimiliano Maini mailto:maxma...@gmail.com>>
Date: Thursday, 29. April 2021 at 14.23
To: Bernhard Lindner 
mailto:priv...@bernhard-lindner.de>>
Cc: interest@qt-project.org 
mailto:interest@qt-project.org>>
Subject: Re: [Interest] L Word
Yeah, maybe that's part of the problem but, as you said, the solution
should be simple: he leaves the mailing list
or, if that's not possible, the admins "make him leave".

On top, with his ramblings and often totally wrong assertions (the
"April's fool link"-gate scandal has been absolutely
hilarious, almost as the subsequent attempt to regain some
credibility, yeah .. nice try) he has now managed to scare
the hell out of me the next time I'll be tied to a medical device: the
mere chance he may be behind it now makes me
extremely nervous. Even if it's only a blood pressure monitor.

Losing valuable people in the mailing list and, at some point, the
mailing list at all is like throwing away a Ferrari
because a pidgeon keeps shitting on it. I'd argue that getting rid of
the pidgeon is a more sensible solution.

On Thu, 29 Apr 2021 at 12:05, Bernhard Lindner
mailto:priv...@bernhard-lindner.de>> wrote:
>
> The main problem isn't trolling. The main problem is: Roland comes from a 
> completely
> different world. The world of functional safety. This world is difficult and 
> a completely
> different from conventional software development. It is particularly 
> different from
> smartphone and web development. And it doesn't have much to do with desktop 
> software
> development. I have also been in this world for more than 3 years. A world 
> where
> programming is the least important thing. Where documentation is important. 
> And the law.
> And prison. And accuracy and multi-level tests and reliability and 
> verification and
> validation and standards. And many years of support. And certifications. A 
> person who has
> worked in this world for a long time has different priorities. Roland calls 
> this "True
> Software Engineering".
>
> Obviously, Qt has nothing to do with this type of software engineering. And 
> it's obviously
> not suitable for functional safety (at least not if you take it seriously).
>
> What I don't understand is why Roland doesn't just leave the mailing list and 
> forget about
> Qt. Qt is not suitable for use in his industrial sector, so I can't 
> understand why he
> spends so much time writing about the conflict between the reality of Qt and 
> the reality
> of his industrial sector. If I were him, I would have given up trying to 
> influence Qt's
> strategy a long time ago.
>
> (Actually, I'm about to give up my hopes for desktop development with Qt).
>
> So, Roland, why are you keeping the conflicts going?
>
> --
> Best Regards,
> Bernhard Lindner
>
> ___
> 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
___
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] Interest Digest, Vol 114, Issue 38

2021-04-01 Thread Scott Bloom
> I would expect Qt to query the version of X being used, say 
> multi-touch isn’t supported so the app cant support it. If my customer 
> complained that multi-touch works on the Windows, and CentOS 7 boxes, but not 
> CentOS 6.
> The reasoning is clear, the default X for CentOS 6 doesn’t support it.  
> I could then point them to the newer X and say have your IT dept move 
> your CentOS to the X.Y.Z version of X (which they wont be able to do) 
> and it will work.
 
Well, that's your answer there: the feature you want isn't supported on the OS 
you have. So why is Qt any different?

I'm painting a scenario to understand how you'd have to handle such a 
situation, when there isn't a company you can call upon to fix the problem for 
you.

We keep discussing the ability to upgrade Qt but not upgrade the rest of the 
OS. I understand that Qt is a central component of the UI, but it's no less 
critical than a lot of other components that you may need to upgrade in order 
to deal with circumstances changing.

--
That doesn’t mean that Qt cant support it, its that Qt needs to be able to 
compile without it.  And if you cant, rev the major version

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


Re: [Interest] Interest Digest, Vol 114, Issue 38

2021-03-31 Thread Scott Bloom
> The response of, its fully supported on CentOS 7 with zero issues.  
> Worked until they had other tools that were working fine (not Qt 
> based)

Now suppose the issue wasn't HiDPI but something else that required a different 
component to be updated (like if you needed to update the Xorg server). And 
suppose the update didn't compile on CentOS 6 either.

Unlike the case of Qt, you don't have The Qt Company to blame. What is the 
outcome?

--
Frankly I would ask then why is the functionality being asked for by the 
customer since its clearly not available given their current OS.

Ie, if the X server didn’t support multi touch (just an example, may not e part 
of the X server, I really don’t know) with the versions available for CentOS 6, 
and Qt added support for multi-touch, but it wasn’t supported for versions of X 
that are too old.

I would expect Qt to query the version of X being used, say multi-touch isn’t 
supported so the app cant support it. If my customer complained that 
multi-touch works on the Windows, and CentOS 7 boxes, but not CentOS 6.  The 
reasoning is clear, the default X for CentOS 6 doesn’t support it.  I could 
then point them to the newer X and say have your IT dept move your CentOS to 
the X.Y.Z version of X (which they wont be able to do) and it will work.

Not say, sorry, we cant built on CentOS 6 because an X doesn’t exist with the 
support.  

For High DPI, I would have hope they cherry picked all the fixes from 5.13 and 
5.14 (and 5.15???) back to 5.12) so that 5.12 had the fixes for the critical 
issue, that is supported by X but is really just a bug in the Qt system


Scott


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


Re: [Interest] Interest Digest, Vol 114, Issue 38

2021-03-28 Thread Scott Bloom
Here is why upgrading to Qt would be important.  The monitor on a perfectly 
working machine, dies.

They put in a new monitor for the engineer.  IT dept has decided the 4k monitor 
for 300 bucks is the standard.

Now the application which LOOKED and worked great, now looks like crap, because 
the version of Qt its built on, doesn’t have fully working high DPI support.

Some of their tools work great, others look like total crap. They notify 
vendors, we need high DPI support.

Multiple vendors stuck on Qt 5.12.9 are fubar,  customer sends letter out, fix 
it, and drop Qt if necessary.  (Yes we have gotten that in writing) if Qt GUI 
cant support high DPI monitors.

The response of, its fully supported on CentOS 7 with zero issues.  Worked 
until they had other tools that were working fine (not Qt based)

Scott

-Original Message-
From: Interest  On Behalf Of Hamish Moffatt
Sent: Saturday, March 27, 2021 5:49 PM
To: interest@qt-project.org
Subject: Re: [Interest] Interest Digest, Vol 114, Issue 38

On 27/3/21 9:04 pm, Roland Hughes wrote:
> If I read Scott's original posts correctly, the compelling reason is a 
> roughly $1 billion multi-year project was started and the OS 
> physically cannot be changed out until that many year project is over.
> The UI can be updated and new functionality added.
>
> You get such projects in the industrial controls world. Generally 
> custom device drivers for custom devices that are part of a production 
> process. It is too expensive in terms of down time and development 
> costs to switch to a new OS version.
>
> If memory serves he is talking about chip fabrication. Downtime is 
> most likely measured at > $1 million per day.
>
> In the medical device world it is almost impossible to change out an 
> OS without having to go down the "new product" approval process. That 
> is lengthy and expensive.
>
> You can, because the design of the device mitigates RISK the UI could 
> pose to patient safety/health, change out the UI library and go down 
> the "minor enhancements" (I forget the correct name) FDA approval 
> path. This is by no means free, but it is far less expensive and time 
> consuming.
>
> If you __have__ to open the hood for a regulatory change, like the 
> service password example I gave, most companies will try to freshen up 
> the screen library to get better graphics and performance 
> improvements. Every performance improvement can help extend battery life.
>
> On 3/26/2021 10:13 PM, interest-requ...@qt-project.org wrote:
>> I still haven't seen any convincing argument on why you expect to use 
>> a brand new Qt with ancient compilers/OSs?
>

None of that was an argument for upgrading Qt, just for not upgrading the rest.



Hamish

___
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] Interest Digest, Vol 114, Issue 39

2021-03-28 Thread Scott Bloom
Short answer from the customer (yep commercial version here) is no.

We were told by support, here is what YOU will have to get working.

Scott

-Original Message-
From: Interest  On Behalf Of Roland Hughes
Sent: Saturday, March 27, 2021 3:24 AM
To: interest@qt-project.org
Subject: Re: [Interest] Interest Digest, Vol 114, Issue 39

So,

Just to be clear.

You are saying QtC has the latest version of Qt 5.x compiling and running on 
Scott's RHEL version though Qt-project does not?

That somewhere inside QtC all the compiler and OS versions abandoned by 
Qt-project mid Qt 5 have shiny happy versions of the latest 5.x?

If one defines "platform" as compiler version + OS version (to make wording 
simple) it would seem to me that one Qt-project abandoned it and started 
writing to newer compiler and platform version it would become impossible to 
make a working fork.

We had this problem with compiler standards quite a few years ago. C++11 was 
supposed to be the minimum supported but the CI was (and probably still is) 
compiling with only the latest standard. I ran headlong into this when people 
were using stuff from from a much later C++ standard in the examples and I 
think a few other places.

Once they start using things that don't exist, or worse, exist differently, 
getting there from here is a very difficult journey.

On 3/27/2021 3:23 AM, interest-requ...@qt-project.org wrote:
> “When Qt chased these markets it knew what the lifetimes would be. Now it has 
> abandoned them.”
>
> I would like to point out that this is not a true statement. We do offer long 
> term support and also extended support for those customers who need it. There 
> are some who every now and then still need something related to Qt 3. 
> Somewhere Qt 2 is still in use. Perhaps Qt 1 even, but personally not certain 
> about that. Qt 4 based systems of course and majority of customers are with 
> Qt 5 currently.
>
> Each of these versions has changed API and we have tried our best to make the 
> transition from Qt 5 to Qt 6 smooth. We are happy to get suggestions and 
> feedback to it still and help in the transition.

--
Roland Hughes, President
Logikal Solutions
(630)-205-1593  (cell)
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com

___
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] Interest Digest, Vol 114, Issue 38

2021-03-28 Thread Scott Bloom
This is correct.  They are stuck on the OS, if we are not in of the internet 
mode (ie once a product has shipped, they create a machine with a given OS, and 
all software necessary to re-produce the produce, and its then taken off the 
internet and put in a black box, sneakernet only room.

But, before that stage, it is often necessary to have every version of every 
piece of software put on the system approved, but the OS doesn’t change.   If 
its working with version X of tool Y, they are not going to update the OS and 
put other tools at risk, because of an update for your tool.

Its just not going to happen.  Their dev cycle can be 6-15 years.  They pick an 
OS at the beginning, usually its already 1-2 (or 4 or 5) years old, because 
they had to test the hell out of it, and confirm the tools they need for the 
new project will work on it.  Once decided its frozen, except for approved 
patches.
Scott

-Original Message-
From: Interest  On Behalf Of Roland Hughes
Sent: Saturday, March 27, 2021 3:04 AM
To: interest@qt-project.org
Subject: Re: [Interest] Interest Digest, Vol 114, Issue 38

If I read Scott's original posts correctly, the compelling reason is a roughly 
$1 billion multi-year project was started and the OS physically cannot be 
changed out until that many year project is over. The UI can be updated and new 
functionality added.

You get such projects in the industrial controls world. Generally custom device 
drivers for custom devices that are part of a production process. 
It is too expensive in terms of down time and development costs to switch to a 
new OS version.

If memory serves he is talking about chip fabrication. Downtime is most likely 
measured at > $1 million per day.

In the medical device world it is almost impossible to change out an OS without 
having to go down the "new product" approval process. That is lengthy and 
expensive.

You can, because the design of the device mitigates RISK the UI could pose to 
patient safety/health, change out the UI library and go down the "minor 
enhancements" (I forget the correct name) FDA approval path. This is by no 
means free, but it is far less expensive and time consuming.

If you __have__ to open the hood for a regulatory change, like the service 
password example I gave, most companies will try to freshen up the screen 
library to get better graphics and performance improvements. 
Every performance improvement can help extend battery life.

On 3/26/2021 10:13 PM, interest-requ...@qt-project.org wrote:
> I still haven't seen any convincing argument on why you expect to use 
> a brand new Qt with ancient compilers/OSs?

--
Roland Hughes, President
Logikal Solutions
(630)-205-1593  (cell)
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com

___
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] the path forward - that 7 year thing - was willy-nilly

2021-03-26 Thread Scott Bloom
Sorry for top posting...

But I disagree here.  Even for mac, Qt 5 is 9 years old, 4 lived 6 (4.0->4.8 
LTS initial release, 4.8 lived for 3 years)

Im not saying we go to a Qt Major version for every mac system style change.  
But if they produce a SDK where previous version is so different than the new 
one, that the same Qt code needs a #ifdef XXX version, so be it.

Yes, its more work.

Scott

-Original Message-
From: Hamish Moffatt  
Sent: Friday, March 26, 2021 17:40
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] the path forward - that 7 year thing - was willy-nilly

On 27/3/21 11:23 am, Scott Bloom wrote:
> To be clear.  Roland and I are talking about very different issues.
>
> To me, Qt should continue to support OS's/Compilers for the life of a 
> Major version of Qt.  if it built on Qt 5.0 it should build on that 
> OS/Compiler in 5.15
>
> If Qt decides that modern C++ was more important in 5.13, and the 
> compilers available on an OS/Compiler are no longer compiling Qt, then 
> frankly, its time to move to Qt 6
>
> There are many open source tool sets, that have parallel paths for a certain 
> time.  Qt 4 is a good example. The late stage Qt4 was still being supported 
> and new patch versions being put out as Qt 5 was rolling out.
>
> I do NOT expect to start a project in Qt3 on CentOS 3/4 (or whatever 
> it was) to be able to trivially rebuilt in Qt 4, or 5 when I move to 
> CentOS 7
>
> But If Im still using Qt 5.9 LTS, and decide to move to Qt 5.15 
> (skipping 12), I don’t expect my OSes to no longer be supported.  If 
> there was functionality being added to 13 that made a version of a 
> compiler/OS no longer valid to target? Make that functionality/code 
> for Qt 6


I'm not sure what you're asking is even possible on macOS. They churn the 
compiler and the SDK so quickly compared to the 8 year development life of Qt 5.

I would ideally like Qt to support deployment on macOS versions slightly older 
than they do. Not all the way back to what was supported in 5.0 though.

I don't see any compelling reason to be compiling with the latest Qt on ancient 
compilers/OSs though.


Hamish

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


Re: [Interest] the path forward - that 7 year thing - was willy-nilly

2021-03-26 Thread Scott Bloom
Forgot to mention this.

I do not expect something that built against Qt3/4/5 to build under Qt4/5/6 on 
the same OS/Compiler.

If Im changing OS, or compiler.  I hope to find a Qt that works on the new 
combo, (that’s rarely ever been an issue) but, my old version of Qt? if the 
major version is different, no I have no expectation.

My view, I would have made Qt 5.13 (or 14) "Qt 6.0" since there were many 
compiler versions dropped on that version  Then I would have ZERO concerns 
about moving to the latest and greatest Qt 5.x knowing my customers OSes would 
be fully supported.

If there is functionality fixes that the Qt team decides needs to be put into 
Qt 5.x, then they may have to code them twice, one using the 5.x and once using 
6.x code standards.  This is what Scintilla does between 2.x and 3.x (a much 
smaller project of course).

Scott

-Original Message-
From: Interest  On Behalf Of Scott Bloom
Sent: Friday, March 26, 2021 17:24
To: Hamish Moffatt ; interest@qt-project.org
Subject: Re: [Interest] the path forward - that 7 year thing - was willy-nilly

To be clear.  Roland and I are talking about very different issues.

To me, Qt should continue to support OS's/Compilers for the life of a Major 
version of Qt.  if it built on Qt 5.0 it should build on that OS/Compiler in 
5.15

If Qt decides that modern C++ was more important in 5.13, and the compilers 
available on an OS/Compiler are no longer compiling Qt, then frankly, its time 
to move to Qt 6

There are many open source tool sets, that have parallel paths for a certain 
time.  Qt 4 is a good example. The late stage Qt4 was still being supported and 
new patch versions being put out as Qt 5 was rolling out.

I do NOT expect to start a project in Qt3 on CentOS 3/4 (or whatever it was) to 
be able to trivially rebuilt in Qt 4, or 5 when I move to CentOS 7

But If Im still using Qt 5.9 LTS, and decide to move to Qt 5.15 (skipping 12), 
I don’t expect my OSes to no longer be supported.  If there was functionality 
being added to 13 that made a version of a compiler/OS no longer valid to 
target? Make that functionality/code for Qt 6

Scott

-Original Message-
From: Interest  On Behalf Of Hamish Moffatt
Sent: Thursday, March 25, 2021 22:06
To: interest@qt-project.org
Subject: Re: [Interest] the path forward - that 7 year thing - was willy-nilly

On 26/3/21 6:38 am, Roland Hughes wrote:
> According to the FDA fact sheet.
>
> https://www.fda.gov/about-fda/fda-basics/fact-sheet-fda-glance
>
> There are currently 25,864 registered FDA medical device facilities. 
> Not one of them can change a single approved process without going 
> through the FDA approval process for said change. That is __NOT__ a 
> sprint nor is it cheap. Within the past 18 months a drug manufacturer 
> in high priced California put out a cattle call for a PDP 11/44 (might 
> have been 24) system manager. Those machines were last made around 
> 1978. There is a group of them still making necessary drugs in California.
>
> Once something is in place it stays there because it is incredibly 
> expensive to replace.
>
>> Qt's horizon is about 7 years.
> That's 8 years too short. 
>> Anything coded to Qt 3.x needs to ported first to 4.8, before going to 5.0.
>> Once you're in the 5.x series, port to 5.15 and fix the warnings. 
>> Once you're clean in a working build, port to Qt 6.
>
> There is no one who went to a good school for their IT degree where 
> they made the person take Cost Accounting ever going to utter that as 
> a valid path forward.
>
> There is no MBA, even from a shit school like Keller, that is going to 
> sign off on such a project.
>

I really don't understand your arguments Roland. You say you need Qt support 
for 15 years, but you can't actually change one bit of your software without 
FDA approval, so presumably this means you aren't upgrading Qt anyway. Then 
after 15 years you want to work on a new model of the device, starting with 
your existing code, and you expect it to compile with the latest Qt unchanged?


Someone else was talking about support for RHEL 6. Why do you expect to use the 
latest Qt with an ancient OS? Is it reasonable to expect to use new Qt with an 
ancient OS?

I see that the latest Microsoft Visual C++ compiler toolset (v142) doesn't 
support building for Windows XP. You can still use an older compiler. That 
seems like a reasonable compromise.



Hamish

___
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
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] the path forward - that 7 year thing - was, willy-nilly

2021-03-26 Thread Scott Bloom
From the Qt blog post https://www.qt.io/blog/qt-offering-changes-2020

"These changes will not have any effect on existing commercial licensing or 
services agreements."

Now, it doesn’t talk about the notion that if you built and produced your code 
against a commercial license, it has to remain in force for you to be 
considered licensed.

As you say Roland, I have no idea how that could be possible for an existing 
contract, but going forward its not an uncommon licensing strategy.

Scott
-Original Message-
From: Interest  On Behalf Of Roland Hughes
Sent: Friday, March 26, 2021 14:33
To: interest@qt-project.org; jh...@gmx.com
Subject: Re: [Interest] the path forward - that 7 year thing - was, willy-nilly


On 3/26/21 1:39 PM, Jason H wrote:
> Thiago, apparently, even with a commercial license, we no longer have 
> rights to use whatever versions were current when we had the license. 
> Previously, we could use it in perpetuity. This is probably a deal 
> breaker at my new organization. It is my understanding that after our 
> software development is done, we have to maintain commercial licenses 
> even when we are not_developing_  software in Qt. I think the previous 
> perpetuity licensing was appropriate.

**Seriously**

They are trying to end a 5.x perpetuity license that was already bought and 
paid for? Nah. Can't be. I know a customer that paid north of $600K for such a 
license and the device isn't yet out the door. They happen to have a lot of 
lawyers too. I can't believe they would take that lying down.

What I "thought" was said was you could no longer obtain such a license. 
I don't agree with that, but that policy doesn't place QtC in legal jepordy 
because the license change only impacts new product.

I'm not a lawyer, but if you bought a license, they (QtC) can't just 
arbitrarily end said license. Companies will be suing for return of license 
fees and for damages.

--
Roland Hughes, President
Logikal Solutions
(630)-205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog

___
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] the path forward - that 7 year thing - was willy-nilly

2021-03-26 Thread Scott Bloom
To be clear.  Roland and I are talking about very different issues.

To me, Qt should continue to support OS's/Compilers for the life of a Major 
version of Qt.  if it built on Qt 5.0 it should build on that OS/Compiler in 
5.15

If Qt decides that modern C++ was more important in 5.13, and the compilers 
available on an OS/Compiler are no longer compiling Qt, then frankly, its time 
to move to Qt 6

There are many open source tool sets, that have parallel paths for a certain 
time.  Qt 4 is a good example. The late stage Qt4 was still being supported and 
new patch versions being put out as Qt 5 was rolling out.

I do NOT expect to start a project in Qt3 on CentOS 3/4 (or whatever it was) to 
be able to trivially rebuilt in Qt 4, or 5 when I move to CentOS 7

But If Im still using Qt 5.9 LTS, and decide to move to Qt 5.15 (skipping 12), 
I don’t expect my OSes to no longer be supported.  If there was functionality 
being added to 13 that made a version of a compiler/OS no longer valid to 
target? Make that functionality/code for Qt 6

Scott

-Original Message-
From: Interest  On Behalf Of Hamish Moffatt
Sent: Thursday, March 25, 2021 22:06
To: interest@qt-project.org
Subject: Re: [Interest] the path forward - that 7 year thing - was willy-nilly

On 26/3/21 6:38 am, Roland Hughes wrote:
> According to the FDA fact sheet.
>
> https://www.fda.gov/about-fda/fda-basics/fact-sheet-fda-glance
>
> There are currently 25,864 registered FDA medical device facilities. 
> Not one of them can change a single approved process without going 
> through the FDA approval process for said change. That is __NOT__ a 
> sprint nor is it cheap. Within the past 18 months a drug manufacturer 
> in high priced California put out a cattle call for a PDP 11/44 (might 
> have been 24) system manager. Those machines were last made around 
> 1978. There is a group of them still making necessary drugs in California.
>
> Once something is in place it stays there because it is incredibly 
> expensive to replace.
>
>> Qt's horizon is about 7 years.
> That's 8 years too short. 
>> Anything coded to Qt 3.x needs to ported first to 4.8, before going to 5.0.
>> Once you're in the 5.x series, port to 5.15 and fix the warnings. 
>> Once you're clean in a working build, port to Qt 6.
>
> There is no one who went to a good school for their IT degree where 
> they made the person take Cost Accounting ever going to utter that as 
> a valid path forward.
>
> There is no MBA, even from a shit school like Keller, that is going to 
> sign off on such a project.
>

I really don't understand your arguments Roland. You say you need Qt support 
for 15 years, but you can't actually change one bit of your software without 
FDA approval, so presumably this means you aren't upgrading Qt anyway. Then 
after 15 years you want to work on a new model of the device, starting with 
your existing code, and you expect it to compile with the latest Qt unchanged?


Someone else was talking about support for RHEL 6. Why do you expect to use the 
latest Qt with an ancient OS? Is it reasonable to expect to use new Qt with an 
ancient OS?

I see that the latest Microsoft Visual C++ compiler toolset (v142) doesn't 
support building for Windows XP. You can still use an older compiler. That 
seems like a reasonable compromise.



Hamish

___
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] The willy-nilly deletion of convenience,, methods

2021-03-24 Thread Scott Bloom


-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Wednesday, March 24, 2021 15:44
To: interest@qt-project.org
Subject: Re: [Interest] The willy-nilly deletion of convenience,, methods

On Wednesday, 24 March 2021 04:48:08 PDT Roland Hughes wrote:
> On 3/24/21 6:00 AM, interest-requ...@qt-project.org wrote:
> > The exact opposite is the correct thing:
> >   - deprecation messages while compiling the source code are correct
> >   - messages to the mailing list are not sufficient
> 
> No, it's not. It only seems correct if you live in a world where 
> nothing lasts six months.
> 
> Out in the real product world you create some product using Qt 3.x or 
> 4.2. That product goes to production where it remains for 7-15+ years.

I stand by what I said and I live in the real world. You clearly live in a 
different, also real world. I don't doubt any of the claims you make are true. 
I do doubt that they are the majority or even significant. The majority of the 
uses I am familiar with last much shorter than 7 years. At the very least, 
there are opportunities in those 7 years to do incremental progress or keep up 
with the latest.

Qt's horizon is about 7 years.

Anything coded to Qt 3.x needs to ported first to 4.8, before going to 5.0. 
Once you're in the 5.x series, port to 5.15 and fix the warnings. Once you're 
clean in a working build, port to Qt 6.
==

Hard failure here.  Because Qt decided to change the list of supported 
compilers and OSes in the Qt 5 timeframe, (another major problem with the Qt 
universe), I know of many companies stuck at 5.12.  BTW, that includes Intel on 
two projects I know of 😊

I have customers who REQUIRE (as in I don’t have a choice) using CentOS 6.  We 
tried and failed to back port 5.15 to it.

So we are effectively stuck at 5.12 until our customer allows us to drop 
CentOS/RHEL 6.0

And yes, we know 6.0 has been end of life'd, is insecure, has problems etc 
etc.. You tell them, well just enter the modern world, stop developing billion 
dollar systems by choosing an OS to start with and not allowing major OS 
changes until the version the team is working on is finished.

And while you are at it, convince the intel internal rtl lint team to do the 
same.

Scott


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


Re: [Interest] SQLite: mystic bug: No query Unable to fetch row error

2021-01-14 Thread Scott Bloom
Prepare can fail if the db is not open, or if the statement has problems that 
can be found during the compilation of the command. Usually they are static, so 
I often only check the results in a debug build, not a release one.

For SQLLite, I have often found improperly setup file based databases, often 
return "no connection" or "unable to fetch" for a multitude of issues


Scott
-Original Message-
From: Alexander Dyagilev [mailto:alervd...@gmail.com] 
Sent: Thursday, January 14, 2021 08:41
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] SQLite: mystic bug: No query Unable to fetch row error

On 1/14/2021 7:06 PM, Scott Bloom wrote:
> Did the prepare fail?

No. But why should it fail?

> Do you check to see that the "m_db" database is valid, open, and connected?

No. However it should be opened. Anyway, in these cases the error should be 
different, isn't it?



>
> Scott
>
> -Original Message-
> From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of 
> Alexander Dyagilev
> Sent: Thursday, January 14, 2021 07:19
> To: interest@qt-project.org
> Subject: [Interest] SQLite: mystic bug: No query Unable to fetch row error
>
> Hello,
>
> Each instance of our app is supposed to have an unique id (UUID).
>
> At every start, it check if it has assigned one, and if not - generates it 
> and saves it to the SQLite database.
>
> We've found, that 4% of ours users has empty UUIDs.
>
> We've added some diagnostic reporting info and found, that this is caused by 
> SQLite database not being able to write generated UUID to it.
>
> QSqlQuery::exec returns false and its last error returns this error "No query 
> Unable to fetch row error".
>
> How can this be? I could not find any problems working with the database in 
> our code.
>
> We do it so:
>
> 1. Make sure the table exists:
>
> "CREATE TABLE IF NOT EXISTS miscData (Name TEXT, Value BLOB, PRIMARY KEY 
> (Name))"
>
> 2. Write value to the table:
>
> QSqlQuery query(m_db);
> query.prepare("REPLACE INTO miscData (Name, Value) VALUES (:Name, :Value)"); 
> query.bindValue(":Name", "UUID"); query.bindValue(":Value", UuidByteArray);
>
> if (!query.exec())
> {
>    // here we're getting this error
> }
>
> What are the possible reasons of this error?
>
>
> ___
> 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] SQLite: mystic bug: No query Unable to fetch row error

2021-01-14 Thread Scott Bloom
Did the prepare fail?

Do you check to see that the "m_db" database is valid, open, and connected?

Scott

-Original Message-
From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Alexander 
Dyagilev
Sent: Thursday, January 14, 2021 07:19
To: interest@qt-project.org
Subject: [Interest] SQLite: mystic bug: No query Unable to fetch row error

Hello,

Each instance of our app is supposed to have an unique id (UUID).

At every start, it check if it has assigned one, and if not - generates it and 
saves it to the SQLite database.

We've found, that 4% of ours users has empty UUIDs.

We've added some diagnostic reporting info and found, that this is caused by 
SQLite database not being able to write generated UUID to it.

QSqlQuery::exec returns false and its last error returns this error "No query 
Unable to fetch row error".

How can this be? I could not find any problems working with the database in our 
code.

We do it so:

1. Make sure the table exists:

"CREATE TABLE IF NOT EXISTS miscData (Name TEXT, Value BLOB, PRIMARY KEY 
(Name))"

2. Write value to the table:

QSqlQuery query(m_db);
query.prepare("REPLACE INTO miscData (Name, Value) VALUES (:Name, :Value)"); 
query.bindValue(":Name", "UUID"); query.bindValue(":Value", UuidByteArray);

if (!query.exec())
{
  // here we're getting this error
}

What are the possible reasons of this error?


___
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] question for a blocking background thread call

2020-10-20 Thread Scott Bloom
Well. I 100% totally overthought this... and was able to implement this in 
about 10 lines of code using a derivation of QProgressDIalog + QtConcurrent

The progress dialog, is run with windowModality set to  Qt::WindowModal,

I overload exec, and launch the function then call QProgressDialog::exec.

Works like charm. Thanks for the advice.

Scott
-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: Tuesday, October 20, 2020 3:44 PM
To: interest@qt-project.org
Subject: Re: [Interest] question for a blocking background thread call

On Tuesday, 20 October 2020 14:26:10 PDT Giuseppe D'Angelo via Interest wrote:
> Can't you just create a QDialog and exec() it?

Or any other modal window in front. You probably want to display either a 
progress bar or a distraction, to let your users know that the application 
isn't frozen.

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



___
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


[Interest] question for a blocking background thread call

2020-10-20 Thread Scott Bloom
Im working with a thirdparty lib, that I have zero control over 😊

Essentially, on a “button click” a long running blocking function call is 
executed. I can safely call the function into a background thread, but I don’t 
want the gui flow to continue.

My idea is the following, a class that takes a lambda.

When a blocking function is called on the class, the lambda is executed in a 
background thread.  While the function waits calling processEvents without user 
events being handled (this part is easy…)

Does anyone have an example to follow for this.  Unfortunately, Im hitting all 
sorts of weirdness when getting this.

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


[Interest] Problems using Qt 5.12/5.15

2020-10-20 Thread Scott Bloom
So I wanted bring up some issues the company I work for is having using 5.12 
and 5.15.

Our customers (IC development companies large and small) are extremely slow to 
move their OS.  We had customers who are still using CentOS 6.X .  These 
customers, often will NOT move OS’s once a project has started.  If a chip is 
an 6-8 year project, they will often start with a 1-2 year old version of the 
OS (OS version migration can take 6 months or more, so they don’t change 
quickly even outside project constraints), and stick with it for that 6-8 years.

Unfortunately, Qt has required newer and newer versions of the OSes, where we 
have 2 choices.  We start with an OS version our customers are willing to move 
to (CentOS 7.0) + we build all linux library dependencies ourselves, or we 
stick with Qt 5.11.x.

They got things working for 5.12 and 5.15, with a bunch of src (more in 5.15 
obviously) based library builds.  But had numerous Squish regression failures, 
which they are still investigating.  We are hoping to get these resolved, 
however the team, is close to simply saying “5.11 for life”.  That the lack of 
bug fixes/security updates will have to do, but we simply don’t have enough 
customers willing to move to newer versions of CentOS, but more importantly 
other big customers will not move, and we have to support them.

I have been a Qt commercial licensee on and off (depending on the company I 
work for) for almost 20 years now.  And I can not remember the lack of 
consistency between minor builds of Qt and the supported OSes.

I understand the want to move to newer compilers, and somethings simply require 
newer features of X (high DPI support) libraries to properly support.  But 
these decisions are really hurting Qt’s reputation in the commercial world.  
I’m hearing this from friends at other companies in the same industry (and 
similar industries).

While Qt 5 is 8 years old, and the changes in C++ in that 8 years have been 
pretty dramatic, especially when compared to the C++ changes over Qt 4’s 
lifetime. Im concerned about Qt 6 taking this same view of forcing a new OS to 
move to later versions.

I would love to see, that we treat the OS build requirements in a similar 
fashion to the ABI requirements are put forth.  That “Minor releases are 
backwards binary and source compatible”.  Or possibly, a push for LTS releases 
that are based on an OS to be supported “For the life of the major version”, 
meaning if you are using 5.9LTS, it will be supported as a LTS throughout 5.X 
since 5.12 had a significant number of OS dependency changes.  And since 5.15 
had a new set of OS requirements, 5.12 would also be LTS for as long as any Qt 
5 is supported.

A third option, is to make sure even if it prevents functionality from being 
supported, is to “ifdef” new compiler/OS changes out if necessary.  Yes, this 
will be a test nightmare, but isn’t that what the commercial licenses are 
paying for 😊 ?  I remember a number of don’t use this if not configured issues, 
where it wasn’t fully “not used” and still had a statically bound dependency on 
a shared library, but it’s a been a number of years and I cant remember the 
exact issue.

I’m not sure what’s the best audience to bring this up, but just had a 
conversation with the bosses at work, and no one is happy with Qt right now 
because of this issue. And the “stay on 5.11” is just a horrible option but it 
wouldn’t surprise me if that is the choice made.

Scott




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


Re: [Interest] [Development] Windows 7 support will be dropped in Qt 6

2020-06-13 Thread Scott Bloom
From: Interest  On Behalf Of Thiago Macieira
Sent: Friday, June 12, 2020 6:23 PM
To: interest@qt-project.org
Subject: Re: [Interest] [Development] Windows 7 support will be dropped in Qt 6

On Friday, 12 June 2020 05:01:17 PDT Roland Hughes wrote:
> You can't drop an OS as long as there are paying customers for it.

Sure they can. But as a consequence, those customers may stop paying for it.

> Real business needs a 15-30 year LTS, not 5.

How do you define "real business"? How about by revenue or market 
capitalisation? The biggest companies on the planet (Apple, Amazon, Microsoft) 
don't support your assertion. The top one (Apple) gives 2 years of support.

Their success validates their business model.
--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products

==
That is what Apple provides for consumers.. Apple requires quite a bit longer 
than that for their software that they use for hardware design.  So does 
Intel..  

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


Re: [Interest] [Development] Windows 7 support will be dropped in Qt 6

2020-06-11 Thread Scott Bloom
One thing that I probably missed in this thread, though I have been reading it 
with quite a lot of interest.

Why is Win7 being dropped?  I (my company) has gotten burned pretty hard by the 
dropping of CentOS 6, similar reasons listed for win7..

Is win 7 being dropped because the Visual Studio versions being supported, can 
no longer target Win7?  

Our customers (multi-national, semiconductor companies) often will not change 
OS's the moment a chip design is started.  They "may" patch security, but 
often, they simply limit access to the outside world so connectivity security 
is not really their concern. The applications aren’t "online" they are usually 
command line drive, with UI interfaces for debugging the issues found.

We still had to support CentOS 5 until about 2 years ago, when our customer 
finally was able to drop it in their process. 

For CentOS 6, I understand it was for enhancements in the Qt functionality.  
However, I think it’s a major mistake for any MAJOR version to drop an OS.  
Adding is fine, but dropping shouldn’t happen.  

If I were king for a day, if its "mostly source compatible" then the OS (and 
compilers) should still be supported.  In this case, unless it’s a patch 
required on the compiler (to fix a bug) I should be able to build Qt 5.X even 
if it requires a dev-tools patch.  Same for Win7 and VS 2013.
 
Moving from Qt5 to 6, I am ok with dropping Win7 and/or CentOS 6.  I disagree 
with Roland here.  Yes, it would be "better", if I could easily build against 
the latest version of Qt, and build it for an ancient version of any particular 
OS. But in order to do that, I would expect the configuration options would go 
insane.  Any item that doesn’t build for that OS (it might not have that 
functionality that code was added for a newer version of the OS) would have to 
be ifdef'ed out via configuration. It’s a possible but expensive solution.

However, I do think, and from a commercial license holder POV (which my current 
company is), in general it is really painful when an OS is dropped from one LTS 
to another.  We are actually hitting that issue right now.  We want to move to 
5.15, but have a 20 million + a year, contract tied to CentOS 6.  We really 
can't even consider  dropping centos 6, instead we have to port Qt to CentOS, 
or stay on the last version of Qt that built on it.  It’s a really crappy 
position to be in.

Telling a customer such as us, for Qt 6, you cant build for CentOS 6, would 
mean, we would simply stay on the Qt 5 tree even longer, and likely pay for 
extended support until we could move off of CentOS 6.  But we know of bugs, 
that directly affect us that have been fixed in newer versions of Qt, and we 
wind up having to back patch them to the Qt we are using, so we can still 
support our OSes

Scott

-Original Message-
From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Roland 
Hughes
Sent: Thursday, June 11, 2020 4:57 PM
To: Sérgio Martins 
Cc: Qt Project 
Subject: Re: [Interest] [Development] Windows 7 support will be dropped in Qt 6


On 6/11/20 6:07 PM, Sérgio Martins wrote:
> On Thu, Jun 11, 2020 at 9:51 PM Roland Hughes 
>  wrote:
>>
>> On 6/11/20 1:47 PM, Michael Jackson wrote:
>>> Windows 7 is EOL. Period. If it costs you, as a developer, additional money 
>>> to support an EOL'ed, unsupported version of an operating system then you 
>>> will need to pass that onto the customer. By still supporting Windows 7 we, 
>>> as developers, are just enabling those customers to keep from updating. 
>>> There are very few real reasons*not*  to update to at least Windows 8. At 
>>> some point the customer needs to understand that they are not going to get 
>>> any new features. They current piece of software will keep working 
>>> (Assuming a perpetual license) but nothing new will be supported. I've had 
>>> requests to back port our software to CentOS 6 and once you explain the 
>>> cost to them for us to maintain all the extra development hardware, extra 
>>> engineering to develop codes that are not supported on the old compilers, 
>>> it becomes cost prohibitive to maintain those versions.
>> Personally I don't think anyone should be running a virus known as 
>> Windows on any computer.
>> There are major corporations still running Windows XP, let alone 7, 
>> because they have critical systems written and running on that OS.
> They can continue to. And why would critical systems be ported to Qt 6 ?

Not ported, added to.


>
>
>> The
>> tool or whatever cannot port forward or costs massive amounts of 
>> money to bring forward. Just today someone told me about one of GM's 
>> factories in Europe is run by a highly customized "canned" factory 
>> control system written in VB5. When people show up to the factory, it 
>> makes vehicles every day.
>>
>> You can't have rolling upgrades on critical systems, you just can't.
> Then why would you want to port that to Qt 6 ?
Not ported to, added to.
>
>
>> Upgrading is a mul

Re: [Interest] Handling of ~ paths

2020-06-11 Thread Scott Bloom


-Original Message-
From: Matthew Woehlke  
Sent: Thursday, June 11, 2020 11:43 AM
To: Scott Bloom ; interest@qt-project.org
Subject: Re: [Interest] Handling of ~ paths

On 11/06/2020 14.33, Scott Bloom wrote:
> On 11/06/2020 14.24, Matthew Woehlke wrote: >> On 11/06/2020 14.03, 
> Scott Bloom wrote:>>> If you are working with a
path, for use in QDir, QFileInfo, QFile etc>>> etc, and the path string is 
using a ~, either of the form ~/foo.txt or>>> ~user/foo.txt, Qt seems to be 
treating it as a relative path of the>>> current user, and prepends 
“/home/scott” in my case to the path,>> >> Uh... yeah? A path starting with 
"~/" or "~/" has been "shorthand">> for that user's home directory ("~/" 
→ current user) for decades.> > Maybe I wasn’t clear, that is 100% exactly what 
I would expect.
> 
> But instead what is returned is "/home/scott/~/foo.txt"

Ah, I see, what you mean is that *the current working directory* is appended. 
(Which in your example is $HOME, which confused me, since replacing ~ with 
$HOME is expected.)

Yeah... well, the bad news is that tilde expansion (not unlike variable
expansion) is usually a shell function and/or needs to be invoked manually, 
rather than an OS function. It appears that QFileDialog also does the 
expansion, but if your path comes from another source, I guess you need to do 
it yourself.

So you are basically asking the same as 
https://stackoverflow.com/questions/1833261/qt-expand-to-home-directory. 
Unfortunately, the answer there does not appear relevant.

--
Yes.  I had found that, and the answer was at "best" irrelevant.

Sorry to the confusion for the prefix, yes, I should have said 
/current/working/dir/~/foo.txt

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


Re: [Interest] Handling of ~ paths

2020-06-11 Thread Scott Bloom
On 11/06/2020 14.03, Scott Bloom wrote:
> If you are working with a path, for use in QDir, QFileInfo, QFile etc 
> etc, and the path string is using a ~, either of the form ~/foo.txt or 
> ~user/foo.txt, Qt seems to be treating it as a relative path of the 
> current user, and prepends “/home/scott” in my case to the path,


Uh... yeah? A path starting with "~/" or "~/" has been "shorthand" 
for that user's home directory ("~/" → current user) for decades. I'm not sure 
what you were expecting?

   $ cd /
   $ ls -d ~
   /home/matthew

===
Maybe I wasn’t clear, that is 100% exactly what I would expect.

User entry, ~/foo.txt, I would 100% expect QFileInfo( "~/foo.txt" 
).absoluteFilePath() to return "/home/scott/foo.txt"

But instead what is returned is "/home/scott/~/foo.txt"

> and of course, the canonicalPath returns an empty string because that 
> file path is invalid and doesn’t exist.

Why is it invalid? Did you somehow manage to have your home directory not exist?

=
See above, the returned path is /home/scott/~/foo.txt

> What is the Qt way to handle this?  It cant be to tell your users not 
> to use ~.  Can it?

If your intention is to treat "~/foo" as a relative path, the first component 
of which is literally "~", then... yeah, don't do that; that isn't the 
"traditional" interpretation of such a path. If that's what you want, use 
"./~/foo" instead. (If you just need to suppress tilde expansion, you may be 
able to check for paths that start with "~" and always add "./" to the 
beginning of them. Beware, however, that users that expect tilde expansion to 
work may be confused or annoyed.)

--
==
My problem is QFileInfo, QDir and QFile do not appear to be doing the ~ 
expansion

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


  1   2   >