Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to add dynamic icons to an application
Qt 6.11 is out! See what's new in the release blog

How to add dynamic icons to an application

Scheduled Pinned Locked Moved Mobile and Embedded
icons
1 Posts 1 Posters 1.3k Views 2 Watching
  • 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.
  • S Offline
    S Offline
    stuartx
    wrote on last edited by stuartx
    #1

    Hi, I need to add icons to my application to dynamically show the status of devices such as WiFi signal, GPS signal, Battery level, etc. I see these icons on devices every day but I am not sure what is the proper way to implement. After spending a lot of time online search, it seems that most cases use a series of static icon files to represent one device status. For example, if the WiFi has 4 bars at full signal strength, then 5 icon files, ( 0 bar, 1 bar, ..., 4 bar) will be used for different status. If this is the case, how the background color of the icon file can match with the application ?

    @@ after testing several image files as the icon, I noticed that the background color match is NOT an issue. Instead resize of the icon could be a problem in some cases. @@

    I also think that I can create a customized widget to work as an icon. Whenever the device status changes, I update the icon widget with its paint event. This method should have higher performance cost than loading static files, I think.

    So what is the proper way for this task ?

    In addition, if you have any source for this kind of work, with or without license, please drop me a link.

    Any advice and source are greatly appreciated!

    1 Reply Last reply
    1

    • Login

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