Project

General

Profile

WStandardItemModel->headerData question

Added by Mark Travis almost 2 years ago

I'm processing an uploaded CSV file and putting it in WStandardItemModel.

I check to see if there are headers, and if so, I process them in via setHeaderData. If there are no headers, I start loading the data in row zero.

Later in the program, I pass the WStandardItemModel to another function for some processing and I want to check for headers or no-headers. I initially tried to use WStandardItemModel->headerData.empty() but I found out that the first row of data is occupying the headerData row.

Are the "header" functions in WStandard and WAbstract just a pointer to row zero?

Is there a way to determine if headers are in the WStandardItemModel? A flag of some sort?


Replies (1)

RE: WStandardItemModel->headerData question - Added by Mark Travis almost 2 years ago

Nevermind. I found a self-inflicted bug.

Evidently I CAN use headerData.empty() to test for headers. (Let me know if that is an incorrect way to do it.)

    (1-1/1)