[PyQt] Rapid GUI Programming with Python and Qt

2010-07-19 Thread projetmbc
Hello,
I would ike to have infos about the future new version for Python 3 of this 
great book. Is there a publication date ?

C.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] question about dip observe handler

2010-07-19 Thread Phil Thompson
On Sun, 18 Jul 2010 18:11:15 -0400, Darren Dale dsdal...@gmail.com
wrote:
 I am reading the dip documentation at

http://www.riverbankcomputing.co.uk/static/Docs/dip/complete_example.html
 , and have a question about the following:
 
 dip will invoke an observe() handler when the value of an attribute
 is set, even if the new value is the same as the old one. We therefore
 use the _propagate_changes attribute to prevent possible recursion
 problems
 
 Why is it necessary to invoke the observe handler when the value of an
 attribute does not change? There are quite a few infinite-recursion
 workarounds in the example. If the possibility of infinite recursion
 is so high, perhaps by default the handler should not be invoked if
 the attribute value does not change, unless observe() was called with
 a kwarg to invoke the handler regardless?

Good question.

The short answer is that it was easiest for me, but (obviously) what
matters is what's easier for developers using it.

The issue is to define what is meant by changed, particularly when the
attribute is a class instance? Rebinding the attribute is obviously a
change, but what about a change to an attribute of the instance?

Phil
___
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

2010-07-19 Thread Lic . José M . Rodriguez Bacallao
and when do you plan to support python 2.6.x?

On 7/17/10, Phil Thompson p...@riverbankcomputing.com wrote:
 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



-- 
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] question about dip observe handler

2010-07-19 Thread Darren Dale
On Mon, Jul 19, 2010 at 9:33 AM, Phil Thompson
p...@riverbankcomputing.com wrote:
 On Sun, 18 Jul 2010 18:11:15 -0400, Darren Dale dsdal...@gmail.com
 wrote:
 I am reading the dip documentation at

 http://www.riverbankcomputing.co.uk/static/Docs/dip/complete_example.html
 , and have a question about the following:

 dip will invoke an observe() handler when the value of an attribute
 is set, even if the new value is the same as the old one. We therefore
 use the _propagate_changes attribute to prevent possible recursion
 problems

 Why is it necessary to invoke the observe handler when the value of an
 attribute does not change? There are quite a few infinite-recursion
 workarounds in the example. If the possibility of infinite recursion
 is so high, perhaps by default the handler should not be invoked if
 the attribute value does not change, unless observe() was called with
 a kwarg to invoke the handler regardless?

 Good question.

 The short answer is that it was easiest for me, but (obviously) what
 matters is what's easier for developers using it.

Perhaps the example would be easier to understand (and to develop from
scratch) with such a change.

 The issue is to define what is meant by changed, particularly when the
 attribute is a class instance? Rebinding the attribute is obviously a
 change, but what about a change to an attribute of the instance?

The last example is another slightly different use case. The way
enthought supports it is documented at
http://code.enthought.com/projects/traits/docs/html/traits_user_manual/notification.html#example-of-a-dynamic-notification-handler
.

Darren
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Rapid GUI Programming with Python and Qt

2010-07-19 Thread Mark Summerfield
On Mon, 19 Jul 2010 15:06:12 +0200 (CEST)
projet...@club-internet.fr wrote:

 Hello,
 I would ike to have infos about the future new version for Python 3
 of this great book. Is there a publication date ?

Hi C,

I would very much like to do a new edition of the PyQt book, but it will
probably not be for another year or two due to other commitments.

I want the next edition to be based on Python 3.1 (or later). Also, I am
hoping that by the time I'm ready to start on it PySide will support
Python 3 and will be sufficiently compatible with PyQt that I can cover
both in the same book without confusing readers.

For those who can't wait I have converted all the book's examples to
Python 3.0 (using PyQt API 1) and to Python 3.1 (using PyQt API 2).

I had expected the conversion to Python 3.1 and API 2 to be rather
difficult, but in the end it was pretty straightforward, so the
differences between what's shown in the book and the Python 3.1 versions
of the examples are either non-existent or easy to see and understand.

I've put a few notes on the most problematic classes at the bottom of
the book's web page:
http://www.qtrac.eu/pyqtbook.html
(This is also where the links to the Python 3 examples are located.)

On a personal note, last week I finished converting all my own Python
programs to Python 3.1 using the 2to3 tool and then manually converting
str % usage to str.format(). This includes some PyQt GUI programs that I
use every day:-)

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Programming in Python 3 - ISBN 0321680561
http://www.qtrac.eu/py3book.html
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Embedding PyQt scripts into Qt applications - manual update

