[PyQt] PyQt and py2app conflicting pre-installed Qt version

2010-04-22 Thread Michael Held
hi PyQt,

after merging to the new Qt 4.6 and PyQt 4.7 I observed strange crashes of my 
py2app bundled application on another test computer. on my development Mac 
everything was fine.

running the binary from my .app directly on the shell I saw a number of strange 
warnings about two Qt versions being used in an undefined way. on the test Mac 
Qt 4.5 was installed and that was mixed with my Qt 4.6 from the app which 
caused the crash.
I checked my env and no DYLD_LIBRARY_PATH is set. after deleting the old Qt 4.5 
version everything was fine on the test Mac.

the question is now: does my app conflict with any pre-installed Qt version a 
user might have? what can I do against it?

see a shortened output from the binary below.

thanks a lot!
michael

/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/test 
objc[32502]: Class QMacSoundDelegate is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QCocoaColorPanelDelegate is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QNSOpenSavePanelDelegate is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QCocoaFontPanelDelegate is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QNSWindowProxy is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QNSPanelProxy is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QCocoaPageLayoutDelegate is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QCocoaPrintPanelDelegate is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QNSMenu is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QNSStatusItem is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
objc[32502]: Class QNSImageView is implemented in both 
/Users/analyzer/Downloads/test_package/test.app/Contents/MacOS/../Frameworks/QtGui.framework/Versions/4/QtGui
 and /Library/Frameworks/QtGui.framework/Versions/4/QtGui. One of the two will 
be used. Which one is undefined.
QObject::moveToThread: Current thread (0xa300220) is not the object's thread 
(0x4c80490).
Cannot move to target thread (0x4c80490)

On Mac OS X, you might be loading two sets of Qt binaries into the same 
process. Check that all plugins are compiled against the right Qt binaries. 
Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being 
loaded.
QObject::moveToThread: Current thread (0xa300220) is not the object's thread 
(0x4c80490).
Cannot move to target thread (0x4c80490)

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


[PyQt] Compilation at MacOS X

2010-02-11 Thread Michael Held
Hi,

is there a general procedure to compile PyQt 4.7 for MacOS X? 
I am facing problems when compiling on MacOS 10.6 and want to run my PyQt app 
on MacOS 10.5

Thanks for your help!
Michael
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] compiled with Snow Leopard, error on Leopard

2009-11-19 Thread Michael Held
hi guys,

I have a problem running PyQt which was compiled under Snow Leopard on a 
Leopard machine. 
error message:

> ImportError: 
> dlopen(/Users/analyzer/Desktop/AnalyzerOne.app/Contents/Resources/lib/python2.6/lib-dynload/PyQt4/QtGui.so,
>  2): no suitable image found.  Did find:
>   
> /Users/analyzer/Desktop/AnalyzerOne.app/Contents/Resources/lib/python2.6/lib-dynload/PyQt4/QtGui.so:
>  unknown required load command 0x8022

SIP was compiled:
> python configure.py --arch=i386 --sdk=MacOSX10.5.sdk

adding --universal gives an error:
> c++ -headerpad_max_install_names -arch i386 
> -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -o sip main.o transform.o 
> gencode.o export.o heap.o parser.o lexer.o 
> ld: library not found for -lcrt1.10.6.o
> collect2: ld returned 1 exit status
> make[1]: *** [sip] Error 1
> make: *** [all] Error 2


I have no problems when I add
> -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
to the CXXFLAGS/CFLAGS

and replacing the LDFLAGS with
> -bundle -flat_namespace -undefined warning -arch i386 -isysroot 
> /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5

doing that manually after configure is no fun, but it works for Mac OS 10.5 and 
10.6

these flags are needed for all C++ extensions I am using to run them under 10.5.

I guess there is a better way...?
thanks a lot,
michael

used: 
sip-4.9.2-snapshot-20091115
PyQt-mac-gpl-4.6.2-snapshot-20091115___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] QGridLayout AlignRight problem

2009-10-06 Thread Michael Held

sorry for the confusion,

the problem has nothing to do with the alignment, but with a column- 
span > 1.
I modified the example. w_label is expanding, or better not all space  
is consumed by w_frame but by both



layout = QGridLayout(parent)
w_label = QLabel(label, parent)
w_frame = QFrame(parent)
w_frame.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,  
QSizePolicy.Fixed))
w_label.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,  
QSizePolicy.Fixed))

layout.addWidget(w_label, 0, 0, 1, 2)
layout.addWidget(w_frame, 0, 1)


thanks again,
michael


On Oct 6, 2009, at 9:03 PM, Michael Held wrote:


hi PyQt,

I have a problem with QGridLayout and AlignRight when enforcing a  
non-expanding behavior of QLabel.


this example works as expected: w_label is left-aligned, w_frame is  
expands horizontally, w_label not


layout = QGridLayout(parent)
w_label = QLabel(label, parent)
w_frame = QFrame(parent)
w_frame.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,  
QSizePolicy.Fixed))
w_label.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,  
QSizePolicy.Fixed))

layout.addWidget(w_label, 0, 0)
layout.addWidget(w_frame, 0, 1)


here w_label is right-aligned, w_frame expands horizontally, BUT  
w_label expands as well. why???


layout = QGridLayout(parent)
w_label = QLabel(label, parent)
w_frame = QFrame(parent)
w_frame.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,  
QSizePolicy.Fixed))
w_label.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,  
QSizePolicy.Fixed))

layout.addWidget(w_label, 0, 0, Qt.AlignRight)
layout.addWidget(w_frame, 0, 1)


thanks a lot!
michael




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



---
Michael Held
Gerlich Group, ETH Zurich
Institute of Biochemistry
HPM D11.1, Schafmattstrasse 18
8093 Zurich, Switzerland
t = { HPM_D11 : +41 44 63 26 900
  mobile  : +41 77 43 13 906 }
f = +41 44 632 1591
m = michael.h...@bc.biol.ethz.ch
w = http://www.bc.biol.ethz.ch/people/groups/gerlichd/people/miheld
---

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

[PyQt] QGridLayout AlignRight problem

2009-10-06 Thread Michael Held

hi PyQt,

I have a problem with QGridLayout and AlignRight when enforcing a non- 
expanding behavior of QLabel.


this example works as expected: w_label is left-aligned, w_frame is  
expands horizontally, w_label not


layout = QGridLayout(parent)
w_label = QLabel(label, parent)
w_frame = QFrame(parent)
w_frame.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,  
QSizePolicy.Fixed))

w_label.setSizePolicy(QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
layout.addWidget(w_label, 0, 0)
layout.addWidget(w_frame, 0, 1)


here w_label is right-aligned, w_frame expands horizontally, BUT  
w_label expands as well. why???


layout = QGridLayout(parent)
w_label = QLabel(label, parent)
w_frame = QFrame(parent)
w_frame.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,  
QSizePolicy.Fixed))

w_label.setSizePolicy(QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed))
layout.addWidget(w_label, 0, 0, Qt.AlignRight)
layout.addWidget(w_frame, 0, 1)


thanks a lot!
michael



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

[PyQt] Snow Leopard

2009-09-28 Thread Michael Held

hi pyqt,

I had some problems forcing Apples Python to 32 bit. neither
export VERSIONER_PYTHON_PREFER_32_BIT=yes
nor
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
was working.

compiling sip4.9 and PyQt4.6 for Qt4.5.2 worked fine, but importing failed:

> python -c "from PyQt4 import QtCore"
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: 
dlopen(/Library/Python/2.6/site-packages/PyQt4/QtCore.so, 2): no 
suitable image found.  Did find:
> /Library/Python/2.6/site-packages/PyQt4/QtCore.so: mach-o, 
but wrong architecture


only
> arch -i386 python -c "from PyQt4 import QtCore"
worked. unfortunately I could not force Eclipse/PyDev to run Python in 
32bit and therefore auto-completion of PyQt is not working.


is there anything I can do to improve this situation?

best regards
michael


PS: for some strange reasons Python 2.6.2 from Python.org crashes with 
Eclipse3.5/PyDev1.5 (both 32 bit carbon and 64 bit cocoa versions)

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


[PyQt] QComboBox stylesheet problem

2009-07-13 Thread Michael Held
hi,

I followed the stylesheet example for QComboBox and everything is fine
so far. but the moment I change the background color of QComboBox, the
entire popup-window changes its layout, which I cannot changer anymore.

I add the stylesheet directly to my app after the app was created.

example:

QComboBox {
border: 1px solid darkgray;
}

works fine!


QComboBox {
border: 1px solid darkgray;
border-radius: 3px;
background-color: black;
}

destroys the popup-layout. this is also the case when I follow the
QCombBox example in
http://doc.qtsoftware.com/4.5/stylesheet-examples.html#customizing-qcombobox

I guess this could be a problem of Qt4 and not PyQt4?

system: MacOS 10.5.7, Python 2.6.2, Qt4.5 2009.03,
PyQt-mac-gpl-4.5.2-snapshot-20090709

thanks a lot!
michael

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


[PyQt] Re: Segfaults on MacOS

2009-06-28 Thread Michael Held
sorry for the spam, it was all my mistake! the underlying data from
which the QImage was generated was moved to the garbage, which caused
the seg fault (looks like QImage is accessing the data by reference
instead value)

michael


Michael Held wrote:
> ok, maybe my debugging is helpful and I am really PyQt newbie, but a
> mutex helped the seg fault.
> I guess this is some kind of concurrency issue of QImage.pixel
> 
> so my new version runs stable (although I am not sure if am really
> supposed to an mutex myself ;-) )
> 
> cheers,
> michael
> 
> 
> class ImageViewer(QScrollArea):
> 
> def __init__(self, parent):
> super(ImageViewer, self).__init__(parent)
> self.setBackgroundRole(QPalette.Dark)
> self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
> self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
> self.label = QLabel(self)
> self.label.setBackgroundRole(QPalette.Base)
> self.setAlignment(Qt.AlignHCenter|Qt.AlignVCenter)
> self.label.installEventFilter(self)
> self.label.show()
> self.label.setMouseTracking(True)
> self.setWidget(self.label)
> self._qimage = None
> self.connect(self, SIGNAL('MouseMovedOverImage'),
>  self._on_move)
> self._mutex = mutex.mutex()
> 
> def from_numpy(self, data):
> self._qimage = numpy_to_qimage(data)
> self._update()
> 
> def from_qimage(self, qimage):
> self._qimage = qimage
> self._update()
> 
> def _on_move(self, pos):
> if self._mutex.testandset():
> print pos, self._qimage.pixel(pos)
> self._mutex.unlock()
> 
> 
> def eventFilter(self, obj, ev):
> if ev.type() == QEvent.MouseMove and obj == self.label:
> self.emit(SIGNAL('MouseMovedOverImage'),
>   ev.pos())
> return True
> else:
> return super(ImageViewer, self).eventFilter(obj, ev)
> 
> def _update(self):
> self.label.setPixmap(QPixmap.fromImage(self._qimage))
> self.label.resize(self.label.pixmap().size())
> #self.setMaximumSize(self.label.pixmap().size()+QSize(15,15))
> 
> 
> Michael Held wrote:
>> hi,
>>
>> I am building an image viewer with PyQt and wanted to display the pixel
>> color under the cursor for mouseMoveEvent - everything fine so far.
>> using the eventFilter I was able circumvent QLabel sub-classing.
>>
>> *BUT* printing the pixel value crashes my program with a seg fault (I am
>> just moving a bit over the image and BANG...)
>> my silly attempt to delay the event-response with time.sleep(0.5) did
>> also not work.
>>
>> I was using Stackless Python 2.6.2 before but the same error happened
>> for the normal Python 2.6.2
>> MacOS 10.5.7
>> PyQt-mac-gpl-4.5.2-snapshot-20090627
>> sip-4.8.1
>>
>> thanks a lot!
>> michael
>>
>>
>> class ImageViewer(QScrollArea):
>>
>> def __init__(self, parent):
>> super(ImageViewer, self).__init__(parent)
>> self.setBackgroundRole(QPalette.Dark)
>> self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
>> self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
>> self.label = QLabel(self)
>> self.label.setBackgroundRole(QPalette.Base)
>> self.setAlignment(Qt.AlignHCenter|Qt.AlignVCenter)
>> self.label.installEventFilter(self)
>> self.label.show()
>> self.label.setMouseTracking(True)
>> self.setWidget(self.label)
>> self._qimage = None
>> self.connect(self, SIGNAL('MouseMovedOverImage'),
>>  self._on_move)
>>
>> def from_numpy(self, data):
>> self._qimage = numpy_to_qimage(data)
>> self._update()
>>
>> def from_qimage(self, qimage):
>> self._qimage = qimage
>> self._update()
>>
>> def _on_move(self, pos):
>> print pos, self._qimage.pixel(pos)
>> time.sleep(0.5)
>>
>> def eventFilter(self, obj, ev):
>> if ev.type() == QEvent.MouseMove and obj == self.label:
>> self.emit(SIGNAL('MouseMovedOverImage'),
>>   ev.pos())
>> return True
>> else:
>> return False
>>
>> def _update(self):
>> self.label.setPixmap(QPixmap.fromImage(self._qimage))
>> self.label.resize(self.label.pixmap().size())
>>
> 

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


