I tried this code then did QEllipseButton b; b.setText("woot"); b.show(); in a simple window of Qt, and it will not show the area. I tried r3, and r1, update,setting a background... but it wont make me a button with a different size.

Like I would like to make an egg shaped button that works just like a pushbutton, but has a nice background image on it.

Qt Code:
  1. class QEllipseButton : public QPushButton {
  2. public:
  3. QEllipseButton(QWidget * parent = 0): QPushButton(parent){
  4. }
  5. protected:
  6. void paintEvent ( QPaintEvent * event ){
  7. QRegion r1(QRect(200, 50, 500, 400), // r1: elliptic region
  8. QRegion::Ellipse);
  9. QRegion r2(QRect(200, 70, 90, 30)); // r2: rectangular region
  10. QRegion r3 = r1.intersected(r2); // r3: intersection
  11.  
  12. QPainter painter(this);
  13. painter.setClipping(true);
  14. painter.setClipRegion(r1);
  15. //QBrush brush(QColor(255,0,0,255));
  16. //painter.setBackground(brush);
  17. //update();
  18. }
  19. };
To copy to clipboard, switch view to plain text mode 

thx for help.