[Qt-interest] QTreeView Wierdness with OS X Cocoa Qt 4.5.0

Mike Jackson imikejackson at gmail.com
Tue Jun 30 23:20:02 CEST 2009


On 2009-05-22 09:26:38 -0400, Mike Jackson <imikejackson at gmail.com> said:

> On 2009-03-28 11:05:45 -0400, Mike Jackson <imikejackson at gmail.com> said:
> 
>> I have an application that uses a QTreeView with a custom TreeModel 
>> implementation. When I build against Qt 4.5 (Cocoa 32 Bit) the top few 
>> items do not seem to receive any mouse clicks. I can use the keyboard 
>> arrow key to highlight the top (root) item then use the arrow key again 
>> to reveal but it takes a few of these iterations to finally be able to 
>> let the mouse have any effect on the tree view (like showing and 
>> hiding) nodes.
>> 
>>   Has anyone else seen anything like this? When I recompile against a 
>> 32 bit Qt 4.4.3 build (Carbon) the tree acts just fine.
>> 
>> I have not compiled against a carbon Qt 4.5 though to see if it is the 
>> Cocoa/Carbon thing or the 4.4 to 4.5 thing.
>> 
>> Any help would be appreciated.
>> 
>> Mike Jackson
> 
> Just FYI, the issue still persists with Qt 4.5.1 and Cocoa even in the 
> QtDesigner application. Any chance of getting a fix for this? This is 
> kind of a show stopper for me at the moment.
> 
> Mike Jackson
> www.bluequartz.net

So, some more follow up. Was looking through the demos when I came 
across the MacMainwindow project. Curious I took a look at it and the 
first thing that occurred to me was that there was a tree view, with NO 
Headers, and I could click on the root node. This something that has 
been an issue with the cocoa builds. So I picked apart the 
MacMainwindow app and my own app to try and see what the difference 
seems to be. The difference is the following:

this->treeView->setAttribute(Qt::WA_MacShowFocusRect, false);

Without that line in there I can not click on the root node of a 
QTreeView with the mouse. I _must_ use the keyboard to disclose the 
first few nodes then I can use the mouse as normal.

   So not sure if this is a bug, but it _is_ a work-around if you are 
having the same issues.

Thanks
Mike Jackson




More information about the Qt-interest-old mailing list