[PyQt] Is there a signal that is generated by any change in a QListWidget?
I have a program that manages a list using QListWidget. It's patterned after the one in chapter 5 of Mark Summerfield's book. It has Up, Down, Sort, Add, Delete, Edit, and Save buttons and also a Count label showing the length of the list, so whenever there is a change to the list I need to update the buttons and the Count label. By update the buttons I mean disable the Up/Down button if the current item is at the top/bottom respectively, and enable it if is isn't. Note that any change whatsoever including clicking on an item, clicking on Sort, clicking on Delete, etc. might require the updating to be done. I put “doUpdate()” after every place in the code that can possibly cause a change. That works but it would be nicer if a signal were generated whenever a change occurred that I could connect to doUpdate(). The documentation for QListWidget only describes signals for particular kinds of changes. Is there an inherited signal that does what I want? Or some other nice way to do it? I find it hard to search for inherited properties. -- Robert Lummis ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
dip v0.1 has been released. This is the first release of dip, an application development framework for PyQt and (for the moment at least) Python v3. The user documentation, including tutorials and a full API reference is available at http://www.riverbankcomputing.com/static/Docs/dip/index.html dip is suitable for developing simple utilities and large scale, complex applications. It includes the following features... - the dip-builder tool for creating initial application stubs and then turning applications into deployable packages - a component based system based on plugins, services and extension points - a declarative type system - the ability to define interfaces and write adaptors that allow objects to appear to implement an interface without having to change the object - the ability to create testable user interfaces declaratively - a default user interface shell, based on QMainWindow - a framework for defining storage and data formats for reading and writing application objects - hooks to support other Qt-based toolkits (specifically PyKDE) so that an application can automatically choose to use an alternative if one is available dip is designed both for developing new code and for integrating existing code to create new applications. It does not require the wholesale adoption of the framework - just use what you find useful. If you want, replace parts of it with your own implementation if you don't like the default behaviour. Obviously with a v0.1 release there is some work still to do. However the existing API is considered to be fairly stable and future development will be concentrated on new features. dip is licensed the same as PyQt - GPL and commercial. Although Python v3 is specifically targeted I will be investigating how easy it will be to also support Python v2.6 and v2.7. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] QTreeview does not show subrows correctly when the model is a Python list
Dear all, I am trying to use a Python list as a model for QTreeView, or to be precise, the model is a subclass of list, the daughter nodes are the elements on this list object, and they themselves are the same subclass of list. Somehow I cannot get the data to show correctly. Only the first row is shown and although the top row indicates that is has subrows, expanding the toprow does not show the subrows. I adapted the sample program that comes with the PyQt source distribution to illustrate the problem. Uncomment the code at line 194/195 to select the working code or my failing code. I observe this problem when I run this on a Mac Book Pro (Mac OS X 10.6.4, Python 2.6, Qt 4.6.3, PyQt 4.7.4). I haven't had the opportunity to test this on other platforms. I'm not sure if there is some mistake in my code or this is a bug in PyQt or Qt. Iv'e found one reference on the web to what sounds like a similar problem: http://www.python-forum.org/pythonforum/viewtopic.php?f=4t=14676. Could anyone offer any insights? Many thanks in advance. Best, Herbert #!/usr/bin/env python ## ## Copyright (C) 2005-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundation ## and appearing in the file LICENSE.GPL included in the packaging of ## this file. Please review the following information to ensure GNU ## General Public Licensing requirements will be met: ## http://www.trolltech.com/products/qt/opensource.html ## ## If you are unsure which license is appropriate for your use, please ## review the following information: ## http://www.trolltech.com/products/qt/licensing.html or contact the ## sales department at sa...@trolltech.com. ## ## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ## # Modified to illustrate that QTreeView does not handle a model that is # subclassed from a Python list. from PyQt4 import QtCore, QtGui # set dbg = True on the line below to see that only the first row is ever # requested, altough rowCount() returns 2. dbg = False # Everything works when creating a new class for the model class TreeItem_Works(object): def __init__(self, data): self.parentItem = None self.itemData = data self.dtrs = [] def appendChild(self, item): item.parentItem = self self.dtrs.append(item) def child(self, row): return self.dtrs[row] def childCount(self): return len(self.dtrs) def columnCount(self): return len(self.itemData) def get_data(self, column): try: return self.itemData[column] except IndexError: return None def parent(self): return self.parentItem def row(self): if self.parentItem: return self.parentItem.dtrs.index(self) return 0 def __str__( self ) : return self.to_string( indent = 0 ) def to_string( self, indent = 0 ) : string = ' ' * indent + repr( self.itemData ) + '\n' d_indent = indent + 2 for index in range( 0, self.childCount() ) : dtr = self.child( index ) string += dtr.to_string( d_indent ) return string # Only the first row is shown (but not its daughters) when using this class # that equates the list of daughters with the TreeItem itself by subclassing # from list. (Btw. subclassing from UserList.UserList has the same result.) #import UserList #class TreeItem_Fails(TreeItem_Works, UserList.UserList): #def __init__(self, data): #UserList.UserList.__init__( self ) #self.parentItem = None #self.itemData = data class TreeItem_Fails(TreeItem_Works, list): def __init__(self, data): list.__init__( self ) self.parentItem = None self.itemData = data def appendChild(self, item): item.parentItem = self self.append(item) def child(self, row): return self[row] def childCount(self): return len(self) def row(self): if self.parentItem: return self.parentItem.index(self) return 0 class TreeModel(QtCore.QAbstractItemModel): def __init__(self, root_item, parent=None): QtCore.QAbstractItemModel.__init__(self, parent) self.rootItem = root_item def columnCount(self, parent): if parent.isValid(): source = parent.internalPointer() else: source = self.rootItem if dbg : print %s columns for %s % ( source.columnCount(), source.itemData ) return
Re: [PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
Hi Phil, Il giorno Sat, 17 Jul 2010 18:02:57 +0100 Phil Thompson p...@riverbankcomputing.com ha scritto: dip v0.1 has been released. This is the first release of dip, an application development framework for PyQt and (for the moment at least) Python v3. The user documentation, including tutorials and a full API reference is available at http://www.riverbankcomputing.com/static/Docs/dip/index.html dip is suitable for developing simple utilities and large scale, complex applications. It includes the following features... [...] first of all congratulations for the great job. I have still not finished to read the docs but it seems to me that many of the features provided by dip are also present in the enthought framework (Traits, Envisage, etc.). I would like to ask you why you decided to develop a new framework and which are advantages/drawbacks of using dip instead of enthought. Best regards -- Antonio Valentino ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
yes, I think that there are some features that are the same in both (entought toolkit and dip) but, in my opinion, enthought toolkit is too performance eater. On 7/17/10, Antonio Valentino antonio.valent...@tiscali.it wrote: Hi Phil, Il giorno Sat, 17 Jul 2010 18:02:57 +0100 Phil Thompson p...@riverbankcomputing.com ha scritto: dip v0.1 has been released. This is the first release of dip, an application development framework for PyQt and (for the moment at least) Python v3. The user documentation, including tutorials and a full API reference is available at http://www.riverbankcomputing.com/static/Docs/dip/index.html dip is suitable for developing simple utilities and large scale, complex applications. It includes the following features... [...] first of all congratulations for the great job. I have still not finished to read the docs but it seems to me that many of the features provided by dip are also present in the enthought framework (Traits, Envisage, etc.). I would like to ask you why you decided to develop a new framework and which are advantages/drawbacks of using dip instead of enthought. Best regards -- Antonio Valentino ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales - ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
there is no version for python = 2.6.x? On 7/17/10, Lic. José M. Rodriguez Bacallao jmr...@gmail.com wrote: yes, I think that there are some features that are the same in both (entought toolkit and dip) but, in my opinion, enthought toolkit is too performance eater. On 7/17/10, Antonio Valentino antonio.valent...@tiscali.it wrote: Hi Phil, Il giorno Sat, 17 Jul 2010 18:02:57 +0100 Phil Thompson p...@riverbankcomputing.com ha scritto: dip v0.1 has been released. This is the first release of dip, an application development framework for PyQt and (for the moment at least) Python v3. The user documentation, including tutorials and a full API reference is available at http://www.riverbankcomputing.com/static/Docs/dip/index.html dip is suitable for developing simple utilities and large scale, complex applications. It includes the following features... [...] first of all congratulations for the great job. I have still not finished to read the docs but it seems to me that many of the features provided by dip are also present in the enthought framework (Traits, Envisage, etc.). I would like to ask you why you decided to develop a new framework and which are advantages/drawbacks of using dip instead of enthought. Best regards -- Antonio Valentino ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales - -- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales - ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] how to launch a pyqt app from another pyqt app
Hi, I have two pyqt application app1 and app2. I am trying to launch app2 from app1. I do not want any parent/child relation. Both apps could be QMainWindow. The idea is that I do not want to start app2 whenvere I start app1. app2 is a server. app1 checks if the server is live, and launch it if necessary. thanks for your help, Philippe ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
where to download dip? On 7/17/10, Lic. José M. Rodriguez Bacallao jmr...@gmail.com wrote: there is no version for python = 2.6.x? On 7/17/10, Lic. José M. Rodriguez Bacallao jmr...@gmail.com wrote: yes, I think that there are some features that are the same in both (entought toolkit and dip) but, in my opinion, enthought toolkit is too performance eater. On 7/17/10, Antonio Valentino antonio.valent...@tiscali.it wrote: Hi Phil, Il giorno Sat, 17 Jul 2010 18:02:57 +0100 Phil Thompson p...@riverbankcomputing.com ha scritto: dip v0.1 has been released. This is the first release of dip, an application development framework for PyQt and (for the moment at least) Python v3. The user documentation, including tutorials and a full API reference is available at http://www.riverbankcomputing.com/static/Docs/dip/index.html dip is suitable for developing simple utilities and large scale, complex applications. It includes the following features... [...] first of all congratulations for the great job. I have still not finished to read the docs but it seems to me that many of the features provided by dip are also present in the enthought framework (Traits, Envisage, etc.). I would like to ask you why you decided to develop a new framework and which are advantages/drawbacks of using dip instead of enthought. Best regards -- Antonio Valentino ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt -- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales - -- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales - -- Lic. José M. Rodriguez Bacallao Centro de Biofisica Medica - Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo. Recuerda: El arca de Noe fue construida por aficionados, el titanic por profesionales - ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
where to download dip? Maybe here : http://www.riverbankcomputing.com/ ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] ANN: dip v0.1 Released - An Application Development Framework for PyQt and Python v3
On Sat, 17 Jul 2010 21:09:04 +0200, Antonio Valentino antonio.valent...@tiscali.it wrote: Hi Phil, Il giorno Sat, 17 Jul 2010 18:02:57 +0100 Phil Thompson p...@riverbankcomputing.com ha scritto: dip v0.1 has been released. This is the first release of dip, an application development framework for PyQt and (for the moment at least) Python v3. The user documentation, including tutorials and a full API reference is available at http://www.riverbankcomputing.com/static/Docs/dip/index.html dip is suitable for developing simple utilities and large scale, complex applications. It includes the following features... [...] first of all congratulations for the great job. I have still not finished to read the docs but it seems to me that many of the features provided by dip are also present in the enthought framework (Traits, Envisage, etc.). Agreed. I've worked with Enthought for several years and did the original port to PyQt amongst other things. There is a lot of good stuff in it. I would like to ask you why you decided to develop a new framework and which are advantages/drawbacks of using dip instead of enthought. There were many reasons to create a new framework, one being the need for Python v3 support and the desire to use Python v3 features. Another significant reason was the way that the Enthought stuff implements toolkit independence, ie. the compromises it makes in order to support wx and PyQt. As a PyQt programmer you often end up being frustrated that you can't get your GUIs to do what you want because TraitsUi is getting in the way. In dip, QWidgets are first class objects. When you create a GUI you get a QWidget, not something that wraps a QWidget in an API that is designed to support wx. Another example (which you'll understand if you are familiar with Traits) is that dip allows you to do... class MyClass(QObject, Model): ... ...where Model is the dip equivalent of HasTraits. Of course the Enthought stuff is very mature and has lots of stuff that dip doesn't have - for example it is very good for engineering applications that need 2D and 3D visualisation. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] PyQt 4.7.4 compilation problems on Ubuntu 10.04
Hi, Has anyone on the list had success compiling PyQt 4.7.4 for Python 3.1 on the 64-bit version of Ubuntu 10.04? Configuration (using SIP 4.10.5) seems to have worked OK, but the 'make' phase fails when attempting to build QtHelp.so, with the following error message: /usr/bin/ld: cannot find -lXext The compiler command clearly includes a -L/usr/lib option, and /usr/lib does contain a libXext.so library, so I can't understand the reason for the linker error. Any suggestions gratefully received! Nick ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] pip install pyqt error
When I try to use pip to install PyQt from PyPi. However I get an error saying there is no setup.py in the tarball it download. Maybe someone would fix this? Maybe its me? -- Harrison Erd (PATX) - http://patx.me/ ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt