I have a little style sheet, that I load from a file in the main class and apply it to the QApp like this:

Qt Code:
  1. QApplication a(argc, argv);
  2.  
  3. QFile file("styles.css");
  4. file.open(QFile::ReadOnly);
  5. QString styleSheet = QLatin1String(file.readAll());
  6. a.setStyleSheet(styleSheet);
  7.  
  8. return a.exec();
To copy to clipboard, switch view to plain text mode 

It's very convenient, because I can change the looks of my application without even having to recompile the code. Now here is the thing. I have QFrames on my gui, that I want to highlight when the mouse moves them and keep highlighted when they get clicked. So I need to set some kind of attribute in the code that the style sheet reacts to.

I have seen this thing in a style sheet before:

Qt Code:
  1. .selected {
  2. border-width: 3px;
  3. }
To copy to clipboard, switch view to plain text mode 

and I figure it would apply to items that somehow get a "selected" attribute. Does anyone know how to do this?

Thanks
Cruz