summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r--src/gui/kernel/qapplication.cpp33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 7acba93..7aeab39 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -850,7 +850,7 @@ extern int qUnregisterGuiStateMachine();
void QApplicationPrivate::initialize()
{
QWidgetPrivate::mapper = new QWidgetMapper;
- QWidgetPrivate::uncreatedWidgets = new QWidgetSet;
+ QWidgetPrivate::allWidgets = new QWidgetSet;
if (qt_appType != QApplication::Tty)
(void) QApplication::style(); // trigger creation of application style
// trigger registering of QVariant's GUI types
@@ -994,23 +994,13 @@ QApplication::~QApplication()
qt_clipboard = 0;
#endif
- // delete widget mapper
- if (QWidgetPrivate::mapper) {
- QWidgetMapper * myMapper = QWidgetPrivate::mapper;
- QWidgetPrivate::mapper = 0;
- for (QWidgetMapper::ConstIterator it = myMapper->constBegin();
- it != myMapper->constEnd(); ++it) {
- register QWidget *w = *it;
- if (!w->parent()) // window
- w->destroy(true, true);
- }
- delete myMapper;
- }
+ delete QWidgetPrivate::mapper;
+ QWidgetPrivate::mapper = 0;
- // delete uncreated widgets
- if (QWidgetPrivate::uncreatedWidgets) {
- QWidgetSet *mySet = QWidgetPrivate::uncreatedWidgets;
- QWidgetPrivate::uncreatedWidgets = 0;
+ // delete all widgets
+ if (QWidgetPrivate::allWidgets) {
+ QWidgetSet *mySet = QWidgetPrivate::allWidgets;
+ QWidgetPrivate::allWidgets = 0;
for (QWidgetSet::ConstIterator it = mySet->constBegin(); it != mySet->constEnd(); ++it) {
register QWidget *w = *it;
if (!w->parent()) // window
@@ -2036,12 +2026,9 @@ QWidgetList QApplication::topLevelWidgets()
QWidgetList QApplication::allWidgets()
{
- QWidgetList list;
- if (QWidgetPrivate::mapper)
- list += QWidgetPrivate::mapper->values();
- if (QWidgetPrivate::uncreatedWidgets)
- list += QWidgetPrivate::uncreatedWidgets->toList();
- return list;
+ if (QWidgetPrivate::allWidgets)
+ return QWidgetPrivate::allWidgets->toList();
+ return QWidgetList();
}
/*!