diff options
author | David Boddie <dboddie@trolltech.com> | 2009-11-24 15:23:16 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-11-24 15:23:16 (GMT) |
commit | 8534bf99bb644c6ef410415333b479967155c829 (patch) | |
tree | 3fc0e267c403c8eebed3d4ece7fec5f6575432fb /src | |
parent | 97aa8ad5ec6b5d23ad023518db92fa91d5fa7fe0 (diff) | |
parent | a0c8e134a284d45520dd3a229e68dbcd155299e6 (diff) | |
download | Qt-8534bf99bb644c6ef410415333b479967155c829.zip Qt-8534bf99bb644c6ef410415333b479967155c829.tar.gz Qt-8534bf99bb644c6ef410415333b479967155c829.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qdialogbuttonbox.cpp | 24 | ||||
-rw-r--r-- | src/gui/widgets/qmdiarea.cpp | 6 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp index 2ee5751..0e859f1 100644 --- a/src/gui/widgets/qdialogbuttonbox.cpp +++ b/src/gui/widgets/qdialogbuttonbox.cpp @@ -1215,6 +1215,30 @@ bool QDialogButtonBox::event(QEvent *event) }else if (event->type() == QEvent::LanguageChange) { d->retranslateStrings(); } +#ifdef QT_SOFTKEYS_ENABLED + else if (event->type() == QEvent::ParentChange) { + QWidget *dialog = 0; + QWidget *p = this; + while (p && !p->isWindow()) { + p = p->parentWidget(); + if ((dialog = qobject_cast<QDialog *>(p))) + break; + } + + // If the parent changes, then move the softkeys + for (QHash<QAbstractButton *, QAction *>::const_iterator it = d->softKeyActions.constBegin(); + it != d->softKeyActions.constEnd(); ++it) { + QAction *current = it.value(); + QList<QWidget *> widgets = current->associatedWidgets(); + foreach (QWidget *w, widgets) + w->removeAction(current); + if (dialog) + dialog->addAction(current); + else + addAction(current); + } + } +#endif return QWidget::event(event); } diff --git a/src/gui/widgets/qmdiarea.cpp b/src/gui/widgets/qmdiarea.cpp index b3288c3..f3dbe34 100644 --- a/src/gui/widgets/qmdiarea.cpp +++ b/src/gui/widgets/qmdiarea.cpp @@ -1947,8 +1947,10 @@ QMdiSubWindow *QMdiArea::addSubWindow(QWidget *widget, Qt::WindowFlags windowFla /*! Removes \a widget from the MDI area. The \a widget must be either a QMdiSubWindow or a widget that is the internal widget of - a subwindow. Note that the subwindow is not deleted by QMdiArea - and that its parent is set to 0. + a subwindow. Note \a widget is never actually deleted by QMdiArea. + If a QMdiSubWindow is passed in its parent is set to 0 and it is + removed, but if an internal widget is passed in the child widget + is set to 0 but the QMdiSubWindow is not removed. \sa addSubWindow() */ |