diff --git a/examples/applets/testtheme/contents/ui/FontGizmo.qml b/examples/applets/testtheme/contents/ui/FontGizmo.qml --- a/examples/applets/testtheme/contents/ui/FontGizmo.qml +++ b/examples/applets/testtheme/contents/ui/FontGizmo.qml @@ -17,7 +17,7 @@ */ import QtQuick 2.1 - +import QtQuick.Window 2.2 import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate @@ -28,7 +28,9 @@ Text { - renderType: QtQuickControlsPrivate.Settings.isMobile ? Text.QtRendering : Text.NativeRendering + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: QtQuickControlsPrivate.Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering font.pointSize: 22 //font.family: theme.defaultFont.family diff --git a/src/declarativeimports/plasmacomponents/qml/Label.qml b/src/declarativeimports/plasmacomponents/qml/Label.qml --- a/src/declarativeimports/plasmacomponents/qml/Label.qml +++ b/src/declarativeimports/plasmacomponents/qml/Label.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.1 +import QtQuick.Window 2.2 import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate import org.kde.plasma.core 2.0 as PlasmaCore @@ -41,7 +42,10 @@ verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter activeFocusOnTab: false - renderType: QtQuickControlsPrivate.Settings.isMobile ? Text.QtRendering : Text.NativeRendering + + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: QtQuickControlsPrivate.Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering font.capitalization: theme.defaultFont.capitalization font.family: theme.defaultFont.family diff --git a/src/declarativeimports/plasmacomponents/qml/private/DualStateButton.qml b/src/declarativeimports/plasmacomponents/qml/private/DualStateButton.qml --- a/src/declarativeimports/plasmacomponents/qml/private/DualStateButton.qml +++ b/src/declarativeimports/plasmacomponents/qml/private/DualStateButton.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.1 +import QtQuick.Window 2.2 import QtQuick.Controls 1.0 import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate import org.kde.plasma.core 2.0 as PlasmaCore @@ -95,7 +96,10 @@ id: label text: dualButton.text - renderType: QtQuickControlsPrivate.Settings.isMobile ? Text.QtRendering : Text.NativeRendering + + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: QtQuickControlsPrivate.Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering anchors { top: parent.top bottom: parent.bottom diff --git a/src/declarativeimports/plasmacomponents3/ComboBox.qml b/src/declarativeimports/plasmacomponents3/ComboBox.qml --- a/src/declarativeimports/plasmacomponents3/ComboBox.qml +++ b/src/declarativeimports/plasmacomponents3/ComboBox.qml @@ -39,6 +39,10 @@ rightPadding: surfaceNormal.margins.right bottomPadding: surfaceNormal.margins.bottom + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering + delegate: ItemDelegate { width: control.popup.width text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData diff --git a/src/declarativeimports/plasmacomponents3/Label.qml b/src/declarativeimports/plasmacomponents3/Label.qml --- a/src/declarativeimports/plasmacomponents3/Label.qml +++ b/src/declarativeimports/plasmacomponents3/Label.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.1 +import QtQuick.Window 2.2 import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore @@ -27,7 +28,10 @@ verticalAlignment: lineCount > 1 ? Text.AlignTop : Text.AlignVCenter activeFocusOnTab: false - renderType: Text.NativeRendering + + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering //font data is the system one by default //TODO: from theme singleton? diff --git a/src/declarativeimports/plasmacomponents3/TextArea.qml b/src/declarativeimports/plasmacomponents3/TextArea.qml --- a/src/declarativeimports/plasmacomponents3/TextArea.qml +++ b/src/declarativeimports/plasmacomponents3/TextArea.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.6 +import QtQuick.Window 2.2 import QtQuick.Controls @QQC2_VERSION@ import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore @@ -41,7 +42,10 @@ opacity: control.enabled ? 1 : 0.6 wrapMode: Text.WordWrap verticalAlignment: TextEdit.AlignTop - renderType: Text.NativeRendering + + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering Label { id: placeholder diff --git a/src/declarativeimports/plasmacomponents3/TextField.qml b/src/declarativeimports/plasmacomponents3/TextField.qml --- a/src/declarativeimports/plasmacomponents3/TextField.qml +++ b/src/declarativeimports/plasmacomponents3/TextField.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.6 +import QtQuick.Window 2.2 import QtQuick.Controls @QQC2_VERSION@ import QtQuick.Templates @QQC2_VERSION@ as T import org.kde.plasma.core 2.0 as PlasmaCore @@ -39,7 +40,10 @@ selectedTextColor: theme.highlightedTextColor verticalAlignment: TextInput.AlignVCenter opacity: control.enabled ? 1 : 0.6 - renderType: Text.NativeRendering + + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering Label { id: placeholder diff --git a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml --- a/src/declarativeimports/plasmastyle/ComboBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/ComboBoxStyle.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.0 +import QtQuick.Window 2.2 import QtQuick.Controls.Styles 1.1 as QtQuickControlStyle import org.kde.plasma.core 2.0 as PlasmaCore @@ -28,6 +29,10 @@ QtQuickControlStyle.ComboBoxStyle { drowDownButtonWidth: units.iconSizes.small + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering + label: PlasmaComponents.Label { text: control.currentText elide: Text.ElideRight diff --git a/src/declarativeimports/plasmastyle/SpinBoxStyle.qml b/src/declarativeimports/plasmastyle/SpinBoxStyle.qml --- a/src/declarativeimports/plasmastyle/SpinBoxStyle.qml +++ b/src/declarativeimports/plasmastyle/SpinBoxStyle.qml @@ -19,6 +19,7 @@ */ import QtQuick 2.0 +import QtQuick.Window 2.2 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.1 as QtQuickControlStyle import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate @@ -40,7 +41,9 @@ selectedTextColor: theme.viewBackgroundColor - renderType: QtQuickControlsPrivate.Settings.isMobile ? Text.QtRendering : Text.NativeRendering + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: QtQuickControlsPrivate.Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering PlasmaCore.Svg { id: arrowSvg diff --git a/src/declarativeimports/plasmastyle/TextAreaStyle.qml b/src/declarativeimports/plasmastyle/TextAreaStyle.qml --- a/src/declarativeimports/plasmastyle/TextAreaStyle.qml +++ b/src/declarativeimports/plasmastyle/TextAreaStyle.qml @@ -19,6 +19,7 @@ import QtQuick 2.1 +import QtQuick.Window 2.2 import QtQuick.Controls.Styles 1.1 as QtQuickControlStyle import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate import QtQuick.Controls 1.1 @@ -41,7 +42,9 @@ selectionColor: control.backgroundVisible ? theme.viewFocusColor : PlasmaCore.ColorScope.highlightColor selectedTextColor: control.backgroundVisible ? theme.viewHighlightedTextColor : PlasmaCore.ColorScope.highlightedTextColor - renderType: QtQuickControlsPrivate.Settings.isMobile ? Text.QtRendering : Text.NativeRendering + // Work around Qt bug where NativeRendering breaks for non-integer scale factors + // https://bugreports.qt.io/browse/QTBUG-67007 + renderType: QtQuickControlsPrivate.Settings.isMobile || Screen.devicePixelRatio % 1 !== 0 ? Text.QtRendering : Text.NativeRendering frame: PlasmaCore.FrameSvgItem { id: base diff --git a/src/declarativeimports/plasmastyle/TextFieldStyle.qml b/src/declarativeimports/plasmastyle/TextFieldStyle.qml --- a/src/declarativeimports/plasmastyle/TextFieldStyle.qml +++ b/src/declarativeimports/plasmastyle/TextFieldStyle.qml @@ -18,6 +18,7 @@ */ import QtQuick 2.0 +import QtQuick.Window 2.2 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.1 as QtQuickControlStyle import QtQuick.Controls.Private 1.0 as QtQuickControlsPrivate @@ -40,8 +41,10 @@ * more blurred with different rendring types. * Using Qt rendering, the dots will look more aligned and equally spaced. * Also if we are on mobile, make sure we use QtRendering + * Finally, use QtRendering if we're using a non-integer scale factor to work around + * https://bugreports.qt.io/browse/QTBUG-67007 */ - renderType: !QtQuickControlsPrivate.Settings.isMobile && control.echoMode == TextInput.Normal ? Text.NativeRendering : Text.QtRendering + renderType: !QtQuickControlsPrivate.Settings.isMobile && control.echoMode == TextInput.Normal && Screen.devicePixelRatio % 1 == 0 ? Text.NativeRendering : Text.QtRendering background: Item { //QQC button heights are max(backgroundHeight, label + margins).