Search code examples
c++qcustomplot

How to show math symbols like theta


I'm trying to find a way to show math symbols such as \theta, \phi, \dot{\theta}, ..., etc. I couldn't find a way to show these letters in my plot. Does qcustomplot support math symbols? I've tried the following line but very few letters show up but the rest doesn't.

ui->customPlot1->graph(0)->setName(QString("\u0024"));


Solution

  • In my Qt GUI in Windows 7, the following line worked

     title->setText(QString::fromWCharArray(L"\u03B8\u2081(t) vs \u03B8\u2081\u1d48(t)"));
    

    The result is

    enter image description here

    where \u03B8 is \theta, \u2081 is subscript one, and \u1d48 is subscript d. For the rest of charaters, see this link.