[Qt-interest] Colum Names form QTreeView

Andreas Pakulat apaku at gmx.de
Mon May 10 20:28:39 CEST 2010


On 10.05.10 12:11:35, Rob Simmermon wrote:
> I have figured out how to get the column headings, but now when I call  
> "sizeHintForCOlumn" my program crashes.
> 
> here's my code:
> 
>      for(columnCounter=0;columnCounter<columnCount;columnCounter++)
>      {
>          // get column header and add to end of current line
>           
> lineToWrite.insert(insertPoint,tvTreeView->model()->headerData(columnCounter,  
> Qt::Horizontal).toString());
>           
> insertPoint+=tvTreeView->header()->sizeHintForColumn(columnCounter) + 2;
>      }
> 
> 
> It crashes on the last line of the loop on the very first iteration.

Whats the backtrace? It does sound as if your treeview has no visible
header (yet), maybe its not yet shown?

Andreas

-- 
You will be successful in love.



More information about the Qt-interest-old mailing list