From dade8b3a709d6889e049f8a20de5378e7bb28beb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 22 Apr 2009 08:27:59 +0200 Subject: Fix the code snippet for executing a test, it should be CONFIG not QT Task-number: 251848 Reviewed-by: TrustMe --- doc/src/snippets/code/doc_src_qtestlib.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/doc_src_qtestlib.qdoc b/doc/src/snippets/code/doc_src_qtestlib.qdoc index ff52b2f..494fa10 100644 --- a/doc/src/snippets/code/doc_src_qtestlib.qdoc +++ b/doc/src/snippets/code/doc_src_qtestlib.qdoc @@ -61,7 +61,7 @@ void TestQString::toUpper() //! [9] -/myTestDirectory$ qmake -project "QT += testlib" +/myTestDirectory$ qmake -project "CONFIG += testlib" /myTestDirectory$ qmake /myTestDirectory$ make //! [9] -- cgit v0.12 From e5fa2cf55c8370ca58f82ba1ef37a54649bd42c8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 22 Apr 2009 08:32:21 +0200 Subject: Fix my previous commit since I missed the q out of qtestlib Task-number: 251848 Reviewed-by: TrustMe --- doc/src/snippets/code/doc_src_qtestlib.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/snippets/code/doc_src_qtestlib.qdoc b/doc/src/snippets/code/doc_src_qtestlib.qdoc index 494fa10..a0e4944 100644 --- a/doc/src/snippets/code/doc_src_qtestlib.qdoc +++ b/doc/src/snippets/code/doc_src_qtestlib.qdoc @@ -61,7 +61,7 @@ void TestQString::toUpper() //! [9] -/myTestDirectory$ qmake -project "CONFIG += testlib" +/myTestDirectory$ qmake -project "CONFIG += qtestlib" /myTestDirectory$ qmake /myTestDirectory$ make //! [9] -- cgit v0.12 From 9792ddf1e5d3f5e6713765b53ea031fa4e6eff4e Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Wed, 22 Apr 2009 09:30:00 +0200 Subject: Fix double entries in the sidebar of QFileDialog The problem is QUrl == operator is case sensitive. On Windows we don't want double entries for C:\dev or c:\dev so i convert the url in lower case and compare them (on Windows only) to avoid duplicate entries. Task-number:226483 Reviewed-by:jasplin --- src/gui/dialogs/qsidebar.cpp | 4 ++++ tests/auto/qsidebar/tst_qsidebar.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/gui/dialogs/qsidebar.cpp b/src/gui/dialogs/qsidebar.cpp index bfdb37e..26108d7 100644 --- a/src/gui/dialogs/qsidebar.cpp +++ b/src/gui/dialogs/qsidebar.cpp @@ -248,7 +248,11 @@ void QUrlModel::addUrls(const QList &list, int row, bool move) if (!url.isValid() || url.scheme() != QLatin1String("file")) continue; for (int j = 0; move && j < rowCount(); ++j) { +#if defined(Q_OS_WIN) + if (index(j, 0).data(UrlRole).toUrl().toLocalFile().toLower() == url.toLocalFile().toLower()) { +#else if (index(j, 0).data(UrlRole) == url) { +#endif removeRow(j); if (j <= row) row--; diff --git a/tests/auto/qsidebar/tst_qsidebar.cpp b/tests/auto/qsidebar/tst_qsidebar.cpp index 7a262e6..705e222 100644 --- a/tests/auto/qsidebar/tst_qsidebar.cpp +++ b/tests/auto/qsidebar/tst_qsidebar.cpp @@ -176,6 +176,32 @@ void tst_QSidebar::addUrls() qsidebar.addUrls(urls, -1); qsidebar.addUrls(moreUrls, -1); QCOMPARE(qsidebar.urls()[0], urls[0]); + + QList doubleUrls; + //tow exact same paths, we have only one entry + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 1); + +#if defined(Q_OS_WIN) + //Windows is case insensitive so no duplicate entries in that case + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath().toUpper()); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 1); +#else + //Two different paths we should have two entries + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath()); + doubleUrls << QUrl::fromLocalFile(QDir::home().absolutePath().toUpper()); + qsidebar.setUrls(emptyUrls); + qsidebar.addUrls(doubleUrls, 1); + QCOMPARE(qsidebar.urls().size(), 2); +#endif + + } void tst_QSidebar::goToUrl() -- cgit v0.12 From a9d0e4f830687b33c3a93cce2a3b8d77cc3546cc Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 22 Apr 2009 10:47:11 +0200 Subject: Compile fix for static builds on Windows for QtOpenGL apps. Reviewed-by: Thiago --- src/opengl/qwindowsurface_gl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 837ccf2..b41adf9 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE // QGLGraphicsSystem // #ifdef Q_WS_WIN -Q_GUI_EXPORT bool qt_win_owndc_required; +extern Q_GUI_EXPORT bool qt_win_owndc_required; #endif QGLGraphicsSystem::QGLGraphicsSystem() : QGraphicsSystem() -- cgit v0.12 From 5cba8ea7d6b793ba0012dfc387e6859ace7c664a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Tue, 21 Apr 2009 16:59:55 +0200 Subject: Fix more NaNs in Elastic Nodes example Don't try to draw zero-length lines. Don't draw lines if nodes are superimposed. Reviewed-by: Andreas --- examples/graphicsview/elasticnodes/edge.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/graphicsview/elasticnodes/edge.cpp b/examples/graphicsview/elasticnodes/edge.cpp index e32a35a..eb02143 100644 --- a/examples/graphicsview/elasticnodes/edge.cpp +++ b/examples/graphicsview/elasticnodes/edge.cpp @@ -96,7 +96,7 @@ void Edge::adjust() prepareGeometryChange(); - if (!qFuzzyCompare(length, qreal(0.0))) { + if (length > qreal(20.)) { QPointF edgeOffset((line.dx() * 10) / length, (line.dy() * 10) / length); sourcePoint = line.p1() + edgeOffset; destPoint = line.p2() - edgeOffset; @@ -124,12 +124,15 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) if (!source || !dest) return; - // Draw the line itself QLineF line(sourcePoint, destPoint); + if (qFuzzyCompare(line.length(), qreal(0.))) + return; + + // Draw the line itself painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter->drawLine(line); - // Draw the arrows if there's enough room + // Draw the arrows double angle = ::acos(line.dx() / line.length()); if (line.dy() >= 0) angle = TwoPi - angle; -- cgit v0.12 From e8468f21d24b85114a8841413f9328a17f7bc54d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 22 Apr 2009 12:05:08 +0200 Subject: Fix crash in drawPixmap when painting on a null pixmap We need to check if the engine is null before we do the thread test. Reviewed-by: Thiago --- src/gui/painting/qpainter.cpp | 6 +++--- tests/auto/qpainter/tst_qpainter.cpp | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index ffb273e..65d87fa 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5167,6 +5167,9 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm) Q_D(QPainter); + if (!d->engine) + return; + #ifndef QT_NO_DEBUG qt_painter_thread_test(d->device->devType(), "drawPixmap()"); #endif @@ -5176,9 +5179,6 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm) return; } - if (!d->engine) - return; - qreal x = p.x(); qreal y = p.y(); diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index 8b43f9b..c81bf67 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -3792,8 +3792,11 @@ void tst_QPainter::imageBlending() void tst_QPainter::paintOnNullPixmap() { + QPixmap pix(16, 16); + QPixmap textPixmap; QPainter p(&textPixmap); + p.drawPixmap(10, 10, pix); p.end(); QPixmap textPixmap2(16,16); -- cgit v0.12 From 7ba85aba8686d83dc8557a9fb6d4504fbbeec349 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 22 Apr 2009 11:58:41 +0200 Subject: Fix Transformed driver on 8-bit displays Task-number: 250971 Reviewed-by: Tom --- src/gui/embedded/qscreentransformed_qws.cpp | 4 +++- src/gui/painting/qmemrotate.cpp | 1 + src/gui/painting/qmemrotate_p.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/embedded/qscreentransformed_qws.cpp b/src/gui/embedded/qscreentransformed_qws.cpp index f988789..46ac1d1 100644 --- a/src/gui/embedded/qscreentransformed_qws.cpp +++ b/src/gui/embedded/qscreentransformed_qws.cpp @@ -410,7 +410,9 @@ void QTransformedScreen::blit(const QImage &image, const QPoint &topLeft, #endif #ifdef QT_QWS_DEPTH_8 case 8: - if (image.depth() == 16) + if (image.format() == QImage::Format_RGB444) + SET_BLIT_FUNC(quint8, qrgb444, trans, func); + else if (image.depth() == 16) SET_BLIT_FUNC(quint8, quint16, trans, func); else SET_BLIT_FUNC(quint8, quint32, trans, func); diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp index 7ad0e42..4058143 100644 --- a/src/gui/painting/qmemrotate.cpp +++ b/src/gui/painting/qmemrotate.cpp @@ -537,6 +537,7 @@ QT_IMPL_MEMROTATE(quint32, quint24) QT_IMPL_MEMROTATE(quint32, quint18) QT_IMPL_MEMROTATE(quint32, quint8) QT_IMPL_MEMROTATE(quint16, quint8) +QT_IMPL_MEMROTATE(qrgb444, quint8) QT_IMPL_MEMROTATE(quint8, quint8) #ifdef QT_QWS_DEPTH_GENERIC QT_IMPL_MEMROTATE(quint32, qrgb_generic16) diff --git a/src/gui/painting/qmemrotate_p.h b/src/gui/painting/qmemrotate_p.h index bd6006b..c1eb93e 100644 --- a/src/gui/painting/qmemrotate_p.h +++ b/src/gui/painting/qmemrotate_p.h @@ -90,6 +90,7 @@ QT_DECL_MEMROTATE(quint32, quint24); QT_DECL_MEMROTATE(quint32, quint18); QT_DECL_MEMROTATE(quint32, quint8); QT_DECL_MEMROTATE(quint16, quint8); +QT_DECL_MEMROTATE(qrgb444, quint8); QT_DECL_MEMROTATE(quint8, quint8); #ifdef QT_QWS_DEPTH_GENERIC QT_DECL_MEMROTATE(quint32, qrgb_generic16); -- cgit v0.12 From 1b1da000ba15530f2070a57ea97bb3166fb67331 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 22 Apr 2009 22:11:22 +1000 Subject: Make make_qfeatures_dot_h script generate the current copyright header. Update the script, and update the generated file. Reviewed-by: Thiago Reviewed-by: Paul Olav Tvete --- src/corelib/global/qfeatures.h | 54 +++++++++++++++++++-------------------- util/scripts/make_qfeatures_dot_h | 41 +++++++++++++++++++++++++---- 2 files changed, 63 insertions(+), 32 deletions(-) diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h index 6d55f7c..2189723 100644 --- a/src/corelib/global/qfeatures.h +++ b/src/corelib/global/qfeatures.h @@ -120,6 +120,9 @@ // QMovie //#define QT_NO_MOVIE +// QNetworkInterface +//#define QT_NO_NETWORKINTERFACE + // QNetworkProxy //#define QT_NO_NETWORKPROXY @@ -198,12 +201,12 @@ // Qt Prerendered Font Format //#define QT_NO_QWS_QPF -// Raster Paint Engine callback functions -//#define QT_NO_RASTERCALLBACKS - // Qt Prerendered Font Format 2 //#define QT_NO_QWS_QPF2 +// Raster Paint Engine callback functions +//#define QT_NO_RASTERCALLBACKS + // Resize Handler //#define QT_NO_RESIZEHANDLER @@ -273,9 +276,6 @@ // HtmlParser //#define QT_NO_TEXTHTMLPARSER -// OdfWriter -//#define QT_NO_TEXTODFWRITER - // QTextStream //#define QT_NO_TEXTSTREAM @@ -316,6 +316,11 @@ #define QT_NO_BUTTONGROUP #endif +// QClipboard +#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES)) +#define QT_NO_CLIPBOARD +#endif + // Codecs #if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) #define QT_NO_CODECS @@ -376,11 +381,6 @@ #define QT_NO_PHONON_VOLUMESLIDER #endif -// QPrinter -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM)) -#define QT_NO_PRINTER -#endif - // QProcess #if !defined(QT_NO_PROCESS) && (defined(QT_NO_THREAD)) #define QT_NO_PROCESS @@ -481,11 +481,6 @@ #define QT_NO_XMLSTREAMWRITER #endif -// Odf Writer -#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) -#define QT_NO_TEXTODFWRITER -#endif - // Context menu #if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) #define QT_NO_CONTEXTMENU @@ -511,11 +506,21 @@ #define QT_NO_LIBRARY #endif +// QPrinter +#if !defined(QT_NO_PRINTER) && (defined(QT_NO_TEXTSTREAM) || defined(QT_NO_PICTURE)) +#define QT_NO_PRINTER +#endif + // QScrollArea #if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) #define QT_NO_SCROLLAREA #endif +// OdfWriter +#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) +#define QT_NO_TEXTODFWRITER +#endif + // QToolButton #if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ICON) || defined(QT_NO_ACTION)) #define QT_NO_TOOLBUTTON @@ -636,16 +641,6 @@ #define QT_NO_WHATSTHIS #endif -// QClipboard -#if !defined(QT_NO_CLIPBOARD) && (defined(QT_NO_QWS_PROPERTIES)) -#define QT_NO_CLIPBOARD -#endif - -// Common UNIX Printing System -#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) -#define QT_NO_CUPS -#endif - // QDirModel #if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS)) #define QT_NO_DIRMODEL @@ -726,6 +721,11 @@ #define QT_NO_COMPLETER #endif +// Common UNIX Printing System +#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) +#define QT_NO_CUPS +#endif + // QDataWidgetMapper #if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) #define QT_NO_DATAWIDGETMAPPER @@ -757,7 +757,7 @@ #endif // QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_PICTURE)) +#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER)) #define QT_NO_PRINTPREVIEWWIDGET #endif diff --git a/util/scripts/make_qfeatures_dot_h b/util/scripts/make_qfeatures_dot_h index c434649..5ca8c88 100755 --- a/util/scripts/make_qfeatures_dot_h +++ b/util/scripts/make_qfeatures_dot_h @@ -2,9 +2,9 @@ # # Usage: make_qfeatures_dot_h # -# Generates core/base/qfeatures.h from core/base/qfeatures.txt. +# Generates src/corelib/global/qfeatures.h from src/corelib/global/qfeatures.txt. # -# The tools/qfeatures.txt file can contain redundancies, and this program +# The qfeatures.txt file can contain redundancies, and this program # will show them. # @@ -85,11 +85,42 @@ open OUT, ">$ENV{QTDIR}/src/corelib/global/qfeatures.h" print OUT "/**************************************************************************** ** -** Copyright (C) 1992-\$THISYEAR\$ \$TROLLTECH\$. All rights reserved. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info\@nokia.com) ** -** This file is part of the \$MODULE\$ of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** -** \$TROLLTECH_DUAL_LICENSE\$ +** \$QT_BEGIN_LICENSE:LGPL\$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales\@nokia.com. +** \$QT_END_LICENSE\$ ** ****************************************************************************/ -- cgit v0.12 From fa4049c9ba8446a582a9bd003d5cdf98ae0505eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Wed, 22 Apr 2009 13:25:56 +0200 Subject: Doc fixes Reviewed-by: Thiago --- doc/src/phonon-api.qdoc | 4 ++-- src/corelib/kernel/qcoreevent.cpp | 1 + src/gui/kernel/qapplication.cpp | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/src/phonon-api.qdoc b/doc/src/phonon-api.qdoc index 3d04c68..501b5a5 100644 --- a/doc/src/phonon-api.qdoc +++ b/doc/src/phonon-api.qdoc @@ -4457,12 +4457,12 @@ */ /*! - \fn QList Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, HideAdvancedDevicesOverride override = FromSettings) const + \fn QList Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const \internal */ /*! - \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category) const + \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const \internal */ diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 3fcfc98..11a2d3c 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -260,6 +260,7 @@ QT_BEGIN_NAMESPACE \omitvalue ApplicationActivated \omitvalue ApplicationDeactivated \omitvalue MacGLWindowChange + \omitvalue MacGLClearDrawable \omitvalue NetworkReplyUpdated \omitvalue FutureCallOut \omitvalue CocoaRequestModal diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 09f0f91..1624b9d 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -832,12 +832,13 @@ QApplication::QApplication(Display *dpy, int &argc, char **argv, #endif // Q_WS_X11 +extern void qInitDrawhelperAsm(); /*! + \fn void QApplicationPrivate::initialize() + Initializes the QApplication object, called from the constructors. */ -extern void qInitDrawhelperAsm(); - void QApplicationPrivate::initialize() { QWidgetPrivate::mapper = new QWidgetMapper; -- cgit v0.12 From 1187d1b2063b42378d9cd1a940bcd7eecb24fb69 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 22 Apr 2009 23:32:40 +1000 Subject: Make all qdoc footers consistent with the main Qt docs. Use the same copyright message in all doc footers. As a side-effect, this change also removes most of the remaining THISYEAR placeholders, and fixes some footers that try to use 110% of the page width. Reviewed-by: Thiago --- tools/assistant/tools/assistant/doc/assistant.qdocconf | 3 +-- tools/qdoc3/test/carbide-eclipse-integration.qdocconf | 6 +++--- tools/qdoc3/test/jambi.qdocconf | 2 +- tools/qdoc3/test/qt-html-templates.qdocconf | 3 +-- tools/qdoc3/test/qt-inc.qdocconf | 2 +- tools/qdoc3/test/standalone-eclipse-integration.qdocconf | 6 +++--- util/qlalr/doc/qlalr.qdocconf | 2 +- 7 files changed, 11 insertions(+), 13 deletions(-) diff --git a/tools/assistant/tools/assistant/doc/assistant.qdocconf b/tools/assistant/tools/assistant/doc/assistant.qdocconf index 0d2271d..f71bc08 100644 --- a/tools/assistant/tools/assistant/doc/assistant.qdocconf +++ b/tools/assistant/tools/assistant/doc/assistant.qdocconf @@ -10,8 +10,7 @@ description = "Qt Assistant" HTML.{postheader,address} = "" HTML.footer = "


