Important: Please read the Qt Code of Conduct -

Bad antialized text shadow

  • Hello,

    I tried to create a white text with shadow on yellow background. On my linux I get ugly text.

    Here is the example qml

    import QtQuick 2.11
    import QtQuick.Window 2.11
    import QtGraphicalEffects 1.0
    Window {
        visible: true
        width: 640
        height: 480
        Rectangle {
            id: background
            anchors.fill: parent
            color: "#f7dc16"
            Text {
                id: text
                anchors.verticalCenter: background.verticalCenter
                anchors.horizontalCenter: background.horizontalCenter
                color: "white"
                font.bold: true
                font.pixelSize: 22
                text: "Hello World"
                layer.enabled: true
                layer.effect: DropShadow {
                    verticalOffset: 1
                    horizontalOffset: 1
                    radius: 0
        title: qsTr("Hello World")

    In this case I get "green" lines at the left side of the rendered characters:

    Could you tell me, what I make wrong? Thanks:
    Antal Tatrai

Log in to reply