diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-12-24 14:18:56 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-12-25 15:08:01 +0100 |
commit | 59d8310b05be86895c62d82daf452f38dde64083 (patch) | |
tree | d080be95638afdb52406e2473e14c13ef36ab8e0 | |
parent | 462be988b6ce2958605177ad3c8dd87210d9ec19 (diff) | |
download | qtbase-59d8310b05be86895c62d82daf452f38dde64083.tar.gz |
QWidget: use a static assert for a compile-time check
Change-Id: I48ec9afc7e5b01e833f66b7e893237d3c68ad048
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 6 |
1 files 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")) { |