qt 讲座归来,几点摘要

2 views
Skip to first unread message

Lisong

unread,
Aug 13, 2008, 3:40:04 PM8/13/08
to Qt中文
前些日子去qt在本地开办的讲座,主要是关于multi-thread和graphic view的。笔记如下:

1. QThread或QConcurrent配合signal slot似乎足以满足一般多线程的需要。
2. Each QObject has a thread id and its events(slots) will be executed
in the thread it belongs to.
3. QConcurrent能自动识别cpu core数量。
4. graphic view新增了opengl为render engine的option。作为这一点的前提条件,QWidgets can
be rendered in QGLCanvas now. 不过似乎要通过graphic view的framework才行。看到一个demo,
一个QDialog在opengl canvas里一个tilted plane上,这年头什么OS都讲究frame, widget的3D
render effect,qt也凑热闹。据说widget会被cache在texture buffer里面,这样repaint起来不会太慢。
5. signals can be connected to signals。以前不知道,看到demo code里有,问是不是4.4新功能,结
果被告知3.x就有了。回来问组里一个qt老手,也不知道,俺们才找到平衡咧。

记得住的就这么多了。

小糊涂神

unread,
Aug 14, 2008, 5:29:04 AM8/14/08
to Qt中文
信号连接到信号这一点在书中有,幸亏我看了书,知道这么一点,我更平衡了,嘿嘿。

Lisong

unread,
Aug 15, 2008, 12:08:19 PM8/15/08
to Qt中文
你这一说,俄又不平衡咧。

Liang Qi

unread,
Aug 18, 2008, 10:15:55 AM8/18/08
to qt-c...@googlegroups.com
2008/8/13 Lisong <lison...@gmail.com>:
> 前些日子去qt在本地开办的讲座,主要是关于multi-thread和graphic view的。笔记如下:

哪里办的讲座呀?

> 1. QThread或QConcurrent配合signal slot似乎足以满足一般多线程的需要。
> 2. Each QObject has a thread id and its events(slots) will be executed
> in the thread it belongs to.

每个QThread现在都有自己的event loop了,这个是4.0就开始有的。

> 3. QConcurrent能自动识别cpu core数量。
> 4. graphic view新增了opengl为render engine的option。作为这一点的前提条件,QWidgets can
> be rendered in QGLCanvas now. 不过似乎要通过graphic view的framework才行。看到一个demo,
> 一个QDialog在opengl canvas里一个tilted plane上,这年头什么OS都讲究frame, widget的3D
> render effect,qt也凑热闹。据说widget会被cache在texture buffer里面,这样repaint起来不会太慢。

QGraphicsView view(&scene);
view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));

4.2引入QGraphicsView时就支持的。

> 5. signals can be connected to signals。以前不知道,看到demo code里有,问是不是4.4新功能,结
> 果被告知3.x就有了。回来问组里一个qt老手,也不知道,俺们才找到平衡咧。

这个好像qt2就支持的了,没用过1.x,所以不记得是不是那个时候就支持了,估计是可以的。

http://doc.trolltech.com/2.3/signalsandslots.html
It is even possible to connect a signal directly to another signal.
(This will emit the second signal immediately whenever the first is
emitted.)

> 记得住的就这么多了。

Lisong

unread,
Aug 18, 2008, 10:56:20 AM8/18/08
to Qt中文

On Aug 18, 10:15 am, "Liang Qi" <cavendish...@gmail.com> wrote:
> 2008/8/13 Lisong <lisong....@gmail.com>:
>
> > 前些日子去qt在本地开办的讲座,主要是关于multi-thread和graphic view的。笔记如下:
>
> 哪里办的讲座呀?

Morristown, New Jersey
离我公司不到20mile,又是免费的,不去白不去。
可惜没有讲webkit,这是所有topic清单。
http://www.ics.com/learning/qtquickstarts/

>
> > 1. QThread或QConcurrent配合signal slot似乎足以满足一般多线程的需要。
> > 2. Each QObject has a thread id and its events(slots) will be executed
> > in the thread it belongs to.
>
> 每个QThread现在都有自己的event loop了,这个是4.0就开始有的。

是的啦,不是新东西,只是咱们半年前刚开始学、用qt,至今还没机会用多线程,去听听就懒得自己看书了。

> > 3. QConcurrent能自动识别cpu core数量。
> > 4. graphic view新增了opengl为render engine的option。作为这一点的前提条件,QWidgets can
> > be rendered in QGLCanvas now. 不过似乎要通过graphic view的framework才行。看到一个demo,
> > 一个QDialog在opengl canvas里一个tilted plane上,这年头什么OS都讲究frame, widget的3D
> > render effect,qt也凑热闹。据说widget会被cache在texture buffer里面,这样repaint起来不会太慢。
>
> QGraphicsView view(&scene);
> view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));

就是这个东东了,graphics view用opengl做render engine.

> 4.2引入QGraphicsView时就支持的。
>
> > 5. signals can be connected to signals。以前不知道,看到demo code里有,问是不是4.4新功能,结
> > 果被告知3.x就有了。回来问组里一个qt老手,也不知道,俺们才找到平衡咧。
>
> 这个好像qt2就支持的了,没用过1.x,所以不记得是不是那个时候就支持了,估计是可以的。
>
> http://doc.trolltech.com/2.3/signalsandslots.html
> It is even possible to connect a signal directly to another signal.
> (This will emit the second signal immediately whenever the first is
> emitted.)

听讲座的时候,也有许多人都说不知道可以这样用,看来还是读书不仔细。

>
> > 记得住的就这么多了。

Liang Qi

unread,
Aug 18, 2008, 11:19:26 AM8/18/08
to qt-c...@googlegroups.com
2008/8/18 Lisong <lison...@gmail.com>:

>
> On Aug 18, 10:15 am, "Liang Qi" <cavendish...@gmail.com> wrote:
>> 2008/8/13 Lisong <lisong....@gmail.com>:
>>
>> > 前些日子去qt在本地开办的讲座,主要是关于multi-thread和graphic view的。笔记如下:
>>
>> 哪里办的讲座呀?
>
> Morristown, New Jersey
> 离我公司不到20mile,又是免费的,不去白不去。
> 可惜没有讲webkit,这是所有topic清单。
> http://www.ics.com/learning/qtquickstarts/

我还以为是国内办的讲座呢,hehe。

ICS和KDAB是Trolltech的培训合作伙伴,欧美的这种机会比较多。

阿牛

unread,
Sep 8, 2008, 8:51:40 AM9/8/08
to Qt中文


> 5. signals can be connected to signals。以前不知道,看到demo code里有,问是不是4.4新功能,结
> 果被告知3.x就有了。回来问组里一个qt老手,也不知道,俺们才找到平衡咧。

这个在qtopia2里面就使了,
呵呵,现在都到qt4了。
Reply all
Reply to author
Forward
0 new messages