Re: [PyQt] help with this question

2010-04-05 Thread Doug Bell
Rafael Lemus wrote:
> Hello,
> 
> I've been wondering if there is a pyqt method that can tell me which was 
> the widget that sent a signal, this is because I want, that whenever a 
> QPushButton is
>  clicked it sends me to a method and in this method I could compare 
> which button send me a signal so i can emit another signal.

Call QObject.sender() in the slot method.

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


[PyQt] help with this question

2010-04-05 Thread Rafael Lemus
Hello,

I've been wondering if there is a pyqt method that can tell me which was 
the widget that sent a signal, this is because I want, that whenever a 
QPushButton is
 clicked it sends me to a method and in this method I could compare 
which button send me a signal so i can emit another signal.
thanks in
 advance


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

Re: [PyQt] PyQt and/or Qt problems on Windows Vista

2010-04-05 Thread Phil Thompson
On Mon, 5 Apr 2010 22:05:49 +0200, Francesco Biccari 
wrote:
> Hello,
> 
> this is my first post to this list.
> I am an Italian researcher. In our lab we would like to move
> from Visual Basic (5!) to Python + PyQt.
> 
> Unfortunately our first tests were discouraging and I am here to
> ask for some advices.
> 
> I use Windows Vista 32 bit.
> I installed Python 2.6.5 (Windows installer) and
> PyQt (PyQt-Py2.6-gpl-4.7.2-1.exe).
> 
> We have noticed two issues:
> 
> 1. programs written with PyQt run slower
> than similar programs written, for example, with wxPython.
> (however this is not a big issue)
> 
> 2. All non-trivial PyQt applications make python.exe to crash when we
> close the application.
> 
> I tried also to compile PyQt by myself but the problems still remain.

I've had another report like this. Two possible solutions - use the current
PyQt snapshot, or use Python 2.6.4.

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


Re: [PyQt] "sip: QFileIconProvider is undefined" from import of QtGui/QtGuimod.sip with SIP 4.10, Qt 4.6.1 and Python 2.5.1

2010-04-05 Thread Phil Thompson
On Mon, 5 Apr 2010 15:27:47 -0400 (EDT), mfl...@evryx.com wrote:
> Excerpt from our pyqtconfig.py script is below.  The Qt string generated
> for pyqt_sip_flags from a Qt 4.6.1/PyQt 4.6.1 installation is 'Qt_4_5_0'
-
> which is puzzling to all of us who were expecting to see something like
> 'Qt_4_6_x'.  Is the appearance of '-t Qt_4_5_0' for 'pyqt_sip_flags' in
the
> Qt 4.6.1/PyQt 4.6.1 installation expected behavior?
> 
> Thanks,
> 
> - Mark

Not if you are using Qt v4.6.1. You must have an older version of the Qt
libraries installed as well.

Phil

