Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.12.0, 5.12.1, 5.12.2, 5.12.3
-
None
Description
If the icon to show doesn't have square dimensions, it's stretched. That's doesn't look well, so I suggest adding a icon.fillMode (like Image.fillMode) property to the controls that support icons.
UPDATE
As mitch_curtis suggested, I will add a working example:
Consider the two following SVG icons:
0.svg
<svg width="512" height="256"> <circle cx="256" cy="128" r="96" style="fill: red; stroke: black; stroke-width: 24"/> </svg>
1.svg
<svg width="256" height="512"> <circle cx="128" cy="256" r="96" style="fill: blue; stroke: black; stroke-width: 24"/> </svg>
And the following main.qml:
main.qml
import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Window 2.15 Window { ComboBox { anchors.centerIn: parent model: 2 delegate: MenuItem { width: parent.width text: "Index " + modelData icon.source: index + ".svg" icon.color: "transparent" } } }
Despite the icons are both circles, when running the above example with qmlscene this is what we obtain:
Attachments
Issue Links
- relates to
-
QTBUG-110876 AbstractButton: add icon.mirror property
- Reported