diff options
| author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-09-22 14:17:52 +0200 |
|---|---|---|
| committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-09-23 11:23:36 +0200 |
| commit | c5a3e5edd9e63b18abf1838c86a27a662224b02c (patch) | |
| tree | 9a367c113d9b586da73439cb100744d616ce6399 /src/widgets/kernel/qlayout.cpp | |
| parent | 3312ac91692c3a4a033d123eecbf982d3ff10471 (diff) | |
| parent | a5df2e7120412dfdedb9f4951cdb061c0f218bf7 (diff) | |
Merge remote-tracking branch 'origin/5.3' into 5.4
The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38
so manually removed code in
src/plugins/bearer/connman/qconnmanengine.cpp
Conflicts:
src/corelib/global/qglobal.h
src/corelib/tools/qcollator_macx.cpp
src/corelib/tools/qstring.cpp
src/gui/kernel/qwindow.cpp
src/gui/kernel/qwindow_p.h
src/gui/text/qtextengine.cpp
src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h
src/plugins/platforms/android/qandroidinputcontext.cpp
src/plugins/platforms/xcb/qglxintegration.cpp
src/plugins/platforms/xcb/qglxintegration.h
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/testlib/qtestcase.cpp
src/testlib/qtestlog.cpp
src/widgets/dialogs/qfiledialog.cpp
src/widgets/kernel/qwindowcontainer.cpp
tests/auto/corelib/tools/qcollator/tst_qcollator.cpp
tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
Diffstat (limited to 'src/widgets/kernel/qlayout.cpp')
| -rw-r--r-- | src/widgets/kernel/qlayout.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index eb21a580b1d..778514f47a0 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -858,6 +858,47 @@ void QLayoutPrivate::reparentChildWidgets(QWidget *mw) } /*! + Returns \c true if the \a widget can be added to the \a layout; + otherwise returns \c false. +*/ +bool QLayoutPrivate::checkWidget(QWidget *widget) const +{ + Q_Q(const QLayout); + if (!widget) { + qWarning("QLayout: Cannot add a null widget to %s/%s", q->metaObject()->className(), + qPrintable(q->objectName())); + return false; + } + if (widget == q->parentWidget()) { + qWarning("QLayout: Cannot add parent widget %s/%s to its child layout %s/%s", + widget->metaObject()->className(), qPrintable(widget->objectName()), + q->metaObject()->className(), qPrintable(q->objectName())); + return false; + } + return true; +} + +/*! + Returns \c true if the \a otherLayout can be added to the \a layout; + otherwise returns \c false. +*/ +bool QLayoutPrivate::checkLayout(QLayout *otherLayout) const +{ + Q_Q(const QLayout); + if (!otherLayout) { + qWarning("QLayout: Cannot add a null layout to %s/%s", q->metaObject()->className(), + qPrintable(q->objectName())); + return false; + } + if (otherLayout == q) { + qWarning("QLayout: Cannot add layout %s/%s to itself", q->metaObject()->className(), + qPrintable(q->objectName())); + return false; + } + return true; +} + +/*! This function is called from \c addWidget() functions in subclasses to add \a w as a managed widget of a layout. |