2010-07-19 Thread Oleksandr Iakovliev
Hi PyQt trolls,

I have finally updated my manual about embedding PyQt scripts into Qt C++ 
applications (up to last versions of Qt and PyQt).
You may find it interesting - it opens a way to create hybrid applications 
where
you have both C++ and Python codes running together and both using Qt Api.

link:

http://lynxline.com/qt-python-superhybrids/
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Get Signals from all buttons in the form

2010-07-19 Thread starglider develop
Hi,
I have a form with 12 QPushButtons and need to connect the signals to the
corresponding  button pressed without have to use the usual
self.connect(obj,SIGNAL(),self.function), because I don't khow many buttons
where made.

Yes I'm a newbe.

Thank you in advance.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] QDomElement set text?

2010-07-19 Thread Scott Ballard
If I have an XML element such as mirrorhhello/mirrorh I can retrieve
its text (hello) using the method .text(), but how do I set it?

Or do I somehow have to use a QTextNode to set the QDomElement?

Any thoughts?

Thanks,
-Scott

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Get Signals from all buttons in the form

2010-07-19 Thread Doug Bell
starglider develop wrote:
 Hi,
 I have a form with 12 QPushButtons and need to connect the signals to the
 corresponding  button pressed without have to use the usual
 self.connect(obj,SIGNAL(),self.function), because I don't khow many buttons
 where made.

Read the documentation for QButtonGroup.  Set it to non-exclusive, and
it can signal if any button is pressed.

Doug
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Get Signals from all buttons in the form

2010-07-19 Thread 机械唯物主义 : linjunhalida
or:

buttons = [QPushButton(button %d % i) for i in range(12)]
for button in buttons:
button.clicked.connect(lambda button=button: do_something(button))

On Tue, Jul 20, 2010 at 8:57 AM, Doug Bell do...@bellz.org wrote:
 starglider develop wrote:
 Hi,
 I have a form with 12 QPushButtons and need to connect the signals to the
 corresponding  button pressed without have to use the usual
 self.connect(obj,SIGNAL(),self.function), because I don't khow many buttons
 where made.

 Read the documentation for QButtonGroup.  Set it to non-exclusive, and
 it can signal if any button is pressed.

 Doug
 ___
 PyQt mailing list    p...@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Rapid GUI Programming with Python and Qt

2010-07-19 Thread Sathishkumar Duraisamy
Hi Mark Summerfield,

I am fan of your book Rapid GUI Programming with Python and Qt. Its
pleasure to have new edition. But two year is little long

I have found the pyqt does not have any support for the classes for embedded
linux. But David Boddie has given some support for it in
http://bitbucket.org/dboddie/pyqt4-for-embedded-linux. I wish please you to
include support for it in next edition, such as how to port it to embedded
linux / embedded systems

Sathishkumar

On Mon, Jul 19, 2010 at 9:07 PM, Mark Summerfield l...@qtrac.plus.comwrote:

 On Mon, 19 Jul 2010 15:06:12 +0200 (CEST)
 projet...@club-internet.fr wrote:

  Hello,
  I would ike to have infos about the future new version for Python 3
  of this great book. Is there a publication date ?

 Hi C,

 I would very much like to do a new edition of the PyQt book, but it will
 probably not be for another year or two due to other commitments.

 I want the next edition to be based on Python 3.1 (or later). Also, I am
 hoping that by the time I'm ready to start on it PySide will support
 Python 3 and will be sufficiently compatible with PyQt that I can cover
 both in the same book without confusing readers.

 For those who can't wait I have converted all the book's examples to
 Python 3.0 (using PyQt API 1) and to Python 3.1 (using PyQt API 2).

 I had expected the conversion to Python 3.1 and API 2 to be rather
 difficult, but in the end it was pretty straightforward, so the
 differences between what's shown in the book and the Python 3.1 versions
 of the examples are either non-existent or easy to see and understand.

 I've put a few notes on the most problematic classes at the bottom of
 the book's web page:
 http://www.qtrac.eu/pyqtbook.html
 (This is also where the links to the Python 3 examples are located.)

 On a personal note, last week I finished converting all my own Python
 programs to Python 3.1 using the 2to3 tool and then manually converting
 str % usage to str.format(). This includes some PyQt GUI programs that I
 use every day:-)

 --
 Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Programming in Python 3 - ISBN 0321680561
http://www.qtrac.eu/py3book.html
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt