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:


    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!