[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] PyQt Digest, Vol 72, Issue 53
From:       Sean Decal <freshcure () live ! com>
Date:       2010-07-29 22:57:33
Message-ID: SNT115-W4BD2C0657D9A66A09AB4CC8A90 () phx ! gbl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

 

Been doing a few excersises from the PyQt4 Rapid Gui Programming  with Python and Qt. The \
Chapter 13 Python Editor crashes after about 15 seconds on Linux and Windows using Python 2.6 \
and 2.7 does anyone else get this ? 

If I exit the program crashes I get a Segmentation Error in the Geany IDE.

 

Sean  
 
> From: pyqt-request@riverbankcomputing.com
> Subject: PyQt Digest, Vol 72, Issue 53
> To: pyqt@riverbankcomputing.com
> Date: Thu, 29 Jul 2010 22:29:28 +0100
> 
> Send PyQt mailing list submissions to
> pyqt@riverbankcomputing.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> or, via email, send a message with subject or body 'help' to
> pyqt-request@riverbankcomputing.com
> 
> You can reach the person managing the list at
> pyqt-owner@riverbankcomputing.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PyQt digest..."
> 
> 
> Today's Topics:
> 
> 1. Re: connect problem on windows xp (F.A.Pinkse)
> 2. Re: connect problem on windows xp (Fabio Mauri)
> 3. Links to the web from html help files in a resource.
> (Robert Norman)
> 4. Which version of Python does dip REALLY work with?
> (Peter Milliken)
> 5. Re: Which version of Python does dip REALLY work with?
> (Phil Thompson)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 29 Jul 2010 16:56:44 +0200
> From: "F.A.Pinkse" <fapinkse@gmail.com>
> To: pyqt@riverbankcomputing.com
> Subject: Re: [PyQt] connect problem on windows xp
> Message-ID: <i2s4rv$hd7$1@dough.gmane.org>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hi Fabio
> 
> To see you print() statements you need to lauch your script with python
> If you use pythonw the script is lauched and the communication channels 
> are closed.
> 
> Or you use one of these:
> 
> 
> def noneSelected(self):
> print ("signal catched 2")
> self.dtype.setText("signal catched 2")
> msgBox=QtGui.QMessageBox()
> msgBox.setText("signal catched 2")
> msgBox.exec()
> 
> def refreshList(self):
> print ("signal catched 1")
> self.dtype.setText ("signal catched 1")
> msgBox=QtGui.QMessageBox()
> msgBox.setText("signal catched 1")
> msgBox.exec()
> 
> I 'borrowed one of the line/text edit widgets.
> Hope this helps.
> 
> 
> With best regards,
> 
> 
> Frans.
> 
> 
> Op 7/29/2010 12:46 PM, Fabio Mauri schreef:
> > Ok, this below is a minimal example.
> > Launching this (with the gui file attached in the previous mail) in
> > Ubuntu 10.04 I can see the prints on cmdline when clicking on
> > pushbuttons, under windows xp I cannot see them.
> > 
> > #!/usr/bin/python
> > from twisted.internet import reactor
> > from coherence.base import Coherence
> > from coherence.upnp.core import utils
> > 
> > import sys
> > import time
> > from threading import Thread, Timer
> > from Wdw import Ui_Wdw
> > from PyQt4 import QtGui
> > from PyQt4 import QtCore
> > from PyQt4.QtCore import *
> > from PyQt4.QtGui import *
> > 
> > class UPnPgui(QtCore.QObject, Ui_Wdw):
> > 
> > def __init__(self):
> > self.version = "0.5b"
> > return
> > 
> > def doConnections(self):
> > QObject.connect(self.refresh, SIGNAL("clicked()"), self.refreshList)
> > QObject.connect(self.clearSel, SIGNAL("clicked()"), self.noneSelected)
> > return
> > 
> > def noneSelected(self):
> > print "signal catched 2"
> > 
> > def refreshList(self):
> > print "signal catched 1"
> > 
> > if __name__ == "__main__":
> > app = QtGui.QApplication(sys.argv)
> > window = QtGui.QWidget()
> > ui = UPnPgui()
> > ui.setupUi(window)
> > ui.doConnections()
> > window.show()
> > window.geometry()
> > window.setWindowTitle(window.windowTitle() + " version " + ui.version)
> > sys.exit(app.exec_())
> > 
> > On Thu, Jul 29, 2010 at 9:32 AM, Sybren A. St?vel<sybren@stuvel.eu> wrote:
> > > On Thu, Jul 29, 2010 at 08:59:16AM +0200, Fabio Mauri wrote:
> > > > Attached you can find the Ui_Wdw class.
> > > 
> > > That wasn't my point. Please make a *minimal* bit of code that shows
> > > your problem.
> > > 
> > > > In the last connect, I used a different style because for such a
> > > > reason the QObject.connect() i used in the lines above wouldn't work
> > > > while the signal.connect() does (on Ubuntu 10.04).
> > > 
> > > That's strange, as signal.connect() works just fine here (Ubuntu
> > > 10.04).
> > > 
> > > Please try to make a minimal example, just one bit of code that shows
> > > the problem.
> > > 
> > > --
> > > Sybren St?vel
> > > 
> > > http://stuvel.eu/
> > > 
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.4.6 (GNU/Linux)
> > > 
> > > iD8DBQFMUS6h8ZTyn8Yy+5MRAqSpAJ9cdL4gUAHDLuTT2pF+4m9BpU3kbACfe9H+
> > > MMM3k69wFanU5O1GktogOlQ=
> > > =wAb4
> > > -----END PGP SIGNATURE-----
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Thu, 29 Jul 2010 17:28:56 +0200
> From: Fabio Mauri <fabio.mauri@gmail.com>
> To: "F.A.Pinkse" <fapinkse@gmail.com>
> Cc: pyqt@riverbankcomputing.com
> Subject: Re: [PyQt] connect problem on windows xp
> Message-ID:
> <AANLkTinviUSMfoFTV6Ej2WVcmdoEY4zWWqUyNB+wumuP@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> I solved the issue following linjunhalida's suggestion:
> 
> adding QObject.__init__(self) in the __init__ function of my GUI,
> everything turns fine also on windows.
> 
> Thank you linjunhalida, and thank you all!
> 
> On Thu, Jul 29, 2010 at 4:56 PM, F.A.Pinkse <fapinkse@gmail.com> wrote:
> > Hi Fabio
> > 
> > To see you print() statements you need to lauch your script with python
> > If you use pythonw the script is lauched and the communication channels are
> > closed.
> > 
> > Or you use one of these:
> > 
> > 
> > ? ?def noneSelected(self):
> > ? ? ? ?print ("signal catched 2")
> > ? ? ? ?self.dtype.setText("signal catched 2")
> > ? ? ? ?msgBox=QtGui.QMessageBox()
> > ? ? ? ?msgBox.setText("signal catched 2")
> > ? ? ? ?msgBox.exec()
> > 
> > ? ?def refreshList(self):
> > ? ? ? ?print ("signal catched 1")
> > ? ? ? ?self.dtype.setText ("signal catched 1")
> > ? ? ? ?msgBox=QtGui.QMessageBox()
> > ? ? ? ?msgBox.setText("signal catched 1")
> > ? ? ? ?msgBox.exec()
> > 
> > I 'borrowed one of the line/text edit widgets.
> > Hope this helps.
> > 
> > 
> > With best regards,
> > 
> > 
> > Frans.
> > 
> > 
> > Op 7/29/2010 12:46 PM, Fabio Mauri schreef:
> > > 
> > > Ok, this below is a minimal example.
> > > Launching this (with the gui file attached in the previous mail) in
> > > Ubuntu 10.04 I can see the prints on cmdline when clicking on
> > > pushbuttons, under windows xp I cannot see them.
> > > 
> > > #!/usr/bin/python
> > > from twisted.internet import reactor
> > > from coherence.base import Coherence
> > > from coherence.upnp.core import utils
> > > 
> > > import sys
> > > import time
> > > from threading import Thread, Timer
> > > from Wdw import Ui_Wdw
> > > from PyQt4 import QtGui
> > > from PyQt4 import QtCore
> > > from PyQt4.QtCore import *
> > > from PyQt4.QtGui import *
> > > 
> > > class UPnPgui(QtCore.QObject, Ui_Wdw):
> > > 
> > > ? ? def __init__(self):
> > > ? ? ? ? self.version = "0.5b"
> > > ? ? ? ? return
> > > 
> > > ? ? def doConnections(self):
> > > ? ? ? ? QObject.connect(self.refresh, SIGNAL("clicked()"),
> > > self.refreshList)
> > > ? ? ? ? QObject.connect(self.clearSel, SIGNAL("clicked()"),
> > > self.noneSelected)
> > > ? ? ? ? return
> > > 
> > > ? ? def noneSelected(self):
> > > ? ? ? ? print "signal catched 2"
> > > 
> > > ? ? def refreshList(self):
> > > ? ? ? ? print "signal catched 1"
> > > 
> > > if __name__ == "__main__":
> > > ? ? app = QtGui.QApplication(sys.argv)
> > > ? ? window = QtGui.QWidget()
> > > ? ? ui = UPnPgui()
> > > ? ? ui.setupUi(window)
> > > ? ? ui.doConnections()
> > > ? ? window.show()
> > > ? ? window.geometry()
> > > ? ? window.setWindowTitle(window.windowTitle() + " version " + ui.version)
> > > ? ? sys.exit(app.exec_())
> > > 
> > > On Thu, Jul 29, 2010 at 9:32 AM, Sybren A. St?vel<sybren@stuvel.eu>
> > > ?wrote:
> > > > 
> > > > On Thu, Jul 29, 2010 at 08:59:16AM +0200, Fabio Mauri wrote:
> > > > > 
> > > > > Attached you can find the Ui_Wdw class.
> > > > 
> > > > That wasn't my point. Please make a *minimal* bit of code that shows
> > > > your problem.
> > > > 
> > > > > In the last connect, I used a different style because for such a
> > > > > reason the QObject.connect() i used in the lines above wouldn't work
> > > > > while the signal.connect() does (on Ubuntu 10.04).
> > > > 
> > > > That's strange, as signal.connect() works just fine here (Ubuntu
> > > > 10.04).
> > > > 
> > > > Please try to make a minimal example, just one bit of code that shows
> > > > the problem.
> > > > 
> > > > --
> > > > Sybren St?vel
> > > > 
> > > > http://stuvel.eu/
> > > > 
> > > > -----BEGIN PGP SIGNATURE-----
> > > > Version: GnuPG v1.4.6 (GNU/Linux)
> > > > 
> > > > iD8DBQFMUS6h8ZTyn8Yy+5MRAqSpAJ9cdL4gUAHDLuTT2pF+4m9BpU3kbACfe9H+
> > > > MMM3k69wFanU5O1GktogOlQ=
> > > > =wAb4
> > > > -----END PGP SIGNATURE-----
> > > > 
> > > > 
> > > 
> > > 
> > > 
> > 
> > 
> > _______________________________________________
> > PyQt mailing list ? ?PyQt@riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> > 
> 
> 
> 
> -- 
> Fabio Mauri
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 29 Jul 2010 09:52:14 -0700
> From: Robert Norman <tfcrobert@gmail.com>
> To: pyqt@riverbankcomputing.com
> Subject: [PyQt] Links to the web from html help files in a resource.
> Message-ID: <4C51B1BE.9070305@gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> I'm using a QTextBrowser for my help system and would like to have some 
> of the hyperlinks bring up the users full browser so that they can, for 
> examle, download support files from third party web sites. All the 
> links, of course get the qrc path prepended to the links since all the 
> html files are in a resource path "qrc:/Help". 
> So my internal link to myPage.html is translated to 
> "qrc:/Help/myPage.html". 
> 
> I'm guessing I'd have to subclass QTextBrowser and check to see if the 
> links contain some appropriate pattern link www.* , filter out the qrc 
> stuff and pass the link on to the default browser. 
> 
> Anyone have a sample of doing this?
> Thanks,
> Rob
> 
> -- 
> Robert Norman
> Embedded Systems Software Engineer
> AC Propulsion
> www.acpropulsion.com
> 909-592-5399 x4030
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Fri, 30 Jul 2010 07:13:06 +1000
> From: Peter Milliken <peter.milliken@gmail.com>
> To: pyqt@riverbankcomputing.com
> Subject: [PyQt] Which version of Python does dip REALLY work with?
> Message-ID:
> <AANLkTikBRiU39xkay97YQyUMcfGa7uzqNBF77SsDWG3F@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi,
> 
> I have Mark Summerfield's book on Rapid gui development with Python and Qt
> and followed the link in Appendix A and found "dip".
> 
> I have Python 2.6.2. The web-site states it works with 2.6, 2.7 and 3.x, I
> realise it is 0.1 and is bound to have problems, but...
> 
> First problem after installation was that the "shebang" doesn't work with
> cygwin bash and Windows XP i.e. when you just run dip-builder it returns a
> complaint of "no such file" for /c/Python26/Scripts/dip-builder - Python
> doesn't understand bash paths.
> 
> Next problem (after explicitly running dip-builder in the Scripts directory)
> was the final line:
> 
> wres12386#1(/c/Python26/Scripts)$ python dip-builder
> File "dip-builder", line 93
> sys.exit(app.exec())
> ^
> SyntaxError: invalid syntax
> [exited with 1]
> 
> A quick look at the Qt documentation for QApplication shows it should be
> app.exec_()
> 
> So that script can't work with ANY version of Python :-)
> 
> Fixed that, then it complained with:
> 
> wres12386#1(/c/Python26/Scripts)$ python dip-builder
> Traceback (most recent call last):
> File "dip-builder", line 28, in <module>
> from dip.plugins import PluginManager
> File "c:\Python26\lib\site-packages\dip\plugins\__init__.py", line 21, in
> <module>
> from .i_extension_point import IExtensionPoint
> File "c:\Python26\lib\site-packages\dip\plugins\i_extension_point.py",
> line 16, in <module>
> from dip.model import Interface, List, Str
> File "c:\Python26\lib\site-packages\dip\model\__init__.py", line 45, in
> <module>
> from .adapt import adapt
> File "c:\Python26\lib\site-packages\dip\model\adapt.py", line 21
> def adapt(*adapted, to):
> ^
> SyntaxError: invalid syntax
> [exited with 1]
> 
> Not sure what this error is - haven't investigated it, thought it might be
> advisable to re-check the versions of Python it is supposed to work with. I
> realise I don't have the latest 2.6.x, but I thought before I go to a lot of
> trouble downloading other versions of Python (I do not want to go to 3.x - I
> need to stay with 2.x), I thought I would ask the question:
> 
> Exactly what version of Python has anybody ACTUALLY got the dip distribution
> working with? :-)
> 
> In the meantime, I think I'll just go back to reading the book...
> 
> Thanks
> Peter
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100730/655ea7c4/attachment-0001.html>
>  
> ------------------------------
> 
> Message: 5
> Date: Thu, 29 Jul 2010 22:29:24 +0100
> From: Phil Thompson <phil@riverbankcomputing.com>
> To: Peter Milliken <peter.milliken@gmail.com>
> Cc: pyqt@riverbankcomputing.com
> Subject: Re: [PyQt] Which version of Python does dip REALLY work with?
> Message-ID: <422bbea991bc77749b98650b9b873498@localhost>
> Content-Type: text/plain; charset=UTF-8
> 
> On Fri, 30 Jul 2010 07:13:06 +1000, Peter Milliken
> <peter.milliken@gmail.com> wrote:
> > Hi,
> > 
> > I have Mark Summerfield's book on Rapid gui development with Python and
> Qt
> > and followed the link in Appendix A and found "dip".
> > 
> > I have Python 2.6.2. The web-site states it works with 2.6, 2.7 and 3.x,
> I
> > realise it is 0.1 and is bound to have problems, but...
> > 
> > First problem after installation was that the "shebang" doesn't work
> with
> > cygwin bash and Windows XP i.e. when you just run dip-builder it returns
> a
> > complaint of "no such file" for /c/Python26/Scripts/dip-builder - Python
> > doesn't understand bash paths.
> > 
> > Next problem (after explicitly running dip-builder in the Scripts
> > directory)
> > was the final line:
> > 
> > wres12386#1(/c/Python26/Scripts)$ python dip-builder
> > File "dip-builder", line 93
> > sys.exit(app.exec())
> > ^
> > SyntaxError: invalid syntax
> > [exited with 1]
> > 
> > A quick look at the Qt documentation for QApplication shows it should be
> > app.exec_()
> > 
> > So that script can't work with ANY version of Python :-)
> > 
> > Fixed that, then it complained with:
> > 
> > wres12386#1(/c/Python26/Scripts)$ python dip-builder
> > Traceback (most recent call last):
> > File "dip-builder", line 28, in <module>
> > from dip.plugins import PluginManager
> > File "c:\Python26\lib\site-packages\dip\plugins\__init__.py", line 21,
> in
> > <module>
> > from .i_extension_point import IExtensionPoint
> > File "c:\Python26\lib\site-packages\dip\plugins\i_extension_point.py",
> > line 16, in <module>
> > from dip.model import Interface, List, Str
> > File "c:\Python26\lib\site-packages\dip\model\__init__.py", line 45,
> in
> > <module>
> > from .adapt import adapt
> > File "c:\Python26\lib\site-packages\dip\model\adapt.py", line 21
> > def adapt(*adapted, to):
> > ^
> > SyntaxError: invalid syntax
> > [exited with 1]
> > 
> > Not sure what this error is - haven't investigated it, thought it might
> be
> > advisable to re-check the versions of Python it is supposed to work
> with. I
> > realise I don't have the latest 2.6.x, but I thought before I go to a
> lot
> > of
> > trouble downloading other versions of Python (I do not want to go to 3.x
> -
> > I
> > need to stay with 2.x), I thought I would ask the question:
> > 
> > Exactly what version of Python has anybody ACTUALLY got the dip
> > distribution
> > working with? :-)
> > 
> > In the meantime, I think I'll just go back to reading the book...
> 
> So what version of dip are you using?
> 
> dip v0.1 is Python v3 only. For earlier versions of Python you need a
> current snapshot. Hint: pick the one with "py2" in the package name.
> 
> Phil
> 
> 
> ------------------------------
> 
> _______________________________________________
> PyQt mailing list
> PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> End of PyQt Digest, Vol 72, Issue 53
> ************************************
 		 	   		  


