From 59d8310b05be86895c62d82daf452f38dde64083 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 24 Dec 2014 14:18:56 +0100 Subject: [PATCH] QWidget: use a static assert for a compile-time check Change-Id: I48ec9afc7e5b01e833f66b7e893237d3c68ad048 Reviewed-by: David Faure Reviewed-by: Olivier Goffart --- src/widgets/kernel/qwidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 143293b589..7b7600fdc3 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -10915,9 +10915,9 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) return; Q_D(QWidget); - Q_ASSERT_X(sizeof(d->high_attributes)*8 >= (Qt::WA_AttributeCount - sizeof(uint)*8), - "QWidget::setAttribute(WidgetAttribute, bool)", - "QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute"); + Q_STATIC_ASSERT_X(sizeof(d->high_attributes)*8 >= (Qt::WA_AttributeCount - sizeof(uint)*8), + "QWidget::setAttribute(WidgetAttribute, bool): " + "QWidgetPrivate::high_attributes[] too small to contain all attributes in WidgetAttribute"); #ifdef Q_OS_WIN // ### Don't use PaintOnScreen+paintEngine() to do native painting in some future release if (attribute == Qt::WA_PaintOnScreen && on && windowType() != Qt::Desktop && !inherits("QGLWidget")) {