I need to create QDialog-based control with custom title and close button. Simple way is to add some methods for controlling title and close button, but I want to have a possibility to style subcontrols through qss ::title and ::close-button selectors, which are already defined for QDockWidget. I want to do something like the following:

Qt Code:
  1. MyDialog::title {
  2. subcontrol-origin:margin;
  3. subcontrol-position:left;
  4. color: white;
  5. .... etc....
  6. }
  7.  
  8. MyDialog::close-button {
  9. subcontrol-origin:margin;
  10. subcontrol-position:right;
  11. image: url(./img.png);
  12. .... etc....
  13. }
To copy to clipboard, switch view to plain text mode 

Is it possible at all ?