[Attachment #5 (text/html)]

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi,<BR>
&nbsp;<BR>
Been doing a few excersises from the PyQt4 Rapid Gui Programming&nbsp; with Python and Qt. The \
Chapter 13 Python Editor&nbsp;crashes after about 15 seconds&nbsp;on Linux and Windows \
using&nbsp;Python 2.6 and 2.7&nbsp;does anyone else get this ? <BR> If I exit the program \
crashes I get a Segmentation Error in the Geany IDE.<BR> &nbsp;<BR>
Sean &nbsp;<BR>&nbsp;<BR>&gt; From: pyqt-request@riverbankcomputing.com<BR>&gt; Subject: PyQt \
Digest, Vol 72, Issue 53<BR>&gt; To: pyqt@riverbankcomputing.com<BR>&gt; Date: Thu, 29 Jul 2010 \
22:29:28 +0100<BR>&gt; <BR>&gt; Send PyQt mailing list submissions to<BR>&gt; \
pyqt@riverbankcomputing.com<BR>&gt; <BR>&gt; To subscribe or unsubscribe via the World Wide \
Web, visit<BR>&gt; http://www.riverbankcomputing.com/mailman/listinfo/pyqt<BR>&gt; or, via \
email, send a message with subject or body 'help' to<BR>&gt; \
pyqt-request@riverbankcomputing.com<BR>&gt; <BR>&gt; You can reach the person managing the list \
at<BR>&gt; pyqt-owner@riverbankcomputing.com<BR>&gt; <BR>&gt; When replying, please edit your \
Subject line so it is more specific<BR>&gt; than "Re: Contents of PyQt digest..."<BR>&gt; \
<BR>&gt; <BR>&gt; Today's Topics:<BR>&gt; <BR>&gt; 1. Re: connect problem on windows xp \
(F.A.Pinkse)<BR>&gt; 2. Re: connect problem on windows xp (Fabio Mauri)<BR>&gt; 3. Links to the \
web from html help files in a resource.<BR>&gt; (Robert Norman)<BR>&gt; 4. Which version of \
Python does dip REALLY work with?<BR>&gt; (Peter Milliken)<BR>&gt; 5. Re: Which version of \
Python does dip REALLY work with?<BR>&gt; (Phil Thompson)<BR>&gt; <BR>&gt; <BR>&gt; \
----------------------------------------------------------------------<BR>&gt; <BR>&gt; \
Message: 1<BR>&gt; Date: Thu, 29 Jul 2010 16:56:44 +0200<BR>&gt; From: "F.A.Pinkse" \
&lt;fapinkse@gmail.com&gt;<BR>&gt; To: pyqt@riverbankcomputing.com<BR>&gt; Subject: Re: [PyQt] \
connect problem on windows xp<BR>&gt; Message-ID: &lt;i2s4rv$hd7$1@dough.gmane.org&gt;<BR>&gt; \
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<BR>&gt; <BR>&gt; Hi Fabio<BR>&gt; \
<BR>&gt; To see you print() statements you need to lauch your script with python<BR>&gt; If you \
use pythonw the script is lauched and the communication channels <BR>&gt; are closed.<BR>&gt; \
<BR>&gt; Or you use one of these:<BR>&gt; <BR>&gt; <BR>&gt; def noneSelected(self):<BR>&gt; \
print ("signal catched 2")<BR>&gt; self.dtype.setText("signal catched 2")<BR>&gt; \
msgBox=QtGui.QMessageBox()<BR>&gt; msgBox.setText("signal catched 2")<BR>&gt; \
msgBox.exec()<BR>&gt; <BR>&gt; def refreshList(self):<BR>&gt; print ("signal catched \
1")<BR>&gt; self.dtype.setText ("signal catched 1")<BR>&gt; msgBox=QtGui.QMessageBox()<BR>&gt; \
msgBox.setText("signal catched 1")<BR>&gt; msgBox.exec()<BR>&gt; <BR>&gt; I 'borrowed one of \
the line/text edit widgets.<BR>&gt; Hope this helps.<BR>&gt; <BR>&gt; <BR>&gt; With best \
regards,<BR>&gt; <BR>&gt; <BR>&gt; Frans.<BR>&gt; <BR>&gt; <BR>&gt; Op 7/29/2010 12:46 PM, \
Fabio Mauri schreef:<BR>&gt; &gt; Ok, this below is a minimal example.<BR>&gt; &gt; Launching \
this (with the gui file attached in the previous mail) in<BR>&gt; &gt; Ubuntu 10.04 I can see \
the prints on cmdline when clicking on<BR>&gt; &gt; pushbuttons, under windows xp I cannot see \
them.<BR>&gt; &gt;<BR>&gt; &gt; #!/usr/bin/python<BR>&gt; &gt; from twisted.internet import \
reactor<BR>&gt; &gt; from coherence.base import Coherence<BR>&gt; &gt; from coherence.upnp.core \
import utils<BR>&gt; &gt;<BR>&gt; &gt; import sys<BR>&gt; &gt; import time<BR>&gt; &gt; from \
threading import Thread, Timer<BR>&gt; &gt; from Wdw import Ui_Wdw<BR>&gt; &gt; from PyQt4 \
import QtGui<BR>&gt; &gt; from PyQt4 import QtCore<BR>&gt; &gt; from PyQt4.QtCore import \
*<BR>&gt; &gt; from PyQt4.QtGui import *<BR>&gt; &gt;<BR>&gt; &gt; class \
UPnPgui(QtCore.QObject, Ui_Wdw):<BR>&gt; &gt;<BR>&gt; &gt; def __init__(self):<BR>&gt; &gt; \
self.version = "0.5b"<BR>&gt; &gt; return<BR>&gt; &gt;<BR>&gt; &gt; def \
doConnections(self):<BR>&gt; &gt; QObject.connect(self.refresh, SIGNAL("clicked()"), \
self.refreshList)<BR>&gt; &gt; QObject.connect(self.clearSel, SIGNAL("clicked()"), \
self.noneSelected)<BR>&gt; &gt; return<BR>&gt; &gt;<BR>&gt; &gt; def \
noneSelected(self):<BR>&gt; &gt; print "signal catched 2"<BR>&gt; &gt;<BR>&gt; &gt; def \
refreshList(self):<BR>&gt; &gt; print "signal catched 1"<BR>&gt; &gt;<BR>&gt; &gt; if __name__ \
== "__main__":<BR>&gt; &gt; app = QtGui.QApplication(sys.argv)<BR>&gt; &gt; window = \
QtGui.QWidget()<BR>&gt; &gt; ui = UPnPgui()<BR>&gt; &gt; ui.setupUi(window)<BR>&gt; &gt; \
ui.doConnections()<BR>&gt; &gt; window.show()<BR>&gt; &gt; window.geometry()<BR>&gt; &gt; \
window.setWindowTitle(window.windowTitle() + " version " + ui.version)<BR>&gt; &gt; \
sys.exit(app.exec_())<BR>&gt; &gt;<BR>&gt; &gt; On Thu, Jul 29, 2010 at 9:32 AM, Sybren A. \
St?vel&lt;sybren@stuvel.eu&gt; wrote:<BR>&gt; &gt;&gt; On Thu, Jul 29, 2010 at 08:59:16AM \
+0200, Fabio Mauri wrote:<BR>&gt; &gt;&gt;&gt; Attached you can find the Ui_Wdw class.<BR>&gt; \
&gt;&gt;<BR>&gt; &gt;&gt; That wasn't my point. Please make a *minimal* bit of code that \
shows<BR>&gt; &gt;&gt; your problem.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt;&gt; In the last connect, \
I used a different style because for such a<BR>&gt; &gt;&gt;&gt; reason the QObject.connect() i \
used in the lines above wouldn't work<BR>&gt; &gt;&gt;&gt; while the signal.connect() does (on \
Ubuntu 10.04).<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; That's strange, as signal.connect() works just \
fine here (Ubuntu<BR>&gt; &gt;&gt; 10.04).<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Please try to make \
a minimal example, just one bit of code that shows<BR>&gt; &gt;&gt; the problem.<BR>&gt; \
&gt;&gt;<BR>&gt; &gt;&gt; --<BR>&gt; &gt;&gt; Sybren St?vel<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; \
http://stuvel.eu/<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; -----BEGIN PGP SIGNATURE-----<BR>&gt; \
&gt;&gt; Version: GnuPG v1.4.6 (GNU/Linux)<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; \
iD8DBQFMUS6h8ZTyn8Yy+5MRAqSpAJ9cdL4gUAHDLuTT2pF+4m9BpU3kbACfe9H+<BR>&gt; &gt;&gt; \
MMM3k69wFanU5O1GktogOlQ=<BR>&gt; &gt;&gt; =wAb4<BR>&gt; &gt;&gt; -----END PGP \
SIGNATURE-----<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; \
<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; ------------------------------<BR>&gt; <BR>&gt; Message: \
2<BR>&gt; Date: Thu, 29 Jul 2010 17:28:56 +0200<BR>&gt; From: Fabio Mauri \
&lt;fabio.mauri@gmail.com&gt;<BR>&gt; To: "F.A.Pinkse" &lt;fapinkse@gmail.com&gt;<BR>&gt; Cc: \
pyqt@riverbankcomputing.com<BR>&gt; Subject: Re: [PyQt] connect problem on windows xp<BR>&gt; \
Message-ID:<BR>&gt; &lt;AANLkTinviUSMfoFTV6Ej2WVcmdoEY4zWWqUyNB+wumuP@mail.gmail.com&gt;<BR>&gt; \
Content-Type: text/plain; charset=ISO-8859-1<BR>&gt; <BR>&gt; I solved the issue following \
linjunhalida's suggestion:<BR>&gt; <BR>&gt; adding QObject.__init__(self) in the __init__ \
function of my GUI,<BR>&gt; everything turns fine also on windows.<BR>&gt; <BR>&gt; Thank you \
linjunhalida, and thank you all!<BR>&gt; <BR>&gt; On Thu, Jul 29, 2010 at 4:56 PM, F.A.Pinkse \
&lt;fapinkse@gmail.com&gt; wrote:<BR>&gt; &gt; Hi Fabio<BR>&gt; &gt;<BR>&gt; &gt; To see you \
print() statements you need to lauch your script with python<BR>&gt; &gt; If you use pythonw \
the script is lauched and the communication channels are<BR>&gt; &gt; closed.<BR>&gt; \
&gt;<BR>&gt; &gt; Or you use one of these:<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ? ?def \
noneSelected(self):<BR>&gt; &gt; ? ? ? ?print ("signal catched 2")<BR>&gt; &gt; ? ? ? \
?self.dtype.setText("signal catched 2")<BR>&gt; &gt; ? ? ? ?msgBox=QtGui.QMessageBox()<BR>&gt; \
&gt; ? ? ? ?msgBox.setText("signal catched 2")<BR>&gt; &gt; ? ? ? ?msgBox.exec()<BR>&gt; \
&gt;<BR>&gt; &gt; ? ?def refreshList(self):<BR>&gt; &gt; ? ? ? ?print ("signal catched \
1")<BR>&gt; &gt; ? ? ? ?self.dtype.setText ("signal catched 1")<BR>&gt; &gt; ? ? ? \
?msgBox=QtGui.QMessageBox()<BR>&gt; &gt; ? ? ? ?msgBox.setText("signal catched 1")<BR>&gt; &gt; \
? ? ? ?msgBox.exec()<BR>&gt; &gt;<BR>&gt; &gt; I 'borrowed one of the line/text edit \
widgets.<BR>&gt; &gt; Hope this helps.<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; With best \
regards,<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; Frans.<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; \
Op 7/29/2010 12:46 PM, Fabio Mauri schreef:<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Ok, this below is \
a minimal example.<BR>&gt; &gt;&gt; Launching this (with the gui file attached in the previous \
mail) in<BR>&gt; &gt;&gt; Ubuntu 10.04 I can see the prints on cmdline when clicking on<BR>&gt; \
&gt;&gt; pushbuttons, under windows xp I cannot see them.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; \
#!/usr/bin/python<BR>&gt; &gt;&gt; from twisted.internet import reactor<BR>&gt; &gt;&gt; from \
coherence.base import Coherence<BR>&gt; &gt;&gt; from coherence.upnp.core import utils<BR>&gt; \
&gt;&gt;<BR>&gt; &gt;&gt; import sys<BR>&gt; &gt;&gt; import time<BR>&gt; &gt;&gt; from \
threading import Thread, Timer<BR>&gt; &gt;&gt; from Wdw import Ui_Wdw<BR>&gt; &gt;&gt; from \
PyQt4 import QtGui<BR>&gt; &gt;&gt; from PyQt4 import QtCore<BR>&gt; &gt;&gt; from PyQt4.QtCore \
import *<BR>&gt; &gt;&gt; from PyQt4.QtGui import *<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; class \
UPnPgui(QtCore.QObject, Ui_Wdw):<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; ? ? def \
__init__(self):<BR>&gt; &gt;&gt; ? ? ? ? self.version = "0.5b"<BR>&gt; &gt;&gt; ? ? ? ? \
return<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; ? ? def doConnections(self):<BR>&gt; &gt;&gt; ? ? ? ? \
QObject.connect(self.refresh, SIGNAL("clicked()"),<BR>&gt; &gt;&gt; self.refreshList)<BR>&gt; \
&gt;&gt; ? ? ? ? QObject.connect(self.clearSel, SIGNAL("clicked()"),<BR>&gt; &gt;&gt; \
self.noneSelected)<BR>&gt; &gt;&gt; ? ? ? ? return<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; ? ? def \
noneSelected(self):<BR>&gt; &gt;&gt; ? ? ? ? print "signal catched 2"<BR>&gt; &gt;&gt;<BR>&gt; \
&gt;&gt; ? ? def refreshList(self):<BR>&gt; &gt;&gt; ? ? ? ? print "signal catched 1"<BR>&gt; \
&gt;&gt;<BR>&gt; &gt;&gt; if __name__ == "__main__":<BR>&gt; &gt;&gt; ? ? app = \
QtGui.QApplication(sys.argv)<BR>&gt; &gt;&gt; ? ? window = QtGui.QWidget()<BR>&gt; &gt;&gt; ? ? \
ui = UPnPgui()<BR>&gt; &gt;&gt; ? ? ui.setupUi(window)<BR>&gt; &gt;&gt; ? ? \
ui.doConnections()<BR>&gt; &gt;&gt; ? ? window.show()<BR>&gt; &gt;&gt; ? ? \
window.geometry()<BR>&gt; &gt;&gt; ? ? window.setWindowTitle(window.windowTitle() + " version " \
+ ui.version)<BR>&gt; &gt;&gt; ? ? sys.exit(app.exec_())<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; On \
Thu, Jul 29, 2010 at 9:32 AM, Sybren A. St?vel&lt;sybren@stuvel.eu&gt;<BR>&gt; &gt;&gt; \
?wrote:<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; On Thu, Jul 29, 2010 at 08:59:16AM +0200, \
Fabio Mauri wrote:<BR>&gt; &gt;&gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt;&gt; Attached you can find the \
Ui_Wdw class.<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; That wasn't my point. Please make a \
*minimal* bit of code that shows<BR>&gt; &gt;&gt;&gt; your problem.<BR>&gt; \
&gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt;&gt; In the last connect, I used a different style because for \
such a<BR>&gt; &gt;&gt;&gt;&gt; reason the QObject.connect() i used in the lines above wouldn't \
work<BR>&gt; &gt;&gt;&gt;&gt; while the signal.connect() does (on Ubuntu 10.04).<BR>&gt; \
&gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; That's strange, as signal.connect() works just fine here \
(Ubuntu<BR>&gt; &gt;&gt;&gt; 10.04).<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; Please try to \
make a minimal example, just one bit of code that shows<BR>&gt; &gt;&gt;&gt; the \
problem.<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; --<BR>&gt; &gt;&gt;&gt; Sybren \
St?vel<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; http://stuvel.eu/<BR>&gt; &gt;&gt;&gt;<BR>&gt; \
&gt;&gt;&gt; -----BEGIN PGP SIGNATURE-----<BR>&gt; &gt;&gt;&gt; Version: GnuPG v1.4.6 \
(GNU/Linux)<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt; \
iD8DBQFMUS6h8ZTyn8Yy+5MRAqSpAJ9cdL4gUAHDLuTT2pF+4m9BpU3kbACfe9H+<BR>&gt; &gt;&gt;&gt; \
MMM3k69wFanU5O1GktogOlQ=<BR>&gt; &gt;&gt;&gt; =wAb4<BR>&gt; &gt;&gt;&gt; -----END PGP \
SIGNATURE-----<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;&gt;<BR>&gt; &gt;&gt;<BR>&gt; \
&gt;&gt;<BR>&gt; &gt;&gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; \
_______________________________________________<BR>&gt; &gt; PyQt mailing list ? \
?PyQt@riverbankcomputing.com<BR>&gt; &gt; \
http://www.riverbankcomputing.com/mailman/listinfo/pyqt<BR>&gt; &gt;<BR>&gt; <BR>&gt; <BR>&gt; \
<BR>&gt; -- <BR>&gt; Fabio Mauri<BR>&gt; <BR>&gt; <BR>&gt; \
------------------------------<BR>&gt; <BR>&gt; Message: 3<BR>&gt; Date: Thu, 29 Jul 2010 \
09:52:14 -0700<BR>&gt; From: Robert Norman &lt;tfcrobert@gmail.com&gt;<BR>&gt; To: \
pyqt@riverbankcomputing.com<BR>&gt; Subject: [PyQt] Links to the web from html help files in a \
resource.<BR>&gt; Message-ID: &lt;4C51B1BE.9070305@gmail.com&gt;<BR>&gt; Content-Type: \
text/plain; charset=ISO-8859-1; format=flowed<BR>&gt; <BR>&gt; I'm using a QTextBrowser for my \
help system and would like to have some <BR>&gt; of the hyperlinks bring up the users full \
browser so that they can, for <BR>&gt; examle, download support files from third party web \
sites. All the <BR>&gt; links, of course get the qrc path prepended to the links since all the \
<BR>&gt; html files are in a resource path "qrc:/Help". <BR>&gt; So my internal link to \
myPage.html is translated to <BR>&gt; "qrc:/Help/myPage.html". <BR>&gt; <BR>&gt; I'm guessing \
I'd have to subclass QTextBrowser and check to see if the <BR>&gt; links contain some \
appropriate pattern link www.* , filter out the qrc <BR>&gt; stuff and pass the link on to the \
default browser. <BR>&gt; <BR>&gt; Anyone have a sample of doing this?<BR>&gt; Thanks,<BR>&gt; \
Rob<BR>&gt; <BR>&gt; -- <BR>&gt; Robert Norman<BR>&gt; Embedded Systems Software \
Engineer<BR>&gt; AC Propulsion<BR>&gt; www.acpropulsion.com<BR>&gt; 909-592-5399 x4030<BR>&gt; \
<BR>&gt; <BR>&gt; <BR>&gt; ------------------------------<BR>&gt; <BR>&gt; Message: 4<BR>&gt; \
Date: Fri, 30 Jul 2010 07:13:06 +1000<BR>&gt; From: Peter Milliken \
&lt;peter.milliken@gmail.com&gt;<BR>&gt; To: pyqt@riverbankcomputing.com<BR>&gt; Subject: \
[PyQt] Which version of Python does dip REALLY work with?<BR>&gt; Message-ID:<BR>&gt; \
&lt;AANLkTikBRiU39xkay97YQyUMcfGa7uzqNBF77SsDWG3F@mail.gmail.com&gt;<BR>&gt; Content-Type: \
text/plain; charset="iso-8859-1"<BR>&gt; <BR>&gt; Hi,<BR>&gt; <BR>&gt; I have Mark \
Summerfield's book on Rapid gui development with Python and Qt<BR>&gt; and followed the link in \
Appendix A and found "dip".<BR>&gt; <BR>&gt; I have Python 2.6.2. The web-site states it works \
with 2.6, 2.7 and 3.x, I<BR>&gt; realise it is 0.1 and is bound to have problems, \
but...<BR>&gt; <BR>&gt; First problem after installation was that the "shebang" doesn't work \
with<BR>&gt; cygwin bash and Windows XP i.e. when you just run dip-builder it returns a<BR>&gt; \
complaint of "no such file" for /c/Python26/Scripts/dip-builder - Python<BR>&gt; doesn't \
understand bash paths.<BR>&gt; <BR>&gt; Next problem (after explicitly running dip-builder in \
the Scripts directory)<BR>&gt; was the final line:<BR>&gt; <BR>&gt; \
wres12386#1(/c/Python26/Scripts)$ python dip-builder<BR>&gt; File "dip-builder", line \
93<BR>&gt; sys.exit(app.exec())<BR>&gt; ^<BR>&gt; SyntaxError: invalid syntax<BR>&gt; [exited \
with 1]<BR>&gt; <BR>&gt; A quick look at the Qt documentation for QApplication shows it should \
be<BR>&gt; app.exec_()<BR>&gt; <BR>&gt; So that script can't work with ANY version of Python \
:-)<BR>&gt; <BR>&gt; Fixed that, then it complained with:<BR>&gt; <BR>&gt; \
wres12386#1(/c/Python26/Scripts)$ python dip-builder<BR>&gt; Traceback (most recent call \
last):<BR>&gt; File "dip-builder", line 28, in &lt;module&gt;<BR>&gt; from dip.plugins import \
PluginManager<BR>&gt; File "c:\Python26\lib\site-packages\dip\plugins\__init__.py", line 21, \
in<BR>&gt; &lt;module&gt;<BR>&gt; from .i_extension_point import IExtensionPoint<BR>&gt; File \
"c:\Python26\lib\site-packages\dip\plugins\i_extension_point.py",<BR>&gt; line 16, in \
&lt;module&gt;<BR>&gt; from dip.model import Interface, List, Str<BR>&gt; File \
"c:\Python26\lib\site-packages\dip\model\__init__.py", line 45, in<BR>&gt; \
&lt;module&gt;<BR>&gt; from .adapt import adapt<BR>&gt; File \
"c:\Python26\lib\site-packages\dip\model\adapt.py", line 21<BR>&gt; def adapt(*adapted, \
to):<BR>&gt; ^<BR>&gt; SyntaxError: invalid syntax<BR>&gt; [exited with 1]<BR>&gt; <BR>&gt; Not \
sure what this error is - haven't investigated it, thought it might be<BR>&gt; advisable to \
re-check the versions of Python it is supposed to work with. I<BR>&gt; realise I don't have the \
latest 2.6.x, but I thought before I go to a lot of<BR>&gt; trouble downloading other versions \
of Python (I do not want to go to 3.x - I<BR>&gt; need to stay with 2.x), I thought I would ask \
the question:<BR>&gt; <BR>&gt; Exactly what version of Python has anybody ACTUALLY got the dip \
distribution<BR>&gt; working with? :-)<BR>&gt; <BR>&gt; In the meantime, I think I'll just go \
back to reading the book...<BR>&gt; <BR>&gt; Thanks<BR>&gt; Peter<BR>&gt; -------------- next \
part --------------<BR>&gt; An HTML attachment was scrubbed...<BR>&gt; URL: \
&lt;http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100730/655ea7c4/attachment-0001.html&gt;<BR>&gt; \
<BR>&gt; ------------------------------<BR>&gt; <BR>&gt; Message: 5<BR>&gt; Date: Thu, 29 Jul \
2010 22:29:24 +0100<BR>&gt; From: Phil Thompson &lt;phil@riverbankcomputing.com&gt;<BR>&gt; To: \
Peter Milliken &lt;peter.milliken@gmail.com&gt;<BR>&gt; Cc: pyqt@riverbankcomputing.com<BR>&gt; \
Subject: Re: [PyQt] Which version of Python does dip REALLY work with?<BR>&gt; Message-ID: \
&lt;422bbea991bc77749b98650b9b873498@localhost&gt;<BR>&gt; Content-Type: text/plain; \
charset=UTF-8<BR>&gt; <BR>&gt; On Fri, 30 Jul 2010 07:13:06 +1000, Peter Milliken<BR>&gt; \
&lt;peter.milliken@gmail.com&gt; wrote:<BR>&gt; &gt; Hi,<BR>&gt; &gt; <BR>&gt; &gt; I have Mark \
Summerfield's book on Rapid gui development with Python and<BR>&gt; Qt<BR>&gt; &gt; and \
followed the link in Appendix A and found "dip".<BR>&gt; &gt; <BR>&gt; &gt; I have Python \
2.6.2. The web-site states it works with 2.6, 2.7 and 3.x,<BR>&gt; I<BR>&gt; &gt; realise it is \
0.1 and is bound to have problems, but...<BR>&gt; &gt; <BR>&gt; &gt; First problem after \
installation was that the "shebang" doesn't work<BR>&gt; with<BR>&gt; &gt; cygwin bash and \
Windows XP i.e. when you just run dip-builder it returns<BR>&gt; a<BR>&gt; &gt; complaint of \
"no such file" for /c/Python26/Scripts/dip-builder - Python<BR>&gt; &gt; doesn't understand \
bash paths.<BR>&gt; &gt; <BR>&gt; &gt; Next problem (after explicitly running dip-builder in \
</html>



_______________________________________________
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