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

while setting a softkey action in a qt application on symbian, the icon specified only is shown partially

    XMLWordPrintable

Details

    • dabc653c47c3fcdbbe9e59b8e55306bc0a4d8006

    Description

      If we set a icon on a QAction, the Icon pixmap is only displayed in half.

      Example Code:

      	QAction *refreshAction = new QAction(this);
      	refreshAction->setSoftKeyRole(QAction::PositiveSoftKey);
      	refreshAction->setIcon(style()->standardIcon(QStyle::SP_BrowserReload));
      	addAction(refreshAction);
      

      Traced the bug in the following component

      QPoint QSoftKeyManagerPrivateS60::softkeyIconPosition(int position, QSize sourceSize, QSize targetSize)
      {
          QPoint iconPosition(0,0);
          switch( AknLayoutUtils::CbaLocation() )
              {
              case AknLayoutUtils::EAknCbaLocationBottom:
                  // RSK must be moved to right, LSK in on correct position by default
                  if (position == RSK_POSITION)
                      iconPosition.setX(targetSize.width() - sourceSize.width());
                  break;
              case AknLayoutUtils::EAknCbaLocationRight:
              case AknLayoutUtils::EAknCbaLocationLeft:
                  // Already in correct position
              default:
                  break;
              }
      
          // Align horizontally to center
          iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1);
          return iconPosition;
      }
      

      The calculation for the Y position messed things up. If I just reset the Y Position to 0, the icon can be seen in full.

      I dont know what the component is so I chose Core:Resource System. Please reassign appropriately

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            e0348803 Miikka Heikkinen
            baheti Shubham Baheti
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes