Conversion of Qvector<qreal> to QVariant fails
-
Why is this conversion from QVector<qreal> to QVariant fails?? same code is working in othermodule while reading values from json and filling in the same type of data structure
Other Module, where it conversion is fine
Any suggestions, what am I missing?
-
AnnotationViewerPlugins::RadarChartConfig::on_chartUpdatePBtn_clicked "FRONTLeft_inner_area_yMax" 4.5 AnnotationViewerPlugins::RadarChartConfig::on_chartUpdatePBtn_clicked "FRONTLeft_inner_area_xMin" 4.31 AnnotationViewerPlugins::RadarChartConfig::on_chartUpdatePBtn_clicked "FRONTLeft_inner_area_xMax" 1.81 AnnotationViewerPlugins::RadarChartConfig::on_chartUpdatePBtn_clicked points vec:: QVector(-1.75, 4.5, 4.31, 1.81) AnnotationViewerPlugins::RadarChartConfig::on_chartUpdatePBtn_clicked pt Variant:: QVariant(QVector<double>, )
-
AnnotationViewerPlugins::RadarChartConfig::on_chartUpdatePBtn_clicked pt Variant:: QVariant(QVector<double>, )
So far as I can tell, all that shows is that the result is of type
QVariant(QVector<double>, )
. (Don't know what the significance is of the trailing comma, if any.)I expected you print out the lengths/values, to see what is going on.
Anyway, doesn't the code in the solution at https://stackoverflow.com/questions/40437335/converting-qvariant-to-qvectorint show you what you should be doing?Sorry, that was the wrong way round, it doesQVariant
toQVector
. -
@sayan275
I should have been a lot happier if you extracted the vector from the variant and showed, say, its length rather than relying on the interpretation of howqDebug()
displays a variant overall. I trust you are correct.I agree I am not sure, and I don't know why you seem to show it working in one place and not in another. Why don't you start by temporarily making them integers and testing same code with
QVariant<int>
instead ofQVariant<qreal>
so we can eliminate someqreal
issue?