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

Wrong resolution of Icon in Windows (Toast) Notifications

    XMLWordPrintable

Details

    • Windows
    • 94809cdec (dev), 7c22796a9 (6.7), 00c1ceb36 (6.6)

    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

        1. blurred.png
          blurred.png
          40 kB
        2. correct.png
          correct.png
          40 kB
        3. WrongResolutionOfNotificationIcon.png
          WrongResolutionOfNotificationIcon.png
          451 kB
        For Gerrit Dashboard: QTBUG-103825
        # Subject Branch Project Status CR V

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes