Re: [PyQt] Question related to tabbed widgets...

2009-12-03 Thread Vincent Vande Vyvre




Ville M. Vainio a écrit :

  On Thu, Dec 3, 2009 at 8:33 PM, Jebagnana Das  wrote:

  
  
   1) Is it possible for us to create tabbed windows by having
images as tab headers.. If u r not getting the point it's like add/remove
programs in windows or tools->preferences in vlc(latest) player... I know
there is QTabwidget tool.. But through this we can set only icons for tabs
not like the windows like the above mentioned two...

  
  
I looked at what vlc 1.0.2 has. That preferences menu is not a tab
widget at all.

Luckily, vlc is using qt4. Grab the source and check out
simple_preferences.cpp. You'll note that it's using a set of
QToolButton objects to implement the category switcher (#define
ADD_CATEGORY...)

  

Or maybe like this :

../PyQt-x.x.x/examples/dialogs/configdialog

Vincent



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

Re: [PyQt] Question related to tabbed widgets...

2009-12-03 Thread Ville M. Vainio
On Thu, Dec 3, 2009 at 8:33 PM, Jebagnana Das  wrote:

>    1) Is it possible for us to create tabbed windows by having
> images as tab headers.. If u r not getting the point it's like add/remove
> programs in windows or tools->preferences in vlc(latest) player... I know
> there is QTabwidget tool.. But through this we can set only icons for tabs
> not like the windows like the above mentioned two...

I looked at what vlc 1.0.2 has. That preferences menu is not a tab
widget at all.

Luckily, vlc is using qt4. Grab the source and check out
simple_preferences.cpp. You'll note that it's using a set of
QToolButton objects to implement the category switcher (#define
ADD_CATEGORY...)

-- 
Ville M. Vainio
http://tinyurl.com/vainio

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


[PyQt] Older version of PyQt

2009-12-03 Thread Anita Westman
Is there somewhere where I can download a gpl version of PyQt that works with 
Python2.4?

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

[PyQt] Question related to tabbed widgets...

2009-12-03 Thread Jebagnana Das
Hello all,

   I've been testing with PyQt for the past few days and it's been
really cool...

Here i've come up with a beginner question...
   1) Is it possible for us to create tabbed windows by having
images as tab headers.. If u r not getting the point it's like add/remove
programs in windows or tools->preferences in vlc(latest) player... I know
there is QTabwidget tool.. But through this we can set only icons for tabs
not like the windows like the above mentioned two...

  Your suggestions are most welcome
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Python bindings for Poppler-Qt4, pypoppler-qt4

2009-12-03 Thread Rajeev J Sebastian
On Thu, Dec 3, 2009 at 8:45 PM, Wilbert Berendsen  wrote:
> Op donderdag 03 december 2009 schreef Rajeev:
>
>> It doesnt have much to do with distributions, because these projects
>> are doing it for their own needs and not for their distributions.
>
> I meant that python-poppler-qt4 could become a package in the Linux
> distribution sense, and that other programs could simply depend om that
> package, instead of including (some fork of) it in their own source tarball.

Thats exactly what I meant too. This being in the Pardus repo has no
bearing on whether it can be packaged (as in .deb, .rpm or .pisi
packages). [see below]

> But for the binding to be useful for others, the API coverage would need to be
> completed.  I for myself need the links() method of the Page object and the
> various Link* classes, but I would be willing to make the binding complete and
> cover and test the full API of libpoppler-qt4.

Cool that would be awesome! :)

> My main reason for creating a (googlecode) repo, is that it would make it
> easier for me to work on both my machines and commit to the repo often. And to
> have a well-known place to provide source tarballs I can point users of my
> application to.

OK. I'll create a bitbucket repo. That should allow you to commit
often and also point your users to place where they can get tarballs.

Regards
Rajeev J Sebastian

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


RE: [PyQt] Python bindings for Poppler-Qt4, pypoppler-qt4

2009-12-03 Thread NARCISO, Rui
Hi Wilbert

I'm very much interested on your approach so please keep us updated on your 
progress.
Cheers

Rui

