Hello everyone,

i'm not new to Qt, however i'm very new to applying stylesheets to widgets. That's why i'm posting in this topic. If you feel that i should be posting in the "Programming" section, tell me and i'll delete this post and create it later.

So basically, i have a QTextEdit widget on a dialog, and i'm trying to apply a stylesheet on it. My stylesheet is in a resource file, and contains this:
Qt Code:
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. color: Black;
  5. white-space: normal;
  6. font-family: Arial;
  7. font-size: 10px;
  8. font-weight: normal;
  9. }
  10. h1 {
  11. color: Red;
  12. font-size: 11px;
  13. }
  14. h2 {
  15. color: Red;
  16. font-size: 10px;
  17. }
  18. h3 {
  19. color: Red;
  20. font-size: 10px;
  21. }
To copy to clipboard, switch view to plain text mode 

Then on my dialog constructor, i do:
Qt Code:
  1. // Set up stylesheet on slip summary widget.
  2. QFile fStyle(":/Resources/Stylesheets/SlipSummary.css");
  3. fStyle.open (QIODevice::ReadOnly|QIODevice::Text);
  4. _ui.txtSlipSummary->setStyleSheet(fStyle.readAll());
  5. fStyle.close();
To copy to clipboard, switch view to plain text mode 

My main problem is that no titles are being shown in red. If i put the "color: red" on the first "*" selector, everything turns red, but no luck with the individual selectors... What can be the problem?

Related to styling widgets, i have a question. Lets say a QTextEdit base contents is set to:
Qt Code:
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
  2. <html>
  3. <head>
  4. <meta name="qrichtext" content="1" />
  5. </head>
  6. <body>
  7. <h1>Test</h1>
  8. <h2>Foo</h2>
  9. <p>Bar</p>
  10. </body>
  11. </html>
To copy to clipboard, switch view to plain text mode 
Then would it be possible to set a stylesheet which would be in a QRC file like this within the <head /> tag:
Qt Code:
  1. <LINK href=":/Resources/CSS/Main.css" rel="stylesheet" type="text/css">
To copy to clipboard, switch view to plain text mode 

Thanks a lot for your help,
Pierre.