Hi Qt developers,

I wrote a simple Qt4 code to get a QMainWindow with Partial Transparent Background and Custom Shape..
Here the core of my application:

Qt Code:
  1. setMask((new QPixmap("logoic_big.png"))->mask());
  2.  
  3. QPalette* palette = new QPalette();
  4. palette->setBrush(QPalette::Background,*(new QBrush(*(new QPixmap("logoic_big.png")))));
  5. setPalette(*palette);
  6.  
  7. setWindowFlags(Qt::FramelessWindowHint);
  8. QWidget *centralWidget = new QWidget(this);
  9. QGridLayout *layout = new QGridLayout();
  10.  
  11. centralWidget->setLayout(layout);
  12.  
  13. QPushButton* m_showAddCommentButton = new QPushButton();
  14. m_showAddCommentButton->setFlat(true);
  15. m_showAddCommentButton->setAutoFillBackground(true);
  16. m_showAddCommentButton->setFixedSize(40,40);
  17. QPalette palett = m_showAddCommentButton->palette();
  18. palett.setColor(QPalette::Button,QColor(Qt::transparent));
  19. m_showAddCommentButton->setPalette(palett);
  20. m_showAddCommentButton->setIcon(QIcon("exit.png"));
  21. m_showAddCommentButton->setIconSize(QSize(40,40));
  22. m_showAddCommentButton->setToolTip("Close");
  23.  
  24. layout->addWidget(m_showAddCommentButton,0,0);
  25.  
  26. setCentralWidget(centralWidget);
  27.  
  28. connect(m_showAddCommentButton, SIGNAL(clicked()), this, SLOT(close()));
To copy to clipboard, switch view to plain text mode 

My question is:
How can I put buttons in a specified positon, that I like, of my custom shape QmainWindows ?

Many thanks in advance..
roby