[PyQt] Re: Segfaults on MacOS

2009-06-28 Thread Michael Held
ok, maybe my debugging is helpful and I am really PyQt newbie, but a
mutex helped the seg fault.
I guess this is some kind of concurrency issue of QImage.pixel

so my new version runs stable (although I am not sure if am really
supposed to an mutex myself ;-) )

cheers,
michael


class ImageViewer(QScrollArea):

def __init__(self, parent):
super(ImageViewer, self).__init__(parent)
self.setBackgroundRole(QPalette.Dark)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.label = QLabel(self)
self.label.setBackgroundRole(QPalette.Base)
self.setAlignment(Qt.AlignHCenter|Qt.AlignVCenter)
self.label.installEventFilter(self)
self.label.show()
self.label.setMouseTracking(True)
self.setWidget(self.label)
self._qimage = None
self.connect(self, SIGNAL('MouseMovedOverImage'),
 self._on_move)
self._mutex = mutex.mutex()

def from_numpy(self, data):
self._qimage = numpy_to_qimage(data)
self._update()

def from_qimage(self, qimage):
self._qimage = qimage
self._update()

def _on_move(self, pos):
if self._mutex.testandset():
print pos, self._qimage.pixel(pos)
self._mutex.unlock()


def eventFilter(self, obj, ev):
if ev.type() == QEvent.MouseMove and obj == self.label:
self.emit(SIGNAL('MouseMovedOverImage'),
  ev.pos())
return True
else:
return super(ImageViewer, self).eventFilter(obj, ev)

def _update(self):
self.label.setPixmap(QPixmap.fromImage(self._qimage))
self.label.resize(self.label.pixmap().size())
#self.setMaximumSize(self.label.pixmap().size()+QSize(15,15))


Michael Held wrote:
> hi,
> 
> I am building an image viewer with PyQt and wanted to display the pixel
> color under the cursor for mouseMoveEvent - everything fine so far.
> using the eventFilter I was able circumvent QLabel sub-classing.
> 
> *BUT* printing the pixel value crashes my program with a seg fault (I am
> just moving a bit over the image and BANG...)
> my silly attempt to delay the event-response with time.sleep(0.5) did
> also not work.
> 
> I was using Stackless Python 2.6.2 before but the same error happened
> for the normal Python 2.6.2
> MacOS 10.5.7
> PyQt-mac-gpl-4.5.2-snapshot-20090627
> sip-4.8.1
> 
> thanks a lot!
> michael
> 
> 
> class ImageViewer(QScrollArea):
> 
> def __init__(self, parent):
> super(ImageViewer, self).__init__(parent)
> self.setBackgroundRole(QPalette.Dark)
> self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
> self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
> self.label = QLabel(self)
> self.label.setBackgroundRole(QPalette.Base)
> self.setAlignment(Qt.AlignHCenter|Qt.AlignVCenter)
> self.label.installEventFilter(self)
> self.label.show()
> self.label.setMouseTracking(True)
> self.setWidget(self.label)
> self._qimage = None
> self.connect(self, SIGNAL('MouseMovedOverImage'),
>  self._on_move)
> 
> def from_numpy(self, data):
> self._qimage = numpy_to_qimage(data)
> self._update()
> 
> def from_qimage(self, qimage):
> self._qimage = qimage
> self._update()
> 
> def _on_move(self, pos):
> print pos, self._qimage.pixel(pos)
> time.sleep(0.5)
> 
> def eventFilter(self, obj, ev):
> if ev.type() == QEvent.MouseMove and obj == self.label:
> self.emit(SIGNAL('MouseMovedOverImage'),
>   ev.pos())
> return True
> else:
> return False
> 
> def _update(self):
> self.label.setPixmap(QPixmap.fromImage(self._qimage))
> self.label.resize(self.label.pixmap().size())
> 

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


[PyQt] Segfaults on MacOS

2009-06-28 Thread Michael Held
hi,

I am building an image viewer with PyQt and wanted to display the pixel
color under the cursor for mouseMoveEvent - everything fine so far.
using the eventFilter I was able circumvent QLabel sub-classing.

*BUT* printing the pixel value crashes my program with a seg fault (I am
just moving a bit over the image and BANG...)
my silly attempt to delay the event-response with time.sleep(0.5) did
also not work.

I was using Stackless Python 2.6.2 before but the same error happened
for the normal Python 2.6.2
MacOS 10.5.7
PyQt-mac-gpl-4.5.2-snapshot-20090627
sip-4.8.1

thanks a lot!
michael


class ImageViewer(QScrollArea):