\n" \ "\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © 2009 Nokia Corporation " \ - "and/or its subsidiary(-ies)Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt 4.5.1
" diff --git a/tools/qdoc3/test/carbide-eclipse-integration.qdocconf b/tools/qdoc3/test/carbide-eclipse-integration.qdocconf index 683048d..7fe489e 100644 --- a/tools/qdoc3/test/carbide-eclipse-integration.qdocconf +++ b/tools/qdoc3/test/carbide-eclipse-integration.qdocconf @@ -6,7 +6,7 @@ macro.TheEclipseIntegration = Carbide.c++ HTML.footer = "


\n" \ "\n" \ - "\n" \ - "\n" \ - "\n" \ + "\n" \ + "\n" \ + "\n" \ "
Copyright © 2009 Nokia CorporationTrademarks
Carbide.c++
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Carbide.c++
" diff --git a/tools/qdoc3/test/jambi.qdocconf b/tools/qdoc3/test/jambi.qdocconf index 3644b69..5288b22 100644 --- a/tools/qdoc3/test/jambi.qdocconf +++ b/tools/qdoc3/test/jambi.qdocconf @@ -41,7 +41,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © \$THISYEAR\$ TrolltechCopyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Jambi \\version
" diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf index f09192a..dc027d0 100644 --- a/tools/qdoc3/test/qt-html-templates.qdocconf +++ b/tools/qdoc3/test/qt-html-templates.qdocconf @@ -25,8 +25,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © %THISYEAR% Nokia Corporation " \ - "and/or its subsidiary(-ies)Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt \\version
" diff --git a/tools/qdoc3/test/qt-inc.qdocconf b/tools/qdoc3/test/qt-inc.qdocconf index 97893dc..18d3faf 100644 --- a/tools/qdoc3/test/qt-inc.qdocconf +++ b/tools/qdoc3/test/qt-inc.qdocconf @@ -140,7 +140,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © %THISYEAR% TrolltechCopyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt \\version
" diff --git a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf index c3c4291..08b6070 100644 --- a/tools/qdoc3/test/standalone-eclipse-integration.qdocconf +++ b/tools/qdoc3/test/standalone-eclipse-integration.qdocconf @@ -5,7 +5,7 @@ macro.TheEclipseIntegration = The Qt Eclipse Integration HTML.footer = "


