diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/phonon/ds9/backendnode.cpp | 2 | ||||
-rw-r--r-- | src/gui/egl/qegl_wince.cpp | 3 | ||||
-rw-r--r-- | src/gui/image/qimage.cpp | 55 | ||||
-rw-r--r-- | src/gui/image/qimage.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 9 | ||||
-rw-r--r-- | src/multimedia/base/qmediaserviceprovider.cpp | 4 | ||||
-rw-r--r-- | src/multimedia/base/qtmedianamespace.h | 2 | ||||
-rw-r--r-- | src/multimedia/base/qtmedianamespace.qdoc | 2 | ||||
-rw-r--r-- | src/plugins/imageformats/jpeg/qjpeghandler.cpp | 20 | ||||
-rw-r--r-- | src/plugins/mediaservices/qt7/qt7movieviewoutput.mm | 6 |
10 files changed, 86 insertions, 18 deletions
diff --git a/src/3rdparty/phonon/ds9/backendnode.cpp b/src/3rdparty/phonon/ds9/backendnode.cpp index 3afcafa..737ab7b 100644 --- a/src/3rdparty/phonon/ds9/backendnode.cpp +++ b/src/3rdparty/phonon/ds9/backendnode.cpp @@ -67,7 +67,7 @@ namespace Phonon if (info.pGraph) { HRESULT hr = info.pGraph->RemoveFilter(filter); - if (hr == VFW_E_NOT_STOPPED && m_mediaObject) { + if (FAILED(hr) && m_mediaObject) { m_mediaObject->ensureStopped(); hr = info.pGraph->RemoveFilter(filter); diff --git a/src/gui/egl/qegl_wince.cpp b/src/gui/egl/qegl_wince.cpp index c07b20b..2d08805 100644 --- a/src/gui/egl/qegl_wince.cpp +++ b/src/gui/egl/qegl_wince.cpp @@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE EGLNativeDisplayType QEgl::nativeDisplay() { - HWND win = (static_cast<QWidget*>(device))->winId(); - HDC myDc = GetDC(win); + HDC myDc = GetDC(0); if (!myDc) { qWarning("QEglContext::nativeDisplay(): WinCE display is not open"); return EGL_DEFAULT_DISPLAY; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 6bcf72b..94307de 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -480,9 +480,12 @@ bool QImageData::checkForAlphaPixels() const \row \o Low-level information \o + The depth() function returns the depth of the image. The supported - depths are 1 (monochrome), 8 and 32 (for more information see the - \l {QImage#Image Formats}{Image Formats} section). + depths are 1 (monochrome), 8, 16, 24 and 32 bits. The + bitPlaneCount() function tells how many of those bits that are + used. For more information see the + \l {QImage#Image Formats}{Image Formats} section. The format(), bytesPerLine(), and byteCount() functions provide low-level information about the data stored in the image. @@ -707,7 +710,7 @@ bool QImageData::checkForAlphaPixels() const packed with the less significant bit (LSB) first. \value Format_Indexed8 The image is stored using 8-bit indexes - into a colormap. + into a colormap. \value Format_RGB32 The image is stored using a 32-bit RGB format (0xffRRGGBB). @@ -1580,12 +1583,12 @@ QRect QImage::rect() const /*! Returns the depth of the image. - The image depth is the number of bits used to encode a single + The image depth is the number of bits used to store a single pixel, also called bits per pixel (bpp). The supported depths are 1, 8, 16, 24 and 32. - \sa convertToFormat(), {QImage#Image Formats}{Image Formats}, + \sa bitPlaneCount(), convertToFormat(), {QImage#Image Formats}{Image Formats}, {QImage#Image Information}{Image Information} */ @@ -5848,6 +5851,48 @@ bool QImage::hasAlphaChannel() const } +/*! + \since 4.7 + Returns the number of bit planes in the image. + + The number of bit planes is the number of bits of color and + transparency information for each pixel. This is different from + (i.e. smaller than) the depth when the image format contains + unused bits. + + \sa depth(), format(), {QImage#Image Formats}{Image Formats} +*/ +int QImage::bitPlaneCount() const +{ + if (!d) + return 0; + int bpc = 0; + switch (d->format) { + case QImage::Format_Invalid: + break; + case QImage::Format_RGB32: + bpc = 24; + break; + case QImage::Format_RGB666: + bpc = 18; + break; + case QImage::Format_RGB555: + bpc = 15; + break; + case QImage::Format_ARGB8555_Premultiplied: + bpc = 23; + break; + case QImage::Format_RGB444: + bpc = 12; + break; + default: + bpc = depthForFormat(d->format); + break; + } + return bpc; +} + + #ifdef QT3_SUPPORT #if defined(Q_WS_X11) QT_BEGIN_INCLUDE_NAMESPACE diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index dd13782..896061f 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -169,6 +169,7 @@ public: QT_DEPRECATED int numColors() const; #endif int colorCount() const; + int bitPlaneCount() const; QRgb color(int i) const; void setColor(int i, QRgb c); diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 9a4916e..ebc05d9 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -260,9 +260,6 @@ void QMenuPrivate::updateActionRects() const icone = style->pixelMetric(QStyle::PM_SmallIconSize, &opt, q); const int fw = style->pixelMetric(QStyle::PM_MenuPanelWidth, &opt, q); const int deskFw = style->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, &opt, q); - - const int sfcMargin = style->sizeFromContents(QStyle::CT_Menu, &opt, QApplication::globalStrut(), q).width() - QApplication::globalStrut().width(); - const int min_column_width = q->minimumWidth() - (sfcMargin + leftmargin + rightmargin + 2 * (fw + hmargin)); const int tearoffHeight = tearoff ? style->pixelMetric(QStyle::PM_MenuTearoffHeight, &opt, q) : 0; //for compatability now - will have to refactor this away.. @@ -336,7 +333,7 @@ void QMenuPrivate::updateActionRects() const if (!sz.isEmpty()) { - max_column_width = qMax(min_column_width, qMax(max_column_width, sz.width())); + max_column_width = qMax(max_column_width, sz.width()); //wrapping if (!scroll && y+sz.height()+vmargin > dh - (deskFw * 2)) { @@ -350,6 +347,10 @@ void QMenuPrivate::updateActionRects() const } max_column_width += tabWidth; //finally add in the tab width + const int sfcMargin = style->sizeFromContents(QStyle::CT_Menu, &opt, QApplication::globalStrut(), q).width() - QApplication::globalStrut().width(); + const int min_column_width = q->minimumWidth() - (sfcMargin + leftmargin + rightmargin + 2 * (fw + hmargin)); + max_column_width = qMax(min_column_width, max_column_width); + //calculate position const int base_y = vmargin + fw + topmargin + diff --git a/src/multimedia/base/qmediaserviceprovider.cpp b/src/multimedia/base/qmediaserviceprovider.cpp index 6e11079..b089b39 100644 --- a/src/multimedia/base/qmediaserviceprovider.cpp +++ b/src/multimedia/base/qmediaserviceprovider.cpp @@ -350,7 +350,7 @@ public: estimate = currentEstimate; plugin = currentPlugin; - if (currentEstimate == QtMultimedia::PreferedService) + if (currentEstimate == QtMultimedia::PreferredService) break; } } @@ -426,7 +426,7 @@ public: allServicesProvideInterface = false; } - //don't return PreferedService + //don't return PreferredService supportEstimate = qMin(supportEstimate, QtMultimedia::ProbablySupported); //Return NotSupported only if no services are available of serviceType diff --git a/src/multimedia/base/qtmedianamespace.h b/src/multimedia/base/qtmedianamespace.h index 2a56fc3..fe20a05 100644 --- a/src/multimedia/base/qtmedianamespace.h +++ b/src/multimedia/base/qtmedianamespace.h @@ -152,7 +152,7 @@ namespace QtMultimedia NotSupported, MaybeSupported, ProbablySupported, - PreferedService + PreferredService }; enum EncodingQuality diff --git a/src/multimedia/base/qtmedianamespace.qdoc b/src/multimedia/base/qtmedianamespace.qdoc index 270c7d6..58e9c92 100644 --- a/src/multimedia/base/qtmedianamespace.qdoc +++ b/src/multimedia/base/qtmedianamespace.qdoc @@ -172,7 +172,7 @@ \value NotSupported The feature is not supported. \value MaybeSupported The feature may be supported. \value ProbablySupported The feature is probably supported. - \value PreferedService The service is the preferred provider of a service. + \value PreferredService The service is the preferred provider of a service. */ /*! diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp index 3555b21..6eed824 100644 --- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp +++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp @@ -562,11 +562,29 @@ inline my_jpeg_destination_mgr::my_jpeg_destination_mgr(QIODevice *device) free_in_buffer = max_buf; } +static bool can_write_format(QImage::Format fmt) +{ + switch (fmt) { + case QImage::Format_Mono: + case QImage::Format_MonoLSB: + case QImage::Format_Indexed8: + case QImage::Format_RGB888: + case QImage::Format_RGB32: + case QImage::Format_ARGB32: + case QImage::Format_ARGB32_Premultiplied: + return true; + break; + default: + break; + } + return false; +} static bool write_jpeg_image(const QImage &sourceImage, QIODevice *device, int sourceQuality) { bool success = false; - const QImage image = sourceImage; + const QImage image = can_write_format(sourceImage.format()) ? + sourceImage : sourceImage.convertToFormat(QImage::Format_RGB888); const QVector<QRgb> cmap = image.colorTable(); struct jpeg_compress_struct cinfo; diff --git a/src/plugins/mediaservices/qt7/qt7movieviewoutput.mm b/src/plugins/mediaservices/qt7/qt7movieviewoutput.mm index b90470c..254af46 100644 --- a/src/plugins/mediaservices/qt7/qt7movieviewoutput.mm +++ b/src/plugins/mediaservices/qt7/qt7movieviewoutput.mm @@ -60,6 +60,7 @@ - (TransparentQTMovieView *) init; - (void) setDrawRect:(QRect &)rect; +- (CIImage *) view:(QTMovieView *)view willDisplayImage:(CIImage *)img; - (void) setContrast:(qreal) contrast; @end @@ -201,7 +202,10 @@ void QT7MovieViewOutput::setMovie(void *movie) void QT7MovieViewOutput::updateNaturalSize(const QSize &newSize) { - m_nativeSize = newSize; + if (m_nativeSize != newSize) { + m_nativeSize = newSize; + emit nativeSizeChanged(); + } } WId QT7MovieViewOutput::winId() const |