-Message d'origine-
De : pyqt-boun...@riverbankcomputing.com
[mailto:pyqt-boun...@riverbankcomputing.com]de la part de Wilbert
Berendsen
Envoyé : jeudi 3 décembre 2009 16:15
À : pyqt@riverbankcomputing.com
Objet : Re: [PyQt] Python bindings for Poppler-Qt4, pypoppler-qt4


Op donderdag 03 december 2009 schreef Rajeev:

> It doesnt have much to do with distributions, because these projects
> are doing it for their own needs and not for their distributions.

I meant that python-poppler-qt4 could become a package in the Linux 
distribution sense, and that other programs could simply depend om that 
package, instead of including (some fork of) it in their own source tarball.

I write and distribute a free software application (written in Python, called 
Frescobaldi, see www.frescobaldi.org ). In the future I want to extend that 
app with a PDF widget based on libpoppler-qt4. But I would rather not include 
the Python binding with my program (as it requires users to compile code).

Users should install the python binding separately. Other projects also can 
then depend on that package instead of including their own version.

But for the binding to be useful for others, the API coverage would need to be 
completed.  I for myself need the links() method of the Page object and the 
various Link* classes, but I would be willing to make the binding complete and 
cover and test the full API of libpoppler-qt4.

Then the binding could be released as tarballs so that other people can easily 
install it and (Linux) distributions can include packaged versions of the 
Python binding for libpoppler-qt4.

> Why do you need a fork on googlecode ? You can simply checkout on your
> local, make mods and send me patches. But if its really necessary, I
> can move it off Pardus' SVN repo and put it on Bitbucket.

I would rather not create a fork. If I can contribute patches it's good as 
well. 

My main reason for creating a (googlecode) repo, is that it would make it 
easier for me to work on both my machines and commit to the repo often. And to 
have a well-known place to provide source tarballs I can point users of my 
application to.

Best regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

This mail has originated outside your organization, either from an external 
partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other than the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.


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


Re: [PyQt] Python bindings for Poppler-Qt4, pypoppler-qt4

2009-12-03 Thread Wilbert Berendsen
Op donderdag 03 december 2009 schreef Rajeev:

> It doesnt have much to do with distributions, because these projects
> are doing it for their own needs and not for their distributions.

I meant that python-poppler-qt4 could become a package in the Linux 
distribution sense, and that other programs could simply depend om that 
package, instead of including (some fork of) it in their own source tarball.

I write and distribute a free software application (written in Python, called 
Frescobaldi, see www.frescobaldi.org ). In the future I want to extend that 
app with a PDF widget based on libpoppler-qt4. But I would rather not include 
the Python binding with my program (as it requires users to compile code).

Users should install the python binding separately. Other projects also can 
then depend on that package instead of including their own version.

But for the binding to be useful for others, the API coverage would need to be 
completed.  I for myself need the links() method of the Page object and the 
various Link* classes, but I would be willing to make the binding complete and 
cover and test the full API of libpoppler-qt4.

Then the binding could be released as tarballs so that other people can easily 
install it and (Linux) distributions can include packaged versions of the 
Python binding for libpoppler-qt4.

> Why do you need a fork on googlecode ? You can simply checkout on your
> local, make mods and send me patches. But if its really necessary, I
> can move it off Pardus' SVN repo and put it on Bitbucket.

I would rather not create a fork. If I can contribute patches it's good as 
well. 

My main reason for creating a (googlecode) repo, is that it would make it 
easier for me to work on both my machines and commit to the repo often. And to 
have a well-known place to provide source tarballs I can point users of my 
application to.

Best regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Python bindings for Poppler-Qt4, pypoppler-qt4

2009-12-03 Thread Rajeev J Sebastian
On Thu, Dec 3, 2009 at 7:56 PM, Wilbert Berendsen  wrote:
> Op donderdag 03 december 2009 schreef Rajeev:
>
>> However, some other projects have made some mods, but not contributed
>> back. No idea why (or whether its ethical).
>
> I would be willing to update and extend the bindings to cover the full api of
> libpoppler-qt4.
>
> Is it OK that I create a small googlecode SVN project for it and maintain the
> source there, providing versioned tarballs for others to use as soon as it is
> complete? That way this nice binding could become part of distributions
> instead of everyone including its own fork (which is OK of course).

