logo       

Re: Capturing close events: msg#00002

Subject: Re: Capturing close events
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.

Thanks,

Marius K.

Ole Christensen wrote:
> Marius,
> It
> 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:
> 
> ---snip---
> package Main;
> 
> ...
> 
> sub closeEvent
> {
>    my $ev = shift;
> 
>    item -> cleanup ();
> 
> ...
> 
>    $ev -> accept ();
> }
> ---snip---
> 
> 
> 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,
> Ole.
> 
> 
> 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.
>>
>> Thanks,
>>
>> Marius Kjeldahl
>> (running perl-qt on linux/x86)
>> _______________________________________________
>> Kde-perl mailing list
>> Kde-perl@xxxxxxx
>> https://mail.kde.org/mailman/listinfo/kde-perl
> _______________________________________________
> Kde-perl mailing list
> Kde-perl@xxxxxxx
> https://mail.kde.org/mailman/listinfo/kde-perl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe