No member named 'setResizeMode' in 'QHeaderView' - Convert Qt 4.7 to Qt 5.8

https://stackoverflow.com/questions/42743141/no-member-named-setresizemode-in-qheaderview-convert-qt-4-7-to-qt-5-8

7down voteaccepted

I guess you need to replace two obsolete lines:

table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);  
table->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); 

with the following Qt 5 code:

table->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 
table->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 

猜你喜欢

转载自www.cnblogs.com/hshy/p/8966434.html