Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert eigen vector to QString for display

What is the easiest way to print a vector from the Eigen library in a Qt interface?

Is there an easy way to convert the vector to a QString so that I can use setText()?

Or is there an easier way of doing it?

like image 853
user3482499 Avatar asked Dec 31 '25 05:12

user3482499


1 Answers

I would write the following for an N dimension vector:

QString myString;
for (int i = 0; i < svector; ++i)
    myString.append(QString(vector[i]) + "\n");
myLabel.setText(myString);
like image 154
lpapp Avatar answered Jan 02 '26 17:01

lpapp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!