[PyQt] [PyQt 4.5 Bug] Derived signals do not present

2009-04-08 Thread Alexandr N Zamaraev
Code for reproduce: [code=python] from PyQt4 import QtGui sm = QtGui.QSortFilterProxyModel() sm.modelReset.conncet(lambda: None) [/code] Traceback (most recent call last): File "C:\Lang\test\python\PyQtSignalBug\QtSortProxy.py", line 4, in sm.modelReset.conncet(lambda: None) AttributeErr

Re: [PyQt] Possible bug - global coordinates work but widget coordinates do not

2009-04-08 Thread Shriramana Sharma
Hello. Didn't anyone notice this report? I now confirm that this bug exists even in PyQt 4.4.4 / Qt 4.5.0 on Kubuntu Jaunty. Shriramana Sharma. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Drag/Drop, removeRows method not being called

2009-04-08 Thread Scott Ballard
Hi, Wondering if anyone has a clue about this. I'm using a sub-classed QAbstractItemModel with all of the required methods reimplemented for drag/drop functionality. For some reason, if the columnCount method returns a value great than 1 the removeRows method doesn't get called after the dro

Re: [PyQt] context menus for QTreeWidgetItem?

2009-04-08 Thread Patrick Boucher
Hi Christian, Implement the context menu on the QTreeWidget but when the context menu signal (customContextMenuRequested(QPoint)) is triggered get the item under the point with QTreeWidget.itemAt(QPoint) if the item is None don't show any menu and return immediately otherwise show your properly fo

[PyQt] context menus for QTreeWidgetItem?

2009-04-08 Thread Christian Aubert
I currently have a context menu for the whole QTreeWidget but I need finer-grained control on a per item basis. Has anyone implemented context menus for QTreeWidgetItems? Any pointers? Christian ___ PyQt mailing listPyQt@riverbankcomputing.com ht

Re: [PyQt] coloring a QDialog

2009-04-08 Thread Phil Thompson
On Wed, 08 Apr 2009 10:26:18 +0200, TP wrote: > Hi everybody, > > To color a QDialog (for example), I can do: > > from PyQt4.QtCore import * > from PyQt4.QtGui import * > import sys > app = QApplication( sys.argv ) > dialog = QDialog( ) > dialog.palette().background().setColor(Qt.blue) # @ > dia

Re: [PyQt] Python v3 Status

