title: Qt- How to merge four images in single rounded image
body: <p>I tried to show avatar image in rounded form. it was working good. </p>
  
  <pre><code>QImage image(":/images/person1.png");
  
  if (image.width() != CGlobalZone::AVATAR_WIDTH_M ||
          image.height() != CGlobalZone::AVATAR_HEIGHT_M)
      image = image.scaled(QSize(CGlobalZone::AVATAR_WIDTH_M , CGlobalZone::AVATAR_HEIGHT_M ),
                           Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
  
  QImage roundedImage(CGlobalZone::AVATAR_WIDTH_M, CGlobalZone::AVATAR_HEIGHT_M, QImage::Format_ARGB32);
  
  roundedImage.fill(Qt::transparent);
  
  QBrush brush(image);
  QPainter painter(&amp;roundedImage);
  QPen pen(QColor(176, 216, 242), 1);
  
  painter.setPen(pen);
  painter.setRenderHint(QPainter::Antialiasing);
  painter.setBrush(brush);
  painter.drawEllipse(1.0, 1.0, CGlobalZone::AVATAR_WIDTH_M - 2, CGlobalZone::AVATAR_HEIGHT_M - 2);
  
  m_defaultAvatar = QPixmap::fromImage(roundedImage);
  </code></pre>
  
  <p><em>AVATAR_WIDTH_M</em> &amp; <em>AVATAR_HEIGHT_M</em> are public variables.<br> Here what is result of this lines:<br>
  <img src="https://i.stack.imgur.com/crhXb.png" alt="enter image description here"><br>
  Now , I want to change it to rounded image with merging four photos. I've changed this line </p>
  
  <pre><code>    image.height() != CGlobalZone::AVATAR_HEIGHT_M)
  image = image.scaled(QSize(CGlobalZone::AVATAR_WIDTH_M , CGlobalZone::AVATAR_HEIGHT_M ),
                       Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
  </code></pre>
  
  <p>To this:</p>
  
  <pre><code>   image.height() != CGlobalZone::AVATAR_HEIGHT_M)
  image = image.scaled(QSize(CGlobalZone::AVATAR_WIDTH_M / 2, CGlobalZone::AVATAR_HEIGHT_M /2),
                       Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
  </code></pre>
  
  <p>And result is :<br>
  <img src="https://i.stack.imgur.com/8jMzb.png" alt="enter image description here"><br>
  It was good for me but it's not enough. target is using four different images in this rounded avatar instead of single image. How to change above codes to merge <br>
     <strong>QImage image(":/images/person1.png");<br>
  and <br>
     QImage image2(":/images/person2.png");<br>
  and <br>
     QImage image(":/images/person3.png");<br>
  and<br>
     QImage image4(":/images/person4.png");</strong></p>