def __init__(self, parent):
super(ImageViewer, self).__init__(parent)
self.setBackgroundRole(QPalette.Dark)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
self.label = QLabel(self)
self.label.setBackgroundRole(QPalette.Base)
self.setAlignment(Qt.AlignHCenter|Qt.AlignVCenter)
self.label.installEventFilter(self)
self.label.show()
self.label.setMouseTracking(True)
self.setWidget(self.label)
self._qimage = None
self.connect(self, SIGNAL('MouseMovedOverImage'),
 self._on_move)

def from_numpy(self, data):
self._qimage = numpy_to_qimage(data)
self._update()

def from_qimage(self, qimage):
self._qimage = qimage
self._update()

def _on_move(self, pos):
print pos, self._qimage.pixel(pos)
time.sleep(0.5)

def eventFilter(self, obj, ev):
if ev.type() == QEvent.MouseMove and obj == self.label:
self.emit(SIGNAL('MouseMovedOverImage'),
  ev.pos())
return True
else:
return False

def _update(self):
self.label.setPixmap(QPixmap.fromImage(self._qimage))
self.label.resize(self.label.pixmap().size())

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


[PyQt] bug in QImage.setColorTable ?

2009-06-28 Thread Michael Held
hi,


with the help of antonio I succeeded in converting a numpy.array into a
QImage:

a = 
h, w = a.shape[:2]
qimage = QImage(a, w, h, QImage.Format_Indexed8)
colors = [QColor(i,i,i).rgb() for i in range(256)]
qimage.setColorTable(colors)


my array 'a' is just a 2D matrix which I want to show in graylevels -
which is *not* working that way. I also tried .rgba() instead .rgb(),
without success.

but

for i in range(256):
qimage.setColor(i, QColor(i,i,i).rgb())

works fine.
I guess I am not calling QImage.setColorTable the right way, or is there
a bug?

thanks a lot!
michael

MacOS 10.5.7
Stackless Python 2.6.2
PyQt-mac-gpl-4.5.2-snapshot-20090623

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


[PyQt] QPixmap / QImage from numpy or string

2009-06-28 Thread Michael Held
hi,

I am trying to create a QImage from a numpy array directly. this is not
supported yet, right?
has anybody tried to load a numpy array via a string into a QImage, like

a = numpy.zeros((100,50))
image = QImage(a.tostring(), a.shape[0], a.shape.[1], a.shape[0],
OImage.Format_Mono)

thanks a lot!
michael

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


[PyQt] Re: py2app generates huge files (200MB)

2009-06-27 Thread Michael Held
hi again,

I think I did not fully understood it: of course can I compress
everything and put it on a website/ftp. but is there a way to run an app
with compressed parts, e.g. resources or a lot of Python scripts? but
this is maybe not the right forum to discuss about...

yes, py2app will wrap everything! I have tested that and it's great!
just for PyQt4 I was not sure whether I compiled it as universal or
intel-only version...

cheers
michael



piotr maliński wrote:
> Zipped apps are common way to publish apps :) OS X can unzipp them and
> users can run the app. Another way is to make a disk image (DMG) and
> place the app in the disk image. Compressed DMG has the size close to a
> ZIP archive, and can have nice installer (a.k.a. copy to Applications),
> readmes etc.
> 
> 15MB Zipped is the "ok" size :)
> 
> As for the PyQt4 installer - you have to compile it, but the final
> py2app made app doesn't require for the user to install anything. The
> app will run on it's own :)
> 
> 
> W dniu 27 czerwca 2009 14:03 użytkownik Michael Held
> mailto:michael.h...@bc.biol.ethz.ch>>
> napisał:
> 
> hi piotr,
> 
> yes, it looks like PyQt4 is using a lot of Pythons standard packages, so
> all the files in Contents/Resources/lib/python2.6/lib-dynload are most
> probably needed...
> 
> I zipped and got 70MB with Qt debug files (from 200MB)
> and 15MB without (from 43MB).
> is there a way to provide an .app file with zipped content which is
> unzipped on the fly?
> 
> currently there is not installer for PyQt4.5 on MacOS available, right?!
> I was compiling everything from scratch (I am also working with
> Stackless Python 2.6.2). I guess there is a way to compile PyQt4 in
> universal mode... somehow ;-)
> 
> thanks a lot again! :-)
> cheers
> michael
> 
> 
> piotr maliński wrote:
> > Debug libraries don't get excluded by "excludes" list so they will
> have
> > to be removed. Also the package includes everything needed to run it -
> > also some Python components.
> > /Contents/Resources/lib/ 9,5 MB in my case
> > /Contents/Frameworks/  24,8 MB
> >
> > And it zipps to 12MB
> >
> > Note that the resulting binary has some symlinks (in libs for example)
> > and calculating size on Mac OS X will count the symlinked (alias)
> files
> > in :) So check zipped size :)
> >
> > If you used Qt with Qt Creator or custom Qt compilation on Intel Mac
> > then you have Intel-only Qt and you will get Intell only App. If you
> > used the Qt DMG without Qt Creator then you got Universal Qt and your
> > app will be universal and DOUBLE size :) (22-24MB Zipped for
> > qtcore/qtgui app).
> >
> >
> > 2009/6/27 Michael Held  <mailto:michael.h...@bc.biol.ethz.ch>
> > <mailto:michael.h...@bc.biol.ethz.ch
> <mailto:michael.h...@bc.biol.ethz.ch>>>
> >
> > hi piotr,
> >
> > thanks a lot for your help!
> >
> > aral balkan writes on his page that one "can remove the Qt
> debug files".
> > these are ~150MB in my case and the *biggest* part of the problem.
> > I guess I need to write a "better" Qt4 recipe for pyapp or I
> have to add
> > some kind of clean-up step after the execution of py2app...
> >
> > furthermore Contents/Resources/lib/python2.6/lib-dynload
> contains ~14MB
> > of python packages which are not used by my "empty" script
> (and I assume
> > PyQt4 is not using those as well...
> >
> > again, I am happy with a 40MB .app file but a 200MB file just
> to much
> > overhead.
> >
> > does anybody know how to tweak the PyQt4 recipe of py2app? I
> had a short
> > look on the code but could not find the right script.
> > or would it be helpful to work with the latest svn revision
> instead the
> > released version 0.3.6?
> >
> > cheers
> > michael
> >
> >
> >
> > piotr maliński wrote:
> > > check out my tutorial:
> > >
> http://www.rkblog.rk.edu.pl/w/p/building-mac-os-x-applications-py2app/
> > >
> > > QtCore/QtGui app zipped should be about 12MB intel-only (22MB if
> > you use
> > > Universal Qt - thus making un

[PyQt] Re: py2app generates huge files (200MB)

2009-06-27 Thread Michael Held
hi piotr,

yes, it looks like PyQt4 is using a lot of Pythons standard packages, so
all the files in Contents/Resources/lib/python2.6/lib-dynload are most
probably needed...

I zipped and got 70MB with Qt debug files (from 200MB)
and 15MB without (from 43MB).
is there a way to provide an .app file with zipped content which is
unzipped on the fly?

currently there is not installer for PyQt4.5 on MacOS available, right?!
I was compiling everything from scratch (I am also working with
Stackless Python 2.6.2). I guess there is a way to compile PyQt4 in
universal mode... somehow ;-)

thanks a lot again! :-)
cheers
michael


