[Qt-interest] QTableView doesn't use delegate
Israel Brewster
israel at frontierflying.com
Fri Dec 11 20:49:31 CET 2009
On Dec 11, 2009, at 9:46 AM, Timothy Reaves wrote:
>
> On Dec 11, 2009, at 1:35 PM, Timothy Reaves wrote:
>
>> --snip--
>
>> Well, it looks like the main differences are I call
>> setItemDelegate(), not setItemDelegateForColumn(). I also don't
>> implement updateEditorGeometry(). I'll play around with your code
>> as see what I get.
>>
>
>
> Well, I was mistaken; the methods are being called. My error was
> in thinking the delegate methods would be called for display; that's
> not the case. They are called for editing. When called for
> editing, the widgets are over-layed on the display widget.
>
> Now, I need to figure out how to get the widgets to be used for
> display as well.
Ah, now that's a different issue- and actually, that's why I used a
subclass of QTableModel in the code I mentioned. I just overrode the
"data" function to format the displayed string in the way I wanted it.
In my case that was enough, as I just wanted to prepend a "$" sign,
but as I don't know what you are trying to accomplish with these
widgets for display, I don't know if that will work for you as well.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Israel Brewster.vcf
Type: text/directory
Size: 417 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091211/d3e1fdbf/attachment.bin
-------------- next part --------------
More information about the Qt-interest-old
mailing list