Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Cleaning the attic III: Cooperative MT Qt apps using GNU pth

This is some­thing I wrote in March of 2000, about how to write a co­op­er­a­tive­ly mul­ti­thread­ing app us­ing Qt and GNU Pth.

Amaz­ing­ly enough, I think it still may have some lit­tle val­ue :-)

The syn­tax is prob­a­bly wrong con­sid­er­ing Qt has gone from 2.0 to 3.2 and Pth from 1.0 to 2.0, but it should work as a rough guide.

One fun­ny bit: I had no copies of this. So, it's a good thing the In­ter­net nev­er for­gets :-)

And so does uqbar

It's bet­ter than I re­mem­ber. Spe­cial­ly be­cause the SF CVS ver­sion is new­er than all the copies I had on disk (I won­der how that hap­pened).

In fac­t, it has a nice trick to cre­ate er­ror di­alogs from any ex­cep­tion I am lift­ing right away for oth­er apps :-)

The on­ly prob­lem it does have is that python's url­lib and url­lib2 sup­port for FTP seems to suck.

You can't choose the user­name and pass­word?

Sailor (Guten­berg's main server) is picky about the pass­word you send, and ralsi­na@rober­to, which url­lib in­sist on us­ing (user­name@host­name) does­n't pass muster.

And ft­plib, which can do the right thing, does­n't let me give progress of the down­load, which would make the pro­gram aw­ful.

Oh, well.

KRsN lives!

Yeah, I fixed the same bug that was mak­ing im­ages/what­ev­er not work in Not­ty, (and that is, of course, a fea­ture of py­browser), and it work­s!.

So, I can now skim all my news quick­ly again :-)

As soon as I re­lease Not­ty (it's pret­ty close), KRsN is the next in the pipe­line to get a scrub­bing and a re­lease.

Of course, any­thing can hap­pen, like a re­al­ly good date, then ev­ery­thing goes on hold for a cou­ple of weeks or months ;-)

PyBrowser: a nicer QTextBrowser

Here's the code for a mod­i­fied QTextBrows­er I am us­ing. I hope it's use­ful for some­one else, too :-)

The main dif­fer­ences:

  • It can open URLs

  • Im­ages re­f­er­enced from the text work

  • It prints (s­­tolen shame­­less­­ly from helpview­er)

It's in the pub­lic do­main, en­joy!

Good news in PyQt

Phil´s sup­port is great. That´s good enough news, but he helped me make im­ages-and-http-in-q­textbrows­er work again.

I think I will pack­age that wid­get neat­ly, be­cause it´s of gen­er­al use­ful­ness.


Contents © 2000-2024 Roberto Alsina