Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Missing icons on "ssh -X" execution (fallback theme issue)
Forum Updated to NodeBB v4.3 + New Features

Missing icons on "ssh -X" execution (fallback theme issue)

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 402 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toralf
    wrote on 13 Dec 2018, 08:40 last edited by
    #1

    Hello, everybody!

    I have a Linux Qt application with a tool-bar consisting of icons loaded using QIcon::fromTheme() with standard action icon names from https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html.

    That works mostly fine and the icons look nice and consistent with everything else. However, sometimes users want to execute the application on a different host (where it's installed); they'll open a terminal window and enter a command of the form "ssh -X host myprogram". The remote system is typically running Red Hat Enterprise Linux 6 or 7, while the user is generally logged into GNOME or MATE on the display system. I suspect the behaviour will the the same under different desktop environments, though.

    In this scenario, no icons will be displayed - instead, the tool-bar will have buttons with text only. The problem appears to be that Qt fails to identify a desktop system to pick up an icon theme setting from, and assumes the fall-back recommended in the icon theme specification: "hicolor". But, the "hicolor" theme doesn't actually have any action icons under RHEL - I've looked pretty hard for a package that might contain these, but found nothing.

    What do you think is the best way around this? I guess everything would work if I set up ssh to transfer environment variables like DESKTOP_SESSION and XDG_CURRENT_DESKTOP, which Qt uses to figure out what desktop is active, but I really want everything to work on a "plain" installation without global config changes... I can also think about some other options, like

    • Set DESKTOP_SESSION or XDG_CURRENT_DESKTOP to a hard-coded desktop name internally in the program.
    • Specify the platform more directly via QT_QPA_PLATFORMTHEME.
    • Just use QIcon::setThemeName().

    I'm not sure I like any of them that much, though. Has anyone else come across this issue? What did you do? Also, what's your take on the fact that "hicolor" icons are missing? Is that something to yell at Red Hat about? And, regardless of whether you've had this particular problem, do you generally specify a fallback icon when using QIcon::fromTheme()?

    Qt version may be 4.8.5, 5.6.1 or 5.9.2, by the way - depending on the version of my program. (5.9.2 is the latest release provided by Red Hat and CentOS). I see exactly the same in all cases.

    Thanks.

    Toralf

    1 Reply Last reply
    0

    1/1

    13 Dec 2018, 08:40

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved