[PyQt] Embedding buttions in QTreeWidget

2009-09-29 Thread Cihat Basol
Hi,

I am new to the Qt framework. Is it possible to embed button -or QWidget for
that matter- in QTreeWidget?

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

Re: [PyQt] ANN: PyQt v4.6 and SIP v4.9 Released

2009-09-29 Thread Phil Thompson
On Mon, 28 Sep 2009 12:59:52 -0700, Christian Caron cca...@fattoc.com
wrote:
 I just upgraded and I get problems patching at the instance level.
 
 I used to patch my own 'customEvent' on the QApplication at the  
 instance level. This doesn't work anymore.
 
 Patching still works at the class level. The following code  
 illustrates this:
 
 
 from PyQt4.QtCore import *
 from PyQt4.QtGui import *
 
 class App(QApplication):
  def customEvent(self, event):
  print 'inherited', event
 
 if __name__ == '__main__':
 
  def classPatch(self, event):
  print 'classPatch', event
 
  def instancePatch(event):
  print 'instancePatch', event
 
  # This still works
  # App.customEvent = classPatch
 
  app = App([])
 
  # This used to work but doesn't anymore.
  # app.customEvent = instancePatch
 
  QApplication.sendEvent(app, QEvent(1000))
 
  widget = QWidget()
  widget.show()
 
  app.exec_()

