Re: [PyQt] Strange sip 4.7.9 bug

2009-05-28 Thread Arve Knudsen
On Wed, May 27, 2009 at 11:45 PM, Phil Thompson p...@riverbankcomputing.com
 wrote:

 On Wed, 27 May 2009 17:17:29 +0200, Arve Knudsen arve.knud...@gmail.com
 wrote:
  Hi
  Phil, I really need help with this extremely strange bug in sip 4.7.9 on
  Windows Vista x64, Python 2.6 (32bit). It's difficult to describe fully,
  but
  I'll try (I can't provide sources, since it's proprietary code). The
  scenario is (more or less) like this: lod.sip declares a class TileTree,
  which lives in igmLod/TileTree.h. gui.sip imports lod.sip and declares a
  class ViewerProject, which refers to a QListTileTree. What then happens
  is
  that the files sip_igmlodTileTree.cpp, which includes igmLod/TileTree.h,
  and
  sip_igmguiQList.cpp, which includes igmLod/TileTreeileTileTreeree.h, are
  generated. As you can see, the inclusion in the latter .cpp is all
  scrambled
  (with the class name). Any idea what's going on here, eventually how I
 can
  debug sip myself?

 You need to send me a test case.


As I said, this is proprietary code, so it can be difficult to extract a
testcase. I don't even know right now how  to identify the exact scenario
since the sip specifications are quite complex at this point. If I could
debug it on-site, it should be far preferable.

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

[PyQt] Can't load custom python plugins in qt4 designer

2009-05-28 Thread Michael Thompson
Hi,
   I'm trying to load a custom plugin in designer, on Ubuntu jaunty.

I have tried running qtdemo from the python-qt4-doc package but the plugins
do not appear in designer. If I use the About-Plugins menu in designer I
can see a libpythonplugin.so folder but no entries underneath it.

Any idea how I can debug this further?

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

Re: [PyQt] How to slim programs under windows

2009-05-28 Thread Demetrius Cassidy

This really isn't PyQt4 related. Look at the py2exe faq, it lists common
modules you can ignore when building your exe.

You can also try UPX: http://upx.sourceforge.net/


handrix wrote:
 
 Hi,
 
 I build a exe program with py2exe, and it size is about 8M.
 The program is very simple, it's a widget that contain  too lineedit and a
 button, it's based on pyqt.
 Please is there a way to resize the file for small one.
 
 Regards,
 
 -- 
 Ali MEZGANI
 Network Engineering/Security
 http://securfox.wordpress.com/
 
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt
 

-- 
View this message in context: 
http://www.nabble.com/How-to-slim-programs-under-windows-tp23745556p23764146.html
Sent from the PyQt mailing list archive at Nabble.com.

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


Re: [PyQt] How to slim programs under windows

2009-05-28 Thread mezgani ali
On Thu, May 28, 2009 at 3:47 PM, Darryl Wallace darryl.wall...@prosensus.ca
 wrote:

 Hello,


 I build a exe program with py2exe, and it size is about 8M.
 The program is very simple, it's a widget that contain  too lineedit and a
 button, it's based on pyqt.
 Please is there a way to resize the file for small one.

 My experience has been that if it is a gui-based PyQt program, you need to
 package the python runtime (python2x.dll), the python PyQt libraries
 (Qt.pyd, QtCore.pyd, QtGui.pyd) and the Qt dll's (QtCore4.dll, QtGui4.dll).
  You may also need to distribute the C-runtime library (mingwm10.dll or
 msvcrXX.dll) depending on how your application was setup.   All of these
 need to be included because you can't assume the end user will have them on
 their system.

Yes, that is.
However, the only way i found and it was a suggestion from the py2exe
mailing list,
is the use of  options = { py2exe: {compressed: 2}} in my setup.py.
That does not include the dll, PyQt libraries and python runtime in the
executable file, giving a chance to install there libraries separately.


 Even with your small widget developed in C++ you still need to distribute
 the Qt dll's since these are not standard windows libraries.

 My conclusion: it's not possible to make your apps have super small
 download size with Qt and PyQt.

 If anyone has other experiences with this please share them.

Thanks Darry for you reply.


 Darryl




-- 
Ali MEZGANI
Network Engineering/Security
http://securfox.wordpress.com/
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Fast way to display an array in a table?

2009-05-28 Thread Vicente Sole

Hello,

I am writing a generic data handling application in which I need to be  
able to show the contents of a numpy array in a sort of  
table/spreadsheet. The array can be big (1024 x 1024 floats or may be  
even more).


Is there a faster way of filling a table than looping through all the  
array elements and introducing them in the table cells one by one?


Thanks for any hint.

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


Re: [PyQt] Fast way to display an array in a table?

2009-05-28 Thread David Douard
Le jeudi 28 mai 2009 20:57:50 Vicente Sole, vous avez écrit :
 Hello,

 I am writing a generic data handling application in which I need to be
 able to show the contents of a numpy array in a sort of
 table/spreadsheet. The array can be big (1024 x 1024 floats or may be
 even more).

 Is there a faster way of filling a table than looping through all the
 array elements and introducing them in the table cells one by one?


You should use a QTableView with a model you write (which should derivate from 
QAbstractTableModel) like the file attached.

-- 
David DouardLOGILAB, Paris (France), +33 1 45 32 03 12
Formations Python, Numpy, Debian :   http://www.logilab.fr/formations
Développement logiciel sur mesure : http://www.logilab.fr/services
Informatique scientifique : http://www.logilab.fr/science

import numpy
from PyQt4 import QtCore, QtGui
Qt = QtCore.Qt

class NumpyModel(QtCore.QAbstractTableModel):
def __init__(self, narray, parent=None):
QtCore.QAbstractTableModel.__init__(self, parent)
self._array = narray

def rowCount(self, parent=None):
return self._array.shape[0]

def columnCount(self, parent=None):
return self._array.shape[1]

def data(self, index, role=Qt.DisplayRole):
if index.isValid():
if role == Qt.DisplayRole:
row = index.row()
col = index.column()
return QtCore.QVariant(%.5f%self._array[row, col])
return QtCore.QVariant()

if __name__ == __main__:
a = QtGui.QApplication([])
w = QtGui.QTableView()
d = numpy.random.normal(0,1, (1000,1000))
m = NumpyModel(d)
w.setModel(m)

w.show()
a.exec_()


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

[PyQt] HeaderToolTip and Coredump

2009-05-28 Thread Jeroen Andreß

Hi,

I have solved the problem.

the HeaderToolTip must saved in a gobal var.

-- self.__t = HeaderToolTip(table.horizontalHeader())

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