\n" \ "\n" \ - "\n" \ - "\n" \ - "\n" \ + "\n" \ + "\n" \ + "\n" \ "
Copyright © 2009 Nokia CorporationTrademarks
Qt Eclipse Integration 1.4.3
Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt Eclipse Integration 1.4.3
" diff --git a/util/qlalr/doc/qlalr.qdocconf b/util/qlalr/doc/qlalr.qdocconf index d97ff7d..a97ef6a 100644 --- a/util/qlalr/doc/qlalr.qdocconf +++ b/util/qlalr/doc/qlalr.qdocconf @@ -59,7 +59,7 @@ HTML.postheader = "\n" \ "
\n" \ - "\n" \ + "\n" \ "\n" \ "\n" \ "
Copyright © \$THISYEAR\$ TrolltechCopyright © 2009 Nokia Corporation and/or its subsidiary(-ies)Trademarks
Qt \\version
" -- cgit v0.12 From f8be94bf4e8fa359bfc71a10aa7dc6b12daf5dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 22 Apr 2009 15:57:06 +0200 Subject: Fix QPrinter::pageRect() for Windows printers, when fullPage() is set. When QPrinter::fullPage() was set, pageRect() returned the same as paperRect(). Under Windows, there is always a non-printable area that was not taken into account in the fullPage() case. Task-number: 248881 Reviewed-by: Kim --- src/gui/painting/qprintengine_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp index c8674b7..7601beb 100644 --- a/src/gui/painting/qprintengine_win.cpp +++ b/src/gui/painting/qprintengine_win.cpp @@ -1532,7 +1532,7 @@ QVariant QWin32PrintEngine::property(PrintEnginePropertyKey key) const value = rect; } else { value = QTransform(1/d->stretch_x, 0, 0, 1/d->stretch_y, 0, 0) - .mapRect(d->fullPage ? d->devPaperRect : d->devPageRect); + .mapRect(d->fullPage ? d->devPhysicalPageRect : d->devPageRect); } break; -- cgit v0.12 From 3696886a327fc4894518c5570b02d5238dcede8a Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 22 Apr 2009 15:55:28 +0200 Subject: QGtkStyle: Fix broken transparency on line edits in Clearlooks This basically uses a workaround to hint to our gtk theme that we do not want it to fill our line edit backgrouns with the background brush. This was suggested by Benjamin berg. More information can be found here: https://bugzilla.mozilla.org/show_bug.cgi?id=405421 Reviewed-by: Tor Arne --- src/gui/styles/qgtkstyle.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index b7fa575..ca71da2 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -951,14 +951,15 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, "interior-focus", &interior_focus, "focus-line-width", &focus_line_width, NULL); + // See https://bugzilla.mozilla.org/show_bug.cgi?id=405421 for info about this hack + g_object_set_data(G_OBJECT(gtkEntry), "transparent-bg-hint", GINT_TO_POINTER(TRUE)); + if (!interior_focus && option->state & State_HasFocus) rect.adjust(focus_line_width, focus_line_width, -focus_line_width, -focus_line_width); - gtkPainter.paintShadow(gtkEntry, "entry", rect, option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE, GTK_SHADOW_IN, gtkEntry->style, option->state & State_HasFocus ? QLS("focus") : QString()); - if (!interior_focus && option->state & State_HasFocus) gtkPainter.paintShadow(gtkEntry, "entry", option->rect, option->state & State_Enabled ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE, -- cgit v0.12 From cf9db492ac60568bd159c3749dfa11e2347b9927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 22 Apr 2009 14:49:24 +0200 Subject: Prevent QTransform::type() from returning TxScale instead of TxProject. We have code that assumes that m33 = 1 if the type is TxScale. Instead of changing all that code it's better to just return TxProject as type when m33 is different from 1. Reviewed-by: Simon Hausmann --- src/gui/painting/qtransform.cpp | 4 ++-- tests/auto/qtransform/tst_qtransform.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index 39e429d..af27fd5 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -1880,7 +1880,7 @@ const QMatrix &QTransform::toAffine() const QTransform::TransformationType QTransform::type() const { if (m_dirty >= m_type) { - if (m_dirty > TxShear && (!qFuzzyCompare(m_13 + 1, 1) || !qFuzzyCompare(m_23 + 1, 1))) + if (m_dirty > TxShear && (!qFuzzyCompare(m_13 + 1, 1) || !qFuzzyCompare(m_23 + 1, 1) || !qFuzzyCompare(m_33, 1))) m_type = TxProject; else if (m_dirty > TxScale && (!qFuzzyCompare(affine._m12 + 1, 1) || !qFuzzyCompare(affine._m21 + 1, 1))) { const qreal dot = affine._m11 * affine._m12 + affine._m21 * affine._m22; @@ -1888,7 +1888,7 @@ QTransform::TransformationType QTransform::type() const m_type = TxRotate; else m_type = TxShear; - } else if (m_dirty > TxTranslate && (!qFuzzyCompare(affine._m11, 1) || !qFuzzyCompare(affine._m22, 1) || !qFuzzyCompare(m_33, 1))) + } else if (m_dirty > TxTranslate && (!qFuzzyCompare(affine._m11, 1) || !qFuzzyCompare(affine._m22, 1))) m_type = TxScale; else if (m_dirty > TxNone && (!qFuzzyCompare(affine._dx + 1, 1) || !qFuzzyCompare(affine._dy + 1, 1))) m_type = TxTranslate; diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp index 8516ddb..74c405e 100644 --- a/tests/auto/qtransform/tst_qtransform.cpp +++ b/tests/auto/qtransform/tst_qtransform.cpp @@ -593,6 +593,16 @@ void tst_QTransform::types() m3.translate(5.0f, 5.0f); QCOMPARE(m3.type(), QTransform::TxScale); QCOMPARE(m3.inverted().type(), QTransform::TxScale); + + m3.setMatrix(1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 2.0f); + QCOMPARE(m3.type(), QTransform::TxProject); + + m3.setMatrix(0.0f, 2.0f, 0.0f, + 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 2.0f); + QCOMPARE(m3.type(), QTransform::TxProject); } -- cgit v0.12 From cb14e8b90c71afb851c3165fc009e4fa11dd04c9 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 09:46:29 -0700 Subject: Take out STATIC_ALLOC of primary surface creation We never resize this surface anyway so it's not necessary. Make it possible to enable with an option. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 041d522..65c027d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -833,15 +833,15 @@ bool QDirectFBScreen::connect(const QString &displaySpec) description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_WIDTH); if (::setIntOption(displayArgs, QLatin1String("height"), &description.height)) description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_HEIGHT); - description.caps = DFBSurfaceCapabilities(DSCAPS_PRIMARY - | DSCAPS_DOUBLE - | DSCAPS_STATIC_ALLOC); - if (displayArgs.contains(QLatin1String("forcepremultiplied"), - Qt::CaseInsensitive)) { - description.caps = DFBSurfaceCapabilities(description.caps - | DSCAPS_PREMULTIPLIED); + uint caps = DSCAPS_PRIMARY|DSCAPS_DOUBLE; + if (displayArgs.contains(QLatin1String("static_alloc"))) + caps |= DSCAPS_STATIC_ALLOC; + + if (displayArgs.contains(QLatin1String("forcepremultiplied"), Qt::CaseInsensitive)) { + caps |= DSCAPS_PREMULTIPLIED; } + description.caps = DFBSurfaceCapabilities(caps); // We don't track the primary surface as it's released in disconnect d_ptr->dfbSurface = createDFBSurface(&description, DontTrackSurface); if (!d_ptr->dfbSurface) { -- cgit v0.12 From 5a7f626f3c6d5d5e2ceaa2c7db9de5b51deca637 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 09:41:54 -0700 Subject: Unify IDirectFBSurface->Lock() calls Certain compilers warns on this kind of code: uchar *mem = ...; (void**)(&mem) dereferencing type punned pointer etc. Since we had this for every call to Lock I put it all into a convenience function. Also fix some issues where we memcpy'ed more bytes than necessary (when stride != w * depth() / 8) and fix issue with QDirectFBScreen::solidFill with pixelFormat == RGB32 Reviewed-by: Donald --- .../gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 19 ++----- .../gfxdrivers/directfb/qdirectfbpixmap.cpp | 19 ++++--- .../gfxdrivers/directfb/qdirectfbscreen.cpp | 64 ++++++++++++++-------- src/plugins/gfxdrivers/directfb/qdirectfbscreen.h | 2 + 4 files changed, 58 insertions(+), 46 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 2a2ef5c..924090c 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -56,23 +56,16 @@ IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const } -// Locks the dfb surface and creates a QImage (lockedImage) from the pointer -void QDirectFBPaintDevice::lockDirectFB() { - +void QDirectFBPaintDevice::lockDirectFB() +{ if (lockedImage) return; // Already locked - void *mem; - int w, h; - DFBResult result = dfbSurface->Lock(dfbSurface, DSLF_WRITE, &mem, &bpl); - if (result != DFB_OK || !mem) { - DirectFBError("QDirectFBPixmapData::buffer()", result); - return; + if (uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl)) { + const QSize s = size(); + lockedImage = new QImage(mem, s.width(), s.height(), bpl, + QDirectFBScreen::getImageFormat(dfbSurface)); } - - dfbSurface->GetSize(dfbSurface, &w, &h); - lockedImage = new QImage(static_cast(mem), w, h, bpl, - QDirectFBScreen::getImageFormat(dfbSurface)); } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 0a1696a..a6017b8 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -267,16 +267,17 @@ void QDirectFBPixmapData::fill(const QColor &color) if (forceRaster) { // in DSPF_RGB32 all dfb drawing causes the Alpha byte to be // set to 0. This causes issues for the raster engine. - char *mem; - int bpl; - const int h = QPixmapData::height(); - dfbSurface->Lock(dfbSurface, DSLF_WRITE, (void**)&mem, &bpl); - const int c = color.rgba(); - for (int i = 0; i < h; ++i) { - memset(mem, c, bpl); - mem += bpl; + uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl); + if (mem) { + const int h = QPixmapData::height(); + const int w = QPixmapData::width() * 4; // 4 bytes per 32 bit pixel + const int c = color.rgba(); + for (int i = 0; i < h; ++i) { + memset(mem, c, w); + mem += bpl; + } + dfbSurface->Unlock(dfbSurface); } - dfbSurface->Unlock(dfbSurface); } else { dfbSurface->Clear(dfbSurface, color.red(), color.green(), color.blue(), color.alpha()); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 65c027d..490eeb0 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -159,15 +159,17 @@ IDirectFBSurface* QDirectFBScreen::createDFBSurface(const QImage &img, SurfaceCr IDirectFBSurface *surface = createDFBSurface(&desc, options); #ifdef QT_NO_DIRECTFB_PREALLOCATED if (surface) { - char *mem; int bpl; - surface->Lock(surface, DSLF_WRITE, (void**)&mem, &bpl); - const int h = img.height(); - for (int i = 0; i < h; ++i) { - memcpy(mem, img.scanLine(i), bpl); - mem += bpl; + uchar *mem = QDirectFBScreen::lockSurface(surface, DSLF_WRITE, &bpl); + if (mem) { + const int h = img.height(); + const int w = img.width() * img.depth() / 8; + for (int i = 0; i < h; ++i) { + memcpy(mem, img.scanLine(i), w); + mem += bpl; + } + surface->Unlock(surface); } - surface->Unlock(surface); } #endif #ifndef QT_NO_DIRECTFB_PALETTE @@ -317,15 +319,17 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img, imgSurface->Release(imgSurface); #else // QT_NO_DIRECTFB_PREALLOCATED Q_ASSERT(image.format() == pixmapFormat); - char *mem; int bpl; - dfbSurface->Lock(dfbSurface, DSLF_WRITE, (void**)&mem, &bpl); - const int w = image.width() * image.depth() / 8; - for (int i = 0; i < image.height(); ++i) { - memcpy(mem, image.scanLine(i), w); - mem += bpl; + uchar *mem = QDirectFBScreen::lockSurface(dfbSurface, DSLF_WRITE, &bpl); + if (mem) { + const int h = image.height(); + const int w = image.width() * image.depth() / 8; + for (int i=0; iUnlock(dfbSurface); } - dfbSurface->Unlock(dfbSurface); #endif return dfbSurface; } @@ -1188,23 +1192,23 @@ void QDirectFBScreen::blit(IDirectFBSurface *src, const QPoint &topLeft, points.data(), n); } +// This function is only ever called by QScreen::drawBackground which +// is only ever called by QScreen::compose which is never called with +// DirectFB so it's really a noop. void QDirectFBScreen::solidFill(const QColor &color, const QRegion ®ion) { if (region.isEmpty()) return; if (QDirectFBScreen::getImageFormat(d_ptr->dfbSurface) == QImage::Format_RGB32) { - uchar *mem; - int bpl; - d_ptr->dfbSurface->Lock(d_ptr->dfbSurface, DSLF_WRITE, (void**)&mem, &bpl); - QImage img(mem, w, h, bpl, QImage::Format_RGB32); - QPainter p(&img); - p.setBrush(color); - p.setPen(Qt::NoPen); - const QVector rects = region.rects(); - p.drawRects(rects.constData(), rects.size()); - p.end(); + data = QDirectFBScreen::lockSurface(d_ptr->dfbSurface, DSLF_WRITE, &lstep); + if (!data) + return; + + QScreen::solidFill(color, region); d_ptr->dfbSurface->Unlock(d_ptr->dfbSurface); + data = 0; + lstep = 0; } else { d_ptr->dfbSurface->SetColor(d_ptr->dfbSurface, color.red(), color.green(), color.blue(), @@ -1241,3 +1245,15 @@ bool QDirectFBScreen::initSurfaceDescriptionPixelFormat(DFBSurfaceDescription *d } return true; } + +uchar *QDirectFBScreen::lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl) +{ + void *mem; + const DFBResult result = surface->Lock(surface, flags, static_cast(&mem), bpl); + if (result != DFB_OK) { + DirectFBError("QDirectFBPixmapData::lockSurface()", result); + } + + return reinterpret_cast(mem); +} + diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h index f394ac1..8dd38dc 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h @@ -127,6 +127,8 @@ public: const QImage &image); #endif + static uchar *lockSurface(IDirectFBSurface *surface, DFBSurfaceLockFlags flags, int *bpl = 0); + private: void compose(const QRegion &r); void blit(IDirectFBSurface *src, const QPoint &topLeft, -- cgit v0.12 From b250e23a418f991bb979158e119bdb78cddc8228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Wed, 22 Apr 2009 19:24:10 +0200 Subject: Don't emit QApplication::focusChanged for no reason The Qt::NoFocusReason is used when Qt temporarily moves the focus to the QMenuBar while switching from one widget to another. While this did not result in a QFocusEvent, it did result in emitting the QApplication::focusChanged signal. This in turn caused a slowness in Qt Creator, since it wanted to update the current context and find filter. The fix here makes sure the focusChanged signal is not emitted when the focus reason is Qt::NoFocusReason, since these focus changes are not interesting for the application. Reviewed-by: mae --- src/gui/kernel/qapplication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 1624b9d..d0b1790 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -2100,8 +2100,8 @@ void QApplicationPrivate::setFocusWidget(QWidget *focus, Qt::FocusReason reason) if (that) QApplication::sendEvent(that->style(), &in); } + emit qApp->focusChanged(prev, focus_widget); } - emit qApp->focusChanged(prev, focus_widget); } } -- cgit v0.12 From 5c5d5cf6f70155d0920d8727696785d8348d65fb Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 22 Apr 2009 20:12:45 +0200 Subject: Show filter extensions in the GTK file dialog if no name is provided In the GTK+ file dialog filters are only represented by names such as "All files", while the actual extensions are hidden. You can create a filter without a name in Qt however so in this case we have to fall back to showing the file extensions instead. Task-number: 251928 Reviewed-by: rosch --- src/gui/styles/gtksymbols.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index acb8437..0842ec7 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -746,9 +746,9 @@ static void setupGtkFileChooser(GtkWidget* gtkFileChooser, QWidget *parent, foreach (const QString &rawfilter, filters) { GtkFileFilter *gtkFilter = QGtk::gtk_file_filter_new (); QString name = rawfilter.left(rawfilter.indexOf(QLatin1Char('('))); - QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name)); - QStringList extensions = extract_filter(rawfilter); + QGtk::gtk_file_filter_set_name(gtkFilter, qPrintable(name.isEmpty() ? extensions.join(QLS(", ")) : name)); + foreach (const QString &fileExtension, extensions) { QGtk::gtk_file_filter_add_pattern (gtkFilter, qPrintable(fileExtension)); } -- cgit v0.12 From 8d7729cd116d40b0ab0bc65a709fe7b70ba84e64 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 11:57:46 -0700 Subject: Kill some warnings Refactor two small things so that we don't get warnings when QT_DIRECTFB_NO_(OPAQUEDETECTION|MOUSE|KEYBOARD) is defined Reviewed-by: Shane McLaughlin --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 3 +++ src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index a6017b8..f9172cc 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -160,6 +160,9 @@ static bool checkForAlphaPixels(const QImage &img) void QDirectFBPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags) { +#ifdef QT_NO_DIRECTFB_OPAQUE_DETECTION + Q_UNUSED(flags); +#endif Q_ASSERT(img.depth() != 1); // these should be handled by QRasterPixmapData if (img.hasAlphaChannel() #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index 490eeb0..b2b8e9b 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -956,16 +956,15 @@ void QDirectFBScreen::disconnect() bool QDirectFBScreen::initDevice() { - QWSServer *server = QWSServer::instance(); #ifndef QT_NO_DIRECTFB_MOUSE if (qgetenv("QWS_MOUSE_PROTO").isEmpty()) { - server->setDefaultMouse("None"); + QWSServer::instance()->->setDefaultMouse("None"); d_ptr->mouse = new QDirectFBMouseHandler; } #endif #ifndef QT_NO_DIRECTFB_KEYBOARD if (qgetenv("QWS_KEYBOARD").isEmpty()) { - server->setDefaultKeyboard("None"); + QWSServer::instance()->->setDefaultKeyboard("None"); d_ptr->keyboard = new QDirectFBKeyboardHandler(QString()); } #endif -- cgit v0.12 From 08218fb6dbcc4f133c20cdc3a4e6575606924a29 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 12:31:03 -0700 Subject: Compile Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index b2b8e9b..3e54e7f 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -958,13 +958,13 @@ bool QDirectFBScreen::initDevice() { #ifndef QT_NO_DIRECTFB_MOUSE if (qgetenv("QWS_MOUSE_PROTO").isEmpty()) { - QWSServer::instance()->->setDefaultMouse("None"); + QWSServer::instance()->setDefaultMouse("None"); d_ptr->mouse = new QDirectFBMouseHandler; } #endif #ifndef QT_NO_DIRECTFB_KEYBOARD if (qgetenv("QWS_KEYBOARD").isEmpty()) { - QWSServer::instance()->->setDefaultKeyboard("None"); + QWSServer::instance()->setDefaultKeyboard("None"); d_ptr->keyboard = new QDirectFBKeyboardHandler(QString()); } #endif -- cgit v0.12 From d64d13102d3d53d0aa43597408d7abf3fecb57a3 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 22 Apr 2009 15:09:59 -0700 Subject: Convert bitmaps to alpha pixmap format Ideally we'd let raster pixmap data handle this but QPixmap::fromImage creates a QPixmapData::PixmapType regardless of the bit depth of the image so we have to handle this case. Reviewed-by: Donald --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index f9172cc..ea9bb3a 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -157,13 +157,13 @@ static bool checkForAlphaPixels(const QImage &img) return false; } -void QDirectFBPixmapData::fromImage(const QImage &img, +void QDirectFBPixmapData::fromImage(const QImage &i, Qt::ImageConversionFlags flags) { #ifdef QT_NO_DIRECTFB_OPAQUE_DETECTION Q_UNUSED(flags); #endif - Q_ASSERT(img.depth() != 1); // these should be handled by QRasterPixmapData + const QImage img = (i.depth() == 1 ? i.convertToFormat(screen->alphaPixmapFormat()) : i); if (img.hasAlphaChannel() #ifndef QT_NO_DIRECTFB_OPAQUE_DETECTION && (flags & Qt::NoOpaqueDetection || ::checkForAlphaPixels(img)) -- cgit v0.12