[BUG] Generator Qt5 - QStringList parameter fails
See original GitHub issueQt 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:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This fix now works and produces the expected result. 👍 The need to convert a
char*
to aQString
is just a question of convenience.I found the reason of the crash, it was from a different commit
should be
Now it is fine.