2009-04-08 Thread Phil Thompson
On Sat, 4 Apr 2009 11:17:11 +0200, Detlev Offenbach wrote: > Hi, > > that is good news. Do you have any experience how the performance of > programs > differ between Python v3 and Python v2. No. > Are there any hints about how to > write a program, that runs with both variants of Python (e.g.

Re: [PyQt] New Style emit without subclassing

2009-04-08 Thread Phil Thompson
On Wed, 08 Apr 2009 07:45:35 -0400, Matt Smith wrote: > Thats not quite what I'm getting at. That will emit the signal, which > is the 'old style' but the new style is a bit different, and after you > set it up you emit the signal by using: > > mysignal.emit(args) > > My question is that

[PyQt] Re: Copying Directory structure from a template one

2009-04-08 Thread F.A. Pinkse
Hello Patrick, All good ideas. Thanks. The 'I can do better' was the multiple templates option. Putting the structure into a file is a good one, less chance of accidental changes. Never have done XML, but will give it a try. Frans. This answer may or may not be useful to you because what

[PyQt] Re: Copying Directory structure from a template one

2009-04-08 Thread F.A. Pinkse
Hello Dimitrius and mir amicitas. Thank you for pointing out this alternative, too busy with PyQt I think. :-) mir amicitas wrote: I agree that using some of the python natives would probably be easier that using a QDirModel. Here is some sample code for a directory walker (you can find more o

Re: [PyQt] Copying Directory structure from a template one

2009-04-08 Thread Patrick Boucher
This answer may or may not be useful to you because what I'm suggesting is an alternative route but still... Up to you to decide. I have to do this 'create a dir structure from template' regularly in my line of work and the solution I've come to like a lot is to use a template file in the form of

Re: [PyQt] Copying Directory structure from a template one

2009-04-08 Thread mir amicitas
I agree that using some of the python natives would probably be easier that using a QDirModel. Here is some sample code for a directory walker (you can find more of these online). It would be relatively easy to os.path.relpath to get the structure relative to your base path, then to use os.path.j

[PyQt] QAbstractItemModel modelAboutToBeReset signal

2009-04-08 Thread Patrick Boucher
Hi all, I've subclassed QAbstractItemModel and overloaded reset to be: def reset(self): self.modelAboutToBeReset.emit() self._loadPeople() self.modelReset.emit() and I get errors pertaining to missing attributes modelAboutToBeReset and modelReset. Do I have something

Re: [PyQt] Copying Directory structure from a template one

2009-04-08 Thread Demetrius Cassidy
I must admit I am not very familiar with QDirModel, but why not use os.walk? #top would be the root directory you are begining your search at. def _walkDirPath(self, top): for dirpath, dirnames, filenames in os.walk(top): for name in filenames: # yields: c:\mydat

Re: [PyQt] New Style emit without subclassing

2009-04-08 Thread Demetrius Cassidy
What's wrong with the old signal? It works. I am not sure about the new one you are talking about, and haven't really seen any docs on it. - Original Message - From: "Matt Smith" To: Sent: Wednesday, April 08, 2009 7:45 AM Subject: Re: [PyQt] New Style emit without subclassing Tha

[PyQt] Copying Directory structure from a template one

2009-04-08 Thread F.A. Pinkse
Hello All, For very new job in my CAD work I make a copy of an old Job Directory structure and rename the directories/files as needed by hand. Finally I decided to throw Python at it. I hard coded the structure, but I felt I could do better, like copying a template and do a rename in the proce

[PyQt] Possible bug - global coordinates work but widget coordinates do not

2009-04-08 Thread Shriramana Sharma
Hello first of all let me clarify that this is specific to PyQt and does not existing in C++/Qt. I am using PyQt 4.3.3 on Qt 4.4.0 on Kubuntu Hardy. I attach three files. 1. test.py is the one that demonstrates the problem. 2. test.cpp is the equivalent C++ version that shows no problem. 3. test

Re: [PyQt] SplashScreen and mousePressEvent

2009-04-08 Thread projetmbc
Brian Kelley a écrit : The splashscreen is probably not what you want. You can make a QFrame and apply the following styles QFrame( parent, Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Tool ) You will need to override the mouseClickEvent to close this w

Re: [PyQt] SplashScreen and mousePressEvent

2009-04-08 Thread Brian Kelley
The splashscreen is probably not what you want. You can make a QFrame and apply the following styles QFrame( parent, Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint | Qt.Tool ) You will need to override the mouseClickEvent to

Re: [PyQt] SplashScreen and mousePressEvent

2009-04-08 Thread projetmbc
Ok. Thanks a lot for the informations. I've tried another method and it works well. Indeed I use a SplashScreen to show a single picture associated to a node in a TreeWidget when the user does a right click on it. A last question. Is it possible to choose the position where the SplashScreen ap

Re: [PyQt] SplashScreen and mousePressEvent

2009-04-08 Thread Brian Kelley
First, get rid of the mousePressEvent since the Splashscreen closes by default when the user clicks on it. Also, make sure you start the event loop otherwise qt can't detect mouse events. (Note the following code won't stop the application, you may need to kill it afterwards) from PyQt4 impor

[PyQt] Re: SplashScreen and mousePressEvent

2009-04-08 Thread projetmbc
projetmbc a écrit : Hello, I would like to close a splashscreen if the user clicks on it. I decide to subclass QtGui.QSplashScreen to do that but the following code doesn't catch the mouse press event. Why ? Best regards. Christophe == The code == class mySplashScreen(QtGui.QSplashS

[PyQt] SplashScreen and mousePressEvent

2009-04-08 Thread projetmbc
Hello, I would like to close a splashscreen if the user clicks on it. I decide to subclass QtGui.QSplashScreen to do that but the following code doesn't catch the mouse press event. Why ? Best regards. Christophe == The code == class mySplashScreen(QtGui.QSplashScreen): def __init

Re: [PyQt] New Style emit without subclassing

2009-04-08 Thread Matt Smith
Thats not quite what I'm getting at. That will emit the signal, which is the 'old style' but the new style is a bit different, and after you set it up you emit the signal by using: mysignal.emit(args) My question is that the only way I know how to make a 'new style' signal emittable is v

[PyQt] coloring a QDialog

2009-04-08 Thread TP
Hi everybody, To color a QDialog (for example), I can do: from PyQt4.QtCore import * from PyQt4.QtGui import * import sys app = QApplication( sys.argv ) dialog = QDialog( ) dialog.palette().background().setColor(Qt.blue) # @ dialog.show() app.exec_() But if I replace the line "@" by: dialog.set