开发者

Common Qt questions

I have learned the basics of Qt and now interested in the depths of that pretty library. Please help me to understand:

  1. Are th开发者_如何学编程e all classes derived from QObject?
  2. Why is it possible to paint on a QWidget (and derived classes)?
  3. What does the line return app.exec(); mean? What does exec() method do?
  4. Are there virtual slots? And virtual signals?

Thanks.


  1. All classes that need Qt's object model (e.g. by using signals and slots) must derive from QObject.
  2. So that you can implement your own widgets, with a customised look. Any sensible GUI library would let you do that.
  3. As documented, it enters the Qt event loop.
  4. Slots can be virtual. Since signals do not have implementation (or rather, moc generates their implementation), they cannot be made virtual.

Qt has really good and extensive documentation, if you have more questions then they are probably already answered there. Start with Programming with Qt section.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