关于QThread,无F*k说的。文档说的差不多,更多的是看到很多人提到Qt开发者之一的“你TM的做错了(You're doing it wrong...)”,这位大哥2010年写的博客,下面评论很多,但主要还是集中在2010年。8年过去了,文档更新了不少,不过在项目中还是可见到他不推荐的那种方式的使用(继承QThread并在构造函数中moveToThread(this))。读到一个评论,就是“你TM这不叫Thread,这叫ThreadControl”。
This is pretty old by now but I’ve just found it and I have to say: Thank you! Now QThread makes so much more sense to me. My suggestion: Don’t call it QThread if it isn’t a thread. Call it QThreadControl and I would’ve been fine from the start. (Would’ve been too if I had read the Qt-sources earlier).
也确实啊,在众多其他语言的多线程中,至少在java的多线程不这样,python多线程不这样,oc不这样。哪有我正策马奔腾的run在其他线程时,调用个自家的函数就跳回到调用线程里了?
那个大哥已经不在Qt了,但看github还是在项目里。
Work Life
I am currently working for Telenor Digital on the Appear.in project. Prior to Appear.in, I worked on the Comoyo View video-on-demand product until it was canceled in September 2013.
I worked at Trolltech AS, later Trolltech ASA, from 2000 until the Nokia acquisition in 2008. I continued with Nokia until 2012 when I left to join Telenor Digital. During this time I worked on the Qt Project.
“用了opensource版就这么叽叽喳喳的,要是收费版你不是要上天?”