diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-10-02 16:02:21 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-10-02 16:02:21 (GMT) |
commit | e658bcb0e64acca9684f0897510d639af98ab552 (patch) | |
tree | 5f2f155093238f0b6e808bc0d6cb54b3bf0b6c4f /src | |
parent | bb35c5aaa2ad80eaa7f88df6d83945adbf9bde92 (diff) | |
parent | 1ffaf40f5cffca57d7e116d61935ccd034239222 (diff) | |
download | Qt-e658bcb0e64acca9684f0897510d639af98ab552.zip Qt-e658bcb0e64acca9684f0897510d639af98ab552.tar.gz Qt-e658bcb0e64acca9684f0897510d639af98ab552.tar.bz2 |
Merge branch '4.6' into mmfphonon
Diffstat (limited to 'src')
59 files changed, 315 insertions, 166 deletions
diff --git a/src/3rdparty/javascriptcore/WebKit.pri b/src/3rdparty/javascriptcore/WebKit.pri index ded4701..fd918c9 100644 --- a/src/3rdparty/javascriptcore/WebKit.pri +++ b/src/3rdparty/javascriptcore/WebKit.pri @@ -48,7 +48,7 @@ symbian|*-armcc { RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293 RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates DEFINES *= QT_NO_UITOOLS -} +} *-armcc { QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS @@ -63,7 +63,7 @@ contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools # Disable a few warnings on Windows. The warnings are also # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops -win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996 +win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 # # For builds inside Qt we interpret the output rule and the input of each extra compiler manually diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h b/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h index 19d4207..dc6b130 100644 --- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h +++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h @@ -26,7 +26,7 @@ QT_BEGIN_NAMESPACE class QObject; -class QMetaObject; +struct QMetaObject; QT_END_NAMESPACE namespace JSC { diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp index 23eef11..3cb2156 100644 --- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp +++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp @@ -1339,7 +1339,7 @@ void QtRuntimeMetaMethod::markChildren(MarkStack& markStack) markStack.append(d->m_disconnect); } -JSValue QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args) +JSValue QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSValue, const ArgList& args) { QtRuntimeMetaMethodData* d = static_cast<QtRuntimeMetaMethod *>(functionObject)->d_func(); @@ -1437,7 +1437,7 @@ QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, const Iden d->m_isConnect = isConnect; } -JSValue QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args) +JSValue QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionObject, JSValue, const ArgList& args) { QtRuntimeConnectionMethodData* d = static_cast<QtRuntimeConnectionMethod *>(functionObject)->d_func(); diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp index f745830..04405d6 100644 --- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp +++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp @@ -238,7 +238,7 @@ void XMLTokenizer::doWrite(const String& parseString) return; } -void XMLTokenizer::initializeParserContext(const char* chunk) +void XMLTokenizer::initializeParserContext(const char*) { m_parserStopped = false; m_sawError = false; diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp index aa79cb9..1113eae 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp @@ -48,7 +48,7 @@ FontCache::FontCache() { } -void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks) +void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&) { } @@ -177,7 +177,7 @@ typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCac // using Q_GLOBAL_STATIC leads to crash. TODO investigate the way to fix this. static FontPlatformDataCache* gFontPlatformDataCache = 0; -FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString& family, bool checkingAlternateName) +FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString&, bool) { if (!gFontPlatformDataCache) gFontPlatformDataCache = new FontPlatformDataCache; diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp index c29fd56..8e1e4f6 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp @@ -130,7 +130,7 @@ const FontData* FontFallbackList::fontDataForCharacters(const WebCore::Font* fon return primaryFontData(font); } -void FontFallbackList::setPlatformFont(const WebCore::FontPlatformData& platformData) +void FontFallbackList::setPlatformFont(const WebCore::FontPlatformData&) { m_familyIndex = cAllFamiliesScanned; } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp index e8eb923..c5960ac 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp @@ -197,7 +197,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon return w + run.padding(); } -int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool includePartialGlyphs) const +int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool) const { const QString string = fixSpacing(qstring(run)); QTextLayout layout(string, font()); diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp index 2f367fa..094054b 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp @@ -860,7 +860,7 @@ void GraphicsContext::drawFocusRing(const Color& color) p->setRenderHint(QPainter::Antialiasing, antiAlias); } -void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing) +void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool) { if (paintingDisabled()) return; @@ -869,8 +869,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr drawLine(origin, endPoint); } -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, - int width, bool grammar) +void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, int, bool) { if (paintingDisabled()) return; @@ -887,7 +886,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect) return FloatRect(QRectF(result)); } -void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Color &color) +void GraphicsContext::setPlatformShadow(const IntSize& size, int, const Color&) { // Qt doesn't support shadows natively, they are drawn manually in the draw* // functions @@ -1198,7 +1197,7 @@ void GraphicsContext::concatCTM(const TransformationMatrix& transform) } } -void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) +void GraphicsContext::setURLForRect(const KURL&, const IntRect&) { notImplemented(); } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp index 34c3c47..98f4606 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp @@ -47,7 +47,7 @@ PassRefPtr<Icon> Icon::createIconForFile(const String& filename) return i.release(); } -PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames) +PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&) { //FIXME: Implement this return 0; diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp index be32797..5255428 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp @@ -68,7 +68,7 @@ ImageBufferData::ImageBufferData(const IntSize& size) painter->setCompositionMode(QPainter::CompositionMode_SourceOver); } -ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, bool& success) +ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace, bool& success) : m_data(size) , m_size(size) { diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp index bf6210b..8851984 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp @@ -301,7 +301,7 @@ String ImageDecoderQt::filenameExtension() const return m_imageFormat; }; -RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t index) +RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t) { Q_ASSERT("use imageAtIndex instead"); return 0; diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp index 71c5cd4..f0d513c 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp @@ -150,7 +150,7 @@ void MediaPlayerPrivate::getSupportedTypes(HashSet<String>&) notImplemented(); } -MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs) +MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String&, const String&) { // FIXME: do the real thing notImplemented(); @@ -259,7 +259,7 @@ float MediaPlayerPrivate::currentTime() const return currentTime; } -void MediaPlayerPrivate::setEndTime(float endTime) +void MediaPlayerPrivate::setEndTime(float) { notImplemented(); } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp index f823f84..f093d7d 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp @@ -33,7 +33,7 @@ void SimpleFontData::determinePitch() m_treatAsFixedPitch = m_platformData.font().fixedPitch(); } -bool SimpleFontData::containsCharacters(const UChar*, int length) const +bool SimpleFontData::containsCharacters(const UChar*, int) const { return true; } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h b/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h index 2b2c1f7..6c417b1 100644 --- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h +++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h @@ -41,7 +41,7 @@ namespace WebCore { // FIXME: StillImages are underreporting decoded sizes and will be unable // to prune because these functions are not implemented yet. - virtual void destroyDecodedData(bool destroyAll = true) { } + virtual void destroyDecodedData(bool destroyAll = true) { Q_UNUSED(destroyAll); } virtual unsigned decodedSize() const { return 0; } virtual IntSize size() const; diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h index e85d2dc..0d98fcb 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h +++ b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h @@ -56,7 +56,7 @@ namespace WebCore { } } - void lookedUp(const QHostInfo &host) + void lookedUp(const QHostInfo&) { // we do not cache the result, we throw it away. // we currently rely on the OS to cache the results. If it does not do that diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp index 063a46b..9b1a054 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp @@ -61,7 +61,7 @@ void ContextMenu::insertItem(unsigned position, ContextMenuItem& item) m_items.insert(position, item); } -void ContextMenu::setPlatformDescription(PlatformMenuDescription menu) +void ContextMenu::setPlatformDescription(PlatformMenuDescription) { // doesn't make sense } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp index c8c0be1..b0611e6 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp @@ -119,7 +119,7 @@ bool DragData::containsURL() const return m_platformDragData->hasUrls(); } -String DragData::asURL(String* title) const +String DragData::asURL(String*) const { if (!m_platformDragData) return String(); diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp index 9ce5838..b44f2ec 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp @@ -60,7 +60,7 @@ void PopupMenu::clear() m_popup->clear(); } -void PopupMenu::populate(const IntRect& r) +void PopupMenu::populate(const IntRect&) { clear(); Q_ASSERT(client()); diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp index f250047..f505d0c 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp @@ -172,7 +172,7 @@ bool RenderThemeQt::supportsHover(const RenderStyle*) const return true; } -bool RenderThemeQt::supportsFocusRing(const RenderStyle* style) const +bool RenderThemeQt::supportsFocusRing(const RenderStyle*) const { return true; // Qt provides this through the style } @@ -274,7 +274,7 @@ Color RenderThemeQt::platformInactiveSelectionForegroundColor() const return pal.brush(QPalette::Inactive, QPalette::HighlightedText).color(); } -void RenderThemeQt::systemFont(int propId, FontDescription& fontDescription) const +void RenderThemeQt::systemFont(int, FontDescription&) const { // no-op } @@ -387,7 +387,7 @@ bool RenderThemeQt::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i return paintButton(o, i, r); } -void RenderThemeQt::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const +void RenderThemeQt::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element*) const { // Ditch the border. style->resetBorder(); @@ -584,8 +584,7 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo return false; } -void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style, - Element* e) const +void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const { // WORKAROUND because html.css specifies -webkit-border-radius for <select> so we override it here // see also http://bugs.webkit.org/show_bug.cgi?id=18399 @@ -887,13 +886,13 @@ bool RenderThemeQt::paintMediaPlayButton(RenderObject* o, const RenderObject::Pa return false; } -bool RenderThemeQt::paintMediaSeekBackButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r) +bool RenderThemeQt::paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { // We don't want to paint this at the moment. return false; } -bool RenderThemeQt::paintMediaSeekForwardButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r) +bool RenderThemeQt::paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) { // We don't want to paint this at the moment. return false; diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp index 48885d3..ccbd751 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp @@ -53,7 +53,7 @@ void ScrollView::adjustWidgetsPreventingBlittingCount(int delta) parent()->adjustWidgetsPreventingBlittingCount(delta); } -void ScrollView::platformAddChild(Widget* child) +void ScrollView::platformAddChild(Widget*) { adjustWidgetsPreventingBlittingCount(1); } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp index 7822b2c..187a5de 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp @@ -29,11 +29,11 @@ SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client) { } -void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems) +void SearchPopupMenu::saveRecentSearches(const AtomicString&, const Vector<String>&) { } -void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems) +void SearchPopupMenu::loadRecentSearches(const AtomicString&, Vector<String>&) { } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp index d37d412..814f961 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp @@ -100,7 +100,7 @@ void getSupportedKeySizes(Vector<String>&) notImplemented(); } -String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) +String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { return String(); } diff --git a/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp index 4e82080..e9c99a4 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp @@ -101,7 +101,7 @@ void Widget::hide() platformWidget()->hide(); } -void Widget::paint(GraphicsContext *, const IntRect &rect) +void Widget::paint(GraphicsContext*, const IntRect&) { } diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp index 9fada0e..6d27e20 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp @@ -83,12 +83,12 @@ void XSLStyleSheet::loadChildSheets() notImplemented(); } -void XSLStyleSheet::loadChildSheet(const String& href) +void XSLStyleSheet::loadChildSheet(const String&) { notImplemented(); } -void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent) +void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*) { notImplemented(); } diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp index 523306a..50ee427 100644 --- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp +++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp @@ -60,7 +60,7 @@ XSLTMessageHandler::XSLTMessageHandler(Document* document) } void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& description, - const QUrl& identifier, const QSourceLocation& sourceLocation) + const QUrl&, const QSourceLocation& sourceLocation) { if (!m_document->frame()) return; @@ -87,7 +87,7 @@ void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& descriptio sourceLocation.line(), sourceLocation.uri().toString()); } -bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding) +bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultString, String&) { bool success = false; diff --git a/src/3rdparty/webkit/WebKit.pri b/src/3rdparty/webkit/WebKit.pri index ded4701..fd918c9 100644 --- a/src/3rdparty/webkit/WebKit.pri +++ b/src/3rdparty/webkit/WebKit.pri @@ -48,7 +48,7 @@ symbian|*-armcc { RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293 RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates DEFINES *= QT_NO_UITOOLS -} +} *-armcc { QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS @@ -63,7 +63,7 @@ contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools # Disable a few warnings on Windows. The warnings are also # disabled in WebKitLibraries/win/tools/vsprops/common.vsprops -win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996 +win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 # # For builds inside Qt we interpret the output rule and the input of each extra compiler manually diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index fe813b8..780f862 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -873,6 +873,7 @@ int QWebFrame::scrollBarMaximum(Qt::Orientation orientation) const */ int QWebFrame::scrollBarMinimum(Qt::Orientation orientation) const { + Q_UNUSED(orientation) return 0; } diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp index 942c3ea..655fd0e 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp @@ -967,7 +967,7 @@ void QWebPagePrivate::keyReleaseEvent(QKeyEvent *ev) ev->setAccepted(handled); } -void QWebPagePrivate::focusInEvent(QFocusEvent *ev) +void QWebPagePrivate::focusInEvent(QFocusEvent*) { FocusController *focusController = page->focusController(); Frame *frame = focusController->focusedFrame(); @@ -978,7 +978,7 @@ void QWebPagePrivate::focusInEvent(QFocusEvent *ev) focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame)); } -void QWebPagePrivate::focusOutEvent(QFocusEvent *ev) +void QWebPagePrivate::focusOutEvent(QFocusEvent*) { // only set the focused frame inactive so that we stop painting the caret // and the focus frame. But don't tell the focus controller so that upon @@ -1082,7 +1082,7 @@ void QWebPagePrivate::dropEvent(QDropEvent* ev) #endif } -void QWebPagePrivate::leaveEvent(QEvent *ev) +void QWebPagePrivate::leaveEvent(QEvent*) { // Fake a mouse move event just outside of the widget, since all // the interesting mouse-out behavior like invalidating scrollbars @@ -1722,6 +1722,7 @@ void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, */ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg) { + Q_UNUSED(frame) #ifndef QT_NO_MESSAGEBOX QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok); #endif @@ -1735,6 +1736,7 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg) */ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg) { + Q_UNUSED(frame) #ifdef QT_NO_MESSAGEBOX return true; #else @@ -1753,6 +1755,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg) */ bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result) { + Q_UNUSED(frame) bool ok = false; #ifndef QT_NO_INPUTDIALOG QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok); @@ -1846,7 +1849,7 @@ static void openNewWindow(const QUrl& url, WebCore::Frame* frame) \sa action() */ -void QWebPage::triggerAction(WebAction action, bool checked) +void QWebPage::triggerAction(WebAction action, bool) { WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame(); if (!frame) @@ -2032,6 +2035,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest & bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type) #endif { + Q_UNUSED(frame) if (type == NavigationTypeLinkClicked) { switch (d->linkPolicy) { case DontDelegateLinks: @@ -2805,6 +2809,7 @@ QWebSettings *QWebPage::settings() const */ QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile) { + Q_UNUSED(parentFrame) #ifndef QT_NO_FILEDIALOG return QFileDialog::getOpenFileName(d->view, QString::null, suggestedFile); #else diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp index c7515ab..3c5f89f 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp @@ -650,6 +650,7 @@ qreal QWebView::textSizeMultiplier() const return page()->mainFrame()->textSizeMultiplier(); } +#if !defined(Q_OS_SYMBIAN) /*! \property QWebView::renderHints \since 4.6 @@ -661,6 +662,7 @@ qreal QWebView::textSizeMultiplier() const \sa QPainter::renderHints() */ +#endif QPainter::RenderHints QWebView::renderHints() const { return d->renderHints; diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h index 0f2649d..15b5836 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h @@ -53,6 +53,7 @@ class QWEBKIT_EXPORT QWebView : public QWidget { // FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject // symbol from Qt lib; it should be reverted after the right symbol is exported. +// remember to revert the qdoc \property comment as well. // See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893 #if !defined(Q_OS_SYMBIAN) Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints) diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index 5c65112..26cf6f6 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -305,7 +305,7 @@ IntRect ChromeClientQt::windowResizerRect() const return IntRect(); } -void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly) +void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool, bool) { // No double buffer, so only update the QWidget if content changed. if (contentChanged) { @@ -351,7 +351,7 @@ void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) cons emit QWebFramePrivate::kit(frame)->contentsSizeChanged(size); } -void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) +void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned) { TextDirection dir; if (result.absoluteLinkURL() != lastHoverURL @@ -402,7 +402,7 @@ void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseN #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) -void ChromeClientQt::reachedMaxAppCacheSize(int64_t spaceNeeded) +void ChromeClientQt::reachedMaxAppCacheSize(int64_t) { // FIXME: Free some space. notImplemented(); diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp index ed79946..b4400ff 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp @@ -52,7 +52,7 @@ void ContextMenuClientQt::contextMenuItemSelected(ContextMenuItem*, const Contex notImplemented(); } -void ContextMenuClientQt::downloadURL(const KURL& url) +void ContextMenuClientQt::downloadURL(const KURL&) { notImplemented(); } diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 67d974c..905e11d 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -282,9 +282,7 @@ void FrameLoaderClientQt::dispatchDidCancelClientRedirect() } -void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url, - double interval, - double fireDate) +void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url, double, double) { if (dumpFrameLoaderCallbacks) printf("%s - willPerformClientRedirectToURL: %s \n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(drtDescriptionSuitableForTestResult(url))); @@ -464,7 +462,7 @@ void FrameLoaderClientQt::postProgressFinishedNotification() emit loadFinished(m_loadError.isNull()); } -void FrameLoaderClientQt::setMainFrameDocumentReady(bool b) +void FrameLoaderClientQt::setMainFrameDocumentReady(bool) { // this is only interesting once we provide an external API for the DOM } @@ -514,13 +512,13 @@ bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const return false; } -bool FrameLoaderClientQt::representationExistsForURLScheme(const String& URLScheme) const +bool FrameLoaderClientQt::representationExistsForURLScheme(const String&) const { return false; } -String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLScheme) const +String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String&) const { notImplemented(); return String(); @@ -632,7 +630,7 @@ void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks() { } -bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const +bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const { return true; } @@ -750,7 +748,7 @@ WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore: QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8)); } -WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response) +WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse&) { notImplemented(); return ResourceError(); @@ -788,7 +786,7 @@ void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCor #endif } -void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const WebCore::ResourceRequest& request) +void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest& request) { if (dumpResourceLoadCallbacks) dumpAssignedUrls[identifier] = drtDescriptionSuitableForTestResult(request.url()); @@ -835,7 +833,7 @@ void FrameLoaderClientQt::dispatchDidReceiveContentLength(WebCore::DocumentLoade { } -void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader* loader, unsigned long) +void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long) { } @@ -1206,8 +1204,8 @@ void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget) m_hasSentResponseToPlugin = false; } -PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, - const Vector<String>& paramNames, const Vector<String>& paramValues) +PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&, + const Vector<String>&, const Vector<String>&) { notImplemented(); return 0; diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp index 340325e..3931a85 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp +++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp @@ -138,12 +138,12 @@ void InspectorClientQt::detachWindow() notImplemented(); } -void InspectorClientQt::setAttachedWindowHeight(unsigned height) +void InspectorClientQt::setAttachedWindowHeight(unsigned) { notImplemented(); } -void InspectorClientQt::highlight(Node* node) +void InspectorClientQt::highlight(Node*) { notImplemented(); } @@ -205,7 +205,7 @@ void InspectorClientQt::storeSetting(const String& key, const InspectorControlle qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type())); } -void InspectorClientQt::removeSetting(const String& key) +void InspectorClientQt::removeSetting(const String&) { notImplemented(); } diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index a440606..9d76dcc 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -194,9 +194,9 @@ public: }; enum TileRule { - Stretch, - Repeat, - Round + StretchTile, + RepeatTile, + RoundTile }; // Text formatting flags for QPainter::drawText and QLabel. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9106fa8..6f0b0ee 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -612,12 +612,6 @@ */ /*! - \enum Qt::CoordinateSystem - \value DeviceCoordinates - \value LogicalCoordinates - */ - -/*! \enum Qt::CaseSensitivity \value CaseInsensitive @@ -1220,7 +1214,7 @@ touch device will be sent as mouse events. \value WA_TouchPadAcceptSingleTouchEvents Allows touchpad single - touch events to be sent to the widget. + touch events to be sent to the widget. \value WA_DontUseStandardGestures Disables standard gestures on Qt widgets. @@ -1241,7 +1235,7 @@ \omitvalue WA_PendingUpdate \omitvalue WA_LaidOut \omitvalue WA_GrabbedShortcut - \omitvalue WA_DontShowOnScreen + \omitvalue WA_DontShowOnScreen \omitvalue WA_InvalidSize \omitvalue WA_ForceUpdatesDisabled \omitvalue WA_NoX11EventCompression @@ -1259,7 +1253,7 @@ /*! \typedef Qt::HANDLE Platform-specific handle type for system objects. This is - equivalent to \c{void *} on Mac OS X and embedded Linux, + equivalent to \c{void *} on Mac OS X and embedded Linux, and to \c{unsigned long} on X11. On Windows it is the DWORD returned by the Win32 function getCurrentThreadId(). @@ -2762,13 +2756,13 @@ This enum describes how to repeat or stretch the parts of an image when drawing. - \value Stretch Scale the image to fit to the available area. + \value StretchTile Scale the image to fit to the available area. - \value Repeat Tile the image until there is no more space. May crop - the last image. + \value RepeatTile Repeat the image until there is no more space. May + crop the last image. - \value Round Like Repeat, but scales the images down to ensure that - the last image is not cropped. + \value RoundTile Similar to Repeat, but scales the image down to + ensure that the last tile is not cropped. */ /*! @@ -2812,13 +2806,13 @@ \value NavigationModeNone Only the touch screen is used. \value NavigationModeKeypadTabOrder Qt::Key_Up and Qt::Key_Down are used to change focus. \value NavigationModeKeypadDirectional Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus. - \value NavigationModeCursorAuto The mouse cursor is used to change focus, + \value NavigationModeCursorAuto The mouse cursor is used to change focus, it is displayed only on non touchscreen devices. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad). This is the recommended setting for an application such as a web browser that needs pointer control on both touch and non-touch devices. - \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, + \value NavigationModeCursorForceVisible The mouse cursor is used to change focus, it is displayed regardless of device type. The keypad is used to implement a virtual cursor, unless the device has an analog mouse type of input device (e.g. touchpad) diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index 0474bf3..aae351c 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -539,7 +539,7 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t) int ok = 0; - if (t->interval > 10 || !t->interval || !qtimeSetEvent) { + if (t->interval > 15 || !t->interval || !qtimeSetEvent) { ok = 1; if (!t->interval) // optimization for single-shot-zero-timer QCoreApplication::postEvent(q, new QZeroTimerEvent(t->timerId)); diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 297c900..eb5fed0 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3022,6 +3022,12 @@ bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) { case Qt::Key_Escape: q->hide(); return true; +#ifdef QT_KEYPAD_NAVIGATION + case Qt::Key_Down: + case Qt::Key_Up: + return (QApplication::navigationMode() != Qt::NavigationModeKeypadTabOrder + && QApplication::navigationMode() != Qt::NavigationModeKeypadDirectional); +#endif default: break; } @@ -3142,7 +3148,17 @@ void QFileDialogListView::keyPressEvent(QKeyEvent *e) if (!d_ptr->itemViewKeyboardEvent(e)) { QListView::keyPressEvent(e); } +#ifdef QT_KEYPAD_NAVIGATION + if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder + || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) + && !hasEditFocus()) { + e->ignore(); + } else { + e->accept(); + } +#else e->accept(); +#endif } QFileDialogTreeView::QFileDialogTreeView(QWidget *parent) : QTreeView(parent) @@ -3189,7 +3205,11 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e) { int key = e->key(); QLineEdit::keyPressEvent(e); - if (key != Qt::Key_Escape) + if (key != Qt::Key_Escape +#ifdef QT_KEYPAD_NAVIGATION + && QApplication::navigationMode() == Qt::NavigationModeNone +#endif + ) e->accept(); if (hideOnEsc && (key == Qt::Key_Escape || key == Qt::Key_Return || key == Qt::Key_Enter)) { e->accept(); diff --git a/src/gui/embedded/qvfbhdr.h b/src/gui/embedded/qvfbhdr.h index f02286e..eff5fc2 100644 --- a/src/gui/embedded/qvfbhdr.h +++ b/src/gui/embedded/qvfbhdr.h @@ -56,6 +56,7 @@ QT_MODULE(Gui) #define QT_QWS_TEMP_DIR "/tmp" #endif +#ifdef QT_PRIVATE_QWS #define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2-%3") \ .arg(QT_QWS_TEMP_DIR).arg(getuid()).arg(DISPLAY) @@ -67,7 +68,22 @@ QT_MODULE(Gui) .append("/qtvfb_map") #define QT_VFB_SOUND_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ .append("/qt_soundserver") -#define QTE_PIPE "QtEmbedded" +#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/QtEmbedded") +#define QTE_PIPE_QVFB QTE_PIPE +#else +#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2") \ + .arg(QT_QWS_TEMP_DIR).arg(DISPLAY) +#define QT_VFB_MOUSE_PIPE(DISPLAY) QString("/tmp/.qtvfb_mouse-%1").arg(DISPLAY) +#define QT_VFB_KEYBOARD_PIPE(DISPLAY) QString("/tmp/.qtvfb_keyboard-%1").arg(DISPLAY) +#define QT_VFB_MAP(DISPLAY) QString("/tmp/.qtvfb_map-%1").arg(DISPLAY) +#define QT_VFB_SOUND_PIPE(DISPLAY) QString("/tmp/.qt_soundserver-%1").arg(DISPLAY) +#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \ + .append("/QtEmbedded-%1") \ + .arg(DISPLAY) +#define QTE_PIPE_QVFB(DISPLAY) QString("/tmp/qtembedded-%1/QtEmbedded-%1") \ + .arg(DISPLAY) +#endif struct QVFbHeader { diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index 4f44109..bea1e8d 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE -struct QImageData { // internal image data +struct Q_GUI_EXPORT QImageData { // internal image data QImageData(); ~QImageData(); static QImageData *create(const QSize &size, QImage::Format format, int numColors = 0); diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 4938442..326dd10 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -64,7 +64,7 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; -/*! +/* \class QSymbianFbsClient \since 4.6 \internal @@ -145,7 +145,7 @@ void QSymbianFbsHeapLock::relock() qt_symbianFbsClient()->lockHeap(); } -/*! +/* \class QSymbianBitmapDataAccess \since 4.6 \internal diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index f77d200..6cde898 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -67,6 +67,7 @@ #include <private/qt_x11_p.h> #include "qx11info_x11.h" #include <private/qdrawhelper_p.h> +#include <private/qimage_p.h> #include <stdlib.h> @@ -369,6 +370,30 @@ void QX11PixmapData::resize(int width, int height) #endif // QT_NO_XRENDER } +struct QX11AlphaDetector +{ + bool hasAlpha() const { + if (checked) + return has; + // Will implicitly also check format and return quickly for opaque types... + checked = true; + has = const_cast<QImage *>(image)->data_ptr()->checkForAlphaPixels(); + return has; + } + + bool hasXRenderAndAlpha() const { + if (!X11->use_xrender) + return false; + return hasAlpha(); + } + + QX11AlphaDetector(const QImage *i) : image(i), checked(false), has(false) { } + + const QImage *image; + mutable bool checked; + mutable bool has; +}; + void QX11PixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) { @@ -402,7 +427,9 @@ void QX11PixmapData::fromImage(const QImage &img, return; } - int dd = X11->use_xrender && img.hasAlphaChannel() ? 32 : xinfo.depth(); + QX11AlphaDetector alphaCheck(&img); + int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth(); + if (qt_x11_preferred_pixmap_depth) dd = qt_x11_preferred_pixmap_depth; @@ -454,7 +481,7 @@ void QX11PixmapData::fromImage(const QImage &img, uchar *newbits= 0; #ifndef QT_NO_XRENDER - if (X11->use_xrender && image.hasAlphaChannel()) { + if (alphaCheck.hasXRenderAndAlpha()) { const QImage &cimage = image; d = 32; @@ -1091,7 +1118,7 @@ void QX11PixmapData::fromImage(const QImage &img, } #endif - if (image.hasAlphaChannel()) { + if (alphaCheck.hasAlpha()) { QBitmap m = QBitmap::fromImage(image.createAlphaMask(flags)); setMask(m); } diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 0fae959..18cab13 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -87,6 +87,7 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() dragDropMode(QAbstractItemView::NoDragDrop), overwrite(false), dropIndicatorPosition(QAbstractItemView::OnItem), + defaultDropAction(Qt::IgnoreAction), #endif #ifdef QT_SOFTKEYS_ENABLED doneSoftKey(0), @@ -1371,6 +1372,28 @@ QAbstractItemView::DragDropMode QAbstractItemView::dragDropMode() const return NoDragDrop; } +/*! + \property QAbstractItemView::defaultDropAction + \brief the drop action that will be used by default in QAbstractItemView::drag() + + If the property is not set, the drop action is CopyAction when the supported + actions support CopyAction. + + \since 4.6 + \sa showDropIndicator dragDropOverwriteMode +*/ +void QAbstractItemView::setDefaultDropAction(Qt::DropAction dropAction) +{ + Q_D(QAbstractItemView); + d->defaultDropAction = dropAction; +} + +Qt::DropAction QAbstractItemView::defaultDropAction() const +{ + Q_D(const QAbstractItemView); + return d->defaultDropAction; +} + #endif // QT_NO_DRAGANDDROP /*! @@ -3297,7 +3320,9 @@ void QAbstractItemView::startDrag(Qt::DropActions supportedActions) drag->setMimeData(data); drag->setHotSpot(d->pressedPosition - rect.topLeft()); Qt::DropAction defaultDropAction = Qt::IgnoreAction; - if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove) + if (d->defaultDropAction != Qt::IgnoreAction && (supportedActions & d->defaultDropAction)) + defaultDropAction = d->defaultDropAction; + else if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove) defaultDropAction = Qt::CopyAction; if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction) d->clearOrRemove(); diff --git a/src/gui/itemviews/qabstractitemview.h b/src/gui/itemviews/qabstractitemview.h index 7d5c765..b4f0957 100644 --- a/src/gui/itemviews/qabstractitemview.h +++ b/src/gui/itemviews/qabstractitemview.h @@ -74,6 +74,7 @@ class Q_GUI_EXPORT QAbstractItemView : public QAbstractScrollArea Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled) Q_PROPERTY(bool dragDropOverwriteMode READ dragDropOverwriteMode WRITE setDragDropOverwriteMode) Q_PROPERTY(DragDropMode dragDropMode READ dragDropMode WRITE setDragDropMode) + Q_PROPERTY(Qt::DropAction defaultDropAction READ defaultDropAction WRITE setDefaultDropAction) #endif Q_PROPERTY(bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors) Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) @@ -181,7 +182,11 @@ public: void setDragDropMode(DragDropMode behavior); DragDropMode dragDropMode() const; + + void setDefaultDropAction(Qt::DropAction dropAction); + Qt::DropAction defaultDropAction() const; #endif + void setAlternatingRowColors(bool enable); bool alternatingRowColors() const; diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h index 84c0892..fcf381a 100644 --- a/src/gui/itemviews/qabstractitemview_p.h +++ b/src/gui/itemviews/qabstractitemview_p.h @@ -117,7 +117,7 @@ public: virtual void _q_columnsInserted(const QModelIndex &parent, int start, int end); virtual void _q_modelDestroyed(); virtual void _q_layoutChanged(); - + void fetchMore(); bool shouldEdit(QAbstractItemView::EditTrigger trigger, const QModelIndex &index) const; @@ -315,7 +315,7 @@ public: } return ref; } - + /** * return true if the index is registered as a QPersistentModelIndex */ @@ -356,8 +356,8 @@ public: Qt::KeyboardModifiers pressedModifiers; QPoint pressedPosition; bool pressedAlreadySelected; - - //forces the next mouseMoveEvent to send the viewportEntered signal + + //forces the next mouseMoveEvent to send the viewportEntered signal //if the mouse is over the viewport and not over an item bool viewportEnteredNeeded; @@ -377,6 +377,7 @@ public: QAbstractItemView::DragDropMode dragDropMode; bool overwrite; QAbstractItemView::DropIndicatorPosition dropIndicatorPosition; + Qt::DropAction defaultDropAction; #endif #ifdef QT_SOFTKEYS_ENABLED diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp index 01c64f1..634f23a 100644 --- a/src/gui/kernel/qapplication_qws.cpp +++ b/src/gui/kernel/qapplication_qws.cpp @@ -232,7 +232,7 @@ QString qws_dataDir() // Get the filename of the pipe Qt for Embedded Linux uses for server/client comms Q_GUI_EXPORT QString qws_qtePipeFilename() { - return (qws_dataDir().append(QTE_PIPE)); + return QTE_PIPE(qws_display_id); } static void setMaxWindowRect(const QRect &rect) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 0b75b06..3cfbb09 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11444,11 +11444,15 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction) QWidget *targetWidget = 0; int shortestDistance = INT_MAX; foreach(QWidget *targetCandidate, QApplication::allWidgets()) { - - if (targetCandidate->focusProxy()) //skip if focus proxy set - continue; const QRect targetCandidateRect = targetCandidate->rect().translated(targetCandidate->mapToGlobal(QPoint())); + + // For focus proxies, the child widget handling the focus can have keypad navigation focus, + // but the owner of the proxy cannot. + // Additionally, empty widgets should be ignored. + if (targetCandidate->focusProxy() || targetCandidateRect.isEmpty()) + continue; + if ( targetCandidate != sourceWidget && targetCandidate->focusPolicy() & Qt::TabFocus && !(direction == DirectionNorth && targetCandidateRect.bottom() > sourceRect.top()) diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 716300e..ac3796a 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1225,7 +1225,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin // horizontal edges switch (rules.horizontal) { - case Qt::Stretch: + case Qt::StretchTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1237,7 +1237,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawPixmap(painter, targetBottomRect, pixmap, sourceBottomRect); } break; - case Qt::Repeat: + case Qt::RepeatTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1249,7 +1249,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawHorizontallyRepeatedPixmap(painter, targetBottomRect, pixmap, sourceBottomRect); } break; - case Qt::Round: + case Qt::RoundTile: if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top()); const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top()); @@ -1265,7 +1265,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin // vertical edges switch (rules.vertical) { - case Qt::Stretch: + case Qt::StretchTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1277,7 +1277,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawPixmap(painter, targetRightRect, pixmap, sourceRightRect); } break; - case Qt::Repeat: + case Qt::RepeatTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1289,7 +1289,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin qDrawVerticallyRepeatedPixmap(painter, targetRightRect, pixmap, sourceRightRect); } break; - case Qt::Round: + case Qt::RoundTile: if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight); const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight); @@ -1308,41 +1308,41 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin const QRect targetCenterRect(targetCenterLeft, targetCenterTop, targetCenterWidth, targetCenterHeight); const QRect sourceCenterRect(sourceCenterLeft, sourceCenterTop, sourceCenterWidth, sourceCenterHeight); switch (rules.horizontal) { - case Qt::Stretch: + case Qt::StretchTile: switch (rules.vertical) { - case Qt::Stretch: // stretch stretch + case Qt::StretchTile: // stretch stretch qDrawPixmap(painter, targetCenterRect, pixmap, sourceCenterRect); break; - case Qt::Repeat: // stretch repeat + case Qt::RepeatTile: // stretch repeat qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Round: // stretch round + case Qt::RoundTile: // stretch round qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; } break; - case Qt::Repeat: + case Qt::RepeatTile: switch (rules.vertical) { - case Qt::Stretch: // repeat stretch + case Qt::StretchTile: // repeat stretch qHorizontalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Repeat: // repeat repeat + case Qt::RepeatTile: // repeat repeat qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap); break; - case Qt::Round: // repeat round + case Qt::RoundTile: // repeat round qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap); break; } break; - case Qt::Round: + case Qt::RoundTile: switch (rules.vertical) { - case Qt::Stretch: // round stretch + case Qt::StretchTile: // round stretch qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap); break; - case Qt::Repeat: // round repeat + case Qt::RepeatTile: // round repeat qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRepeatedPixmap); break; - case Qt::Round: // round round + case Qt::RoundTile: // round round qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRoundedPixmap); break; } diff --git a/src/gui/painting/qdrawutil.h b/src/gui/painting/qdrawutil.h index 3a2dd0e..22a57e9 100644 --- a/src/gui/painting/qdrawutil.h +++ b/src/gui/painting/qdrawutil.h @@ -137,22 +137,22 @@ struct QTileRules { inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule) : horizontal(horizontalRule), vertical(verticalRule) {} - inline QTileRules(Qt::TileRule rule = Qt::Stretch) + inline QTileRules(Qt::TileRule rule = Qt::StretchTile) : horizontal(rule), vertical(rule) {} Qt::TileRule horizontal; Qt::TileRule vertical; }; -Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter, - const QRect &targetRect, - const QMargins &targetMargins, +Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter, + const QRect &targetRect, + const QMargins &targetMargins, const QPixmap &pixmap, - const QRect &sourceRect, - const QMargins &sourceMargins, + const QRect &sourceRect, + const QMargins &sourceMargins, const QTileRules &rules = QTileRules()); -inline void qDrawBorderPixmap(QPainter *painter, - const QRect &target, - const QMargins &margins, +inline void qDrawBorderPixmap(QPainter *painter, + const QRect &target, + const QMargins &margins, const QPixmap &pixmap) { qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins); diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 0f3a88b..707b05e 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1126,7 +1126,7 @@ void QRenderRule::fixupBorder(int nativeWidth) void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect) { static const Qt::TileRule tileMode2TileRule[] = { - Qt::Stretch, Qt::Round, Qt::Stretch, Qt::Repeat, Qt::Stretch }; + Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile }; const QStyleSheetBorderImageData *borderImageData = border()->borderImage(); const int *targetBorders = border()->borders; diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp index c3289b4..28f3be3 100644 --- a/src/gui/widgets/qabstractslider.cpp +++ b/src/gui/widgets/qabstractslider.cpp @@ -693,13 +693,8 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) if (e->orientation() != d->orientation && !rect().contains(e->pos())) return; - int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep); - if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) - step = d->pageStep; - - qreal currentOffset = qreal(e->delta()) * step / 120; + qreal currentOffset = qreal(e->delta()) / 120; d->offset_accumulated += d->invertedControls ? -currentOffset : currentOffset; - if (int(d->offset_accumulated) == 0) { // QAbstractSlider works on integer values. So if the accumulated // offset is less than +/- 1, we need to wait until we get more @@ -708,8 +703,20 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e) return; } + // Calculate the number of steps to scroll (per 15 degrees of rotate): +#ifdef Q_OS_MAC + // On mac, since mouse wheel scrolling is accelerated and + // fine tuned by the OS, we skip applying acceleration: + int stepsToScroll = int(d->offset_accumulated); +#else + int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep); + if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) + step = d->pageStep; + int stepsToScroll = step * int(d->offset_accumulated); +#endif + int prevValue = d->value; - d->position = d->overflowSafeAdd(int(d->offset_accumulated)); // value will be updated by triggerAction() + d->position = d->overflowSafeAdd(stepsToScroll); // value will be updated by triggerAction() triggerAction(SliderMove); if (prevValue == d->value) { diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 5ff323a..5ba0571 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -886,7 +886,18 @@ void QLabel::focusInEvent(QFocusEvent *ev) void QLabel::focusOutEvent(QFocusEvent *ev) { Q_D(QLabel); - d->sendControlEvent(ev); + if (d->control) { + d->sendControlEvent(ev); + QTextCursor cursor = d->control->textCursor(); + Qt::FocusReason reason = ev->reason(); + if (reason != Qt::ActiveWindowFocusReason + && reason != Qt::PopupFocusReason + && cursor.hasSelection()) { + cursor.clearSelection(); + d->control->setTextCursor(cursor); + } + } + QFrame::focusOutEvent(ev); } diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp index 3fe9bb4..dc78fd5 100644 --- a/src/gui/widgets/qtextedit.cpp +++ b/src/gui/widgets/qtextedit.cpp @@ -174,13 +174,8 @@ void QTextEditPrivate::init(const QString &html) if (!html.isEmpty()) control->setHtml(html); -#ifdef Q_OS_MAC - hbar->setSingleStep(1); - vbar->setSingleStep(1); -#else hbar->setSingleStep(20); vbar->setSingleStep(20); -#endif viewport->setBackgroundRole(QPalette::Base); q->setAcceptDrops(true); diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 84224ec..f890d12 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -312,7 +312,7 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt return true; } case QNativeSocketEngine::AddressReusable: -#ifdef SO_REUSEPORT +#if defined(SO_REUSEPORT) && !defined(Q_OS_SYMBIAN) n = SO_REUSEPORT; #else n = SO_REUSEADDR; @@ -1018,10 +1018,12 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c if(selectForExec) { qWarning("nativeSelect (checkRead %d, checkWrite %d, ret %d, errno %d): Unexpected expectfds ready in fd %d", checkRead, checkWrite, ret, errno, socketDescriptor); - if (checkRead) - FD_SET(socketDescriptor, &fdread); - if (checkWrite) + if (checkWrite){ + FD_CLR(socketDescriptor, &fdread); FD_SET(socketDescriptor, &fdwrite); + } else if (checkRead) + FD_SET(socketDescriptor, &fdread); + if ((ret == -1) && ( errno == ECONNREFUSED || errno == EPIPE )) ret = 1; diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0402268..2327d7a 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -59,6 +59,8 @@ # include <private/qt_mac_p.h> #endif +#include <qdatetime.h> + #include <stdlib.h> // malloc #include "qpixmap.h" @@ -2077,6 +2079,8 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G #ifdef QGL_BIND_TEXTURE_DEBUG printf("QGLContextPrivate::bindTexture(), imageSize=(%d,%d), internalFormat =0x%x, options=%x\n", image.width(), image.height(), internalFormat, int(options)); + QTime time; + time.start(); #endif // Scale the pixmap if needed. GL textures needs to have the @@ -2092,7 +2096,8 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G { img = img.scaled(tx_w, tx_h); #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - upscaled to %dx%d\n", tx_w, tx_h); + printf(" - upscaled to %dx%d (%d ms)\n", tx_w, tx_h, time.elapsed()); + #endif } @@ -2112,7 +2117,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G && options & QGLContext::MipmapBindOption) { #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - generating mipmaps\n"); + printf(" - generating mipmaps (%d ms)\n", time.elapsed()); #endif #if !defined(QT_OPENGL_ES_2) glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST); @@ -2148,7 +2153,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G if (premul) { img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied); #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - converting ARGB32 -> ARGB32_Premultiplied \n"); + printf(" - converting ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed()); #endif } break; @@ -2156,7 +2161,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G if (!premul) { img = img.convertToFormat(target_format = QImage::Format_ARGB32); #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - converting ARGB32_Premultiplied -> ARGB32\n"); + printf(" - converting ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed()); #endif } break; @@ -2173,19 +2178,19 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G ? QImage::Format_ARGB32_Premultiplied : QImage::Format_ARGB32); #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - converting to 32-bit alpha format\n"); + printf(" - converting to 32-bit alpha format (%d ms)\n", time.elapsed()); #endif } else { img = img.convertToFormat(QImage::Format_RGB32); #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - converting to 32-bit\n"); + printf(" - converting to 32-bit (%d ms)\n", time.elapsed()); #endif } } if (options & QGLContext::InvertedYBindOption) { #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - flipping bits over y\n"); + printf(" - flipping bits over y (%d ms)\n", time.elapsed()); #endif int ipl = img.bytesPerLine() / 4; int h = img.height(); @@ -2199,7 +2204,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G if (externalFormat == GL_RGBA) { #ifdef QGL_BIND_TEXTURE_DEBUG - printf(" - doing byte swapping\n"); + printf(" - doing byte swapping (%d ms)\n", time.elapsed()); #endif // The only case where we end up with a depth different from // 32 in the switch above is for the RGB16 case, where we set @@ -2242,6 +2247,13 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G } #endif +#ifdef QGL_BIND_TEXTURE_DEBUG + static int totalUploadTime = 0; + totalUploadTime += time.elapsed(); + printf(" - upload done in (%d ms) time=%d\n", time.elapsed(), totalUploadTime); +#endif + + // this assumes the size of a texture is always smaller than the max cache size int cost = img.width()*img.height()*4/1024; QGLTexture *texture = new QGLTexture(q, tx_id, target, options); diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index d802bdd..971a660 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -86,9 +86,19 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) qt_egl_add_platform_config(configProps, device()); configProps.setRenderableType(QEgl::OpenGL); + QEgl::PixelFormatMatch matchType = QEgl::BestPixelFormat; + if (device()->depth() == 16) { + configProps.setValue(EGL_RED_SIZE, 5); + configProps.setValue(EGL_GREEN_SIZE, 6); + configProps.setValue(EGL_BLUE_SIZE, 5); + configProps.setValue(EGL_ALPHA_SIZE, 0); + matchType = QEgl::ExactPixelFormat; + } + configProps.setRenderableType(QEgl::OpenGL); + // Search for a matching configuration, reducing the complexity // each time until we get something that matches. - if (!d->eglContext->chooseConfig(configProps, QEgl::BestPixelFormat)) { + if (!d->eglContext->chooseConfig(configProps, matchType)) { delete d->eglContext; d->eglContext = 0; return false; diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 1ee3bbf..ae4bed0 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -48,9 +48,12 @@ #include <private/qgl_p.h> #include <private/qdrawhelper_p.h> +#include <private/qimage_p.h> #include <private/qpaintengineex_opengl2_p.h> +#include <qdesktopwidget.h> + QT_BEGIN_NAMESPACE extern QGLWidget* qt_gl_share_widget(); @@ -315,7 +318,7 @@ void QGLPixmapData::ensureCreated() const } void QGLPixmapData::fromImage(const QImage &image, - Qt::ImageConversionFlags) + Qt::ImageConversionFlags flags) { if (image.size() == QSize(w, h)) setSerialNumber(++qt_gl_pixmap_serial); @@ -323,20 +326,26 @@ void QGLPixmapData::fromImage(const QImage &image, if (pixelType() == BitmapType) { m_source = image.convertToFormat(QImage::Format_MonoLSB); + } else { - m_source = image.hasAlphaChannel() - ? image.convertToFormat(QImage::Format_ARGB32_Premultiplied) - : image.convertToFormat(QImage::Format_RGB32); + QImage::Format format = QImage::Format_RGB32; + if (qApp->desktop()->depth() == 16) + format = QImage::Format_RGB16; + + if (image.hasAlphaChannel() && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels()) + format = QImage::Format_ARGB32_Premultiplied;; + + m_source = image.convertToFormat(format); } m_dirty = true; m_hasFillColor = false; - m_hasAlpha = image.hasAlphaChannel(); + m_hasAlpha = m_source.hasAlphaChannel(); w = image.width(); h = image.height(); is_null = (w <= 0 || h <= 0); - d = pixelType() == QPixmapData::PixmapType ? 32 : 1; + d = m_source.depth(); if (m_texture.id) { QGLShareContextScope ctx(qt_gl_share_widget()->context()); diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 3a348bc..7f8577a 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -306,8 +306,13 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window) d_ptr->pb = 0; d_ptr->fbo = 0; d_ptr->ctx = 0; +#if defined (QT_OPENGL_ES_2) + d_ptr->tried_fbo = true; + d_ptr->tried_pb = true; +#else d_ptr->tried_fbo = false; d_ptr->tried_pb = false; +#endif d_ptr->destructive_swap_buffers = qgetenv("QT_GL_SWAPBUFFER_PRESERVE").isNull(); d_ptr->glDevice.d = d_ptr; d_ptr->q_ptr = this; @@ -438,6 +443,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & QRect rect = br.translated(-offset - wOffset); const GLenum target = GL_TEXTURE_2D; + Q_UNUSED(target); if (context()) { context()->makeCurrent(); diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index eb4dee1..9dea6dc 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -734,12 +734,12 @@ QT_BEGIN_NAMESPACE \sa QTest::qSleep() */ -/*! \fn void QTest::qWaitForWindowShown(QWidget *window) +/*! \fn bool QTest::qWaitForWindowShown(QWidget *window) \since 4.6 Waits until the \a window is shown in the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some - time after being asked to show itself on the screen. + time after being asked to show itself on the screen. Returns true. Example: \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 24 |