Converting a float to float*
I have QStandardItem* list in my code
QList<QStandardItem*> lst
Now this is acceptable and works
float a = lst[0]->text().toFloat();
However the following does not work
float* a = &(lst[0]->text().toFloat());
I get an intellisense error stating
Expression must be an lvalue or a function designator
I need a pointer here since I am using an external library that requires a
reference that looks like this
some_class.add_variable(const std::string& variable_name, float& t);
So if I get a pointer I could simply pass it as *a
Any suggetsions on how I could resolve this issue ?
No comments:
Post a Comment