Qt-interest Archive, June 2007
QTableView and QItemDelegate
Message 1 in thread
hi.
i wrote a subclass of QItemDelegate, it returns an editor which is a subclass of
QDialog. the delegate is assigned to a subclass of QTableView, to make it's rows
editable.
the problem is the window-handling of the QDialog, currently it hides, when the
mouse leaves the window which contains the QTableView.
the data must be persisted over the network in a asyncronous way.
given these, i must have exact control over the QDialog, i should not be hidden,
it should start the network-request when it's OK-button is pressed and should
only be closed, when there arrives a positive response over the network.
i fiddled around a bit with the window-events of the dialog, with not much success.
i wonder if there's no way to tune the behaviour of editors generally. i can
define when they are opened by EditTriggers, but i can't find something about
when they are allowed to close, etc.
any ideas?
cheers,
alexander
-- (sorry for) the information according to german laws:
e-dict GmbH & Co. KG
Alter Steinweg 3
D-20459 Hamburg/Germany
Handelsniederlassungsort: Hamburg/Deutschland
Registergericht: Amtsgericht Hamburg
Handelsregistereintrags-Nr.: HRA 92586
persönlich haftender Gesellschafter: e-dict Beteiligungs GmbH
Handelsniederlassungsort: Hamburg/Deutschland
Registergericht: Amtsgericht Hamburg
Handelsregistereintrags-Nr.: HRA 67171
Geschäftsführer: Mark Dieckmann
--
[ signature omitted ]
Message 2 in thread
El Miércoles, 27 de Junio de 2007 17:14, alexander krohn escribió:
> hi.
>
> i wrote a subclass of QItemDelegate, it returns an editor which is a
> subclass of QDialog. the delegate is assigned to a subclass of QTableView,
> to make it's rows editable.
>
> the problem is the window-handling of the QDialog, currently it hides, when
> the mouse leaves the window which contains the QTableView.
>
> the data must be persisted over the network in a asyncronous way.
>
> given these, i must have exact control over the QDialog, i should not be
> hidden, it should start the network-request when it's OK-button is pressed
> and should only be closed, when there arrives a positive response over the
> network.
>
> i fiddled around a bit with the window-events of the dialog, with not much
> success.
>
> i wonder if there's no way to tune the behaviour of editors generally. i
> can define when they are opened by EditTriggers, but i can't find something
> about when they are allowed to close, etc.
>
Have you defined the function paint() in the subclass of QItemDelegate.
I think that this function tells to the QTableView what to show when the
editor is closed.
> any ideas?
>
> cheers,
>
--
[ signature omitted ]
Message 3 in thread
Manuel Parrilla wrote:
> [...]
>> i wonder if there's no way to tune the behaviour of editors generally. i
>> can define when they are opened by EditTriggers, but i can't find something
>> about when they are allowed to close, etc.
>>
> Have you defined the function paint() in the subclass of QItemDelegate.
> I think that this function tells to the QTableView what to show when the
> editor is closed.
> [...]
sorry, i didn't get the idea.
what should paint() do in this case?
cheers
alexander
-- (sorry for) the information according to german laws:
e-dict GmbH & Co. KG
Alter Steinweg 3
D-20459 Hamburg/Germany
Handelsniederlassungsort: Hamburg/Deutschland
Registergericht: Amtsgericht Hamburg
Handelsregistereintrags-Nr.: HRA 92586
persönlich haftender Gesellschafter: e-dict Beteiligungs GmbH
Handelsniederlassungsort: Hamburg/Deutschland
Registergericht: Amtsgericht Hamburg
Handelsregistereintrags-Nr.: HRA 67171
Geschäftsführer: Mark Dieckmann
--
[ signature omitted ]
Message 4 in thread
> -- (sorry for) the information according to german laws:
> e-dict GmbH & Co. KG
> Alter Steinweg 3
> D-20459 Hamburg/Germany
> Handelsniederlassungsort: Hamburg/Deutschland
> Registergericht: Amtsgericht Hamburg
> Handelsregistereintrags-Nr.: HRA 92586
> persönlich haftender Gesellschafter: e-dict Beteiligungs GmbH
> Handelsniederlassungsort: Hamburg/Deutschland
> Registergericht: Amtsgericht Hamburg
> Handelsregistereintrags-Nr.: HRA 67171
> Geschäftsführer: Mark Dieckmann
Hi,
i very much doubt you need to put the full info when mailing on a mailing list - but you can at least stuff it all in one line, reducing the noise ;)
Cheers,
Peter
--
[ signature omitted ]
Message 5 in thread
On Wednesday 27 June 2007 17:14, alexander krohn wrote:
> hi.
>
> i wrote a subclass of QItemDelegate, it returns an editor which is a
> subclass of QDialog. the delegate is assigned to a subclass of QTableView,
> to make it's rows editable.
>
> the problem is the window-handling of the QDialog, currently it hides, when
> the mouse leaves the window which contains the QTableView.
What os and qt version is this?
Frank
--
[ signature omitted ]
Message 6 in thread
Frank Hemer wrote:
> On Wednesday 27 June 2007 17:14, alexander krohn wrote:
>> hi.
>>
>> i wrote a subclass of QItemDelegate, it returns an editor which is a
>> subclass of QDialog. the delegate is assigned to a subclass of QTableView,
>> to make it's rows editable.
>>
>> the problem is the window-handling of the QDialog, currently it hides, when
>> the mouse leaves the window which contains the QTableView.
>
> What os and qt version is this?
qt 4.3.0 with pyqt 4.2 under linux with x11 and gnome.
cheers
alexander
--
[ signature omitted ]
Message 7 in thread
On Thursday 28 June 2007 18:10, you wrote:
> Frank Hemer wrote:
> > On Wednesday 27 June 2007 17:14, alexander krohn wrote:
> >> hi.
> >>
> >> i wrote a subclass of QItemDelegate, it returns an editor which is a
> >> subclass of QDialog. the delegate is assigned to a subclass of
> >> QTableView, to make it's rows editable.
> >>
> >> the problem is the window-handling of the QDialog, currently it hides,
> >> when the mouse leaves the window which contains the QTableView.
Might be caused by your window manager settings.
Verify what happens to your focus - I didn't look into the scr but I guess
editing is finished when the focus moves to another cell.
Frank
ps: please dont't reply to me in person, I'm on the list
--
[ signature omitted ]
Message 8 in thread
Frank Hemer wrote:
> On Thursday 28 June 2007 18:10, you wrote:
>> Frank Hemer wrote:
>>> On Wednesday 27 June 2007 17:14, alexander krohn wrote:
>>>> hi.
>>>>
>>>> i wrote a subclass of QItemDelegate, it returns an editor which is a
>>>> subclass of QDialog. the delegate is assigned to a subclass of
>>>> QTableView, to make it's rows editable.
>>>>
>>>> the problem is the window-handling of the QDialog, currently it hides,
>>>> when the mouse leaves the window which contains the QTableView.
>
> Might be caused by your window manager settings.
> Verify what happens to your focus - I didn't look into the scr but I guess
> editing is finished when the focus moves to another cell.
yes, the dialog reacts on focus-changes to the main-window.
i want to disable or stop this behaviour. the only chance for the dialog to
close should be in reaction of the dialog's OK button.
there must be place where the dialog-window gets its hide()-call from, but i
can't find it.
cheers
alexander
>
> Frank
>
> ps: please dont't reply to me in person, I'm on the list
please don't send a reply-to header, pointing to your own address ;)
--
[ signature omitted ]
Message 9 in thread
On Thursday 28 June 2007 19:42, alexander krohn wrote:
> Frank Hemer wrote:
> > On Thursday 28 June 2007 18:10, you wrote:
> >> Frank Hemer wrote:
> >>> On Wednesday 27 June 2007 17:14, alexander krohn wrote:
> >>>> hi.
> >>>>
> >>>> i wrote a subclass of QItemDelegate, it returns an editor which is a
> >>>> subclass of QDialog. the delegate is assigned to a subclass of
> >>>> QTableView, to make it's rows editable.
> >>>>
> >>>> the problem is the window-handling of the QDialog, currently it hides,
> >>>> when the mouse leaves the window which contains the QTableView.
> >
> > Might be caused by your window manager settings.
> > Verify what happens to your focus - I didn't look into the scr but I
> > guess editing is finished when the focus moves to another cell.
>
> yes, the dialog reacts on focus-changes to the main-window.
>
> i want to disable or stop this behaviour. the only chance for the dialog to
> close should be in reaction of the dialog's OK button.
>
> there must be place where the dialog-window gets its hide()-call from, but
> i can't find it.
The hide call cames from QAbstractItemDelegate.
You might want to reimplement QAbstractItemDelegate::editorEvent (...) instead
to have full control over editing.
Frank
--
[ signature omitted ]
Message 10 in thread
Hi!
Or maybe the following function will help:
http://doc.trolltech.com/4.3/qabstractitemview.html#openPersistentEditor
Greetings
Niklas
--
[ signature omitted ]