do what?
Derive a class?
Am... this is basic C++.
Its not something some one can teach you on a forum thread...
This book should be a good start.

At any rate here is the answer to you question:
Qt Code:
  1. class QMessageBoxEx : publick QMessageBox
  2. {
  3. //contructors, destructors
  4. static StandardButton /*or a new enum if you define one*/ warning ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton );
  5. }
  6.  
  7. StandardButton QMessageBoxEx::warning ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons, StandardButton defaultButton, StandardButton defaultButton )
  8. {
  9. //your implementation
  10. }
To copy to clipboard, switch view to plain text mode 

or something similar