Set font for headers in QTableWidget



  • Hi
    I want to change the font used for the horizontal and vertical headers in a QTableWidget.

    			QFont font = m_tableWidget->horizontalHeader()->font();
    
    			font.setWeight(QFont::Light);
    
    			m_tableWidget->verticalHeader()->setFont(font);
    			m_tableWidget->horizontalHeader()->setFont(font);
    
    			m_tableWidget->setHorizontalHeaderLabels(horizontalHeaderLabels);
    			m_tableWidget->setVerticalHeaderLabels(m_tableRowNames);
    
    

    As it stands this does not work. Does anyone have a suggestion?

    Thanks



  • @GrahamLa

    This was caused by a style sheet setting for all QHeaderView's


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.