When you freeze rows at the top of the table, only rows at the top of the current viewport can be frozen. If you wish to freeze rows that are not at top of the viewport, you must first move those rows to the top using moveRows(). Once the rows are at the top of the viewport, you can call freezeTopRows() to freeze them.
Similarly, when you freeze rows at the bottom, only rows at the bottom of the current viewport can be frozen. If you wish to freeze rows that are not at bottom of the viewport, you must first move those rows to the bottom using moveRows(). Once the rows are at the botom of the viewport, you can call freezeBottomRows() to freeze them.
// Move rows 6 and 7 to the top of the table QMemArray<int> rows_to_move(2); rows_to_move[0] = 6; rows_to_move[1] = 7; table->moveRows(0, rows_to_move); // Now freeze the rows table->freezeTopRows(2);
Similar methods exist for freezing columns. Move the columns you wish to freeze to the left or right edge of the table using moveColumns(), then freeze the columns by calling freezeLeftColumns() or freezeRightColumns().
For a complete example program showing frozen rows and columns, see Example - Freezing Rows and Columns.