> # These are installation specific values created when PyQt4 was
configured.
> _pkg_config = {
> 'pyqt_bin_dir':  '/rel/lang/python/2.5.1-6/opt-gccWS5_64/bin',
> 'pyqt_config_args':  '--confirm-license --concatenate --consolidate
>
--qmake=/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/bin/qmake
>
--plugin-destdir=/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/plugins
> --verbose CC=/usr/bin/gcc4 CXX=/usr/bin/g++4 LINK=/usr/bin/g++4
> LINK_SHLIB=/usr/bin/g++4 CXXFLAGS=-mcmodel=small -fPIC
> LFLAGS+=-Wl,--rpath,/opt/lib/gccWS5_64 -Wl,--rpath,/usr/lib64 -fPIC',
> 'pyqt_mod_dir': 
>
'/rel/lang/python/2.5.1-6/opt-gccWS5_64/lib/python2.5/site-packages/PyQt4',
> 'pyqt_modules':  'QtCore QtGui QtHelp QtNetwork QtOpenGL QtScript
> QtScriptTools QtSql QtSvg QtTest QtWebKit QtXml QtXmlPatterns
> QtAssistant QtDesigner',
> 'pyqt_sip_dir':  '/rel/lang/python/2.5.1-6/share/sip/PyQt4',
> 'pyqt_sip_flags':'-x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug
-t
> Qt_4_5_0 -x Py_v3 -g',
> 'pyqt_version':  0x040601,
> 'pyqt_version_str':  '4.6.1',
> 'qt_data_dir':  
> '/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64',
> 'qt_dir':   
> '/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64',
> 'qt_edition':'Desktop',
> 'qt_framework':  0,
> 'qt_inc_dir':   
>
'/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/include',
> 'qt_lib_dir':   
>
'/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/lib',
> 'qt_threaded':   1,
> 'qt_version':0x040601,
> 'qt_winconfig':  'shared'
> 
> 
> 
> 
> -Original Message-
> From: "Phil Thompson" 
> Sent: Wednesday, March 31, 2010 4:38pm
> To: "Mark Floyd" 
> Cc: pyqt@riverbankcomputing.com
> Subject: Re: [PyQt] "sip: QFileIconProvider is undefined" from import of
> QtGui/QtGuimod.sip with SIP 4.10, Qt 4.6.1 and Python 2.5.1
> 
> On Tue, 30 Mar 2010 20:34:14 -0700, Mark Floyd  wrote:
>> I'm trying to run a simple .sip file example and can't seem to get the
>> bloody thing to run.  Here is my small example *without* the import of
>> QtGui/QtGuimod.sip... which will build normally:
>> 
>>   Working Example working.sip ###
>> %Module word 0
>>  End working.sip
>> 
>> % sip -I/rel/lang/python/2.5.1-6/share/sip/PyQt4 -t WS_X11 -t Qt_4_6_0
-c
> .
>> working.sip
>> 
>> 
>> If I try to import QtGui/QtGuimod.sip as demonstrated below:
>> 
>> ### Broken Example broken.sip ###
>> %Import QtGui/QtGuimod.sip
>> %Module word 0
>> ### End broken.sip
>> 
>> I get the following error:
>> % sip -I/rel/lang/python/2.5.1-6/share/sip/PyQt4 -t WS_X11 -t Qt_4_6_0
-c
> .
>> broken.sip
>> sip: QFileIconProvider is undefined
>> 
>> I found another thread on the email list where a user said "-t Qt_4_6_0"
>> would fix this problem... but I'm not getting same luck here.
>> 
>> /rel/lang/python/2.5.1-6/share/sip/PyQt4/QtGui/QtGuimod.sip does include
>> qfileiconprovider.sip.
>> 
>> The error doesn't give much information for a newcomer to analyze... and
> an
>> strace isn't revealing much either.  Any pointers on how to fix this
> would
>> be much appreciated.
>> 
>> This was built on a RedHat 4 box using SIP 4.10, Qt 4.6.1, and Python
>> 2.5.1.
> 
> Works fine for me. It suggests a problem with your PyQt installation. You
> can check 'pyqt_sip_flags' in pyqtconfig.py to see what flags you should
be
> using.
> 
> Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] PyQt and/or Qt problems on Windows Vista

2010-04-05 Thread Francesco Biccari
Hello,

this is my first post to this list.
I am an Italian researcher. In our lab we would like to move
from Visual Basic (5!) to Python + PyQt.

Unfortunately our first tests were discouraging and I am here to
ask for some advices.

I use Windows Vista 32 bit.
I installed Python 2.6.5 (Windows installer) and
PyQt (PyQt-Py2.6-gpl-4.7.2-1.exe).

We have noticed two issues:

1. programs written with PyQt run slower
than similar programs written, for example, with wxPython.
(however this is not a big issue)

2. All non-trivial PyQt applications make python.exe to crash when we
close the application.

I tried also to compile PyQt by myself but the problems still remain.

Here there is an example of application which show these problems:
http://eli.thegreenplace.net/2009/12/12/tetris-implemented-in-pyqt/
another application is Eric4.

Thank you in advance for your help.
Regards.
Francesco
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] "sip: QFileIconProvider is undefined" from import of QtGui/QtGuimod.sip with SIP 4.10, Qt 4.6.1 and Python 2.5.1

2010-04-05 Thread mfloyd
Excerpt from our pyqtconfig.py script is below.  The Qt string generated for 
pyqt_sip_flags from a Qt 4.6.1/PyQt 4.6.1 installation is 'Qt_4_5_0' - which is 
puzzling to all of us who were expecting to see something like 'Qt_4_6_x'.  Is 
the appearance of '-t Qt_4_5_0' for 'pyqt_sip_flags' in the Qt 4.6.1/PyQt 4.6.1 
installation expected behavior?

