From kde-bindings Tue Oct 18 09:00:48 2005 From: Stefan Champailler Date: Tue, 18 Oct 2005 09:00:48 +0000 To: kde-bindings Subject: Re: [Kde-bindings] Qt and Multithread Message-Id: <200510181100.51179.champailler () octalis ! com> X-MARC-Message: https://marc.info/?l=kde-bindings&m=112962606003250 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============2038624149==" --===============2038624149== Content-Type: multipart/signed; boundary="nextPart4113350.f7VrQSeO3d"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart4113350.f7VrQSeO3d Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sorry about this question, I just saw there's on previous post on=20 this ML that deals with the very same kind of issue... There : http://lists.kde.org/?l=3Dkde-bindings&m=3D112798649226241&w=3D2 stF > Dear all, > > > I'm still developping my robot for konqueror and I've stumbled on > a fundamental issue. > > I want to have a robot that can control konqueror to make GUI > testing (and I have a good reason to do it like that, HttpUnit > won't do it). > > The thing I want to achieve is to have several little functions > that allow me to write scripts like this : > > # this is ruby code... > openURL(google.org") > fillForm("search","what I serach for") > submitForm("search") > assert( link_present("www.mysite.com")) > > To achieve this, ruby must have the control flow. However, if I > use Korundum and a KApplication, the control flow is passed to Qt. > This leads to code like this, with an event handler : > > case scenarioStep > when 1 > openURL(google.org") > when 2 > fillForm("search","what I serach for") > ... > end > scenarioStep++ > > this works but it's not nice : having to write down all these > "when" is not nice. > > What I was thinking on is to have two threads. One threads running > the QT stuff (one window with a KHTML part) and another running my > script. This way the application loop control flow is handled > separately of the scenario control flow. > > The problem is that first, if I create a thread beside the > KApplication.exec one, it is run only if events are thrown at the > KApplication.exec. > > Second, if I write : > > a =3D KDE::Application.new() > > Thread.new { > a.exec > } > > it crashes miserably. > > Any suggestion ? > > Thank you ! > > Stefan --nextPart4113350.f7VrQSeO3d Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQBDVLnDJSFeitOo3lcRAuIAAKCBRkrLnst0GU80REJS+qK3aMqbxwCeJZSv qfkPBefao6zHdehWG+ZVaW4= =Nu5M -----END PGP SIGNATURE----- --nextPart4113350.f7VrQSeO3d-- --===============2038624149== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kde-bindings mailing list Kde-bindings@kde.org https://mail.kde.org/mailman/listinfo/kde-bindings --===============2038624149==--