question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Generator Qt5 - QStringList parameter fails

See original GitHub issue

Qt version: 5.15.2

Description

Lately the parameters has been changed to QVariant. The conversions fails to work for QStringList.

Details

Passing a QStringList or a QList<QString> as a parameter is converted to a QVariant. Inside the generated method there is an attempt to convert QVariant back via var.value<QList<QString>>() which fails to work.

Solution

After patching the var.value<QList<QString>>() to var.value<QStringList>() the interface works as intended.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Jazzcocommented, Mar 15, 2021

This fix now works and produces the expected result. 👍 The need to convert a char* to a QString is just a question of convenience.

1reaction
etherealjoycommented, Mar 13, 2021

I found the reason of the crash, it was from a different commit

        if(findChildren<PFXHttpRequestWorker>().count() == 0){

should be

        if(findChildren<PFXHttpRequestWorker*>().count() == 0){

Now it is fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with QStringList - bug or feature? - Qt Forum
I ran into a problem with QStringList. I have been able to create a small example showing the problem. For comparison I have...
Read more >
How to iterate through a QStringList - c++ - Stack Overflow
Here is how you can iterate through a QStringList using C++11's range-based for loop: const QStringList list { "A", "B", "C" }; for...
Read more >
Migrating a Harvester HMI from Qt 5.12 to Qt 6.2
Sometimes the use of a deprecated function causes an error. ... argument is a QStringList with the options and arguments of the command....
Read more >
Understand the Qt containers - Marc Mutz - WordPress.com
Qt containers only have range-erase. All STL containers have an Allocator template argument. While rather arcane, the allocator allows to place the elements...
Read more >
qprocess.h source code [qtbase/src/corelib/io ... - Code browser
115, FailedToStart , //### file not found, resource error. 116, Crashed ,. 117, Timedout , ... 179, void setArguments (const QStringList & arguments...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found