piotr maliński wrote:
> Debug libraries don't get excluded by "excludes" list so they will have
> to be removed. Also the package includes everything needed to run it -
> also some Python components.
> /Contents/Resources/lib/ 9,5 MB in my case
> /Contents/Frameworks/  24,8 MB
> 
> And it zipps to 12MB
> 
> Note that the resulting binary has some symlinks (in libs for example)
> and calculating size on Mac OS X will count the symlinked (alias) files
> in :) So check zipped size :)
> 
> If you used Qt with Qt Creator or custom Qt compilation on Intel Mac
> then you have Intel-only Qt and you will get Intell only App. If you
> used the Qt DMG without Qt Creator then you got Universal Qt and your
> app will be universal and DOUBLE size :) (22-24MB Zipped for
> qtcore/qtgui app).
> 
> 
> 2009/6/27 Michael Held  <mailto:michael.h...@bc.biol.ethz.ch>>
> 
> hi piotr,
> 
> thanks a lot for your help!
> 
> aral balkan writes on his page that one "can remove the Qt debug files".
> these are ~150MB in my case and the *biggest* part of the problem.
> I guess I need to write a "better" Qt4 recipe for pyapp or I have to add
> some kind of clean-up step after the execution of py2app...
> 
> furthermore Contents/Resources/lib/python2.6/lib-dynload contains ~14MB
> of python packages which are not used by my "empty" script (and I assume
> PyQt4 is not using those as well...
> 
> again, I am happy with a 40MB .app file but a 200MB file just to much
> overhead.
> 
> does anybody know how to tweak the PyQt4 recipe of py2app? I had a short
> look on the code but could not find the right script.
> or would it be helpful to work with the latest svn revision instead the
> released version 0.3.6?
> 
> cheers
> michael
> 
> 
> 
> piotr maliński wrote:
> > check out my tutorial:
> > http://www.rkblog.rk.edu.pl/w/p/building-mac-os-x-applications-py2app/
> >
> > QtCore/QtGui app zipped should be about 12MB intel-only (22MB if
> you use
> > Universal Qt - thus making universal py2app application)
> >
> > 2009/6/27 Michael Held  <mailto:michael.h...@bc.biol.ethz.ch>
> > <mailto:michael.h...@bc.biol.ethz.ch
> <mailto:michael.h...@bc.biol.ethz.ch>>>
> >
> > hi pyqt,
> >
> > I am using PyQt4.5 and py2app 0.3.6 on MacOS 10.5
> >
> > > from setuptools import setup
> > >
> > > APP = ['MyApp.py']
> > > DATA_FILES = []
> > > OPTIONS = {'argv_emulation': True,
> > >'includes': [],
> > >}
> > >
> > > setup(
> > > app=APP,
> > > data_files=DATA_FILES,
> > > options={'py2app': OPTIONS},
> > > setup_requires=['py2app'],
> > > )
> >
> > running this setup.py PyQt4, sip and the Qt framework are
> detected and
> > the app runs fine,
> >
> > *BUT* the app is 200MB (TWOHUNDRET MEGABYTES) big and its
> doing nothing
> > but opening an empty QFrame.
> > I looked into the app-contents and found a lot of debug stuff
> for the
> > QtGui/QtCore Frameworks.
> >
> > after deleting these files the app was still running fine and
> only 42MB
> > big (I found a lot of Pyhton libs/packages in there which are
> not used
> > at all)
> >
> > 42MB for an "empty program" is ok, since all my scripts will
> not add
> > much size, but 200MB is just *too big*.
> > it looks like py2app is including a lot of unnecessary stuff...
> > could stackless Python 2.6.2 is the problem?
> >
> 

[PyQt] Re: py2app generates huge files (200MB)

2009-06-27 Thread Michael Held
hi piotr,

thanks a lot for your help!

aral balkan writes on his page that one "can remove the Qt debug files".
these are ~150MB in my case and the *biggest* part of the problem.
I guess I need to write a "better" Qt4 recipe for pyapp or I have to add
some kind of clean-up step after the execution of py2app...

furthermore Contents/Resources/lib/python2.6/lib-dynload contains ~14MB
of python packages which are not used by my "empty" script (and I assume
PyQt4 is not using those as well...

again, I am happy with a 40MB .app file but a 200MB file just to much
overhead.

does anybody know how to tweak the PyQt4 recipe of py2app? I had a short
look on the code but could not find the right script.
or would it be helpful to work with the latest svn revision instead the
released version 0.3.6?

cheers
michael



piotr maliński wrote:
> check out my tutorial:
> http://www.rkblog.rk.edu.pl/w/p/building-mac-os-x-applications-py2app/
> 
> QtCore/QtGui app zipped should be about 12MB intel-only (22MB if you use
> Universal Qt - thus making universal py2app application)
> 
> 2009/6/27 Michael Held  <mailto:michael.h...@bc.biol.ethz.ch>>
> 
> hi pyqt,
> 
> I am using PyQt4.5 and py2app 0.3.6 on MacOS 10.5
> 
> > from setuptools import setup
> >
> > APP = ['MyApp.py']
> > DATA_FILES = []
> > OPTIONS = {'argv_emulation': True,
> >'includes': [],
> >}
> >
> > setup(
> > app=APP,
> > data_files=DATA_FILES,
> > options={'py2app': OPTIONS},
> > setup_requires=['py2app'],
> > )
> 
> running this setup.py PyQt4, sip and the Qt framework are detected and
> the app runs fine,
> 
> *BUT* the app is 200MB (TWOHUNDRET MEGABYTES) big and its doing nothing
> but opening an empty QFrame.
> I looked into the app-contents and found a lot of debug stuff for the
> QtGui/QtCore Frameworks.
> 
> after deleting these files the app was still running fine and only 42MB
> big (I found a lot of Pyhton libs/packages in there which are not used
> at all)
> 
> 42MB for an "empty program" is ok, since all my scripts will not add
> much size, but 200MB is just *too big*.
> it looks like py2app is including a lot of unnecessary stuff...
> could stackless Python 2.6.2 is the problem?
> 
> thanks a lot for your help!
> michael
> 
> ___
> PyQt mailing listPyQt@riverbankcomputing.com
> <mailto:PyQt@riverbankcomputing.com>
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> 

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


[PyQt] py2app generates huge files (200MB)

2009-06-26 Thread Michael Held
hi pyqt,

I am using PyQt4.5 and py2app 0.3.6 on MacOS 10.5

> from setuptools import setup
> 
> APP = ['MyApp.py']
> DATA_FILES = []
> OPTIONS = {'argv_emulation': True,
>'includes': [],
>} 
> 
> setup(
> app=APP,
> data_files=DATA_FILES,
> options={'py2app': OPTIONS},
> setup_requires=['py2app'],
> )

running this setup.py PyQt4, sip and the Qt framework are detected and
the app runs fine,

*BUT* the app is 200MB (TWOHUNDRET MEGABYTES) big and its doing nothing
but opening an empty QFrame.
I looked into the app-contents and found a lot of debug stuff for the
QtGui/QtCore Frameworks.

after deleting these files the app was still running fine and only 42MB
big (I found a lot of Pyhton libs/packages in there which are not used
at all)

42MB for an "empty program" is ok, since all my scripts will not add
much size, but 200MB is just *too big*.
it looks like py2app is including a lot of unnecessary stuff...
could stackless Python 2.6.2 is the problem?

thanks a lot for your help!
michael

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


[PyQt] Re: bus error and segmentation fault on MacOS

2009-06-12 Thread Michael Held
Michael Held wrote:
> hi,
> 
> so I am still a newbie in PyQt/Qt and was playing around with QFrames
> and QDialogs.
> the purpose of the attached program is to show a QFrame XOR a QDialog
> editing the same object via a QDoubleSpinBox. Frame and Dialog should
> not be visible at the same time.
> when switching between Frame and Dialog with certain speed a seg fault /
> bus error is occurring on MacOS.
> 
> MacOS 10.5.7
> Python 2.6 (stackless)
> Qt 4.5 (2009.02)
> PyQt 4.5 (stable)
> SIP sip-4.8-snapshot-20090430
> 
> on windows this error is not occurring, therefore the Frame is not
> disappearing correctly (it's removed from the layout and destroyed
> afterwards)
> 
> Windows XP
> Python 2.6.2 (stackless)
> Qt 4.5.1
> PyQt 4.5.1 (binary)
> 
> thanks for your help!
> michael
> 

just in case nobody can reproduce this crash I am attaching Apples
traceback here:

> Process: Python [48824]
> Path:
> /Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
> Identifier:  Python
> Version: ??? (???)
> Code Type:   X86 (Native)
> Parent Process:  bash [34561]
> 
> Interval Since Last Report:  18729 sec
> Crashes Since Last Report:   14
> Per-App Interval Since Last Report:  0 sec
> Per-App Crashes Since Last Report:   14
> 
> Date/Time:   2009-06-12 14:01:26.062 +0200
> OS Version:  Mac OS X 10.5.7 (9J61)
> Report Version:  6
> Anonymous UUID:  FCE00F17-C4E6-4A27-A7FD-280EAB755AAA
> 
> Exception Type:  EXC_BAD_ACCESS (SIGBUS)
> Exception Codes: KERN_PROTECTION_FAILURE at 0x0194
> Crashed Thread:  0
> 
> Thread 0 Crashed:
> 0   com.apple.HIToolbox   0x937221a7 
> HIObject::IsOfClass(HIObjectClass*) + 25
> 1   com.apple.HIToolbox   0x93725fa8 HIObjectIsOfClass + 60
> 2   QtGui 0x01c3d17f 
> qt_isGenuineQWidget(OpaqueControlRef*) + 31
> 3   QtGui 0x01c42347 qt_mac_window_for(QWidget 
> const*) + 71
> 4   QtGui 0x01c42aa8 
> QWidgetPrivate::setFocus_sys() + 56
> 5   QtGui 0x01ca423c 
> QApplicationPrivate::setFocusWidget(QWidget*, Qt::FocusReason) + 252
> 6   QtGui 0x01ce2001 
> QWidget::setFocus(Qt::FocusReason) + 289
> 7   QtGui 0x01ca4926 
> QApplication::setActiveWindow(QWidget*) + 1078
> 8   QtGui 0x01c373e7 
> QApplicationPrivate::globalEventProcessor(OpaqueEventHandlerCallRef*, 
> OpaqueEventRef*, void*) + 4759
> 9   com.apple.HIToolbox   0x9370e11d 
> DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 
> 1181
> 10  com.apple.HIToolbox   0x9370d55b 
> SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, 
> HandlerCallRec*) + 405
> 11  com.apple.HIToolbox   0x9370d3c0 
> SendEventToEventTargetWithOptions + 58
> 12  com.apple.HIToolbox   0x93792465 PostActivateEvent + 381
> 13  com.apple.HIToolbox   0x93791ef7 HiliteAndActivateWindow + 381
> 14  com.apple.HIToolbox   0x939cfe6d 
> AdjustToNewWindowActivation(WindowData*, WindowContext*, OpaqueWindowPtr*, 
> unsigned char, WindowData*) + 225
> 15  com.apple.HIToolbox   0x93793100 
> PotentiallyAdjustToNewWindowActivation(WindowData*, WindowData*, 
> WindowContext*, OpaqueWindowPtr*, WindowData*) + 126
> 16  com.apple.HIToolbox   0x9379304a 
> BringToFrontAndActivateWindow(WindowData*, OpaqueWindowGroupRef*, unsigned 
> char) + 134
> 17  com.apple.HIToolbox   0x93792f07 WindowData::SelectWindow() + 
> 229
> 18  QtGui 0x01c44073 QWidget::activateWindow() + 
> 403
> 19  QtGui 0x01c389f4 
> QApplicationPrivate::globalEventProcessor(OpaqueEventHandlerCallRef*, 
> OpaqueEventRef*, void*) + 10404
> 20  com.apple.HIToolbox   0x9370e11d 
> DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 
> 1181
> 21  com.apple.HIToolbox   0x9370d55b 
> SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, 
> HandlerCallRec*) + 405
> 22  com.apple.HIToolbox   0x93729eac SendEventToEventTarget + 52
> 23  QtGui 0x01c47ca1 
> QWidgetPrivate::qt_window_event(OpaqueEventHandlerCallRef*, OpaqueEventRef*, 
> void*) + 1409
> 24  com.apple.HIToolbox   0x9370e11d 
> DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 
> 1181
> 25  com.apple.HIToolbox   0x9370d55b 
> SendEventToE

[PyQt] bus error and segmentation fault on MacOS

2009-06-12 Thread Michael Held
hi,

so I am still a newbie in PyQt/Qt and was playing around with QFrames
and QDialogs.
the purpose of the attached program is to show a QFrame XOR a QDialog
editing the same object via a QDoubleSpinBox. Frame and Dialog should
not be visible at the same time.
when switching between Frame and Dialog with certain speed a seg fault /
bus error is occurring on MacOS.

MacOS 10.5.7
Python 2.6 (stackless)
Qt 4.5 (2009.02)
PyQt 4.5 (stable)
SIP sip-4.8-snapshot-20090430

on windows this error is not occurring, therefore the Frame is not
disappearing correctly (it's removed from the layout and destroyed
afterwards)

Windows XP
Python 2.6.2 (stackless)
Qt 4.5.1
PyQt 4.5.1 (binary)

thanks for your help!
michael
#--
# standard library imports:
#
import time
import sys
import os

#--
# extension module imports:
#
from PyQt4 import QtCore, QtGui

#--
# constants:
#

QT_DIALOG = 'QT_DIALOG'
QT_FRAME = 'QT_FRAME'

#--
# helper functions:
#

def visualize(parent, obj, kind=QT_DIALOG):
if kind == QT_DIALOG:
widget = MyDialog(parent, obj)
elif kind == QT_FRAME:
widget = MyFrame(parent, obj)
else:
raise ValueError("Kind '%s' not supported." % kind)
return widget


#--
# classes:
#

class _Widget(object):

def __init__(self, obj):
layout = QtGui.QGridLayout()
value = obj.my_float
print value
widget = QtGui.QDoubleSpinBox(self)
widget.setValue(value)
layout.addWidget(widget, 0, 0)
shedule = lambda x,y: lambda z: self._setValue(x, y, z)
self.connect(widget,
 QtCore.SIGNAL('valueChanged(double)'),
 shedule(obj, 'my_float'))

layout.setAlignment(QtCore.Qt.AlignCenter|
QtCore.Qt.AlignVCenter)
self.setLayout(layout)
self.show()

def _setValue(self, obj, name, value):
setattr(obj, name, value)
print getattr(obj, name)

class MyFrame(QtGui.QFrame, _Widget):

def __init__(self, parent, obj):
QtGui.QFrame.__init__(self, parent)
_Widget.__init__(self, obj)

class MyDialog(QtGui.QDialog, _Widget):

def __init__(self, parent, obj):
QtGui.QDialog.__init__(self, parent)
_Widget.__init__(self, obj)


#--
# main:
#

if __name__ == "__main__":


class Test:

my_float = 23.1

class MainWindow(QtGui.QMainWindow):
def __init__(self, obj):
QtGui.QMainWindow.__init__(self)

self.setGeometry(0, 0, 600, 400)
self.setWindowTitle('Some test...')

frame = QtGui.QFrame(self)
self.setCentralWidget(frame)

self.obj = obj

self.frame_widget = None
self.dialog_widget = None

self.layout = QtGui.QVBoxLayout()
self.layout.setAlignment(QtCore.Qt.AlignTop)
widget = QtGui.QPushButton('Dialog Demo', self)
self.connect(widget, QtCore.SIGNAL('clicked()'), self._onShowDialog)
self.layout.addWidget(widget)
widget = QtGui.QPushButton('Frame Demo', self)
self.connect(widget, QtCore.SIGNAL('clicked()'), self._onShowFrame)
self.layout.addWidget(widget)
frame.setLayout(self.layout)
frame.show()

self.center()
self.show()
self.raise_()

def _onShowFrame(self):
if not self.dialog_widget is None:
self.dialog_widget.close()
self.dialog_widget = None
if self.frame_widget is None:
self.frame_widget = visualize(self,
  self.obj,
  QT_FRAME)
self.layout.addWidget(self.frame_widget)
self.update()

def _onShowDialog(self):
if not self.frame_widget is None:
self.layout.removeWidget(self.frame_widget)
self.frame_widget.destroy()
self.frame_widget = None
if self.dialog_widget is None:
self.dialog_widget = visualize(self,
   self.obj,
   QT_DIALOG)
self.connect(self.dialog_widget,
 QtCore.SIGNAL('finished(int)'),
 self._onDestroyed)
self.update()

def _onDestroyed(self, x):
print "moo"
self.dialog_widget.close()

[PyQt] Re: PyQt application appears always in the background

2009-06-12 Thread Michael Held
Hans-Peter Jansen wrote:
> Am Donnerstag, 11. Juni 2009 schrieb Phil Thompson:
>> On Thu, 11 Jun 2009 18:50:13 +1200, Alexei Puzikov 
>>
>> wrote:
>>> This seems to be something with PyQt, because C++ Qt applications
>>> don't have this problem.
>>>
>>> What helps with the situation is:
>>>
>>> window.show()
>>> window.raise_()
>> I've seen C++ Qt applications do the same which is why I haven't looked
>> into it too deeply.
>>
>> Any suggestions welcome.
>>
> 
> No suggestion, but qtdemo.py on the mac suffers from the same problem, while 
> the Qt version does not. 
> 
> Pete
> 
> PyQt 4.5/Qt 4.5.1

thanks a lot for your help!

>>> window.show()
>>> window.raise_()
works perfect, although this looks more like a workaround...

cheers
michael

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


[PyQt] PyQt application appears always in the background

2009-06-10 Thread Michael Held
hi,

my PyQt application appears always in the background (the last window in
the stack of all Mac applications) which is annoying since I want so see
my app on top of all other windows.
is there any PyQt or system option?

I am running PyQt4.5 + Python2.6 on MacOS 10.5.

thanks a lot!
michael

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


[PyQt] Re: PyQt 4.5 snapshot build (windows and mac)

2009-05-17 Thread Michael Held
Andreas Pakulat wrote:
> On 17.05.09 13:51:13, Michael Held wrote:
>> Andreas Pakulat wrote:
>>> On 17.05.09 09:13:45, Magnus Benjes wrote:
>>>>> I was not aware that PyQt goes with mingw32 (what about VC9?). using
>>>>> mingw which came with Qt4.5 I could build SIP and PyQt (still compiling)
>>>>> successfully. this article was really helpful:
>>>>> http://diotavelli.net/PyQtWiki/BuildPyQt4Windows
>>>> There is a build in binary incompatibility between the comercial version 
>>>> of Qt and the open source version on Windows. The open source version is 
>>>> built with Mingw and the comercial version is built with VC. If you want 
>>>> to use Qt with VC you have to buy a comercial licence.
>>> No you don't. Both the GPL and LGPL version of Qt4 build just fine with
>>> MSVC 2005 or later (IIRC MSVC is supported in the GPL version since 4.3).
>>>
>> thanks for your infos. I installed the non-commercial Qt4.5 binaries
> 
> Missed that part, the binary package of Qt4.5 is of course compiled with
> MinGW. However you can simply fetch the source package and build it
> yourself with MSVC.
> 
>> actually mingw is fine for me, or are there serious implications I do
>> not know about?
> 
> Well, its only slightly less broken than MSVC6 wrt. some C++ constructs and
> its horribly slow too.
> 
> Andreas
> 

thanks for the infos. so you say
PyQt-Py2.6-gpl-4.5-snapshot-20090504-1.exe was build with mingw?
actually I was pretty impressed by the speed of VC9 - but compared to
gcc I would say it was time!
anyway, I am fine with mingw32, but tried to find out why my py2exe dist
is not transferable to another PC.
I switched to this binary snapshot of PyQt 4.5 but py2exe is now
struggling to find MSVCP90.DLL...

michael

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


[PyQt] Re: PyQt 4.5 snapshot build (windows and mac)

2009-05-17 Thread Michael Held
Andreas Pakulat wrote:
> On 17.05.09 09:13:45, Magnus Benjes wrote:
>>> I was not aware that PyQt goes with mingw32 (what about VC9?). using
>>> mingw which came with Qt4.5 I could build SIP and PyQt (still compiling)
>>> successfully. this article was really helpful:
>>> http://diotavelli.net/PyQtWiki/BuildPyQt4Windows
>> There is a build in binary incompatibility between the comercial version 
>> of Qt and the open source version on Windows. The open source version is 
>> built with Mingw and the comercial version is built with VC. If you want 
>> to use Qt with VC you have to buy a comercial licence.
> 
> No you don't. Both the GPL and LGPL version of Qt4 build just fine with
> MSVC 2005 or later (IIRC MSVC is supported in the GPL version since 4.3).
> 
> Andreas
> 

hi andreas,

thanks for your infos. I installed the non-commercial Qt4.5 binaries and
the PyQt4.5 snapshot, but running nmake for VC9express did only compile
the qtdirs.exe but nothing else, while mingw32-make did the full job.
could it be that Configure.py needs more arguments to setup for VC9?

actually mingw is fine for me, or are there serious implications I do
not know about?

michael

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


[PyQt] PyQt 4.5 snapshot build (windows and mac)

2009-05-16 Thread Michael Held
hi PyQt people,

first thanks a lot for your huge efforts!
I am newbie here, sorry for stupid questions.

I was able to build PyQt 4.5 snapshots on windows and mac but not
without issues


on mac:
I used PyQt-mac-gpl-4.5-snapshot-20090507.tar.gz together with stackless
python 2.6.1 which succeeded after a SIP patched
(sip-4.8-snapshot-20090430.tar.gz)


on windows:
also using PyQt 4.5 snapshot (PyQt-win-gpl-4.5-snapshot-20090507.zip)

I was not aware that PyQt goes with mingw32 (what about VC9?). using
mingw which came with Qt4.5 I could build SIP and PyQt (still compiling)
successfully. this article was really helpful:
http://diotavelli.net/PyQtWiki/BuildPyQt4Windows

sorry PyQt guys, but your build comments where not very helpful, since
there is no 'make' on windows but nmake, qmake, mingw32-make

installing Python to 'C:\Program Files' did not work because
configure.py seems to mess up the include path (Python.h not fond)

cheers
michael

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