Thanks,

- Mark

# These are installation specific values created when PyQt4 was configured.
_pkg_config = {
'pyqt_bin_dir':  '/rel/lang/python/2.5.1-6/opt-gccWS5_64/bin',
'pyqt_config_args':  '--confirm-license --concatenate --consolidate 
--qmake=/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/bin/qmake
 
--plugin-destdir=/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/plugins
 --verbose CC=/usr/bin/gcc4 CXX=/usr/bin/g++4 LINK=/usr/bin/g++4 
LINK_SHLIB=/usr/bin/g++4 CXXFLAGS=-mcmodel=small -fPIC 
LFLAGS+=-Wl,--rpath,/opt/lib/gccWS5_64 -Wl,--rpath,/usr/lib64 -fPIC',
'pyqt_mod_dir':  
'/rel/lang/python/2.5.1-6/opt-gccWS5_64/lib/python2.5/site-packages/PyQt4',
'pyqt_modules':  'QtCore QtGui QtHelp QtNetwork QtOpenGL QtScript 
QtScriptTools QtSql QtSvg QtTest QtWebKit QtXml QtXmlPatterns QtAssistant 
QtDesigner',
'pyqt_sip_dir':  '/rel/lang/python/2.5.1-6/share/sip/PyQt4',
'pyqt_sip_flags':'-x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t 
Qt_4_5_0 -x Py_v3 -g',
'pyqt_version':  0x040601,
'pyqt_version_str':  '4.6.1',
'qt_data_dir':   
'/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64',
'qt_dir':
'/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64',
'qt_edition':'Desktop',
'qt_framework':  0,
'qt_inc_dir':
'/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/include',
'qt_lib_dir':
'/rel/depot/third_party_build/qt/4.6.1-0/opt-ws4-x86_64-gccWS5_64/lib',
'qt_threaded':   1,
'qt_version':0x040601,
'qt_winconfig':  'shared'




-Original Message-
From: "Phil Thompson" 
Sent: Wednesday, March 31, 2010 4:38pm
To: "Mark Floyd" 
Cc: pyqt@riverbankcomputing.com
Subject: Re: [PyQt] "sip: QFileIconProvider is undefined" from import of 
QtGui/QtGuimod.sip with SIP 4.10, Qt 4.6.1 and Python 2.5.1

On Tue, 30 Mar 2010 20:34:14 -0700, Mark Floyd  wrote:
> I'm trying to run a simple .sip file example and can't seem to get the
> bloody thing to run.  Here is my small example *without* the import of
> QtGui/QtGuimod.sip... which will build normally:
> 
>   Working Example working.sip ###
> %Module word 0
>  End working.sip
> 
> % sip -I/rel/lang/python/2.5.1-6/share/sip/PyQt4 -t WS_X11 -t Qt_4_6_0 -c
.
> working.sip
> 
> 
> If I try to import QtGui/QtGuimod.sip as demonstrated below:
> 
> ### Broken Example broken.sip ###
> %Import QtGui/QtGuimod.sip
> %Module word 0
> ### End broken.sip
> 
> I get the following error:
> % sip -I/rel/lang/python/2.5.1-6/share/sip/PyQt4 -t WS_X11 -t Qt_4_6_0 -c
.
> broken.sip
> sip: QFileIconProvider is undefined
> 
> I found another thread on the email list where a user said "-t Qt_4_6_0"
> would fix this problem... but I'm not getting same luck here.
> 
> /rel/lang/python/2.5.1-6/share/sip/PyQt4/QtGui/QtGuimod.sip does include
> qfileiconprovider.sip.
> 
> The error doesn't give much information for a newcomer to analyze... and
an
> strace isn't revealing much either.  Any pointers on how to fix this
would
> be much appreciated.
> 
> This was built on a RedHat 4 box using SIP 4.10, Qt 4.6.1, and Python
> 2.5.1.

Works fine for me. It suggests a problem with your PyQt installation. You
can check 'pyqt_sip_flags' in pyqtconfig.py to see what flags you should be
using.

Phil


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


Re: [PyQt] Problem in installing PyQt on Mac OS X 10.6.2

2010-04-05 Thread Jebagnana Das
Thanks darren for your reply. But still i couldn't make it to work.

This is what i did. Installed the qt-mac-cocoa-opensource-4.6.0.dmgfrom the
source you specified.. Installed SIP 4.10.1 using $python3 configure.py,
$make and $make install.

Then after extracting PyQt-mac-gpl-4.7.tar.gz the $python3 configure.py
produces the following error..

Determining the layout of your Qt installation...
This is the GPL version of PyQt 4.7 (licensed under the GNU General Public
License) for Python 3.1 on darwin.

Type '2' to view the GPL v2 license.
Type '3' to view the GPL v3 license.
Type 'yes' to accept the terms of the license.
Type 'no' to decline the terms of the license.

Do you accept the terms of the license? yes
Checking to see if the QtGui module should be built...
Checking to see if the QtHelp module should be built...
Checking to see if the QtMultimedia module should be built...
Checking to see if the QtNetwork module should be built...
Checking to see if the QtOpenGL module should be built...
Checking to see if the QtScript module should be built...
Checking to see if the QtScriptTools module should be built...
Checking to see if the QtSql module should be built...
Checking to see if the QtSvg module should be built...
Checking to see if the QtTest module should be built...
Checking to see if the QtWebKit module should be built...
Checking to see if the QtXml module should be built...
Checking to see if the QtXmlPatterns module should be built...
Checking to see if the phonon module should be built...
Checking to see if the QtAssistant module should be built...
Checking to see if the QtDesigner module should be built...
Qt v4.6.0 free edition is being used.
Qt is built as a framework.
SIP 4.10.1 is being used.
The Qt header files are in /usr/include.
The shared Qt libraries are in /Library/Frameworks.
The Qt binaries are in /Developer/Tools/Qt.
The Qt mkspecs directory is in /usr/local/Qt4.6.
These PyQt modules will be built: QtCore, QtGui, QtHelp, QtMultimedia,
QtNetwork, QtOpenGL, QtScript, QtScriptTools, QtSql, QtSvg, QtTest,
QtWebKit,
QtXml, QtXmlPatterns, QtAssistant, QtDesigner.
The PyQt Python package will be installed in
/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages.
PyQt is being built with generated docstrings.
PyQt is being built with 'protected' redefined as 'public'.
The Designer plugin will be installed in
/Developer/Applications/Qt/plugins/designer.
The PyQt .sip files will be installed in
/Library/Frameworks/Python.framework/Versions/3.1/share/sip/PyQt4.
pyuic4, pyrcc4 and pylupdate4 will be installed in
/Library/Frameworks/Python.framework/Versions/3.1/bin.
Generating the C++ source for the QtCore module...
sip: Usage: sip [-h] [-V] [-a file] [-b file] [-c dir] [-d file] [-e] [-g]
[-I dir] [-j #] [-k] [-m file] [-o] [-p module] [-r] [-s suffix] [-t tag]
[-w] [-x feature] [-z file] [file]
Error: Unable to create the C++ code.

Am i doing anything wrong here??

Regards,
Jeba


On Mon, Apr 5, 2010 at 8:50 PM, Darren Dale  wrote:

> On Mon, Apr 5, 2010 at 11:09 AM, Jebagnana Das 
> wrote:
> > Hi all,
> >
> >  I found an archived discussion regarding the same problem. Click
> here
> > to see the discussion. But the solution proposed here is bit confusing. I
> > hope this issue must have been fixed by now(It was posted on Nov 2009).
> > Anybody have the new solution of installing pyqt 0n mac os x 10.6.2??
>
> Try here:
> http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg19680.html
>
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Problem in installing PyQt on Mac OS X 10.6.2

2010-04-05 Thread Darren Dale
On Mon, Apr 5, 2010 at 11:09 AM, Jebagnana Das  wrote:
> Hi all,
>
>  I found an archived discussion regarding the same problem. Click here
> to see the discussion. But the solution proposed here is bit confusing. I
> hope this issue must have been fixed by now(It was posted on Nov 2009).
> Anybody have the new solution of installing pyqt 0n mac os x 10.6.2??

Try here: http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg19680.html
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Problem in installing PyQt on Mac OS X 10.6.2

2010-04-05 Thread Jebagnana Das
Hi all,

 I found an archived discussion regarding the same problem. Click here
to see the 
discussion.
But the solution proposed here is bit confusing. I hope this issue must have
been fixed by now(It was posted on Nov 2009). Anybody have the new solution
of installing pyqt 0n mac os x 10.6.2??

Regards,
Jeba.

On Thu, Apr 1, 2010 at 3:50 PM, Phil Thompson
wrote:

> On Thu, 1 Apr 2010 15:46:16 +0530, Jebagnana Das 
> wrote:
> > Thanks phil for your reply. Here's the output of $python3 configure.py
> > --verbose (Though it's pretty long)
> >
> > Determining the layout of your Qt installation...
> > /usr/bin/qmake -spec macx-g++ -o qtdirs.mk qtdirs.pro
> > make -f qtdirs.mk
> > b'g++ -c -pipe -g -gdwarf-2 -arch i386 -Wall -W -DQT_CORE_LIB -DQT_SHARED
> > -I/usr/local/Qt4.6/mkspecs/macx-g++ -I.
> > -I/Library/Frameworks/QtCore.framework/Versions/4/Headers
> > -I/usr/include/QtCore -I/usr/include -I. -F/Library/Frameworks -o
> qtdirs.o
> > qtdirs.cpp\n'b'g++ -headerpad_max_install_names -arch i386 -o
> > qtdirs.app/Contents/MacOS/qtdirs qtdirs.o   -F/Library/Frameworks
> > -L/Library/Frameworks -framework QtCore
> \n'qtdirs.app/Contents/MacOS/qtdirs
> > This is the GPL version of PyQt 4.7 (licensed under the GNU General
> Public
> > License) for Python 3.1 on darwin.
> >
> > Type '2' to view the GPL v2 license.
> > Type '3' to view the GPL v3 license.
> > Type 'yes' to accept the terms of the license.
> > Type 'no' to decline the terms of the license.
> >
> > Do you accept the terms of the license? yes
> > Checking to see if the QtGui module should be built...
> > g++ -DQT_NO_DEBUG -DQT_GUI_LIB -I. -I/mkspecs/macx-g++
> > -I/Library/Frameworks/QtGui.framework/Headers -I/usr/include -pipe -O2 -w
> > cfgtest_QtGui.cpp -o cfgtest_QtGui -F/Library/Frameworks
> > -L/Library/Frameworks -headerpad_max_install_names -framework QtGui
> > -framework QtCore
> > b'In file included from
> > /Library/Frameworks/QtCore.framework/Headers/qnamespace.h:45,\n'b'
> > from
> > /Library/Frameworks/QtCore.framework/Headers/qobjectdefs.h:45,\n'b'
> > from
> > /Library/Frameworks/QtGui.framework/Headers/qwindowdefs.h:45,\n'b'
> > from
> > /Library/Frameworks/QtGui.framework/Headers/qwidget.h:45,\n'b'
> > from
> >
>
> cfgtest_QtGui.cpp:1:\n'b'/Library/Frameworks/QtCore.framework/Headers/qglobal.h:288:2:
> > error: #error "You are building a 64-bit application, but using a 32-bit
> > version of Qt. Check your build configuration."
>
> That would appear to be the problem.   --Phil

>Thanks phil for stating my problem clearly.. But i can't find a separate qt
> package for 64 bit application in mac (It's available for windows and linux
> only).. Do i have to build it from the source?? Is there any other way of
> doing this??
>
> >Regards,
> >Jeba
>

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

Re: [PyQt] pyrcc4 query

2010-04-05 Thread Clément Mairet


Anshul Jain wrote:
Please tell me if there is any other possible way to create a resource 
file without the pyrcc4 command.


Hi!

Wondering the same thing a while back, we tried coming up with a Python
alternative to pyrcc for the Spyrit project, mostly as an exercise to
easily package and compress our resources in a slightly smaller file
format, and allow users to do so from our application itself -- for
instance to re-generate themes and so on.

We put together our own Python implementation of pyrcc4
for convenience, which generates similar output as pyrcc4 when used with
the '--legacy' option -- our version is as yet incomplete as it doesn't
handle resource subdirectories at all, nor does it use Qt compression
yet. It does work for simpler cases, however.

You can find the code in the Spyrit sources, it works as a standalone
script but should be easy to adapt to other uses:

http://spyrit.hg.sourceforge.net/hgweb/spyrit/spyrit/file/cd759ccf86a7/resources/spyrcc.py

It's probably a suboptimal implementation, and I'd also be curious to
know of similar -- and more mature -- tools in Python.

Hope it helps,

-- C.



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