Re: QML, Python, Signals, and Slots Part 2

2012-06-25 Thread Eric Mesa
On Mon, Jun 25, 2012 at 1:35 AM, Luca Beltrame wrote: > In data lunedì 25 giugno 2012 07:51:21, Viranch Mehta ha scritto: > > > 1. sender.signal.connect(receiver.slot) > > I would recommend this way of connecting signals in, since errors will be > immediately caught (AttributeError in case of wron

Re: QML, Python, Signals, and Slots Part 2

2012-06-24 Thread Luca Beltrame
In data lunedì 25 giugno 2012 07:51:21, Viranch Mehta ha scritto: > 1. sender.signal.connect(receiver.slot) I would recommend this way of connecting signals in, since errors will be immediately caught (AttributeError in case of wrong / missing signal) rather than silently ignored. The only case

Re: QML, Python, Signals, and Slots

2012-06-24 Thread Eric Mesa
Yup! I just figured out your first answer on my own. Thanks again for all your help! -- Eric Mesa http://about.me/ericmesa http://www.ericsbinaryworld.com On Sun, Jun 24, 2012 at 10:32 PM, Viranch Mehta wrote: > On Sun, Jun 24, 2012 at 8:26 PM, Eric Mesa wrote: > >> >> Just curious about one

Re: QML, Python, Signals, and Slots Part 2

2012-06-24 Thread Eric Mesa
On Sun, Jun 24, 2012 at 10:21 PM, Viranch Mehta wrote: > On Mon, Jun 25, 2012 at 5:32 AM, Eric Mesa wrote: > >> >> print connect(view.rootObject(),SIGNAL(mySignal(QString)), receiver, >> SLOT(QUrl('message.qml'))) >> > > You don't need this line because you've already connected QML's > messageRequ

Re: QML, Python, Signals, and Slots

2012-06-24 Thread Viranch Mehta
On Sun, Jun 24, 2012 at 8:26 PM, Eric Mesa wrote: > > Just curious about one thing: > 1) With this framework I can get information from the python program to > affect the QML (and change the button to a blue colour). How do I get > information to the python program? In other words, if I have a

Re: QML, Python, Signals, and Slots Part 2

2012-06-24 Thread Viranch Mehta
On Mon, Jun 25, 2012 at 5:32 AM, Eric Mesa wrote: > > print connect(view.rootObject(),SIGNAL(mySignal(QString)), receiver, > SLOT(QUrl('message.qml'))) > You don't need this line because you've already connected QML's messageRequired signal to Now's appropriate slot. So just remove this line and

Re: QML, Python, Signals, and Slots Part 2

2012-06-24 Thread Eric Mesa
On Sun, Jun 24, 2012 at 4:33 PM, Viranch Mehta wrote: > > > On Mon, Jun 25, 2012 at 12:52 AM, Eric Mesa wrote: > >> OK, I did a bunch of googling and I think I can better word what I want >> to do. I want to emit a signal in QML and catch it in a python slot. That >> way it can be the arguments

Re: QML, Python, Signals, and Slots Part 2

2012-06-24 Thread Viranch Mehta
On Mon, Jun 25, 2012 at 12:52 AM, Eric Mesa wrote: > OK, I did a bunch of googling and I think I can better word what I want to > do. I want to emit a signal in QML and catch it in a python slot. That > way it can be the arguments to a function within python. Can I please get > some help with t

QML, Python, Signals, and Slots Part 2

2012-06-24 Thread Eric Mesa
OK, I did a bunch of googling and I think I can better word what I want to do. I want to emit a signal in QML and catch it in a python slot. That way it can be the arguments to a function within python. Can I please get some help with this? The syntax is just indirect enough (like the signal an

QML, Python, Signals, and Slots

2012-06-24 Thread Eric Mesa
I have the following in my Python file: import sys from PyQt4.QtCore import QDateTime, QObject, QUrl, pyqtSignal from PyQt4.QtGui import QApplication from PyQt4.QtDeclarative import QDeclarativeView #this class will emit success if photo is added to group class updateGroup(QObject): now = pyq