diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 691a169269..03d6ea31e9 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -88,7 +88,9 @@ #include "qwidget_p.h" #include <QtGui/private/qwindow_p.h> -#include "qaction_p.h" +#if QT_CONFIG(action) +# include "qaction_p.h" +#endif #include "qlayout_p.h" #if QT_CONFIG(graphicsview) #include "QtWidgets/qgraphicsproxywidget.h" @@ -192,7 +194,15 @@ QWidgetPrivate::QWidgetPrivate(int version) return; } - checkForIncompatibleLibraryVersion(version); +#ifdef QT_BUILD_INTERNAL + // Don't check the version parameter in internal builds. + // This allows incompatible versions to be loaded, possibly for testing. + Q_UNUSED(version); +#else + if (Q_UNLIKELY(version != QObjectPrivateVersion)) + qFatal("Cannot mix incompatible Qt library (version 0x%x) with this library (version 0x%x)", + version, QObjectPrivateVersion); +#endif isWidget = true; memset(high_attributes, 0, sizeof(high_attributes)); @@ -1506,13 +1516,8 @@ QWidget::~QWidget() if (d->declarativeData) { d->wasDeleted = true; // needed, so that destroying the declarative data does the right thing - if (static_cast<QAbstractDeclarativeDataImpl*>(d->declarativeData)->ownedByQml1) { - if (QAbstractDeclarativeData::destroyed_qml1) - QAbstractDeclarativeData::destroyed_qml1(d->declarativeData, this); - } else { - if (QAbstractDeclarativeData::destroyed) - QAbstractDeclarativeData::destroyed(d->declarativeData, this); - } + if (QAbstractDeclarativeData::destroyed) + QAbstractDeclarativeData::destroyed(d->declarativeData, this); d->declarativeData = nullptr; // don't activate again in ~QObject d->wasDeleted = false; } @@ -4374,7 +4379,7 @@ void QWidget::setPalette(const QPalette &palette) widget's palette are implicitly imposed on this widget by the user). Note that this font does not take into account the palette set on \a w itself. */ -QPalette QWidgetPrivate::naturalWidgetPalette(uint inheritedMask) const +QPalette QWidgetPrivate::naturalWidgetPalette(QPalette::ResolveMask inheritedMask) const { Q_Q(const QWidget); @@ -4911,9 +4916,6 @@ void qt_qpa_set_cursor(QWidget *w, bool force) \note To obtain the contents of a QOpenGLWidget, use QOpenGLWidget::grabFramebuffer() instead. - - \note To obtain the contents of a QGLWidget (deprecated), use - QGLWidget::grabFrameBuffer() or QGLWidget::renderPixmap() instead. */ void QWidget::render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, RenderFlags renderFlags) |