Can I globally switch to my own text rendering in Qt Quick Controls 2?

I would like to use my own rendering for all the text in my application. For each item Text, Labeletc. I can do it

Text {
    renderType: Text.NativeRendering
}

to invoke your own rendering. I can also use the software renderer for the whole application:

QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);

However, due to some bugs with the software renderer and some performance issues, I would like to avoid this.

Is there a global switch for changing the type of rendering?

+4
source share
2 answers

Qt 5.7, Qt Quick , , , . , libQt5Quick.so QT_QUICK_DEFAULT_TEXT_RENDER_TYPE, NativeRendering. . https://codereview.qt-project.org/#/c/121748/.

Qt qt.io, , , qtdeclarative/src/quick, qmake define build. - :

cd path/to/Qt/Sources/5.8/qtdeclarative/src/quick
# NOTE: make sure to run qmake from the same/correct Qt installation
path/to/Qt/5.8/<spec>/qmake "DEFINES+=QT_QUICK_DEFAULT_TEXT_RENDER_TYPE=NativeRendering"
make -jN

Qt-, make clean ( , qquicktext*.o) make, .

EDIT: Qt 5.10, ++ QQuickWindow::setTextRenderType(). , QML.

+2

QML_DISABLE_DISTANCEFIELD .

qputenv("QML_DISABLE_DISTANCEFIELD", "1");

, .

: http://www.kdab.com/~thomas/stuff/distancefield.html

+2

Source: https://habr.com/ru/post/1674658/


All Articles