glutz
glutz

Reputation: 1959

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 default?

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

Upvotes: 3

Views: 1881

Answers (3)

unwind
unwind

Reputation: 400109

They probably refer to the QMainWindow class.

Upvotes: 4

spraff
spraff

Reputation: 33435

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.

Upvotes: 2

TonyK
TonyK

Reputation: 17124

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

Upvotes: 2

Related Questions