Re: Disabling the cancel button
"Colin Pinkney" <[email protected]> Mon, 2 Dec 2002 08:55:02 +0000
| Newsgroups | gmane.comp.handhelds.zaurus.devel |
|---|---|
| Message-ID | <[email protected]> |
Sorry if I've missed this before, but why exactly do you want to disable this behaviour? The cancel button is supposed to close the application when in the main window. We should really stick to the defined GUI guidelines otherwise it's going to be a mess for those not familiar with Qtopia. Konrad Hinsen <[email protected]>@lists.sourceforge.net on 29/11/2002 21:42:41 Sent by: [email protected] To: "Russell Clarke" <[email protected]> cc: <[email protected]> Subject: Re: [Zaurus-devel] Disabling the cancel button "Russell Clarke" <[email protected]> writes: > QPEApplication reimplements QApplication::qwsEventFilter() - this is where > the key event for Qt::Key_Escape is trapped and hardwired to > QWidget::close(). The key event will still be delivered, by a different > route, but only after this has happened. > > you can get round this by reimplementing QApplication::notify() and > filtering off the cancel key event there. Unfortunately that doesn't work for me. My notify() routine only sees a close event when cancel is pressed. I looked at the source of QPEApplication, but that hasn't helped. Except for understanding how the console application acquires its special status: if ( active && active->testWFlags( WType_TopLevel ) && (int)active->winId() == ke->simpleData.window && !active->testWFlags( WStyle_Dialog|WStyle_Customize|WType_Popup|WType_Desktop )) { if ( active->inherits( "QDialog" ) ) { HackDialog *d = (HackDialog *)active; d->rejectIt(); return TRUE; } else if ( strcmp( argv()[0], "embeddedkonsole") != 0 ) { active->close(); } } This code is from QPEApplication - it contains an explicit exception for the application called "embeddedkonsole"! What a hack... Does anyone know what the "testWFlags" stuff is for? Could I perhaps set some flag somewhere in order to get around this forced termination? ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf