Cannot change font size for QTableWidget header in Qt 5.0.0



  • Using the code snippet below I was able to change the font size for the QTableWidget header in Qt v4.8.2 but the same code compiles and runs in Qt 5.0.0 but does not affect the header font size. Any ideas on what is happening here?

    @bingoNumbersTableWidget = new QTableWidget(15, 5, leftWidget);
    bingoNumbersTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
    bingoNumbersTableWidget->setSelectionMode(QAbstractItemView::NoSelection);
    bingoNumbersTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
    bingoNumbersTableWidget->horizontalHeader()->setFixedHeight(sizeMap.value("bingoNumbersTableWidgetHorizontalHeaderHeight"));
    bingoNumbersTableWidget->horizontalHeader()->setFont(bingoFont);
    bingoNumbersTableWidget->setFont(numberFont);

    colHeaderLabels << settings.value("bHeaderLetter", "B").toString();
    colHeaderLabels << settings.value("iHeaderLetter", "I").toString();
    colHeaderLabels << settings.value("nHeaderLetter", "N").toString();
    colHeaderLabels << settings.value("gHeaderLetter", "G").toString();
    colHeaderLabels << settings.value("oHeaderLetter", "O").toString();

    bingoNumbersTableWidget->setHorizontalHeaderLabels(colHeaderLabels);
    @
    Tim Reilly


Log in to reply
 

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