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] can't create a QPainter in QTreeWidget's paintEvent

2007-08-23 Thread Devon
On 8/23/07, David Boddie <[EMAIL PROTECTED]> wrote: > On Thu Aug 23 16:04:19 BST 2007, Devon wrote: > > > > If you pass a device (self in this case) when you create a QPainter, don't > > > call its begin() or end() methods. I think its the end() call that > > > actually triggers this message in thi

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] can't create a QPainter in QTreeWidget's paintEvent

2007-08-23 Thread David Boddie
On Thu Aug 23 16:04:19 BST 2007, Devon wrote: > > If you pass a device (self in this case) when you create a QPainter, don't > > call its begin() or end() methods. I think its the end() call that > > actually triggers this message in this case. > > I'm not explicitly calling begin() - I believe t

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] can't create a QPainter in QTreeWidget's paintEvent

2007-08-23 Thread Devon
> If you pass a device (self in this case) when you create a QPainter, don't > call its begin() or end() methods. I think its the end() call that actually > triggers this message in this case. I'm not explicitly calling begin() - I believe that's happening in QPainter(self). painter.end() is not

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] can't create a QPainter in QTreeWidget's paintEvent

2007-08-23 Thread David Boddie
On Wed Aug 22 21:49:05 BST 2007, Devon wrote: > Here is a dummy version of a derived tree widget: [...] > def paintEvent(self, e): > QTreeWidget.paintEvent(self, e) > painter = QPainter(self) > painter.end() [...] > When an instance is added to a layout, I get the f

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] can't create a QPainter in QTreeWidget's paintEvent

2007-08-23 Thread Devon
> > Here is a dummy version of a derived tree widget: > > > > > > class MyTreeWidget(QTreeWidget): > > def __init__(self, parent=None): > > QTreeWidget.__init__(self, parent) > > > > def paintEvent(self, e): > > QTreeWidget.paintEvent(self, e) >

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