Fixed in tonight's SIP snapshot. However, your instance patch needs a self
argument. If that worked before (and it's not a typo) then it was a bug.

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


Re: [PyQt] older sip version

2009-09-29 Thread David Boddie
On Mon Sep 28 23:10:21 BST 2009, Clinton Stimpson wrote:

 Where can I download sip 4.7.8?  I need to build PyQt 4.4.
 Any newer version of sip doesn't work with that.

Which platform are you using?

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


[PyQt] [Solved] promoted QDockWidget

2009-09-29 Thread Giorgio Luciano

I made a gui with qtdesigner. The idea was to have a main MDI and then on the
left a dock in which I .
In the dock I wanted to put a promoted widget created in qt designer, in
order to change it later and make my work more modular.
How was it possible ?
I put a mdi and a QDockwidget in the editor then INSIDE the QDockwidget I
put a widget container and finally promoted the widget to a custom widget.
It was not very intuitive but it worked. I will update code in my repository
and share everydetails for everyone interested.
Giorgio
http://code.google.com/p/openchem/source/browse/#svn/trunk
-- 
View this message in context: 
http://www.nabble.com/-Solved--promoted-QDockWidget-tp25661914p25661914.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] ANN: PyQt v4.6 and SIP v4.9 Released

2009-09-29 Thread Christian Caron

Typo indeed.

Thanks!

Sent from my iPhone

On Sep 29, 2009, at 1:53 AM, Phil Thompson  
p...@riverbankcomputing.com wrote:


On Mon, 28 Sep 2009 12:59:52 -0700, Christian Caron  
cca...@fattoc.com

wrote:

I just upgraded and I get problems patching at the instance level.

I used to patch my own 'customEvent' on the QApplication at the
instance level. This doesn't work anymore.

Patching still works at the class level. The following code
illustrates this:


from PyQt4.QtCore import *
from PyQt4.QtGui import *

class App(QApplication):
def customEvent(self, event):
print 'inherited', event

if __name__ == '__main__':

def classPatch(self, event):
print 'classPatch', event

def instancePatch(event):
print 'instancePatch', event

# This still works
# App.customEvent = classPatch

app = App([])

# This used to work but doesn't anymore.
# app.customEvent = instancePatch

QApplication.sendEvent(app, QEvent(1000))

widget = QWidget()
widget.show()

app.exec_()


Fixed in tonight's SIP snapshot. However, your instance patch needs  
a self
argument. If that worked before (and it's not a typo) then it was a  
bug.


Phil

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


Re: [PyQt] older sip version

2009-09-29 Thread Clinton Stimpson
On Tuesday 29 September 2009 05:43:21 am David Boddie wrote:
 On Mon Sep 28 23:10:21 BST 2009, Clinton Stimpson wrote:
  Where can I download sip 4.7.8?  I need to build PyQt 4.4.
  Any newer version of sip doesn't work with that.

 Which platform are you using?


Windows.  But I manged to get the source using a linux box and extracting it 
out of a Fedora source rpm.  I'm now able to build and use this PyQt.
I think it would be nice if previous sip releases are kept on the sip website.

Thanks,
Clint

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


[PyQt] Need a recipe for building

2009-09-29 Thread Brian Brown

Hello folks!

I'm yet another Snow Leopard user and I'm trying to get 4.6 going (I'm  
a commercial PyQt user).


From a starting place, I'm confused as to what I should be using.

   - The Qt 4.6 technology preview (tp1), or get a particular version  
from their repository?
   - If you just check out the trunk, it claims to be 4.7 and  
doesn't work at all


   - The 4.9 sip release or current snapshot?
   - The 4.6 PyQt release or current snapshot?

If none of this is supported or possible under snow leopard I would  
expect to see that on the web site or in a README or something. If  
there is a method of getting this going, could someone put it on the  
wiki?



I'm trying to build it as 32-bit and so am using arch of i386 - I've  
read the list archives and seen various suggestions to get this to  
work, and I've tried many of them. Qt itself builds and works just  
fine, but I currently get the following with Qt 4.6 tp1, Release 4.6  
PyQt and Release 4.9 sip.



g++ -c -pipe -fPIC -arch i386 -O2 -Wall -W -DNDEBUG -DQT_NO_DEBUG - 
DQT_CORE_LIB -I. -I/Users/brian/Dev/Qt/PyQt-mac-commercial-4.6/qpy/ 
QtCore -I/System/Library/Frameworks/Python.framework/Versions/2.6/ 
include/python2.6 -I/usr/local/Trolltech/Qt-4.6.0-tp1/mkspecs/default - 
I/usr/local/Trolltech/Qt-4.6.0-tp1/lib/QtCore.framework/Headers -I/usr/ 
local/Trolltech/Qt-4.6.0-tp1/include -F/Users/brian/Dev/Qt/PyQt-mac- 
commercial-4.6/qpy/QtCore -F/usr/local/Trolltech/Qt-4.6.0-tp1/lib -o  
sipQtCoreQResource.o sipQtCoreQResource.cpp
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h: In  
copy constructor ‘QResource::QResource(const QResource)’:
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:180:  
error: ‘QScopedPointerT, Cleanup::QScopedPointer(const  
QScopedPointerT, Cleanup) [with T = QResourcePrivate, Cleanup =  
QScopedPointerDeleterQResourcePrivate]’ is private
/usr/local/Trolltech/Qt-4.6.0-tp1/lib/QtCore.framework/Headers/ 
qresource.h:59: error: within this context
sipQtCoreQResource.cpp: In constructor ‘sipQResource::sipQResource 
(const QResource)’:
sipQtCoreQResource.cpp:62: note: synthesized method  
‘QResource::QResource(const QResource)’ first required here
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h: In  
static member function ‘static void QScopedPointerDeleterT::cleanup 
(T*) [with T = QResourcePrivate]’:
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h: 
100:   instantiated from ‘QScopedPointerT, Cleanup::~QScopedPointer 
() [with T = QResourcePrivate, Cleanup =  
QScopedPointerDeleterQResourcePrivate]’
/usr/local/Trolltech/Qt-4.6.0-tp1/lib/QtCore.framework/Headers/ 
qresource.h:59:   instantiated from here
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:59:  
error: invalid application of ‘sizeof’ to incomplete type  
‘QResourcePrivate’
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:59:  
error: creating array with negative size (‘-0x1’)
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:60:  
error: invalid application of ‘sizeof’ to incomplete type  
‘QResourcePrivate’
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:60:  
error: creating array with negative size (‘-0x1’)
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:62:  
warning: possible problem detected in invocation of delete operator:
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:54:  
warning: ‘pointer’ has incomplete type
/usr/local/Trolltech/Qt-4.6.0-tp1/lib/QtCore.framework/Headers/ 
qresource.h:56: warning: forward declaration of ‘struct  
QResourcePrivate’
/usr/local/Trolltech/Qt-4.6.0-tp1/include/QtCore/qscopedpointer.h:62:  
note: neither the destructor nor the class-specific operator delete  
will be called, even if they are declared when the class is defined.

make[1]: *** [sipQtCoreQResource.o] Error 1
make: *** [all] Error 2

- Brian

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


Re: [PyQt] Signal this way

2009-09-29 Thread David Boddie
On Tue Sep 29 02:47:11 BST 2009, pantheon wrote:

 I am creating QAction in a loop and adding it to menu.

 action = QtGui.QAction(QtGui.QIcon(iconFile), fileName, menu)
menu.addAction(action)

 I need to connect this action to a python function in such a way that I
 should get text of QAction or instance of QAction object itself.

Connect its triggered() signal to a slot where you call sender() to obtain
the action object.

New-style connection syntax:

  action.triggered.connect(handleAction)

Then you can obtain the text from the action object:

  def handleAction(self):
  text = sender().text()

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


[PyQt] Error building Sip 4.9.1 Snapshots 090929

2009-09-29 Thread Melton Low
Error building Sip 4.9.1 Snapshots 090929:
LittleMac:sip-4.9.1-snapshot-20090929 melton$ python2.6 configure.py
This is SIP 4.9.1-snapshot-20090929 for Python 2.6.2 on darwin.
The SIP code generator will be installed in
/Library/Frameworks/Python.framework/Versions/2.6/bin.
The SIP module will be installed in
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages.
The SIP header file will be installed in
/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6.
The default directory to install .sip files in is
/Library/Frameworks/Python.framework/Versions/2.6/share/sip.
The platform/compiler configuration is macx-g++.
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...
LittleMac:sip-4.9.1-snapshot-20090929 melton$ make
cc -c -pipe -Os -w -DNDEBUG -I. -o main.o main.c
cc -c -pipe -Os -w -DNDEBUG -I. -o transform.o transform.c
cc -c -pipe -Os -w -DNDEBUG -I. -o gencode.o gencode.c
cc -c -pipe -Os -w -DNDEBUG -I. -o export.o export.c
cc -c -pipe -Os -w -DNDEBUG -I. -o heap.o heap.c
cc -c -pipe -Os -w -DNDEBUG -I. -o parser.o parser.c
cc -c -pipe -Os -w -DNDEBUG -I. -o lexer.o lexer.c
c++ -headerpad_max_install_names -o sip main.o transform.o gencode.o
export.o heap.o parser.o lexer.o
cc -c -pipe -fPIC -Os -w -DNDEBUG -I.
-I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -o
siplib.o siplib.c
siplib.c: In function ‘sip_api_is_py_method’:
siplib.c:6062: error: ‘cls’ undeclared (first use in this function)
siplib.c:6062: error: (Each undeclared identifier is reported only once
siplib.c:6062: error: for each function it appears in.)
make[1]: *** [siplib.o] Error 1
make: *** [all] Error 2
LittleMac:sip-4.9.1-snapshot-20090929 melton$

Environment:
Mac OS X 10.5.8 Intel
Python 2.6.2

Let me know if you need more info.

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