Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How can I show pinyin on top of characters using PySide?



  • f11765b7-c751-413b-a0ef-cbbc1f22c1f7-image.png

    I have a string of Chinese characters and their respective pinyin. Is there any way I can display them as text like in the image above with PySide?

    I have tried something like this for the CSS part:

    span {
        display: inline-block;
        text-align: center;
    }
    

    As for the HTML part:

    <span>wǒ<br>我</span><span>ài<br>爱</span><span>nǐ<br>你</span>
    

    AFAIK, PyQt does not have full CSS support so the inline-block method does not work. Please correct me if I am wrong. Thank you!