Personally, I do not understand why people make their own fork anyway.

It doesnt have much to do with distributions, because these projects
are doing it for their own needs and not for their distributions.

Why do you need a fork on googlecode ? You can simply checkout on your
local, make mods and send me patches. But if its really necessary, I
can move it off Pardus' SVN repo and put it on Bitbucket.

Regards
Rajeev J Sebastian
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Python bindings for Poppler-Qt4, pypoppler-qt4

2009-12-03 Thread Wilbert Berendsen
Op donderdag 03 december 2009 schreef Rajeev:

> However, some other projects have made some mods, but not contributed
> back. No idea why (or whether its ethical).

I would be willing to update and extend the bindings to cover the full api of 
libpoppler-qt4.

Is it OK that I create a small googlecode SVN project for it and maintain the 
source there, providing versioned tarballs for others to use as soon as it is 
complete? That way this nice binding could become part of distributions 
instead of everyone including its own fork (which is OK of course).

with many regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Disable minize button problem

2009-12-03 Thread KS Jothybasu
Hi all,

I have a MDI area and I have added few subwindows in it.

I want to disable the minimize button and I tried setting the windows flags
(self.subwindow1.setWindowsFlags(Qt.Window|Qt.WindowMinimizeButtonHint))

But, not working!

Should I first disable all buttons and then try to set this or should I
first set customstyle and then try.

Thanks in advance!

Regards

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

Re: [PyQt] Freezes and crashes with signal autoconnection

2009-12-03 Thread Phil Thompson
On Wed, 2 Dec 2009 17:09:36 -0800 (PST), Christian Roche
 wrote:
> Phil Thompson-5 wrote:
>> 
>> Either way people need a small, self-contained example that demonstrates
>> the problem.
>> 
> 
> Hi Phil,
> 
> I think I've been able to isolate a small piece of code that consistently
> reproduces the problem.  http://old.nabble.com/file/p26619445/main.py
This
> piece of code  displays a gray rectangle on my system and systematically
> crashes when I click on it.  My config is as follows:
> 
> qt-4.5.3-9.fc11.i586.rpm
> PyQt4-4.5.4-1.fc11.i586.rpm
> sip-4.8.2-1.fc11.i586.rpm
> 
> I'd be very interested in understanding what's wrong here because i've
been
> strugling for weeks with incomprehensible crashes that seem to come out
of
> nowhere and I've not the single clue what's going on.

You might want to look at the last paragraph of...

http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#qvariant

...as it seems to apply to your ImageLink type.

I'd suggest changing the design so that you are passing something simpler
than a QObject between threads.

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


Re: [PyQt] socket problem

2009-12-03 Thread Hans-Peter Jansen
On Thursday 03 December 2009, 10:19:38 Prashant Saxena wrote:
> Here are the two version of my Receiver & Sender scripts:
> Receiver
> if status:
>
> # Create socket
> self.socket = QtNetwork.QUdpSocket(self)
> self.socket.setReadBufferSize(buffer)
> self.socket.bind(QHostAddress.LocalHost, port,
> QtNetwork.QUdpSocket.ShareAddress)
> self.socket.readyRead.connect(self.dataArrived)
> msg=("Socket opened at host=%s, port=%d." % (host, port))
> # Stop Communication.
> else:
> # Close socket
> self.socket.disconnectFromHost()
> self.socket.waitForDisconnected()
> self.socket.close()
> msg=("Socket closed at host=%s, port=%d." % (host, port))
>
> Sender:
>
> import socket
>
> # Set the socket parameters
> host = "localhost"
> port = 6268
> addr = (host, port)
>
> service = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>
> data = "This is a test string."
> try:
> service.connect(addr)
> service.send(data)
> except Exception, (value, message):
> if service:
> service.close()
> print message
> service.close()It seems Receiver script is not opening the port for
> listening.

Aren't you mixing UDP and TCP concepts here? Sender speaks hindi, while 
receiver waits for sanskrit answers ;-)

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


Re: [PyQt] Freezes and crashes with signal autoconnection

