No luck here. Here's my test app, derived from yours but without the SQL stuff:

Qt Code:
  1. #include <QApplication>
  2. #include <QStringList>
  3. #include <QTreeWidget>
  4. #include <QTreeWidgetItem>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication app(argc, argv);
  9.  
  10. v.setColumnCount(2);
  11. v.setStyleSheet("QHeaderView::section:checked { background-color: green } QHeaderView::section:hover { background-color: red }");
  12. v.setSortingEnabled(true);
  13. v.addTopLevelItem(new QTreeWidgetItem(&v, QStringList() << "John" << "Doe"));
  14. v.show();
  15.  
  16. return app.exec();
  17. }
To copy to clipboard, switch view to plain text mode 
Setting QHeaderView::section:hover works but setting QHeaderView::section:checked doesn't.

I also tried with QTableView as you did in your test, same problem.

Qt 4.7.0 on Windows Vista.

Thanks,
Franz