开发者

What is the "main widget" in QT?

I've seen the main widget referenced in a few QT docs. Does this simply refer to the first widget created after QApplication?

If so, is it automatically the widget to which all user events are sent by def开发者_JAVA技巧ault?

If not, could you explain what i'm missing?


They probably refer to the QMainWindow class.


In Qt, any parentless widget is a top-level window by default. Any widget type could be your "main" window. You can have more than one. It's a convention, not a technicality.

QMainWindow incorporates a lot of common features and I recommend you start there unless you want something unusual.


The mainWidget is a Qt 3 relic, and is no longer actively supported. Its Qt 4 counterpart is the QMainWindow class.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