2009-12-03 Thread Hans-Peter Jansen
On Thursday 03 December 2009, 02:09:36 Christian Roche wrote:
> Phil Thompson-5 wrote:
> > Either way people need a small, self-contained example that
> > demonstrates the problem.
>
> Hi Phil,
>
> I think I've been able to isolate a small piece of code that consistently
> reproduces the problem.  http://old.nabble.com/file/p26619445/main.py

This does NOT qualify as a small piece of code, because:
 - it's convoluted code (e.g. it's not obvious, which part runs threaded)
 - you're doing hard to track things with QUrls (this is, where it crashes)

> This piece of code  displays a gray rectangle on my system and
> systematically crashes when I click on it.  My config is as follows:
>
> qt-4.5.3-9.fc11.i586.rpm
> PyQt4-4.5.4-1.fc11.i586.rpm
> sip-4.8.2-1.fc11.i586.rpm
>
> I'd be very interested in understanding what's wrong here because i've
> been strugling for weeks with incomprehensible crashes that seem to come
> out of nowhere and I've not the single clue what's going on.

Your clue stick is called gdb, but you need to prepare your system 
accordingly, e.g. need to install debuginfo packages of Qt, sip and PyQt 
beforehand. Then run:

gdb python -ex 'set args main.py' -ex run

Click on the image, and:

Starting program: main.py
[Thread debugging using libthread_db enabled]
[New Thread 0xb5c85b90 (LWP 4686)]
[Thread 0xb5c85b90 (LWP 4686) exited]

