Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, May 2007
[model/view] custom QTimeEdit as an editor in a custom QItemDelegate


Message 1 in thread

Hi all,

in a subclass of QItemDelegate, I create my own QTimeEdit to edit some data.

I select carefully selecte the appropriate column in the QTimeEdit.

In MyDelegate::createEditor, the appropriate column is selected  (minutes,
indeed).

In MyDelegate::setEditorData, the selected column is still correct.

Unfortunately, when the editor is displayed, the column selected has been
reset by Qt  (the Hour column selected instead of the Minute column).

I've traced all the calls in MyDelegate.

Indeed, apparently, the selected column in QTimeEdit is reset by Qt between 
        MyDelegate::setEditorData
and the first call to 
        MyDelegate::paint (indeed, the painted column is NOT the edited column...)

Does anyone would know where Qt resets the selected column ?

Is it in QTImeEdit (on first show event, or anything else) ?
Or in QItemDelegate ?


Thanks in advance,

Best,
Nicolas 

--
 [ signature omitted ] 

Message 2 in thread

I have a custom delegate and model for a table and am seeing a similar 
thing (I'm assuming that you mean the heading is "bold" when editing a 
cell in the column).  I'd be interested if anyone knows where to look 
(perhaps somewhere in the view?)

Sorry I don't have an answer for you, but am seeking one myself.

Nicolas Castagne wrote:
> Hi all,
>
> in a subclass of QItemDelegate, I create my own QTimeEdit to edit some data.
>
> I select carefully selecte the appropriate column in the QTimeEdit.
>
> In MyDelegate::createEditor, the appropriate column is selected  (minutes,
> indeed).
>
> In MyDelegate::setEditorData, the selected column is still correct.
>
> Unfortunately, when the editor is displayed, the column selected has been
> reset by Qt  (the Hour column selected instead of the Minute column).
>
> I've traced all the calls in MyDelegate.
>
> Indeed, apparently, the selected column in QTimeEdit is reset by Qt between 
>         MyDelegate::setEditorData
> and the first call to 
>         MyDelegate::paint (indeed, the painted column is NOT the edited column...)
>
> Does anyone would know where Qt resets the selected column ?
>
> Is it in QTImeEdit (on first show event, or anything else) ?
> Or in QItemDelegate ?
>
>
> Thanks in advance,
>
> Best,
> Nicolas 
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
>   



---

This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.

Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den Absender zurück und löschen Sie die E-mail aus Ihrem System.

--
 [ signature omitted ]