[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] About keyPressEvent
From: "Gustavo_A._Díaz"
Date: 2007-08-24 5:42:46
Message-ID: 46CE6FD6.80808 () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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 new fuction for that.
Thanks!!
Rob Knapp escribió:
> > 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 -- you could perhaps rewire them somehow.
> >
> >
>
> This is good advice.... however, I also have a systray application, and do not
> see the behavior the original poster is talking about. I can hit Alt-F4 or Alt-Esc \
> (which for me on GNOME minimzes) all day and my app stays up. (Well, ok... not all \
> day, but well after the last window is closed.....)
> Perhaps you (the original poster) should double check and make sure that you are \
> calling setQuitOnLastWindowClosed(False) on your QApplication instance before your \
> call to exec_. Sounds silly I know, but more than once I've been moving code \
> around and missed a line or two.
> ---
> Rob Knapp
> Lead Developer
> www.bizling.com
> _______________________________________________
> PyQt mailing list PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
--
/Gustavo A. Díaz/
*GDNet Projects*
www.gdnet.com.ar <http://www.gdnet.com.ar>
Gustavo A. Díaz
[Attachment #5 (multipart/related)]
[Attachment #7 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Well, setQuitOnLastWindowClosed(False) solved that problem now the
pressKeyEven works perfect:<br>
<br>
if event.key() == QtCore.Qt.Key_Escape and (event.modifiers() &<br>
QtCore.Qt.AltModifier):<br>
self.hide()<br>
<br>
Now, i used closeEvent to close my app from the systray, so i've
implemented a new fuction for that.<br>
<br>
Thanks!!<br>
<br>
<br>
Rob Knapp escribió:
<blockquote cite="mid:0000077452@bizling.com" type="cite">
<blockquote type="cite">
<pre wrap="">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 -- you could perhaps rewire them somehow.
</pre>
</blockquote>
<pre wrap=""><!---->
This is good advice.... however, I also have a systray application, and do not
see the behavior the original poster is talking about. I can hit Alt-F4 or Alt-Esc \
(which for me on GNOME minimzes) all day and my app stays up. (Well, ok... not all \
day, but well after the last window is closed.....)
Perhaps you (the original poster) should double check and make sure that you are \
calling setQuitOnLastWindowClosed(False) on your QApplication instance before your \
call to exec_. Sounds silly I know, but more than once I've been moving code around \
and missed a line or two.
---
Rob Knapp
Lead Developer
<a class="moz-txt-link-abbreviated" \
href="http://www.bizling.com">www.bizling.com</a> \
_______________________________________________ PyQt mailing list <a \
class="moz-txt-link-abbreviated" \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a> <a \
class="moz-txt-link-freetext" \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<em>Gustavo A. Díaz</em><br>
<strong>GDNet Projects</strong><br>
<a href="http://www.gdnet.com.ar">www.gdnet.com.ar</a><br>
<img alt="Gustavo A. Díaz" src="cid:part1.09050303.02090308@gmail.com">
</div>
</body>
</html>
["firma-email.jpg" (image/jpeg)]
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic