#include <QtWidgets>

class MyWidget : public QWidget
{
public:
    MyWidget(QWidget *parent = 0) : QWidget(parent)
    {
    }
protected:
    void paintEvent(QPaintEvent *e)
    {
        QPainter painter(this);
        painter.setBrush(Qt::black);
        QPainterPath p;
        p.addText(50, 120, font(), QString::fromUtf8("你好!"));
        painter.drawPath(p);
    }
};

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    int id = QFontDatabase::addApplicationFont(":/DroidSansFallback.ttf");
    MyWidget w;
    w.setFont(QFont(QFontDatabase::applicationFontFamilies(id).first(), 48));
    w.resize(500, 500);
    w.show();
    return app.exec();
}
