[Kde-perl] Capturing close events
marius at kjeldahl.net
Tue Mar 21 18:54:26 CET 2006
Would you mind testing a "parentWidget()" call or any other method defined in
QWidget which would use the implicit this pointer? I use parentWidget other
places in my source without any trouble, but in the close/closeEvent methods it
seems the implicit this pointer is not set correctly.
Ole Christensen wrote:
> seems you are doing something wrong. I have already overloaded
> closeEvent and it works fine. This is (approximately) my source within
> the main window package:
> package Main;
> sub closeEvent
> my $ev = shift;
> item -> cleanup ();
> $ev -> accept ();
> item is a Qt::attributes and holds some kind of object (do not remember
> well) derived from Qt::Object. You do not need explicit access to the
> this pointer.
> Hope that helps a bit,
> Marius Kjeldahl wrote:
>> In my application I need to capture close events for a QWidget derived widget.
>> I've attempted to override "close" and "closeEvent", and they get called but
>> carry no information about the "this" pointer. This means I am not able to
>> access attributes in my widget instance from within close/closeEvents.
>> Does anybody have any ideas why this isn't working, or an alternative method of
>> capturing the close events? Keep in mind that the close event is typically
>> triggered from the window system, so I can not capture it elsewhere I think.
>> Marius Kjeldahl
>> (running perl-qt on linux/x86)
>> Kde-perl mailing list
>> Kde-perl at kde.org
> Kde-perl mailing list
> Kde-perl at kde.org
More information about the Kde-perl