[Interest] fixit in Creator 7.01

2022-05-04 Thread John Weeks
Our old code has tons of assignments inside if statements, like:
if (err = somefunction())
return err;

These are flagged by the clangd suggesting that it should be either
if ( (err = somefunction()) )
or
if (err == somefunction())

In the past, if you left-clicked on the little light bulb at the end of the 
line, it would put up a menu of fixits, offering a choice of those two fixes. 
In 7.01, when I left-click, it simply goes ahead and applies the *second* fix 
without presenting a choice. That, of course, creates a very hard-to-see bug.

I can just barely see where someone might think this change is a good idea, but 
it seems more likely to be a bug. Thought I would ask before filing a bug, as 
I'm not very good at searching the bugs data base.

At one point, I clicked on the yellow triangle in the left margin and got the 
little fixit widget. I clicked on the one I wanted (adding parens) and it 
applied BOTH fixes!

-John Weeks

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


Re: [Interest] QColumnView and QTreeView using same model

2022-05-04 Thread Michael Jackson
Thank you for the tips. Got the checkboxes working. 
--
Mike Jackson

On 5/4/22, 10:06 AM, "Interest on behalf of Tony Rietwyk" 
 wrote:

On 4/05/2022 11:43 pm, Michael Jackson wrote:
> ...
> Now on to figure out how to display checkboxes next to each item. I've 
tried:
>
> Qt::ItemFlags ImportDataStructureModel::flags(const QModelIndex& index) 
const
> {
>if(!index.isValid())
>{
>  return {};
>}
>return Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | 
QAbstractItemModel::flags(index);
> }
>
> Which does not seem to show anything. I'll probably have to create a 
custom delegate.
> --
> Mike Jackson
>
Hi Mike,

If you return flag ItemIsUserCheckable in your model, then you must also 
return a valid variant with Qt::CheckState for data(Qt::CheckStateRole) 
- it won't just assume Qt::Unchecked.

Ditto with the item widgets - besides item->setFlags, you need to call 
item->setCheckState as well.

Tony

___
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] QColumnView and QTreeView using same model

2022-05-04 Thread Tony Rietwyk

On 4/05/2022 11:43 pm, Michael Jackson wrote:

...
Now on to figure out how to display checkboxes next to each item. I've tried:

Qt::ItemFlags ImportDataStructureModel::flags(const QModelIndex& index) const
{
   if(!index.isValid())
   {
 return {};
   }
   return Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | 
QAbstractItemModel::flags(index);
}

Which does not seem to show anything. I'll probably have to create a custom 
delegate.
--
Mike Jackson


Hi Mike,

If you return flag ItemIsUserCheckable in your model, then you must also 
return a valid variant with Qt::CheckState for data(Qt::CheckStateRole) 
- it won't just assume Qt::Unchecked.


Ditto with the item widgets - besides item->setFlags, you need to call 
item->setCheckState as well.


Tony

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


Re: [Interest] QColumnView and QTreeView using same model

2022-05-04 Thread Michael Jackson
Thanks for the help. I was able to track it down to errors in my parent(…) 
method. I was just returning:

return createIndex(0, 0, some_unique_value);

which apparently works just fine for tree views but not for QColumnView.

Now on to figure out how to display checkboxes next to each item. I've tried:

Qt::ItemFlags ImportDataStructureModel::flags(const QModelIndex& index) const
{
  if(!index.isValid())
  {
return {};
  }
  return Qt::ItemIsUserCheckable | Qt::ItemIsSelectable | 
QAbstractItemModel::flags(index);
}

Which does not seem to show anything. I'll probably have to create a custom 
delegate.
--
Mike Jackson


--
Michael Jackson | Owner, President
  BlueQuartz Software
[e] mike.jack...@bluequartz.net
[w] www.bluequartz.net


On 5/3/22, 6:07 PM, "Scott Bloom"  wrote:

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"  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] [Development] Issues with latest Qt MaintenanceTool and Kaspersky

2022-05-04 Thread Kai Köhne

> -Ursprüngliche Nachricht-
> [...]
> Is there a reason to be using a vbs file ? In windows a running executable
> cannot replace itself, but it can rename itself. [...]

Hi Julien,

I don't know the exact reasons why the .vbs approach was chosen. I now filed 
https://bugreports.qt.io/browse/QTIFW-2625 with your suggestion, maybe the 
Installer Team wants to give it a try 

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


Re: [Interest] [Development] Issues with latest Qt MaintenanceTool and Kaspersky

2022-05-04 Thread Julien Cugnière
Le mer. 4 mai 2022 à 08:44, Kai Köhne  a écrit :
> They are not _included_ in the MaintenanceTool package. Anyhow, 
> "deferredrenameXX.vbs”are temporary files the MaintenaceTool.exe writes 
> to schedule an update of itself. That is, because on Windows an executable 
> cannot be replaced when it is running, the MaintenanceTool.exe
>
> Saves the new MaintenanceTool.exe in parallel
> Writes above .vbs file, and starts it
> Stops itself
>
> The .vbs script will then every second try to replace the original .exe file, 
> and – after being successful – restarting the MaintenanceTool.

Hi,

Is there a reason to be using a vbs file ? In windows a running
executable cannot replace itself, but it can rename itself. The way
I've done it in the past is:

* The running executable renames itself.
* It then creates the new executable with the correct name.
* Just before returning from main, it starts the new executable (there
is a short window of time where both the old and new one can be
running, but it doesn't matter if the old one is not using any
resources any more ; if need be, the new one can be given a flag to
wait for the old one to exit).

I find it simpler, and much less likely to trigger an antivirus than a
vbs file :)

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


Re: [Interest] Issues with latest Qt MaintenanceTool and Kaspersky

2022-05-04 Thread Kai Köhne
Hi,

> Are deferredrenamekERbOS.vbs and deferredrenameQIoNFA.vbs included in the 
> MaintenanceTool package?

They are not _included_ in the MaintenanceTool package. Anyhow, 
"deferredrenameXX.vbs”are temporary files the MaintenaceTool.exe writes to 
schedule an update of itself. That is, because on Windows an executable cannot 
be replaced when it is running, the MaintenanceTool.exe

  *   Saves the new MaintenanceTool.exe in parallel
  *   Writes above .vbs file, and starts it
  *   Stops itself

The .vbs script will then every second try to replace the original .exe file, 
and – after being successful – restarting the MaintenanceTool.


Why Kaspersky now starts to complain about it: No idea :/ Anyhow, we had false 
positives about the MaintenanceTool before, the best process to fix it is 
probably to report the false positive to Kaspersky: 
https://support.kaspersky.com/viruses/answers/1870 . Would you like to do that 
(since you still have the temporary files, I assume)?

Regards

Kai

Von: Interest  Im Auftrag von Nibedit Dey
Gesendet: Dienstag, 3. Mai 2022 22:06
An: developm...@qt-project.org; interest@qt-project.org
Betreff: [Interest] Issues with latest Qt MaintenanceTool and Kaspersky

Hello Qt Team,

I just ran the updater using the MaintenanceTool. After the update, the 
MaintenanceTool got listed as malware by Kaspersky Anti-Virus and removed from 
the system.
Refer to the screenshot below:
[cid:image001.png@01D85F92.23A1F470]

[cid:image002.png@01D85F92.23A1F470]

I have been using both Qt and KAV together for the last several years without 
any issues.
Are deferredrenamekERbOS.vbs and deferredrenameQIoNFA.vbs included in the 
MaintenanceTool package?
Why suddenly did the anti-virus start listing it as malware? Has anyone else 
observed this?

Thanks & Regards,
Nibedit
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest