[PyQt] PyQwt on mac osx (designer + pyuic4 error)

2009-06-01 Thread massimo di stefano


Hi All,

i'm on mac osx leopard,
i have installed Qt 4.5 sdk + pyqt4.4 + qwt + pyqwt

 i tried some pyqwt examples and it runs without problems
i also have an application that use pyqwt in some plug-in (and it  
works too)


but now i'm tring to create a gui in designer, that uses the Qwt widjet,
i can select the qwt widjet in designer  but when i try to run pyuic4  
on the generated.ui file i get an error :



  pyuic4 /Users/Shared/Development/gsoc/OssimPlanetSasha/ 
planetsashaui.ui -o /Applications/GRASS-7.0.app/Contents/MacOS/etc/ 
python/planetsashaui.py

  An unexpected error occurred.
  Check that you are using the latest version of PyQt and send an  
error report to
  supp...@riverbankcomputing.com, including the following  
information:

* your version of PyQt (4.4.4)
* the UI file that caused this error
* the debug output of pyuic4 (use the -d flag when calling  
pyuic4)


i uploaded the -d log and the .ui file here :

http://www.geofemengineering.it/data/pyuic4__log.txt
http://www.geofemengineering.it/data/planetsashaui.ui


thanks to All for any suggestion on how to debug this problem!


regards,




Massimo Di Stefano
massimodisa...@yahoo.it

epifanio on   irc.freenode.net  /join gfoss







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

[PyQt] SIGNAL("itemActivated(QListWidgetItem *)") problem

2009-06-01 Thread paolomilani

Hi! :)
I've a little problem with SIGNAL("itemActivated(QListWidgetItem *)").

When kde4.2.2 is set on double click mode, everything is ok, but when it's set 
on single click mode, I select items with ctrl+click and SIGNAL itemActivated 
is emitted.  Is it a bug? or is it my misunderstanding?

many thanks,
Paolo

My system is kubuntu 9.04 (python 2.6.2, Qt 4.5.0, PyQT 4.4.4). Tested on amd64 
and i386 platform.

-

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.kdeui import *

class ListWidgetTest(QDialog):
    def __init__(self, parent=None):
        super(ListWidgetTest, self).__init__(parent)

        listWidget = QListWidget()
        listWidget.setSelectionMode(QAbstractItemView.ExtendedSelection)
        layout = QVBoxLayout()
        layout.addWidget(listWidget)
        self.setLayout(layout)

        self.connect(listWidget, SIGNAL("itemClicked(QListWidgetItem *)"), 
self.printClicked)
        self.connect(listWidget, SIGNAL("itemActivated(QListWidgetItem *)"), 
self.printActivated)
        item0 = QListWidgetItem("0")
        item0.setData(Qt.UserRole, QVariant(1))
        item1 = QListWidgetItem("1")
        item1.setData(Qt.UserRole, QVariant(1))
        item2 = QListWidgetItem("2")
        item2.setData(Qt.UserRole, QVariant(1))
        listWidget.insertItem(0, item0)
        listWidget.insertItem(1, item1)
        listWidget.insertItem(2, item2)

    def printClicked(self, item):
        print "clicked", item.text()
    def printActivated(self, item):
        print "activated", item.text()


if __name__ == "__main__":
    import sys
    app = QApplication(sys.argv)
    dialog = ListWidgetTest()
    dialog.show()
    app.exec_()




  

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


[PyQt] trouble building PyQt4-x11 20090529 snapshot

2009-06-01 Thread Darren Dale
Hello,

This morning I downloaded the 20090529 PyQt4 snapshot, and am having trouble
building it on a 64-bit gentoo linux system. I didn't see any SIP snapshots
available at the riverbank website, so I am using the 20090525 sip snapshot:

g++ -c -pipe -fno-strict-aliasing -O2 -march=k8 -mtune=k8 -pipe -fPIC -Wall
-W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/python2.6
-I../../QtCore -I. -I. -o qpycore_pyqtboundsignal.o
qpycore_pyqtboundsignal.cpp
qpycore_pyqtboundsignal.cpp:94: error: 'SIP_MLNAME_CAST' was not declared in
this scope
qpycore_pyqtboundsignal.cpp:96: error: 'SIP_MLDOC_CAST' was not declared in
this scope
qpycore_pyqtboundsignal.cpp:97: error: 'SIP_MLNAME_CAST' was not declared in
this scope
qpycore_pyqtboundsignal.cpp:98: error: 'SIP_MLDOC_CAST' was not declared in
this scope
qpycore_pyqtboundsignal.cpp:99: error: 'SIP_MLNAME_CAST' was not declared in
this scope
qpycore_pyqtboundsignal.cpp:100: error: 'SIP_MLDOC_CAST' was not declared in
this scope
qpycore_pyqtboundsignal.cpp:116: error: 'SIP_TPNAME_CAST' was not declared
in this scope
make[2]: *** [qpycore_pyqtboundsignal.o] Error 1
make[2]: Leaving directory
`/home/share/packages/PyQt-x11-gpl-4.5-snapshot-20090529/qpy/QtCore'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/home/share/packages/PyQt-x11-gpl-4.5-snapshot-20090529/qpy'
make: *** [all] Error 2

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

Re: [PyQt] Question about QMenu's triggered action

2009-06-01 Thread Arnold Krille
On Sunday 31 May 2009 22:33:51 Tony Willis wrote:
> According to the Qt4 docs, a QMenu is supposed to be capable of emitting a
> `triggered' event which contains the action which was triggered. (I realize
> that its a better coding practice to connect the `triggered' event
> associated with individual QActions to their own separate callbacks, but
> I'm porting an application from Qt3 to Qt4 and I'd prefer not to
> have to write a whole bunch (~50) of new callbacks.) So I'd like to get the
> more global QMenu triggered event to work. Unfortunately, with PyQt, I
> can't seem to see or catch the QMenu's triggered event. The attached PyQt
> demo script illustrates the problem. Can someone point out what I'm doing
> wrong?

I believe you have to decorate the python slot so the connect knows which 
arguments it has. Something like @pyqtdecorator( "QAction" )...

And I really don't think its good coding practice to have one connection and 
do the split yourself. Cause actually the signals are send individually, then 
combined by qmenu, send as one and decomposed into a big select-statement by 
you again.
Why not just connect the individual signals?
And connecting to the actions directly has another advantage: Plug them into a 
toolbar (additionally to your menu) and you get the same signal (because its 
the same action). Or use them in multiple menus (like in the menubar and in 
the context menu) and still deal with only one signal. And deal with only one 
action to activate/deactivate if needed...

Arnold


signature.asc
Description: This is a digitally signed message part.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt