icon.source property not working in QML Button?
Belz Ulrich
ulbemu at mnet-online.de
Tue May 3 19:33:11 BST 2022
Indeed, after upgrading to 6.3.0, it works. Thank you very much.
Am 03.05.2022 um 04:27 schrieb Yuya Nishihara:
> On Mon, 2 May 2022 23:26:15 +0200, Belz Ulrich wrote:
>> It looks like the icon.source property of a QML Button is not working
>> (PyQt 6.2.2). The referenced image is not shown. Example to reproduce:
>> Button {
>> id: button
>> x: 200
>> y: 100
>> width: 48
>> height: 48
>> visible: true
>> display: Button.IconOnly
>> icon.source: "./icon-arrow-down-red.png"
> Basically you need to wrap relative paths with Qt.resolvedUrl() in Qt 6.
>
> There's a significant behavior change regarding relative path (or URL)
> resolution, and icon.source is broken until Qt 6.2.5.
>
> https://doc.qt.io/qt-6/qml-changes-qt6.html#url-resolution
> https://bugreports.qt.io/browse/QTBUG-95587
More information about the PyQt
mailing list