PDA

View Full Version : QSqlTableModel + QTableView + rich text in Headers



giusepped
22nd March 2010, 03:19
I have a QSqlTableModel with a QTableView I use to display the model's item.
I set the header of the table view with:


model->setHeaderData(1, Qt::Horizontal, tr("Marca"),Qt:: DisplayRole);


Now, suppose I wanna put some fancy things in the header, for example a greek symbol.
I know that in html I can do "γ", but this does not work if I put, let's say,


model->setHeaderData(1, Qt::Horizontal, tr("<p>&gamma;</p>"),Qt:: DisplayRole);

How can I do it?
regards

nemesisqp
8th April 2010, 07:46
try


#ifdef _UNICODE
#define _T(x) L ## x
#else /* _UNICODE */
#define _T(x) x
#endif /* _UNICODE */


QString::fromStdWString(_T("ΓΞΦ"))