Program received signal SIGSEGV, Segmentation fault.
0xb783c49a in QUrl (this=0xb5305630, u...@0xb530b3ec) at io/qurl.cpp:3907
3907if (!url.isEmpty())
Current language:  auto; currently c++
(gdb) bt
#0  0xb783c49a in QUrl (this=0xb5305630, u...@0xb530b3ec) at io/qurl.cpp:3907
#1  0xb7a436bc in init_QUrl (sipArgs=0x8145ecc, sipArgsParsed=0xbfffb6f0) at 
sipQtCoreQUrl.cpp:2576
#2  0xb799edc7 in sipSimpleWrapper_init (self=0x815e8cc, args=0x8145ecc, 
kwds=0x0) at siplib.c:7945
#3  0xb7ebc9b5 in type_call (type=, args=0x8145ecc, 
kwds=0x0) at Objects/typeobject.c:745
#4  0xb7e6bc1c in PyObject_Call (func=0x80dcd9c, arg=0x8145ecc, kw=0x0) at 
Objects/abstract.c:2487
#5  0xb7ef6d20 in PyEval_EvalFrameEx (f=0xb530b734, throwflag=0) at 
Python/ceval.c:3890
#6  0xb7ef623d in PyEval_EvalFrameEx (f=0xb530b15c, throwflag=0) at 
Python/ceval.c:3765
#7  0xb7ef623d in PyEval_EvalFrameEx (f=0xb530aff4, throwflag=0) at 
Python/ceval.c:3765
#8  0xb7efbb9b in PyEval_EvalCodeEx (co=0xb7c3b3c8, globals=0xb7c7902c, 
locals=0x0, args=0xb7c463f8, argcount=2, 
kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at 
Python/ceval.c:2942
#9  0xb7e90a29 in function_call (func=0xb7bbce2c, arg=0xb7c463ec, kw=0x0) at 
Objects/funcobject.c:524
#10 0xb7e6bc1c in PyObject_Call (func=0xb7bbce2c, arg=0xb7c463ec, kw=0x0) at 
Objects/abstract.c:2487
#11 0xb7e799fe in instancemethod_call (func=0xb7bbce2c, arg=0xb7c463ec, kw=0x0) 
at Objects/classobject.c:2579
#12 0xb7e6bc1c in PyObject_Call (func=0xb7c2984c, arg=0x8145d0c, kw=0x0) at 
Objects/abstract.c:2487
#13 0xb7ef474f in PyEval_CallObjectWithKeywords (func=0xb7c2984c, 
arg=0x8145d0c, kw=0x0) at Python/ceval.c:3548
#14 0xb79a0933 in sip_api_call_method (isErr=0x0, method=0xb7c2984c, 
fmt=0xb723e007 "D") at siplib.c:1534
#15 0xb6d57679 in sipVH_QtGui_27 (sipGILState=PyGILState_UNLOCKED, 
sipMethod=0xb7c2984c, a0=0xbfffcc48)
at sipQtGuicmodule.cpp:7057
#16 0xb6fe4239 in sipQListView::mouseReleaseEvent (this=0x820cce8, 
a0=0xbfffcc48) at sipQtGuiQListView.cpp:763
#17 0xb62b7363 in QWidget::event (this=0x820cce8, event=0xbfffcc48) at 
kernel/qwidget.cpp:7554
#18 0xb66479b3 in QFrame::event (this=0x820cce8, e=0xbfffcc48) at 
widgets/qframe.cpp:559
#19 0xb66e6c7f in QAbstractScrollArea::viewportEvent (this=0x820cce8, 
e=0xb531)
at widgets/qabstractscrollarea.cpp:962
#20 0xb6799567 in QAbstractItemView::viewportEvent (this=0x820cce8, 
event=0xbfffcc48)
at itemviews/qabstractitemview.cpp:1476
#21 0xb6fdd70f in sipQListView::viewportEvent (this=0x820cce8, a0=0xbfffcc48) 
at sipQtGuiQListView.cpp:1371
#22 0xb66e9285 in QAbstractScrollAreaFilter::eventFilter (this=0x820e250, 
o=0x820cb10, e=0xbfffcc48)
at widgets/qabstractscrollarea_p.h:100
#23 0xb7882b0a in QCoreApplicationPrivate::sendThroughObjectEventFilters 
(this=0x8196878, receiver=0x820cb10, 
event=0xbfffcc48) at kernel/qcoreapplication.cpp:726
#24 0xb626074a in QApplicationPrivate::notify_helper (this=0x8196878, 
receiver=0x820cb10, e=0xbfffcc48)
at kernel/qapplication.cpp:4061
#25 0xb62693d1 in QApplication::notify (this=0x8196858, receiver=0x820cb10, 
e=0xbfffcc48)
at kernel/qapplication.cpp:3767
#26 0xb71bb4ce in sipQApplication::notify (this=0x8196858, a0=0x820cb10, 
a1=0xbfffcc48) at sipQtGuiQApplication.cpp:309
#27 0xb78838fb in QCoreApplication::notifyInternal (this=0x8196858, 
receiver=0x820cb10, event=0xbfffcc48)
at kernel/qcoreapplication.cpp:610
#28 0xb626843e in QApplicationPrivate::sendMouseEvent (receiver=0x820cb10, 
event=0xbfffcc48, alienWidget=0x820cb10, 
nativeWidget=0x81e8090, buttonDown=0xb6ac9a20, 
lastmousereceiv...@0xb6ac9a

[PyQt] socket problem

2009-12-03 Thread Prashant Saxena
Here are the two version of my Receiver & Sender scripts:
Receiver
if status:

# Create socket
self.socket = QtNetwork.QUdpSocket(self)
self.socket.setReadBufferSize(buffer)
self.socket.bind(QHostAddress.LocalHost, port, 
QtNetwork.QUdpSocket.ShareAddress)
self.socket.readyRead.connect(self.dataArrived)
msg=("Socket opened at host=%s, port=%d." % (host, port))
# Stop Communication.
else:
# Close socket
self.socket.disconnectFromHost()
self.socket.waitForDisconnected()
self.socket.close()
msg=("Socket closed at host=%s, port=%d." % (host, port))

Sender:

import socket
 
# Set the socket parameters
host = "localhost"
port = 6268
addr = (host, port)
 
service = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 
data = "This is a test string."
try:
service.connect(addr)
service.send(data)
except Exception, (value, message):
if service:
service.close()
print message
service.close()It seems Receiver script is not opening the port for listening.

Thanks in advance

Prashant

PyQt 4.6.1
Python 2.6.2
Win XP 32



  The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

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


RE: [PyQt] Drag & Drop with QTreeWidget

2009-12-03 Thread NARCISO, Rui
Thanks so much

It works nicely
Had not thought of your "type" approach.

