Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. QIcon ThemeIcons not showing up in WebAssembly apps
Forum Updated to NodeBB v4.3 + New Features

QIcon ThemeIcons not showing up in WebAssembly apps

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
qiconthemeicon
3 Posts 2 Posters 499 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.
  • P Offline
    P Offline
    pmacmillan2000
    wrote on 3 Mar 2025, 23:00 last edited by
    #1

    I have a very simple "hello, world" Qt Widgets app, with a QPushButton on the QMainWindow-derived main window.

    I used the Property Editor in Qt Creator to specify an icon property for the button, chosen from among the built-in Theme icons. Everything works fine in a Desktop version of the app but in the Web Assembly version, the icon does not show up.

    Is this expected?

    Thanks

    here is the ui xml:
    <widget class="QPushButton" name="pushButton">
    <property name="geometry">
    <rect>
    <x>30</x>
    <y>20</y>
    <width>171</width>
    <height>51</height>
    </rect>
    </property>
    <property name="text">
    <string>PushButton</string>
    </property>
    <property name="icon">
    <iconset theme="QIcon::ThemeIcon::DocumentPrint"/>
    </property>
    </widget>

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pmacmillan2000
      wrote on 3 Mar 2025, 23:16 last edited by
      #2

      Here it is working in a desktop app:

      Screenshot1.png

      And here it is not working in a Web Assembly app:

      Screenshot2.png

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gilboonet
        wrote on 4 Mar 2025, 09:50 last edited by
        #3

        For WebAssembly you cannot use theme icons directly but must use the Qt Ressource System

        1 Reply Last reply
        2

        1/3

        3 Mar 2025, 23:00

        • Login

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