Ok, just so anyone else trying to do the same thing has an answer, here's what I did:
//In the constructor for the Header subclass
m_styleSet = "QHeaderView::down-arrow { image: url(:/images/down_arrow.png); width: 13px; height:9px; subcontrol-position: bottom right;} "
"QHeaderView::up-arrow { image: url(:/images/up_arrow.png); subcontrol-position: bottom right; } "
"QHeaderView:: section { color: %1; background-color: %2; }";
this->setStyleSheet(setStyle);
//In the constructor for the Header subclass
m_styleSet = "QHeaderView::down-arrow { image: url(:/images/down_arrow.png); width: 13px; height:9px; subcontrol-position: bottom right;} "
"QHeaderView::up-arrow { image: url(:/images/up_arrow.png); subcontrol-position: bottom right; } "
"QHeaderView:: section { color: %1; background-color: %2; }";
QString setStyle = m_styleSet.arg(QApplication::palette().windowText().color().name()).arg(QApplication::palette().window().color.name());
this->setStyleSheet(setStyle);
To copy to clipboard, switch view to plain text mode
I installed an event filter:
{
if ((event
->type
() == QEvent::ApplicationPaletteChange) ||
(event
->type
() == QEvent::PaletteChange)) {
this->setStyleSheet(setStyle);
return true;
}
}
bool CHeaderView::eventFilter(QObject* obj, QEvent* event)
{
if ((event->type() == QEvent::ApplicationPaletteChange) ||
(event->type() == QEvent::PaletteChange))
{
QString setStyle = m_styleSet.arg(QApplication::palette().windowText().color().name()).arg(QApplication::palette().window().color.name());
this->setStyleSheet(setStyle);
return true;
}
return QHeaderView::eventFilter(obj,event);
}
To copy to clipboard, switch view to plain text mode
This allows for palette changes & still gives me the arrow that I want (the .pngs)
Vycke
Bookmarks