Re: [PyQt] About keyPressEvent

2007-08-23 Thread Gustavo A. Dí­az
Well, setQuitOnLastWindowClosed(False) solved that problem now the pressKeyEven works perfect: if event.key() == QtCore.Qt.Key_Escape and (event.modifiers() &         QtCore.Qt.AltModifier):             self.hide() Now, i used closeEvent to close my app from the systray, so i've implemented a

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Gustavo A. Díaz
Sorry.. i mean alt+f4... 2007/8/23, Henrik Pauli <[EMAIL PROTECTED]>: > > Hmmm, I have never in my life pressed alt-esc in KDE. alt-f4 yes > (which I remember being Close on the default scheme, not just on the > "Windows like" key scheme), esc yes (which triggers a Cancel/Close > action on most d

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Rob Knapp
> What I suddenly think about is that you should try to catch some > signal (I can't remember the name, but do read up on what signals and > slots a QMainWindow/KMainWindow has) that is related to quitting the > application. I seem to remember there are methods which get triggered > at exit --

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Henrik Pauli
Hmmm, I have never in my life pressed alt-esc in KDE. alt-f4 yes (which I remember being Close on the default scheme, not just on the "Windows like" key scheme), esc yes (which triggers a Cancel/Close action on most dialogs). What I suddenly think about is that you should try to catch some signal

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Gustavo A. Díaz
Hi David, The thing that my app has systray support, and when i close the app with the Close button, it goes there. So, many users press Alt+Esc to close their apps. and this is a problem for me, cause my app will not go into the systray. Will be enough if even exist the possibility to block this

Re: [PyQt] About keyPressEvent

2007-08-23 Thread David Boddie
On Thu Aug 23 15:22:29 BST 2007, Gustavo A. Díaz wrote: > Yes, which i sould use X11 internals indeed. > > I will have to investigate about this... Is it really necessary to use Alt-Esc in your application? You could have the same problem with any keyboard shortcut - some of your users might hav

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Gustavo A. Díaz
Yes, which i sould use X11 internals indeed. I will have to investigate about this... Thanks. Cheers. 2007/8/23, Andreas Pakulat <[EMAIL PROTECTED]>: > > On 23.08.07 10:01:03, "Gustavo A. Dí­az" wrote: > > Anyway that do not work cause for sure, now that i am thinking, that key > > combination

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Andreas Pakulat
On 23.08.07 10:01:03, "Gustavo A. Dí­az" wrote: > Anyway that do not work cause for sure, now that i am thinking, that key > combination to close an app is reserved by my window manager, which is > KDE... so maybe i will have to implement something related to kde (or PyKDE) > > like Sundace make m

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Gustavo A. Dí­az
Andreas Pakulat escribió: On 23.08.07 00:54:59, "Gustavo A. Dí­az" wrote: I did this time: def keyPressEvent(self, event): if event.key() == QtCore.Qt.Key_Escape: self.hide() if event.key() == QtCore.Qt.Key_Alt + QtCore.Qt.Key_Esca

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Andreas Pakulat
On 23.08.07 00:54:59, "Gustavo A. Dí­az" wrote: > I did this time: > > def keyPressEvent(self, event): > if event.key() == QtCore.Qt.Key_Escape: > self.hide() > > if event.key() == QtCore.Qt.Key_Alt + QtCore.Qt.Key_Escape: > self.hide()

Re: [PyQt] About keyPressEvent

2007-08-23 Thread Sundance
Gustavo A. Dí­az wrote: > But this method is applied when you have a Menu bar right? No. This method is applied when you add an action to a QWidget, as I said in my previous email. It just so happens that if the QWidget is a menu or a toolbar, Qt creates a menu entry or a toolbutton, respectiv

Re: [PyQt] About keyPressEvent

2007-08-22 Thread Gustavo A. Dí­az
I did this time: def keyPressEvent(self, event):         if event.key() == QtCore.Qt.Key_Escape:         self.hide()                     if event.key() == QtCore.Qt.Key_Alt + QtCore.Qt.Key_Escape:             self.hide() Esc key only, hides the app. Alt + Esc does not, it just

Re: [PyQt] About keyPressEvent

2007-08-22 Thread Gustavo A. Dí­az
But this method is applied when you have a Menu bar right? Which i do NOT use. I just want the key combination Alt+Esc to hide my app. Examples please? Thanks. Sundance escribió: Gustavo A. Dí­az wrote: As i said, only Escape key. I want to know to do the same but with al

Re: [PyQt] About keyPressEvent

2007-08-22 Thread Sundance
Gustavo A. Dí­az wrote: > As i said, only Escape key. > > I want to know to do the same but with alt + Escape... or which > is the way to do it... Hi Gustavo, I am not sure I understand what it is that gives you trouble here. Is it that you don't know how to go about it, or is it that it do

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Gustavo A. Dí­az
As i said, only Escape key. I want to know to do the same but with alt + Escape... or which is the way to do it... cheers. Henrik Pauli escribió: What I was thinking about was this: http://doc.trolltech.com/4.3/qt.html#WidgetAttribute-enum -> Qt::WA_DeleteOnClose as it's now called.  As

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Henrik Pauli
What I was thinking about was this: http://doc.trolltech.com/4.3/qt.html#WidgetAttribute-enum -> Qt::WA_DeleteOnClose as it's now called. As I said, I could be completely wrong with assuming it being the culprit, but anyway. Now... isn't the code you pasted actually handling Escape, not Alt+Escap

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Gustavo A. Dí­az
I forgot, that code only hide the app when i press Esc key, i want alt + Esc key combination to do the same... Thanks. Uğur Çetin escribió: 22-08-2007 01:18 Gustavo A. Dí­az: I am trying to catch the keyPressEvent of alt + esc combination with: def keyPressEvent(self, event):

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Gustavo A. Dí­az
I think you are missunderstanding I have an app, i have a systray, when i press the close button, it hide on the systray, cause i've implemented that... Now i want to hide the app too when i press alt+esc...not closing it. Thanks... Cheers. Uğur Çetin escribió: 22-08-2007 01:18 Gusta

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Uğur Çetin
22-08-2007 01:18 Gustavo A. Dí­az: > I am trying to catch the keyPressEvent of alt + esc combination with: > > def keyPressEvent(self, event): > if event.key() == QtCore.Qt.Key_Escape: > self.hide() > > And this has no effect, the app closes anyway. What i want is to h

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Gustavo A. Dí­az
what?? Henrik Pauli escribió: Off the top of my head, and as such it could be completely wrong: WDestructiveClose? On 8/22/07, "Gustavo A. Dí­az" < [EMAIL PROTECTED]> wrote: Hi!! I am trying to catch the keyPressEvent of alt + esc combination with: def keyPressEvent(self,

Re: [PyQt] About keyPressEvent

2007-08-21 Thread Henrik Pauli
Off the top of my head, and as such it could be completely wrong: WDestructiveClose? On 8/22/07, "Gustavo A. Dí­az" <[EMAIL PROTECTED]> wrote: > > Hi!! > > I am trying to catch the keyPressEvent of alt + esc combination with: > > def keyPressEvent(self, event): > if event.key() == Qt

[PyQt] About keyPressEvent

2007-08-21 Thread Gustavo A. Dí­az
Hi!! I am trying to catch the keyPressEvent of alt + esc combination with: def keyPressEvent(self, event):         if event.key() == QtCore.Qt.Key_Escape:         self.hide() And this has no effect, the app closes anyway. What i want is to hide the app and not close it. What i