Content-Type: multipart/signed;
Content-Transfer-Encoding: 7bit

Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Am Freitag, 24. Februar 2006 18:19 schrieb Thomas Baumgart:
> So if I get this right - and I already read your explanation a few times -
> you have the following setup:
> A B (Objects)
> changed --> slotSet
> slotSet <--- changed
> where A::slotSet() contains "emit changed()" and B::slotSet() does the
> same. So when you call any of the slotSet methods directly via code then
> you end up in an endless loop. Right?

Yeah, thats the setup I have. Except that I avoided the direct endless loop=
having a static bool as signle-execution-protection in A::changed.

> > What to do?

> In the above case, I would do the following (example code for one object
> only)
> A::slotSet(..., QObject* p =3D 0);
> A::slotSet(..., QObject* p)
> {
> if(p =3D=3D this)
> return;
> if(p =3D=3D 0)
> p =3D this;
> emit changed(..., p);
> }
> I used the '...' to represent all your current parameters you pass around.
> The above should avoid that you execute A::slotSet a second time. In your
> actual initial call, you would not specify the parameter p so it will get
> passed as 0 to startup the logic.

Well, that could work. Will try it.

But the problem is that A's interface should be compatible in the Qt-way=20
(thats why the slots and signals are setValue(...) and valueChanged(...)) a=
that B is a Qt-class (QSpinBox, QLineEdit, QDoubleSpinBox to be precise).

But when I use an own class as bridge for the Qt-widgets it could work. Tha=
for the idea, also thanks to Cyrille!

> p.s. Gr=FCsse nach Dillenburg.

Thanks, currently I am not in Dillenburg but in Halle (Saale) for studying.=
And currently it looks as if I am never to stay for a long time (>1year) in=
Dillenburg again...

Have a nice day,


Get my public-key from pgp.mit.edu or pgp.uni-mainz.de

Content-Type: application/pgp-signature

Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBD/0RpuYLL1cDjHx0RAvXBAJ9jONZRslsokLs554lKqYZgaNAZ2wC fbY8z


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<