From 6d87e3ed40173eac8c275d5926266359d53c74c7 Mon Sep 17 00:00:00 2001 From: Axel Rasmussen Date: Mon, 7 Jul 2014 19:50:12 -0600 Subject: [PATCH] Rename QPixelFormat enum value to avoid conflict with X.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a potential compile error where pixelformat.h would not compile if X.h from x11proto was included first, since X.h #define's GrayScale as an integer constant. Task-number: QTBUG-40087 Change-Id: I7208a204259c6d3a13b5d0cbc98a76bb54b8b494 Reviewed-by: Jørgen Lind --- src/gui/image/qimage.cpp | 4 ++-- src/gui/kernel/qpixelformat.cpp | 4 ++-- src/gui/kernel/qpixelformat.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index d8c3a8c2eb1..c48924e2fd3 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4603,7 +4603,7 @@ static const QPixelFormat pixelformats[] = { //QImage::Format_Invalid: QPixelFormat(), //QImage::Format_Mono: - QPixelFormat(QPixelFormat::GrayScale, + QPixelFormat(QPixelFormat::Grayscale, /*RED*/ 1, /*GREEN*/ 0, /*BLUE*/ 0, @@ -4616,7 +4616,7 @@ static const QPixelFormat pixelformats[] = { /*INTERPRETATION*/ QPixelFormat::UnsignedByte, /*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian), //QImage::Format_MonoLSB: - QPixelFormat(QPixelFormat::GrayScale, + QPixelFormat(QPixelFormat::Grayscale, /*RED*/ 1, /*GREEN*/ 0, /*BLUE*/ 0, diff --git a/src/gui/kernel/qpixelformat.cpp b/src/gui/kernel/qpixelformat.cpp index 436694915f2..1e3345ee7a0 100644 --- a/src/gui/kernel/qpixelformat.cpp +++ b/src/gui/kernel/qpixelformat.cpp @@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE \value Indexed The color model uses a color palette. - \value GrayScale The color model is GrayScale. + \value Grayscale The color model is Grayscale. \value CMYK The color model is CMYK. @@ -302,7 +302,7 @@ Q_STATIC_ASSERT(sizeof(QPixelFormatGrayScale) == sizeof(QPixelFormat)); \fn QPixelFormatGrayScale::QPixelFormatGrayScale(uchar channelSize, TypeInterpretation typeInterpretation = UnsignedInteger) - Constructor for creating a GrayScale format. Monochrome formats can be + Constructor for creating a Grayscale format. Monochrome formats can be described by passing 1 to \a channelSize. Its also possible to define very accurate greyscale formats using doubles to describe each pixel by passing 8 as \a channelSize and FloatingPoint as \a typeInterpretation. diff --git a/src/gui/kernel/qpixelformat.h b/src/gui/kernel/qpixelformat.h index b020a53e6d3..0e5df679f82 100644 --- a/src/gui/kernel/qpixelformat.h +++ b/src/gui/kernel/qpixelformat.h @@ -53,7 +53,7 @@ public: RGB, BGR, Indexed, - GrayScale, + Grayscale, CMYK, HSL, HSV, @@ -360,7 +360,7 @@ QPixelFormatRgb::QPixelFormatRgb(uchar red, Q_DECL_CONSTEXPR QPixelFormatGrayScale::QPixelFormatGrayScale(uchar channelSize, TypeInterpretation typeInt) Q_DECL_NOTHROW - : QPixelFormat(GrayScale, + : QPixelFormat(Grayscale, channelSize, 0, 0,