From a1ec686734e105228ff539c0e3bfc7850c66dc04 Mon Sep 17 00:00:00 2001 From: Alexis Menard Date: Tue, 12 Jan 2010 10:35:26 +0100 Subject: Fix completion in QFileDialog. Completing under the root directory was "eating" the first letter. On windows under C:\ the completion was not working at all. Task-number: QTBUG-4933 Reviewed-by:janarve Reviewed-by:gabi --- src/gui/dialogs/qfiledialog.cpp | 8 ++++++ tests/auto/qfiledialog2/tst_qfiledialog2.cpp | 42 +++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 3c388de..ab44fe7 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3245,6 +3245,10 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const QString currentLocation = dirModel->rootPath(); QString path = index.data(QFileSystemModel::FilePathRole).toString(); if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) { +#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE) + if (currentLocation == QDir::separator()) + return path.mid(currentLocation.length()); +#endif return path.mid(currentLocation.length() + 1); } return index.data(QFileSystemModel::FilePathRole).toString(); @@ -3300,6 +3304,10 @@ QStringList QFSCompleter::splitPath(const QString &path) const else dirModel = sourceModel; QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath()); +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) + if (currentLocation.endsWith(QLatin1Char(':'))) + currentLocation.append(sep); +#endif if (currentLocation.contains(sep) && path != currentLocation) { QStringList currentLocationList = splitPath(currentLocation); while (!currentLocationList.isEmpty() diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp index c3f88c4..f1fac17 100644 --- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp @@ -116,6 +116,7 @@ private slots: #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) void task226366_lowerCaseHardDriveWindows(); #endif + void completionOnLevelAfterRoot(); void task233037_selectingDirectory(); void task235069_hideOnEscape(); void task236402_dontWatchDeletedDir(); @@ -202,7 +203,7 @@ void tst_QFiledialog::heapCorruption() qDeleteAll(dialogs); } -struct FriendlyQFileDialog : public QFileDialog +struct FriendlyQFileDialog : public QNonNativeFileDialog { friend class tst_QFileDialog; Q_DECLARE_PRIVATE(QFileDialog) @@ -552,6 +553,45 @@ void tst_QFiledialog::task226366_lowerCaseHardDriveWindows() } #endif +void tst_QFiledialog::completionOnLevelAfterRoot() +{ + QNonNativeFileDialog fd; +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + fd.setDirectory("C:"); + QDir current = fd.directory(); + current.mkdir("completionOnLevelAfterRootTest"); +#else + fd.setFilter(QDir::Hidden | QDir::AllDirs | QDir::Files | QDir::System); + fd.setDirectory("/"); + QDir etc("/etc"); + if (!etc.exists()) + QSKIP("This test requires to have an etc directory under /", SkipAll); +#endif + fd.show(); + QLineEdit *edit = qFindChild(&fd, "fileNameEdit"); + QTest::qWait(2000); +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + //I love testlib :D + QTest::keyClick(edit, Qt::Key_C); + QTest::keyClick(edit, Qt::Key_O); + QTest::keyClick(edit, Qt::Key_M); + QTest::keyClick(edit, Qt::Key_P); + QTest::keyClick(edit, Qt::Key_L); +#else + QTest::keyClick(edit, Qt::Key_E); + QTest::keyClick(edit, Qt::Key_T); +#endif + QTest::qWait(200); + QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); + QTest::qWait(200); +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QCOMPARE(edit->text(), QString("completionOnLevelAfterRootTest")); + current.rmdir("completionOnLevelAfterRootTest"); +#else + QCOMPARE(edit->text(), QString("etc")); +#endif +} + void tst_QFiledialog::task233037_selectingDirectory() { QDir current = QDir::currentPath(); -- cgit v0.12 From 81e1d9a9e9ff6649727bd26ea0c3be971813866d Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 12 Jan 2010 12:32:09 +0100 Subject: Update change log with Yoann Lopes work. --- dist/changes-4.6.1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 65b865a..d35a4c1 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -53,6 +53,25 @@ QtGui GL implementation. - QGraphicsObject * 'id' property was removed. Use the 'objectName' property instead. + - QPrinter + * [QTBUG-3412] QGraphicsProxyWidgets are now rendered correctly when + printing a QGraphicsScene to PDF format. + - QPainter + * [QTBUG-5939] Fixed incorrect redirection matrix that was causing + wrong transformation for QGraphicsProxyWidgets. + - QGraphicsView + * [QTBUG-6935] When using CacheBackground, the background is now + correctly repainted after the QGraphicsView is shown after being + hidden. + * [QTBUG-6835] Mouse tracking is now automatically enabled when using + AnchorUnderMouse for view transformation. + - QGraphicsItem + * [QTBUG-5917] Fixed memory leaks when removing a QGraphicsEffect from + a QGraphicsItem or QWidget with setGraphicsEffect(0). + * [QTBUG-5859] Fixes incorrect rounding of the exposed rectangle of the + QGraphicsItem causing painting issues when scaling the QGraphicsView. + * [QTBUG-5071] Fixes transformation problems when grouping/ungrouping + the item with a QGraphicsItemGroup. QtDBus ------ -- cgit v0.12 From 48b4a790b94acab1000c0e3bb3c6780bf6b9ba0b Mon Sep 17 00:00:00 2001 From: Kim Motoyoshi Kalland Date: Tue, 12 Jan 2010 13:29:11 +0100 Subject: Fixed bug where QGLPixmapData::toImage() returned too dark image. QGLPixmapData::toImage() called qt_gl_read_texture() which didn't take into account that the texture was in a premultiplied format. Task-number: QTBUG-7190 Reviewed-by: Trond --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 4a79427..602c14d 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1555,7 +1555,7 @@ QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha) { - QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32); + QImage img(size, alpha_format ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); int w = size.width(); int h = size.height(); #if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) -- cgit v0.12 From ea24edbf74d29cfa128b651e41fde14a0d2a79f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Tue, 12 Jan 2010 14:55:01 +0100 Subject: 4.6.1 changes --- dist/changes-4.6.1 | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index d35a4c1..b3c076e 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -51,16 +51,20 @@ QtGui in the DDS, ETC1, PVRTC2, and PVRTC4 formats if the OpenGL graphics system is active and the appropriate extensions are present in the GL implementation. + * [QTBUG-6840] Fixed load() to not modify referenced copies. + * [QTBUG-5840] Fixed a crash in fromImage() when passing in a null image. + - QRasterPixmapData + * [QTBUG-6985] Fixed metric() to return the correct height in mm. - QGraphicsObject * 'id' property was removed. Use the 'objectName' property instead. - QPrinter * [QTBUG-3412] QGraphicsProxyWidgets are now rendered correctly when printing a QGraphicsScene to PDF format. - QPainter - * [QTBUG-5939] Fixed incorrect redirection matrix that was causing + * [QTBUG-5939] Fixed incorrect redirection matrix that was causing wrong transformation for QGraphicsProxyWidgets. - QGraphicsView - * [QTBUG-6935] When using CacheBackground, the background is now + * [QTBUG-6935] When using CacheBackground, the background is now correctly repainted after the QGraphicsView is shown after being hidden. * [QTBUG-6835] Mouse tracking is now automatically enabled when using @@ -73,6 +77,9 @@ QtGui * [QTBUG-5071] Fixes transformation problems when grouping/ungrouping the item with a QGraphicsItemGroup. + - QTextDocument + * [QTBUG-6051] Fixed an endless loop when printing a QTextDocument. + QtDBus ------ @@ -114,6 +121,8 @@ QtOpenGL * [QTBUG-6045] Crash in dashed line handling in the GL stroker. - QGLGlyphCache * [QTBUG-6936] Fix memory leak of QGLGlyphCoord objects. + - QGLWidget + * [QTBUG-5002, QTBUG-6931] Fixed QGLWidget::renderText(). QtOpenVG -------- @@ -173,12 +182,15 @@ Third party components Qt for Unix (X11 and Mac OS X) ------------------------------ - - + - Qt for Linux/X11 ---------------- - - + - QGL + * [QTBUG-5732] Fixed querying of GLX extensions under X11. + - QPrintDialog + * [QTBUG-5547] Fixed handling of the "..." button. Qt for Windows -------------- @@ -188,7 +200,9 @@ Qt for Windows Qt for Mac OS X --------------- - - + - QPixmap + * [QTBUG-5070] Fixed a crash on Mac that could occur when loading + pixmaps of different sizes into the same QPixmap object. Qt for Embedded Linux --------------------- -- cgit v0.12 From c186438710bb0f5a09ba6168a5b35d8b485da41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 12 Jan 2010 14:52:38 +0100 Subject: Update changelog with my 4.6.1 changes. --- dist/changes-4.6.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index b3c076e..e2ec649 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -46,6 +46,8 @@ QtCore QtGui ----- + - QPixmapCache + * Fixed a small leak when using the new QPixmapCAche::Key based API. - QPixmap * load() and loadFromData() can now support compressed GL textures in the DDS, ETC1, PVRTC2, and PVRTC4 formats if the OpenGL graphics @@ -63,6 +65,11 @@ QtGui - QPainter * [QTBUG-5939] Fixed incorrect redirection matrix that was causing wrong transformation for QGraphicsProxyWidgets. + * [QTBUG-6684] Added optimizations of 32-bit blend functions + for ARM platforms with NEON support. + - QGraphicsEffect + * [QTBUG-5918] Fixed redraw bugs when using graphics effects on + items while animating them by transformations. - QGraphicsView * [QTBUG-6935] When using CacheBackground, the background is now correctly repainted after the QGraphicsView is shown after being @@ -76,6 +83,9 @@ QtGui QGraphicsItem causing painting issues when scaling the QGraphicsView. * [QTBUG-5071] Fixes transformation problems when grouping/ungrouping the item with a QGraphicsItemGroup. + - QTextDocument + * [QTBUG-5397] Fixed printing of QTextDocuments not including custom + text objects. - QTextDocument * [QTBUG-6051] Fixed an endless loop when printing a QTextDocument. -- cgit v0.12 From 1595d8594782321de9d92659e2a0cd03148c7ff5 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 12 Jan 2010 15:21:32 +0100 Subject: Update changes file for 4.6.1 --- dist/changes-4.6.1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index e2ec649..e9e5922 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -133,6 +133,15 @@ QtOpenGL * [QTBUG-6936] Fix memory leak of QGLGlyphCoord objects. - QGLWidget * [QTBUG-5002, QTBUG-6931] Fixed QGLWidget::renderText(). + * Fixed WA_TranslucentBackground for QGLWidgets on X11/EGL + * Fix EGL surface leaks when re-parenting on X11/EGL + - QGL2PaintEngineEx + * Performance: Don't mark brush as dirty if it hasn't changed + * Performance: Use 3x3 PMV matrices rather than 4x4 + * Performance: Move the 0.5 offset we add for aliased rendering to updateMatrix() + * Performance: Remove superfluous enable/disable vertex arrtib arrays + * Performance: Track the glVertexAttribPointer and only update it if it's changed + * [QTBUG-7094] Introduce new "snapToPixelGrid" flag for drawText QtOpenVG -------- @@ -197,10 +206,10 @@ Qt for Unix (X11 and Mac OS X) Qt for Linux/X11 ---------------- - - QGL - * [QTBUG-5732] Fixed querying of GLX extensions under X11. - - QPrintDialog - * [QTBUG-5547] Fixed handling of the "..." button. + - [QTBUG-5732] Fixed querying of GLX extensions under X11. + - [QTBUG-5547] Fixed handling of the "..." button. + - Added new mkspec for Maemo targets (linux-g++-maemo) + - Added new mkspec for Scratchbox host compiler (unsupported/linux-host-g++) Qt for Windows -------------- -- cgit v0.12