Thanks again.

Cheers
Rui

-Message d'origine-
De : Baz Walter [mailto:baz...@ftml.net]
Envoyé : jeudi 3 décembre 2009 00:10
À : NARCISO, Rui
Cc : PyQt (E-mail)
Objet : Re: [PyQt] Drag & Drop with QTreeWidget


NARCISO, Rui wrote:
>>> and when doing so create the sub-node "Folder1" if it does not exist within 
>>> "campaign" and put the dragged items under "folder1" (and not 
>>> "campaign" where they were dropped). How to do this ? Do I do this 
>>> in a dropEvent? In a dropEventAction ?
>> you could monitor the tree using QTreeView.rowsInserted and then 
>> reparent dropped items as necessary.
> 
> Hi again, 
> 
> I have tried but I am unable from redefining rowsInserted to reparent the 
> items.
> I am having problems combining the information QModelIndex used by 
> rowsInserted and the QAbstractModel automatically set-up behind the scenes by 
> QTreeWidget 

don't know what you're trying to do, but i had in mind something like this:

import sys
from PyQt4 import QtGui, QtCore

CAMPAIGN_TYPE, FOLDER_TYPE, CALC_TYPE = range(1001, 1004)


class TreeWidget(QtGui.QTreeWidget):
 def __init__(self, parent=None):
 QtGui.QTreeWidget.__init__(self, parent)
 self.header().setHidden(True)
 self.setSelectionMode(self.ExtendedSelection)
 self.setDragDropMode(self.InternalMove)
 self.setDragEnabled(True)
 self.setDropIndicatorShown(True)
 self.invisibleRootItem().setFlags(QtCore.Qt.NoItemFlags)
 parent = TreeWidgetItem(self, CAMPAIGN_TYPE)
 for i in xrange(1, 4):
 TreeWidgetItem(parent, CALC_TYPE)
 TreeWidgetItem(self, CAMPAIGN_TYPE)
 TreeWidgetItem(self, CAMPAIGN_TYPE)

 def rowsInserted(self, parent, start, end):
 QtGui.QTreeWidget.rowsInserted(self, parent, start, end)
 item = self.itemFromIndex(parent)
 if (item is not None and
 item.type() == CAMPAIGN_TYPE and
 item.child(start).type() == CALC_TYPE):
 child = item.takeChild(start)
 if item.folder is None:
 item.folder = TreeWidgetItem(item, FOLDER_TYPE)
 item.folder.addChild(child)


class TreeWidgetItem(QtGui.QTreeWidgetItem):
 def __init__(self, parent, type):
 QtGui.QTreeWidgetItem.__init__(self, parent, type)
 if type == CALC_TYPE:
 text, flags = 'Calc', ~QtCore.Qt.ItemIsDropEnabled
 else:
 self.setChildIndicatorPolicy(self.ShowIndicator)
 self.setExpanded(True)
 if type == CAMPAIGN_TYPE:
 text, flags = 'Campaign', ~QtCore.Qt.ItemIsDragEnabled
 elif type == FOLDER_TYPE:
 text, flags = 'Folder', ~QtCore.Qt.ItemIsDragEnabled
 self.setText(0, text)
 self.setFlags(self.flags() & flags)
 self.folder = None


if __name__ == "__main__":
 app = QtGui.QApplication(sys.argv)
 tree = TreeWidget()
 tree.resize(200, 300)
 tree.move(300, 300)
 tree.show()
 sys.exit(app.exec_())

This mail has originated outside your organization, either from an external 
partner or the Global Internet.
Keep this in mind if you answer this message.



The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other than the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.


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


[PyQt] Cython Compiled module doesn't load

2009-12-03 Thread Prashant Saxena
Previously I have written an application using wxPython and some of the modules 
were compiled using (cython+mingw+win32).
All of them were compiled as is without changing a single line of code and 
application was working fine.

This is not happening in case of PyQt. Modules are successfully compiled using 
cython but when I load the module, I am getting 
"win32 unhandled exception". I have a limited knowledge in c/c++ stuff.
Are there any specific changes required in PyQt python modules?

Thanks in Advance.
Prashant



  The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

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