Bug 433433 - Components that use StylePrivate.StyleItem to render content can't handle icon.source
Summary: Components that use StylePrivate.StyleItem to render content can't handle ico...
Status: CONFIRMED
Alias: None
Product: frameworks-qqc2-desktop-style
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
: 509438 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-22 17:14 UTC by Nate Graham
Modified: 2025-09-19 16:04 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
KDE notification with a missing icon (20.48 KB, image/png)
2025-09-19 11:24 UTC, Gauthier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2021-02-22 17:14:43 UTC
This is because the base QWidgets component that's being called can only support taking an icon string, not a URL. As a result, using icon.source produces no result in Button, ToolButton, RoundButton, CheckBox, and MenuItem.

Simple test case:


import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.13

Item {
    implicitWidth: 400
    implicitHeight: 400

    ColumnLayout {
        anchors.centerIn: parent

        Button {
            Layout.alignment: Qt.AlignHCenter
            text: "I wish I had an icon"
            icon.source: "https://dl.flathub.org/repo/logo.svg"
        }

        Button {
            Layout.alignment: Qt.AlignHCenter
            text: "Look at my beautiful icon"
            icon.name: "edit-bomb"
        }
    }
}
Comment 1 David Redondo 2021-02-23 08:13:07 UTC
Probably  need to do it like Kirigami
https://invent.kde.org/frameworks/kirigami/-/blob/master/src/icon.cpp#L402
Comment 2 Bug Janitor Service 2021-04-19 21:15:13 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/67
Comment 3 Nate Graham 2021-04-23 14:37:12 UTC
Git commit 35e6076565d565922939eeca11e93abe67f7b664 by Nate Graham.
Committed on 19/04/2021 at 21:11.
Pushed by ngraham into branch 'master'.

Draw icon in QQStyleItem

Checkbox already knew how to do this, but it was doing so internally to
itself. Let's move that logic to CheckDelegate.qml so that everything
that uses it gains the same feature. This functionality can be optionally
disabled in case a control using it already handles icon-drawing by itself.

M  +4    -4    org.kde.desktop/CheckBox.qml
M  +5    -2    org.kde.desktop/CheckDelegate.qml
M  +12   -1    org.kde.desktop/CheckIndicator.qml
M  +2    -0    org.kde.desktop/MenuItem.qml
M  +4    -4    org.kde.desktop/RadioButton.qml
M  +5    -2    org.kde.desktop/RadioDelegate.qml

https://invent.kde.org/frameworks/qqc2-desktop-style/commit/35e6076565d565922939eeca11e93abe67f7b664
Comment 4 Nate Graham 2025-02-22 16:40:16 UTC
Still an issue despite that commit.
Comment 5 Roke Julian Lockhart Beedell 2025-03-22 22:07:09 UTC
(In reply to Nate Graham from comment #4)  
Does https://github.com/nextcloud/desktop/issues/7419#issuecomment-2745794768 appear to be an example of this?
Comment 6 Gauthier 2025-05-20 09:00:35 UTC
Is there any movement on this? If this is indeed a manifestation of the glitches in the nextcloud client then it is rather problematic as it makes the client look totally broken under KDE plasma (does not give a great image of plasma).
Comment 7 Nate Graham 2025-05-20 17:39:20 UTC
If there was, you'd see it reflected here. :)
Comment 8 Gauthier 2025-05-20 20:50:53 UTC
(In reply to Nate Graham from comment #7)
> If there was, you'd see it reflected here. :)

Sure, thanks. It's just sometime depending what component are affected things move in separate places (e.g. invent / git / qtbug) and not always reported here (until say a fix). Also I was surprised Roke's question hadn't been answered.
Comment 9 Roke Julian Lockhart Beedell 2025-05-20 21:10:31 UTC
(In reply to Gauthier from comment #8)

> Also I was surprised Roke's question hadn't been answered.

Thanks 🥲
Comment 10 Nate Graham 2025-05-21 15:59:28 UTC
Per https://github.com/nextcloud/desktop/issues/7419#issuecomment-2745794768, yes it looks like that issue is caused by this bug.
Comment 11 Roke Julian Lockhart Beedell 2025-05-21 19:42:44 UTC
(In reply to Nate Graham from comment #10)

Is that possible, since per https://github.com/nextcloud/desktop/issues/7419#issuecomment-2466272561, it also reproduces on Windows?
Comment 12 Nate Graham 2025-05-22 15:35:33 UTC
If they're shipping the qqc2-desktop-style on Windows, it would be the same issue, yes.

If they're shipping a custom style on Windows that has the same issue as qqc2-desktop-style does, that would be another way for it to happen there.
Comment 13 Roke Julian Lockhart Beedell 2025-09-19 10:37:50 UTC
*** Bug 509438 has been marked as a duplicate of this bug. ***
Comment 14 Matthieu Gallien 2025-09-19 10:50:15 UTC
(In reply to Nate Graham from comment #12)
> If they're shipping the qqc2-desktop-style on Windows, it would be the same
> issue, yes.
> 
> If they're shipping a custom style on Windows that has the same issue as
> qqc2-desktop-style does, that would be another way for it to happen there.

the issue is when running the nextcloud desktop client from a KDE Plasma workspace

I currently use this workaround
QT_QPA_PLATFORMTHEME=gtk3 ./nextcloud

which is not ideal
Comment 15 Gauthier 2025-09-19 11:24:05 UTC
Created attachment 185089 [details]
KDE notification with a missing icon

Unfortunately "QT_QPA_PLATFORMTHEME=gtk3 nextcloud" doesn’t solve the issue for me. I still get the missing icons.

Also I have notice similar missing icons else in KDE, for exemplar in some (but not all) KDE connect notifications (see screenshot attached).

Operating System: Fedora Linux 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2
Kernel Version: 6.16.7-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 PRO 6650U with Radeon Graphics
Memory: 32 GiB of RAM (30.7 GiB usable)
Graphics Processor: AMD Radeon Graphics
Comment 16 TraceyC 2025-09-19 16:04:02 UTC
(In reply to Gauthier from comment #15)
> Created attachment 185089 [details]
> KDE notification with a missing icon

The screenshot shows the KDE Connect icon in the upper left
In the body "Sensitive notification content hidden"
Then a Reply button and a blank button / missing icon