Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103825

Wrong resolution of Icon in Windows (Toast) Notifications

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.2, 6.3.0
    • GUI: Other
    • None
    • Windows

    Description

      If a Windows (Toast) Notifiaction is send with the showMessage function of QSystemTrayIcon the given Icon is in the wrong resolution. The icon itself is scaled into a smaller resolution and upscaled by Windows to the desired size. As you can see in the image attached the icon is completly pixelated. 

      The error should reside in qwindowssystemtrayicon.cpp at line 283:

      QPixmap pm = icon.pixmap(size);    
      if (pm.isNull()) {        
          tnd.dwInfoFlags = NIIF_INFO;    
      } else {        
          if (pm.size() != size) {            
              qWarning("QSystemTrayIcon::showMessage: Wrong icon size (%dx%d), please add      standard one: %dx%d",                      
              pm.size().width(), pm.size().height(), size.width(), size.height());            
              pm = pm.scaled(size, Qt::IgnoreAspectRatio);        
          }        
          tnd.hBalloonIcon = qt_pixmapToWinHICON(pm);    
      }
      

      On Windows 8.1 or newer the check if it's a large or small icon should be deprecated.

      Attachments

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            thomas_stachl Thomas Stachl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: