From c027f0ae1967ec1d64cb2c9679c8b57f18faf7f5 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 10:54:41 +0100 Subject: ActiveQt Internet Explorer component causes Desktop Icons to flicker. This happens only if IE is embedded in an frameless window. The repaint caused by calling EnableModeless() is making the desktop icons flicker. This repaint generated via ActiveQt will be ignored by QtGui. This is done by checking if the window style is already in the required state or not. Task-number: QTBUG-8355 Reviewed-by: Denis --- src/gui/kernel/qwidget.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 850e961..91a11ec 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7925,13 +7925,16 @@ inline void setDisabledStyle(QWidget *w, bool setStyle) // set/reset WS_DISABLED style. if(w && w->isWindow() && w->isVisible() && w->isEnabled()) { LONG dwStyle = GetWindowLong(w->winId(), GWL_STYLE); + LONG newStyle = dwStyle; if (setStyle) - dwStyle |= WS_DISABLED; + newStyle |= WS_DISABLED; else - dwStyle &= ~WS_DISABLED; - SetWindowLong(w->winId(), GWL_STYLE, dwStyle); - // we might need to repaint in some situations (eg. menu) - w->repaint(); + newStyle &= ~WS_DISABLED; + if (newStyle != dwStyle) { + SetWindowLong(w->winId(), GWL_STYLE, newStyle); + // we might need to repaint in some situations (eg. menu) + w->repaint(); + } } } #endif -- cgit v0.12 From 3604c59a93eae6f27407316e5be3840f87d01711 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 12:12:13 +0100 Subject: Remove unwanted code after c027f0ae1967ec1d64cb2c9679c8b57f18faf7f5 The LockWindowUpdate() was used to reduce the flicker caused when calling EnableModeless(). After the above commit, no repaints will be generated by this code path, so we can remove this call. Task-number: QTBUG-8355 Reviewed-by: Bradley T. Hughes --- src/activeqt/container/qaxwidget.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp index 9149320..865c26c 100644 --- a/src/activeqt/container/qaxwidget.cpp +++ b/src/activeqt/container/qaxwidget.cpp @@ -1438,9 +1438,6 @@ extern Q_GUI_EXPORT bool qt_win_ignoreNextMouseReleaseEvent; HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) { -#if !defined(Q_OS_WINCE) - LockWindowUpdate(host->window()->winId()); -#endif EnableWindow(host->window()->winId(), fEnable); if (!fEnable) { @@ -1451,9 +1448,6 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable) QApplicationPrivate::leaveModal(host); } qt_win_ignoreNextMouseReleaseEvent = false; -#if !defined(Q_OS_WINCE) - LockWindowUpdate(0); -#endif return S_OK; } -- cgit v0.12 From 7ff5a5bc4b67a807200cae3ac83884d721bad373 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Tue, 23 Feb 2010 17:12:30 +0100 Subject: Skip complex FBO tests if combined depth-stencil isn't supported MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-By: Trond Kjernåsen --- tests/auto/qgl/tst_qgl.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 2983af3..a0656d0 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -1036,6 +1036,11 @@ void tst_QGL::glFBORendering() // Don't complicate things by using NPOT: QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + if (fbo->attachment() != QGLFramebufferObject::CombinedDepthStencil) { + delete fbo; + QSKIP("FBOs missing combined depth~stencil support", SkipSingle); + } + QPainter fboPainter; bool painterBegun = fboPainter.begin(fbo); QVERIFY(painterBegun); @@ -1098,6 +1103,16 @@ void tst_QGL::multipleFBOInterleavedRendering() QGLFramebufferObject *fbo2 = new QGLFramebufferObject(256, 128, fboFormat); QGLFramebufferObject *fbo3 = new QGLFramebufferObject(256, 128, fboFormat); + if ( (fbo1->attachment() != QGLFramebufferObject::CombinedDepthStencil) || + (fbo2->attachment() != QGLFramebufferObject::CombinedDepthStencil) || + (fbo3->attachment() != QGLFramebufferObject::CombinedDepthStencil) ) + { + delete fbo1; + delete fbo2; + delete fbo3; + QSKIP("FBOs missing combined depth~stencil support", SkipSingle); + } + QPainter fbo1Painter; QPainter fbo2Painter; QPainter fbo3Painter; @@ -1203,7 +1218,7 @@ protected: QPainter widgetPainter; widgetPainterBeginOk = widgetPainter.begin(this); QGLFramebufferObjectFormat fboFormat; - fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + fboFormat.setAttachment(QGLFramebufferObject::NoAttachment); QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat); QPainter fboPainter; -- cgit v0.12 From c815fd0a6426e43aa9efd861888888aa4d5b233b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 26 Feb 2010 10:44:51 +0100 Subject: Fixed qgl autotest failures on Maemo. Changed glFBOSimpleRendering and glFBOUseInGLWidget auto tests to use NPOT sizes. NPOT FBOs are not twiddled, and thus not exposed to the twiddled glReadPixels() bug in the current drivers. Skipped glWidgetRenderPixmap as renderPixmap() is not supported under EGL currently. Reviewed-by: Tom Cooksey --- tests/auto/qgl/qgl.pro | 2 ++ tests/auto/qgl/tst_qgl.cpp | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/auto/qgl/qgl.pro b/tests/auto/qgl/qgl.pro index 9116f39..5f058f9 100644 --- a/tests/auto/qgl/qgl.pro +++ b/tests/auto/qgl/qgl.pro @@ -6,6 +6,8 @@ load(qttest_p4) requires(contains(QT_CONFIG,opengl)) QT += opengl +contains(QT_CONFIG,egl):DEFINES += QGL_EGL + SOURCES += tst_qgl.cpp RESOURCES = qgl.qrc diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index a0656d0..101e361 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -998,8 +998,7 @@ void tst_QGL::glFBOSimpleRendering() QGLFramebufferObjectFormat fboFormat; fboFormat.setAttachment(QGLFramebufferObject::NoAttachment); - // Don't complicate things by using NPOT: - QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat); + QGLFramebufferObject *fbo = new QGLFramebufferObject(200, 100, fboFormat); fbo->bind(); @@ -1219,7 +1218,7 @@ protected: widgetPainterBeginOk = widgetPainter.begin(this); QGLFramebufferObjectFormat fboFormat; fboFormat.setAttachment(QGLFramebufferObject::NoAttachment); - QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat); + QGLFramebufferObject *fbo = new QGLFramebufferObject(100, 100, fboFormat); QPainter fboPainter; fboPainterBeginOk = fboPainter.begin(fbo); @@ -1243,7 +1242,7 @@ void tst_QGL::glFBOUseInGLWidget() #ifdef Q_WS_QWS w.setWindowFlags(Qt::FramelessWindowHint); #endif - w.resize(128, 128); + w.resize(100, 100); w.show(); #ifdef Q_WS_X11 @@ -1355,6 +1354,10 @@ void tst_QGL::glWidgetRenderPixmap() QImage reference(fb.size(), QImage::Format_RGB32); reference.fill(0xffff0000); +#ifdef QGL_EGL + QSKIP("renderPixmap() not yet supported under EGL", SkipAll); +#endif + QFUZZY_COMPARE_IMAGES(fb, reference); } -- cgit v0.12 From 9229489304894e35e137606ea263f007e5605d22 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 14:37:59 +0100 Subject: Fixed autotest tst_QWidget::translucentWidget() on Windows Vista & above Grabbing layered windows doesn't work on Vista and above, so instead we need to grab the corresponding area of the desktop widget. Reviewed-by: Samuel --- src/gui/image/qpixmap.cpp | 6 +++++- tests/auto/qwidget/tst_qwidget.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 1df7946..08003e5 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -2026,12 +2026,16 @@ QPixmap QPixmap::fromImage(const QImage &image, Qt::ImageConversionFlags flags) over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed. - Note on X11that if the given \a window doesn't have the same depth + Note on X11 that if the given \a window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will \e not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized. + On Windows Vista and above grabbing a layered window, which is + created by setting the Qt::WA_TranslucentBackground attribute, will + not work. Instead grabbing the desktop widget should work. + \warning In general, grabbing an area outside the screen is not safe. This depends on the underlying window system. diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index b59017b..abd9604 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -8829,7 +8829,15 @@ void tst_QWidget::translucentWidget() #endif QTest::qWait(200); - QPixmap widgetSnapshot = QPixmap::grabWindow(label.winId()); + QPixmap widgetSnapshot; + +#ifdef Q_WS_WIN + QWidget *desktopWidget = QApplication::desktop()->screen(0); + if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) + widgetSnapshot = QPixmap::grabWindow(desktopWidget->winId(), 0,0, label.width(), label.height()); + else +#endif + widgetSnapshot = QPixmap::grabWindow(label.winId()); QImage actual = widgetSnapshot.toImage().convertToFormat(QImage::Format_RGB32); QImage expected = pm.toImage().convertToFormat(QImage::Format_RGB32); QCOMPARE(actual.size(),expected.size()); -- cgit v0.12 From 8733baf8b770a5fca12aecf4c38a8c8f94c4b0fa Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 26 Feb 2010 14:45:55 +0100 Subject: fix "configure -fast" on Windows for other maketools than nmake Task-number: QTBUG-8562 Reviewed-by: ossi --- configure.exe | Bin 1008128 -> 1212416 bytes tools/configure/configureapp.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.exe b/configure.exe index 9974236..3e51833 100755 Binary files a/configure.exe and b/configure.exe differ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index d521276..153df10 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3700,7 +3700,7 @@ void Configure::generateMakefiles() QTextStream txt(&file); txt << "all:\n"; txt << "\t" << args.join(" ") << "\n"; - txt << "\t" << dictionary[ "MAKE" ] << " -f " << it->target << "\n"; + txt << "\t\"$(MAKE)\" -$(MAKEFLAGS) -f " << it->target << "\n"; txt << "first: all\n"; txt << "qmake:\n"; txt << "\t" << args.join(" ") << "\n"; -- cgit v0.12 From 573fee867d129654ca2eb629d8f0ffb7f515a324 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Fri, 26 Feb 2010 13:28:45 +0100 Subject: Crash when dragging an empty URL-list. While converting the mime to native CF_ formats, we need to check the vaildity of the list. Task-number: QTBUG-8446 Reviewed-by: Thierry --- src/gui/kernel/qmime_win.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qmime_win.cpp b/src/gui/kernel/qmime_win.cpp index e191d7b..39633bf 100644 --- a/src/gui/kernel/qmime_win.cpp +++ b/src/gui/kernel/qmime_win.cpp @@ -640,14 +640,18 @@ bool QWindowsMimeURI::convertFromMime(const FORMATETC &formatetc, const QMimeDat } else if (getCf(formatetc) == CF_INETURL_W) { QList urls = mimeData->urls(); QByteArray result; - QString url = urls.at(0).toString(); - result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort)); + if (!urls.isEmpty()) { + QString url = urls.at(0).toString(); + result = QByteArray((const char *)url.utf16(), url.length() * sizeof(ushort)); + } result.append('\0'); result.append('\0'); return setData(result, pmedium); } else if (getCf(formatetc) == CF_INETURL) { QList urls = mimeData->urls(); - QByteArray result = urls.at(0).toString().toLocal8Bit(); + QByteArray result; + if (!urls.isEmpty()) + result = urls.at(0).toString().toLocal8Bit(); return setData(result, pmedium); } } -- cgit v0.12 From 13df3749820f3fd1847e4359b302da052eef5137 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 26 Feb 2010 15:08:28 +0100 Subject: QAbstractItemView::setIndexWidget: remove the old widget from the QSet of persistent editors Task-number: QTBUG-8422 Reviewed-by: Thierry --- src/gui/itemviews/qabstractitemview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index adf3ce3..2c4d9b7 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -3014,6 +3014,7 @@ void QAbstractItemView::setIndexWidget(const QModelIndex &index, QWidget *widget if (!d->isIndexValid(index)) return; if (QWidget *oldWidget = indexWidget(index)) { + d->persistent.remove(oldWidget); d->removeEditor(oldWidget); oldWidget->deleteLater(); } -- cgit v0.12 From 4302c8fa7a234f6f4cfc35f572b93a000d199fe3 Mon Sep 17 00:00:00 2001 From: mread Date: Fri, 26 Feb 2010 14:34:16 +0000 Subject: Symbian file system use optimisation for stat and symlinks Symbian implementation of fileFlags calls both doStat and isSymlink resulting in calls to both stat and lstat. However most of the time, ie when accessing a normal file rather than a symlink, lstat gives all the information we require. So this change uses lstat where possible, and caches its result for both doStat and isSymlink. During start of DesktopServices app, this cuts calls to stat/lstat by 45%. Reviewed-by: Shane Kearns --- src/corelib/io/qfsfileengine_unix.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp index d2fa744..1331f54 100644 --- a/src/corelib/io/qfsfileengine_unix.cpp +++ b/src/corelib/io/qfsfileengine_unix.cpp @@ -668,6 +668,16 @@ bool QFSFileEnginePrivate::doStat() const could_stat = (QT_FSTAT(QT_FILENO(fh), &st) == 0); } else if (fd == -1) { // ### actually covers two cases: d->fh and when the file is not open +#if defined(Q_OS_SYMBIAN) + // Optimisation for Symbian where fileFlags() calls both doStat() and isSymlink(), but rarely on real links. + // When the filename is not a link, lstat will return the same info as stat, but this also removes + // any need for a further call to lstat to check if the file is a link. + need_lstat = false; + could_stat = (QT_LSTAT(nativeFilePath.constData(), &st) == 0); + is_link = could_stat ? S_ISLNK(st.st_mode) : false; + // if it turns out this was a link, we can call stat too. + if (is_link) +#endif could_stat = (QT_STAT(nativeFilePath.constData(), &st) == 0); } else { could_stat = (QT_FSTAT(fd, &st) == 0); -- cgit v0.12 From 30abadd0d0a190889dab6d1c154053a25e060042 Mon Sep 17 00:00:00 2001 From: ninerider Date: Sat, 27 Feb 2010 12:09:28 +0100 Subject: Test modifications for the Windows Mobile platform. Test were changed to run in reasonable time on Windows Mobile. Also some test were skipped for instance those using OpenGL. OpenGL support for Windows Mobile is a forthcoming feature. --- .../corelib/io/qdir/10000/bench_qdir_10000.cpp | 2 +- tests/benchmarks/corelib/io/qfile/main.cpp | 17 +++++++++++++---- .../corelib/tools/containers-sequential/main.cpp | 2 +- tests/benchmarks/corelib/tools/qstringlist/main.cpp | 4 ++++ .../graphicsview/qgraphicsview/tst_qgraphicsview.cpp | 3 +++ .../network/access/qnetworkreply/tst_qnetworkreply.cpp | 4 ++-- .../network/socket/qtcpserver/tst_qtcpserver.cpp | 3 +++ tools/qtestlib/wince/cetest/cetest.pro | 7 ++++++- 8 files changed, 33 insertions(+), 9 deletions(-) diff --git a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp index 1238804..4fe4723 100644 --- a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp +++ b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp @@ -165,7 +165,7 @@ private slots: WIN32_FIND_DATA fd; HANDLE hSearch = FindFirstFileW(appendedPath, &fd); - QVERIFY(hSearch == INVALID_HANDLE_VALUE); + QVERIFY(hSearch != INVALID_HANDLE_VALUE); QBENCHMARK { do { diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 103b77c..2dc0e86 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -175,7 +175,10 @@ void tst_qfile::cleanupTestCase() void tst_qfile::readBigFile_QFile() { readBigFile(); } void tst_qfile::readBigFile_QFSFileEngine() { readBigFile(); } -void tst_qfile::readBigFile_posix() { readBigFile(); } +void tst_qfile::readBigFile_posix() +{ + readBigFile(); +} void tst_qfile::readBigFile_Win32() { readBigFile(); } void tst_qfile::readBigFile_QFile_data() @@ -476,8 +479,14 @@ void tst_qfile::open() void tst_qfile::readSmallFiles_QFile() { readSmallFiles(); } void tst_qfile::readSmallFiles_QFSFileEngine() { readSmallFiles(); } -void tst_qfile::readSmallFiles_posix() { readSmallFiles(); } -void tst_qfile::readSmallFiles_Win32() { readSmallFiles(); } +void tst_qfile::readSmallFiles_posix() +{ + readSmallFiles(); +} +void tst_qfile::readSmallFiles_Win32() +{ + readSmallFiles(); +} void tst_qfile::readSmallFiles_QFile_data() { @@ -534,7 +543,7 @@ void tst_qfile::createSmallFiles() dir.cd("tst"); tmpDirName = dir.absolutePath(); -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE) for (int i = 0; i < 100; ++i) #else for (int i = 0; i < 1000; ++i) diff --git a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp index a6e405c..edf0eff 100644 --- a/tests/benchmarks/corelib/tools/containers-sequential/main.cpp +++ b/tests/benchmarks/corelib/tools/containers-sequential/main.cpp @@ -133,7 +133,7 @@ struct Large { // A "large" item type }; // Symbian devices typically have limited memory -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE) # define LARGE_MAX_SIZE 2000 #else # define LARGE_MAX_SIZE 20000 diff --git a/tests/benchmarks/corelib/tools/qstringlist/main.cpp b/tests/benchmarks/corelib/tools/qstringlist/main.cpp index 3fac598..81ecd11 100644 --- a/tests/benchmarks/corelib/tools/qstringlist/main.cpp +++ b/tests/benchmarks/corelib/tools/qstringlist/main.cpp @@ -147,6 +147,7 @@ void tst_QStringList::split_data() const void tst_QStringList::split_std() const { +#ifndef QT_NO_STL QFETCH(QString, input); const char split_char = ':'; std::string stdinput = input.toStdString(); @@ -159,10 +160,12 @@ void tst_QStringList::split_std() const token.push_back(each)) ; } +#endif } void tst_QStringList::split_stdw() const { +#ifndef QT_NO_STL QFETCH(QString, input); const wchar_t split_char = ':'; std::wstring stdinput = input.toStdWString(); @@ -175,6 +178,7 @@ void tst_QStringList::split_stdw() const token.push_back(each)) ; } +#endif } void tst_QStringList::split_ba() const diff --git a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp index 3c0ae71..ba56d58 100644 --- a/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/benchmarks/gui/graphicsview/qgraphicsview/tst_qgraphicsview.cpp @@ -414,6 +414,9 @@ void tst_QGraphicsView::chipTester_data() void tst_QGraphicsView::chipTester() { +#ifdef Q_WS_WINCE_WM +QSKIP("WinCE WM: Fails on Windows Mobile w/o OpenGL", SkipAll); +#endif QFETCH(bool, antialias); QFETCH(bool, opengl); QFETCH(int, operation); diff --git a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp index f173ed1..90ae153 100644 --- a/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -555,7 +555,7 @@ void tst_qnetworkreply::uploadPerformance() void tst_qnetworkreply::httpUploadPerformance() { -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM) // SHow some mercy for non-desktop platform/s enum {UploadSize = 4*1024*1024}; // 4 MB #else @@ -626,7 +626,7 @@ void tst_qnetworkreply::httpDownloadPerformance() { QFETCH(bool, serverSendsContentLength); QFETCH(bool, chunkedEncoding); -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) || defined(Q_WS_WINCE_WM) // Show some mercy to non-desktop platform/s enum {UploadSize = 4*1024*1024}; // 4 MB #else diff --git a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp index 022bf3d..c77c619 100644 --- a/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/benchmarks/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -175,6 +175,9 @@ void tst_QTcpServer::ipv6LoopbackPerformanceTest() QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; +#if defined(Q_WS_WINCE_WM) + QSKIP("WinCE WM: Not yet supported", SkipAll); +#endif #if defined(Q_OS_SYMBIAN) QSKIP("Symbian: IPv6 is not yet supported", SkipAll); diff --git a/tools/qtestlib/wince/cetest/cetest.pro b/tools/qtestlib/wince/cetest/cetest.pro index 6b6b02a..2773fe4 100644 --- a/tools/qtestlib/wince/cetest/cetest.pro +++ b/tools/qtestlib/wince/cetest/cetest.pro @@ -18,10 +18,13 @@ DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED QT_NO_CODECS QT_LITE_UNICODE QT INCLUDEPATH = \ $$QT_SOURCE_TREE/tools/qtestlib/ce/cetest \ $$QT_SOURCE_TREE/qmake \ - $$QT_SOURCE_TREE/tools/shared \ + $$QT_SOURCE_TREE/qmake/generators/symbian \ + $$QT_SOURCE_TREE/tools/shared \ $$QT_BUILD_TREE/include \ $$QT_BUILD_TREE/include/QtCore \ $$QT_BUILD_TREE/src/corelib/global + +VPATH += $$QT_SOURCE_TREE/tools/shared DEPENDPATH += $$QT_BUILD_TREE/src/corelib/tools $$QT_BUILD_TREE/src/corelib/io @@ -33,6 +36,8 @@ HEADERS += \ SOURCES += \ remoteconnection.cpp \ deployment.cpp \ + symbian/epocroot.cpp \ + windows/registry.cpp \ main.cpp LIBS += ole32.lib advapi32.lib -- cgit v0.12 From 6a7b7947e36a2d9440c4eba40dc6d4177fbc0c29 Mon Sep 17 00:00:00 2001 From: ninerider Date: Sat, 27 Feb 2010 12:13:01 +0100 Subject: Preparation to enable OpenGLES 2.0 for Windows Mobile. As there are no SDKs available for our test device (HTC HD2) that support OpenGL, we had to construct the libraries by extracting them from the ROM image. This is still work in progress at this time. --- src/gui/egl/qegl_wince.cpp | 6 ++++-- src/gui/egl/qeglproperties_p.h | 9 +++++++-- src/opengl/qgl_p.h | 12 +++++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/gui/egl/qegl_wince.cpp b/src/gui/egl/qegl_wince.cpp index c9c9773..dfef39f 100644 --- a/src/gui/egl/qegl_wince.cpp +++ b/src/gui/egl/qegl_wince.cpp @@ -89,8 +89,10 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties EGLNativeDisplayType QEglContext::nativeDisplay() { - HWND win = (static_cast(device))->winId(); - HDC myDc = GetDC(win); + //HWND win = (static_cast(device))->winId(); + //HDC myDc = GetDC(win); + HDC myDc = GetWindowDC(0); + if (!myDc) { qWarning("QEglContext::nativeDisplay(): WinCE display is not open"); return EGL_DEFAULT_DISPLAY; diff --git a/src/gui/egl/qeglproperties_p.h b/src/gui/egl/qeglproperties_p.h index feed1d2..43c3393 100644 --- a/src/gui/egl/qeglproperties_p.h +++ b/src/gui/egl/qeglproperties_p.h @@ -58,12 +58,17 @@ QT_BEGIN_INCLUDE_NAMESPACE +#if defined(QT_OPENGL_ES_2) +# include +#endif + #if defined(QT_GLES_EGL) -#include +# include #else -#include +# include #endif + #if defined(Q_WS_X11) // If included , then the global namespace // may have been polluted with X #define's. The following makes sure diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 0d5a54a..80217c0 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -80,13 +80,19 @@ #define q_vertexTypeEnum GL_FIXED #endif //QT_OPENGL_ES_1_CL -#ifdef QT_OPENGL_ES +#if defined(QT_OPENGL_ES) || defined(QT_OPENGL_ES_2) QT_BEGIN_INCLUDE_NAMESPACE + #if defined(QT_OPENGL_ES_2) -#include +# include +#endif + +#if defined(QT_GLES_EGL) +# include #else -#include +# include #endif + QT_END_INCLUDE_NAMESPACE #endif -- cgit v0.12 From 1d8b860694c121527b1f964e1090aa2d1987075e Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 1 Mar 2010 09:41:55 +0200 Subject: Added fullscreen support to softkeys in Symbian. This commit enables the following two features: 1. Developer can make softkeys visible in fullscreen widget by setting the Qt::WindowSoftkeysVisibleHint window flag. This flag implememts intermediate mode for maximized and fullscreen modes. In maximized mode both statuspane and softkeys are visible, in fullscreen mode with WindowSoftkeysVisibleHint flag, only the softkeys are visible and in normal fullscreen mode both statuspane and softkeys are invisible. This feature was requested by QTBUG-5171. 2. Developer can make softkeys to respond to the key events even the softkeys are invisible. This means that when widget with Qt::WindowSoftkeysRespondHint window flag is shown in fullsreen, the softkey HW key events are routed to invisible softkeys and softkeys trigger the action associated to pressed softkey button. If the flag is not set, the key event will be passed to application/focused widget normally and softkey actions are not triggered. This feature was requested in QTBUG-4564. Both new flags are by default off. In addition, the softkey example is updated to demonstrate the new window flags. The commit also contains some code style fixes applied by my editor automatically to changed files. Task-number: QTBUG-5171 Task-number: QTBUG-4564 Reviewed-by: Jason Barron --- examples/widgets/softkeys/softkeys.cpp | 38 +++++++++++++++++++++++ examples/widgets/softkeys/softkeys.h | 19 +++++++----- examples/widgets/windowflags/controllerwindow.cpp | 4 +-- src/corelib/global/qnamespace.h | 4 ++- src/corelib/global/qnamespace.qdoc | 8 +++++ src/gui/kernel/qapplication_s60.cpp | 29 ++++++++++++----- src/gui/kernel/qsoftkeymanager_s60.cpp | 12 ++++++- src/gui/kernel/qwidget_s60.cpp | 35 +++++++++++++++------ 8 files changed, 120 insertions(+), 29 deletions(-) diff --git a/examples/widgets/softkeys/softkeys.cpp b/examples/widgets/softkeys/softkeys.cpp index cbd227c9..e5c2e73 100644 --- a/examples/widgets/softkeys/softkeys.cpp +++ b/examples/widgets/softkeys/softkeys.cpp @@ -70,6 +70,12 @@ MainWindow::MainWindow(QWidget *parent) toggleButton->setContextMenuPolicy(Qt::NoContextMenu); toggleButton->setCheckable(true); + modeButton = new QPushButton(tr("Loop SK window type"), this); + modeButton->setContextMenuPolicy(Qt::NoContextMenu); + + modeLabel = new QLabel(tr("Normal maximized"), this); + modeLabel->setContextMenuPolicy(Qt::NoContextMenu); + pushButton = new QPushButton(tr("File Dialog"), this); pushButton->setContextMenuPolicy(Qt::NoContextMenu); @@ -87,6 +93,8 @@ MainWindow::MainWindow(QWidget *parent) layout->addWidget(toggleButton, 2, 0); layout->addWidget(pushButton, 2, 1); layout->addWidget(comboBox, 3, 0, 1, 2); + layout->addWidget(modeButton, 4, 0, 1, 2); + layout->addWidget(modeLabel, 5, 0, 1, 2); central->setLayout(layout); fileMenu = menuBar()->addMenu(tr("&File")); @@ -97,6 +105,7 @@ MainWindow::MainWindow(QWidget *parent) connect(pushButton, SIGNAL(clicked()), this, SLOT(openDialog())); connect(exit, SIGNAL(triggered()), this, SLOT(exitApplication())); connect(toggleButton, SIGNAL(clicked()), this, SLOT(setCustomSoftKeys())); + connect(modeButton, SIGNAL(clicked()), this, SLOT(setMode())); pushButton->setFocus(); } @@ -133,6 +142,35 @@ void MainWindow::setCustomSoftKeys() } } +void MainWindow::setMode() +{ + if(isMaximized()) { + showFullScreen(); + modeLabel->setText(tr("Normal Fullscreen")); + } else { + Qt::WindowFlags flags = windowFlags(); + if(flags & Qt::WindowSoftkeysRespondHint) { + flags |= Qt::WindowSoftkeysVisibleHint; + flags &= ~Qt::WindowSoftkeysRespondHint; + setWindowFlags(flags); // Hides visible window + showFullScreen(); + modeLabel->setText(tr("Fullscreen with softkeys")); + } else if(flags & Qt::WindowSoftkeysVisibleHint) { + flags &= ~Qt::WindowSoftkeysVisibleHint; + flags &= ~Qt::WindowSoftkeysRespondHint; + setWindowFlags(flags); // Hides visible window + showMaximized(); + modeLabel->setText(tr("Normal Maximized")); + } else { + flags &= ~Qt::WindowSoftkeysVisibleHint; + flags |= Qt::WindowSoftkeysRespondHint; + setWindowFlags(flags); // Hides visible window + showFullScreen(); + modeLabel->setText(tr("Fullscreen with SK respond")); + } + } +} + void MainWindow::exitApplication() { qApp->exit(); diff --git a/examples/widgets/softkeys/softkeys.h b/examples/widgets/softkeys/softkeys.h index bae31e7..d533484 100644 --- a/examples/widgets/softkeys/softkeys.h +++ b/examples/widgets/softkeys/softkeys.h @@ -57,21 +57,24 @@ private slots: void okPressed(); void cancelPressed(); void setCustomSoftKeys(); + void setMode(); public: MainWindow(QWidget *parent = 0); ~MainWindow(); private: QGridLayout *layout; QWidget *central; - QTextEdit* textEditor; + QTextEdit *textEditor; QLabel *infoLabel; - QPushButton* toggleButton; - QPushButton* pushButton; - QMenu* fileMenu; - QAction* addSoftKeysAct; - QAction* exit; - QAction* ok; - QAction* cancel; + QPushButton *toggleButton; + QPushButton *pushButton; + QPushButton *modeButton; + QLabel *modeLabel; + QMenu *fileMenu; + QAction *addSoftKeysAct; + QAction *exit; + QAction *ok; + QAction *cancel; }; //! [0] diff --git a/examples/widgets/windowflags/controllerwindow.cpp b/examples/widgets/windowflags/controllerwindow.cpp index 0277794..a1e5455 100644 --- a/examples/widgets/windowflags/controllerwindow.cpp +++ b/examples/widgets/windowflags/controllerwindow.cpp @@ -58,7 +58,7 @@ ControllerWindow::ControllerWindow() bottomLayout->addStretch(); bottomLayout->addWidget(quitButton); - QVBoxLayout *mainLayout = new QVBoxLayout; + QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->addWidget(typeGroupBox); mainLayout->addWidget(hintsGroupBox); mainLayout->addLayout(bottomLayout); @@ -149,7 +149,7 @@ void ControllerWindow::createTypeGroupBox() splashScreenRadioButton = createRadioButton(tr("Splash screen")); windowRadioButton->setChecked(true); - QGridLayout *layout = new QGridLayout; + QVBoxLayout *layout = new QGridLayout; layout->addWidget(windowRadioButton, 0, 0); layout->addWidget(dialogRadioButton, 1, 0); layout->addWidget(sheetRadioButton, 2, 0); diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 177bee4..bc8d452 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -299,7 +299,9 @@ public: MacWindowToolBarButtonHint = 0x10000000, BypassGraphicsProxyWidget = 0x20000000, WindowOkButtonHint = 0x00080000, - WindowCancelButtonHint = 0x00100000 + WindowCancelButtonHint = 0x00100000, + WindowSoftkeysVisibleHint = 0x40000000, + WindowSoftkeysRespondHint = 0x80000000 #ifdef QT3_SUPPORT , diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 392ece3..6968773 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2146,6 +2146,14 @@ \value WindowCancelButtonHint Adds a Cancel button to the window decoration of a dialog. Only supported for Windows CE. + \value WindowSoftkeysVisibleHint Makes softkeys visible when widget is fullscreen. + Only supported for Symbian. + + \value WindowSoftkeysRespondHint Makes softkeys to receive key events even + when invisible. With this hint the softkey actions are triggered + even the softkeys are invisible i.e. the window is displayed with + \c showFullscreen(). Only supported for Symbian. + \value WindowType_Mask A mask for extracting the window type part of the window flags. diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 2eecd56..cf8ce62 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -597,9 +597,9 @@ TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCod TUint s60Keysym = QApplicationPrivate::resolveS60ScanCode(keyEvent.iScanCode, keyEvent.iCode); int keyCode; - if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used - keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode); - } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { + if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used + keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode); + } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) { // Normal characters keys. keyCode = s60Keysym; } else { @@ -966,13 +966,26 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); #ifdef Q_WS_S60 // If widget is fullscreen/minimized, hide status pane and button container otherwise show them. - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); + CEikStatusPane *statusPane = S60->statusPane(); + CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer(); TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized)); if (statusPane) statusPane->MakeVisible(visible); - if (buttonGroup) - buttonGroup->MakeVisible(visible); + if (buttonGroup) { + // Visibility + const TBool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen; + const TBool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; + buttonGroup->MakeVisible(visible || (isFullscreen && cbaVisibilityHint)); + + // Responsiviness + CEikCba *cba = static_cast( buttonGroup->ButtonGroup() ); // downcast from MEikButtonGroup + TUint cbaFlags = cba->ButtonGroupFlags(); + if(qwidget->windowFlags() & Qt::WindowSoftkeysRespondHint) + cbaFlags |= EAknCBAFlagRespondWhenInvisible; + else + cbaFlags &= ~EAknCBAFlagRespondWhenInvisible; + cba->SetButtonGroupFlags(cbaFlags); + } #endif } else if (QApplication::activeWindow() == qwidget->window()) { if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) { @@ -1229,7 +1242,7 @@ void qt_init(QApplicationPrivate * /* priv */, int) S60->avkonComponentsSupportTransparency = (value==1) ? true : false; } } -#endif +#endif if (touch) { QApplicationPrivate::navigationMode = Qt::NavigationModeNone; diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 8ac1e31..2a1ecc5 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -73,11 +73,21 @@ bool QSoftKeyManagerPrivateS60::skipCbaUpdate() // Lets not update softkeys if // 1. We don't have application panes, i.e. cba // 2. Our CBA is not active, i.e. S60 native dialog or menu with custom CBA is shown + // 2.1. Except if thre is no current CBA at all and WindowSoftkeysRespondHint is set + // Note: Cannot use IsDisplayingMenuOrDialog since CBA update can be triggered before // menu/dialog CBA is actually displayed i.e. it is being costructed. CEikButtonGroupContainer *appUiCba = S60->buttonGroupContainer(); + // CEikButtonGroupContainer::Current returns 0 if CBA is not visible at all CEikButtonGroupContainer *currentCba = CEikButtonGroupContainer::Current(); - if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) || appUiCba != currentCba) { + // Check if softkey need to be update even they are not visible + bool cbaRespondsWhenInvisible = false; + QWidget *window = QApplication::activeWindow(); + if (window && (window->windowFlags() & Qt::WindowSoftkeysRespondHint)) + cbaRespondsWhenInvisible = true; + + if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes) + || (appUiCba != currentCba && !cbaRespondsWhenInvisible)) { return true; } return false; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index ebd289c..7bbc142 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1042,7 +1042,13 @@ void QWidget::setWindowState(Qt::WindowStates newstate) Q_D(QWidget); Qt::WindowStates oldstate = windowState(); - if (oldstate == newstate) + + const TBool isFullscreen = newstate & Qt::WindowFullScreen; + const TBool cbaRequested = windowFlags() & Qt::WindowSoftkeysVisibleHint; + const TBool cbaVisible = CEikButtonGroupContainer::Current() ? true : false; + const TBool softkeyVisibilityChange = isFullscreen && (cbaRequested != cbaVisible); + + if (oldstate == newstate && !softkeyVisibilityChange) return; if (isWindow()) { @@ -1058,16 +1064,27 @@ void QWidget::setWindowState(Qt::WindowStates newstate) #ifdef Q_WS_S60 // Hide window decoration when switching to fullsccreen / minimized otherwise show decoration. - // The window decoration visibility has to be changed before doing actual window state - // change since in that order the availableGeometry will return directly the right size and + // The window decoration visibility has to be changed before doing actual window state + // change since in that order the availableGeometry will return directly the right size and // we will avoid unnecessarty redraws - CEikStatusPane* statusPane = S60->statusPane(); - CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer(); - TBool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); + CEikStatusPane *statusPane = S60->statusPane(); + CEikButtonGroupContainer *buttonGroup = S60->buttonGroupContainer(); + TBool visible = !(newstate & (Qt::WindowFullScreen | Qt::WindowMinimized)); if (statusPane) statusPane->MakeVisible(visible); - if (buttonGroup) - buttonGroup->MakeVisible(visible); + if (buttonGroup) { + // Visibility + buttonGroup->MakeVisible(visible || (isFullscreen && cbaRequested)); + + // Responsiviness + CEikCba *cba = static_cast( buttonGroup->ButtonGroup() ); // downcast from MEikButtonGroup + TUint cbaFlags = cba->ButtonGroupFlags(); + if(windowFlags() & Qt::WindowSoftkeysRespondHint) + cbaFlags |= EAknCBAFlagRespondWhenInvisible; + else + cbaFlags &= ~EAknCBAFlagRespondWhenInvisible; + cba->SetButtonGroupFlags(cbaFlags); + } #endif // Q_WS_S60 createWinId(); @@ -1080,7 +1097,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate) const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry; if (newstate & Qt::WindowFullScreen) - setGeometry(qApp->desktop()->screenGeometry(this)); + setGeometry(qApp->desktop()->availableGeometry(this)); else if (newstate & Qt::WindowMaximized) setGeometry(qApp->desktop()->availableGeometry(this)); else -- cgit v0.12 From 8113f2d94afd4e25caf12edf9716b7e0a82de1a8 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Mon, 1 Mar 2010 10:21:25 +0200 Subject: Added orientation change support for show/showNormal widgets in S60. Earlier the widget normalGeometry was calculated once when widget was made visible first time. Because geometry was not recalculated the widget displayed with show/showNormal did not change its location or size as a result of orientation change. This lead to unefficient screen usage. This commit makes widget to recalculate its normalGeometry as a result of orientation change, if developer has not set the widget position or size explicitly. Task-number: QTBUG-8551 Reviewed-by: Jason Barron --- src/gui/kernel/qapplication_s60.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index cf8ce62..2a90ba6 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1029,6 +1029,16 @@ void QSymbianControl::HandleResourceChange(int resourceType) } else if (qwidget->isMaximized()) { TRect r = static_cast(S60->appUi())->ClientRect(); SetExtent(r.iTl, r.Size()); + } else if (!qwidget->isMinimized()){ // Normal geometry + if (!qwidget->testAttribute(Qt::WA_Resized)) { + qwidget->adjustSize(); + qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize + } + if (!qwidget->testAttribute(Qt::WA_Moved)) { + TRect r = static_cast(S60->appUi())->ClientRect(); + SetPosition(r.iTl); + qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position + } } break; } -- cgit v0.12 From 3d50a8049b20e01b8a2cb9b954b14302dc6144c6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 26 Feb 2010 17:13:54 +0200 Subject: Added .condition modifier to SUBDIRS. In Symbian, it is now possible to set certain subdirs to be built only when specified define is true when bld.inf is parsed. For example, compile a subdir only when building for emulator: SUBDIRS += winscw_lib winscw_lib.condition = WINSCW Also improved SUBDIRS variable documentation; the modifiers were completely undocumented. Task-number: QT-3017 Reviewed-by: axis --- doc/src/development/qmake-manual.qdoc | 28 +++++++++++++++++++++++++ doc/src/snippets/code/doc_src_qmake-manual.qdoc | 14 +++++++++++++ qmake/generators/symbian/symmake.cpp | 13 +++++++++++- 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index b3d6f72..3157536 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2968,6 +2968,34 @@ For example: \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 51 + It is possible to modify this default behavior of \c SUBDIRS by giving + additional modifiers to \c SUBDIRS elements. Supported modifiers are: + + \table + \header \o Modifier \o Effect + \row \o .subdir \o Use the specified subdirectory instead of \c SUBDIRS value. + \row \o .file \o Specify the subproject \c pro file explicitly. Cannot be + used in conjunction with \c .subdir modifier. + \row \o .condition \o Specifies a \c bld.inf define that must be true for + subproject to be built. Available only on Symbian platform. + \row \o .depends \o This subproject depends on specified subproject. + Available only on platforms that use makefiles. + \row \o .makefile \o The makefile of subproject. + Available only on platforms that use makefiles. + \row \o .target \o Base string used for makefile targets related to this + subproject. + Available only on platforms that use makefiles. + \endtable + + For example, define two subdirectories, both of which reside in a different directory + than the \c SUBDIRS value, and one of the subdirectories must be built before the other: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 149 + + For example, define a subdirectory that is only build for emulator builds in Qt for Symbian: + + \snippet doc/src/snippets/code/doc_src_qmake-manual.qdoc 150 + \target TARGET \section1 TARGET diff --git a/doc/src/snippets/code/doc_src_qmake-manual.qdoc b/doc/src/snippets/code/doc_src_qmake-manual.qdoc index 5a04420..e8c00d3 100644 --- a/doc/src/snippets/code/doc_src_qmake-manual.qdoc +++ b/doc/src/snippets/code/doc_src_qmake-manual.qdoc @@ -982,3 +982,17 @@ MYVARIABLES = LIB addMMPRules(MYCONDITIONS, MYVARIABLES) //! [148] + +//! [149] +SUBDIRS += my_executable my_library +my_executable.subdir = app +my_executable.depends = my_library +my_library.subdir = lib +//! [149] + +//! [150] +symbian { + SUBDIRS += emulator_dll + emulator_dll.condition = WINSCW +} +//! [150] diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index b5a0696..9ade699 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -1317,6 +1317,10 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy fixedItem = item; } + QString condition; + if (!project->isEmpty(item + ".condition")) + condition = project->first(item + ".condition"); + QFileInfo subdir(fileInfo(fixedItem)); QString relativePath = directory.relativeFilePath(fixedItem); QString subdirFileName = subdir.completeBaseName(); @@ -1345,9 +1349,16 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy bldinfDefine = bldinfDefine.toUpper(); removeSpecialCharacters(bldinfDefine); + if (!condition.isEmpty()) + t << "#if defined(" << condition << ")" << endl; + t << "#ifndef " << bldinfDefine << endl; t << "\t#include \"" << bldinfFilename << "\"" << endl; - t << "#endif // " << bldinfDefine << endl; + t << "#endif" << endl; + + if (!condition.isEmpty()) + t << "#endif" << endl; + } // Add supported project platforms -- cgit v0.12 From fc2fab3e08ea577d12166d318863c453e093c2f1 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 1 Mar 2010 12:30:25 +0100 Subject: fix qt_wince_is_windows_mobile_65() This function checked the wrong OS build number. The first Windows mobile 6.5 build is supposed to have build number 21139. Task-number: QTBUG-8418 Reviewed-by: thartman --- src/gui/kernel/qguifunctions_wince.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qguifunctions_wince.cpp b/src/gui/kernel/qguifunctions_wince.cpp index ac4cdc8..f5004b0 100644 --- a/src/gui/kernel/qguifunctions_wince.cpp +++ b/src/gui/kernel/qguifunctions_wince.cpp @@ -278,7 +278,14 @@ int qt_wince_get_version() bool qt_wince_is_windows_mobile_65() { - return ((qt_wince_get_version() == 52) && (qt_wince_get_build() > 2000)); + const DWORD dwFirstWM65BuildNumber = 21139; + OSVERSIONINFO osvi; + osvi.dwOSVersionInfoSize = sizeof(osvi); + if (!GetVersionEx(&osvi)) + return false; + return osvi.dwMajorVersion > 5 + || (osvi.dwMajorVersion == 5 && (osvi.dwMinorVersion > 2 || + (osvi.dwMinorVersion == 2 && osvi.dwBuildNumber >= dwFirstWM65BuildNumber))); } bool qt_wince_is_pocket_pc() { -- cgit v0.12 From 334ed757857d14e075630644495540fb70a3aaae Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 1 Mar 2010 13:04:48 +0100 Subject: fix bad performance penalty for tab widgets for Windows mobile 6.5 Task-number: QTBUG-8419 Reviewed-by: thartman --- src/gui/styles/qwindowsmobilestyle.cpp | 37 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index a264b1b..6e77409 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -4040,25 +4040,26 @@ enum QSliderDirection { SliderUp, SliderDown, SliderLeft, SliderRight }; void QWindowsMobileStylePrivate::tintImagesButton(QColor color) { - if (currentTintButton == color) + if (currentTintButton == color) return; - - imageTabEnd = QImage(tabend_xpm); - imageTabSelectedEnd = QImage(tabselectedend_xpm); - imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); - imageTabMiddle = QImage(tabmiddle_xpm); - tintImage(&imageTabEnd, color, 0.0); - tintImage(&imageTabSelectedEnd, color, 0.0); - tintImage(&imageTabSelectedBegin, color, 0.0); - tintImage(&imageTabMiddle, color, 0.0); - - if (!doubleControls) { - int height = imageTabMiddle.height() / 2 + 1; - imageTabEnd = imageTabEnd.scaledToHeight(height); - imageTabMiddle = imageTabMiddle.scaledToHeight(height); - imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); - imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); - } + currentTintButton = color; + + imageTabEnd = QImage(tabend_xpm); + imageTabSelectedEnd = QImage(tabselectedend_xpm); + imageTabSelectedBegin = QImage(tabselectedbeginn_xpm); + imageTabMiddle = QImage(tabmiddle_xpm); + tintImage(&imageTabEnd, color, 0.0); + tintImage(&imageTabSelectedEnd, color, 0.0); + tintImage(&imageTabSelectedBegin, color, 0.0); + tintImage(&imageTabMiddle, color, 0.0); + + if (!doubleControls) { + int height = imageTabMiddle.height() / 2 + 1; + imageTabEnd = imageTabEnd.scaledToHeight(height); + imageTabMiddle = imageTabMiddle.scaledToHeight(height); + imageTabSelectedEnd = imageTabSelectedEnd.scaledToHeight(height); + imageTabSelectedBegin = imageTabSelectedBegin.scaledToHeight(height); + } } void QWindowsMobileStylePrivate::tintImagesHigh(QColor color) -- cgit v0.12 From 1ab5feb6260589f254ed209816cb67dbe9d3e4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 1 Mar 2010 13:44:22 +0100 Subject: Fixed QPixmap::load() to not modify referenced copies (again!) Change 8721d060a67a01ac891cab9d3d17aacf7373bcf0 broke the previous fix. Task-number: QTBUG-8606 Reviewed-by: Gunnar --- src/gui/image/qpixmap.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 08003e5..7b225eb 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -831,21 +831,14 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers if (QPixmapCache::find(key, *this)) return true; - bool ok; - - if (data) { - ok = data->fromFile(fileName, format, flags); - } else { - QScopedPointer tmp(QPixmapData::create(0, 0, QPixmapData::PixmapType)); - ok = tmp->fromFile(fileName, format, flags); - if (ok) - data = tmp.take(); - } - - if (ok) + QScopedPointer tmp(QPixmapData::create(0, 0, data ? data->type : QPixmapData::PixmapType)); + if (tmp->fromFile(fileName, format, flags)) { + data = tmp.take(); QPixmapCache::insert(key, *this); + return true; + } - return ok; + return false; } /*! -- cgit v0.12 From f3af7b746221cb44899f3e433659791f75255f21 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 1 Mar 2010 14:16:41 +0100 Subject: Ensure that a library path with a space in it gets quoted on Windows This was not happening when -L and -l was used and the path specified with -L was quoted. It would lose the quotes when combining it to get the full path for the library it found. Task-number: QTBUG-2433 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/winmakefile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 9d3b4c6..0d03fa3 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -150,7 +150,10 @@ Win32MakefileGenerator::findLibraries(const QString &where) if(QMakeMetaInfo::libExists((*it).local() + Option::dir_sep + lib) || exists((*it).local() + Option::dir_sep + lib + extension)) { out = (*it).real() + Option::dir_sep + lib + extension; - break; + if (out.contains(QLatin1Char(' '))) { + out.prepend(QLatin1Char('\"')); + out.append(QLatin1Char('\"')); + } } } } -- cgit v0.12 From 283b77b4e956540ac9370cd0e05f817b14a134d1 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 1 Mar 2010 14:26:10 +0100 Subject: Readd a line that got removed by accident in previous change A line got removed by accident in the change f3af7b746221cb44899f3e433659791f75255f21, this patch readds it back. Reviewed-by: TrustMe --- qmake/generators/win32/winmakefile.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 0d03fa3..c36cc9c 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -154,6 +154,7 @@ Win32MakefileGenerator::findLibraries(const QString &where) out.prepend(QLatin1Char('\"')); out.append(QLatin1Char('\"')); } + break; } } } -- cgit v0.12 From a5e5f9925e7f945e6b95452662be6981b41adecb Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 1 Mar 2010 14:27:20 +0100 Subject: QHostInfo: Forgot to free some stuff on application exit. Reviewed-by: TrustMe --- src/network/kernel/qhostinfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 9de499e..b23f6db 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -451,6 +451,11 @@ QHostInfoLookupManager::QHostInfoLookupManager() : mutex(QMutex::Recursive), was QHostInfoLookupManager::~QHostInfoLookupManager() { wasDeleted = true; + + // don't qDeleteAll currentLookups, the QThreadPool has ownership + qDeleteAll(postponedLookups); + qDeleteAll(scheduledLookups); + qDeleteAll(finishedLookups); } void QHostInfoLookupManager::work() -- cgit v0.12 From 5255c09fceddf5a1b79c6016f51c0d721c599c9b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 1 Mar 2010 14:55:25 +0100 Subject: handle WM_GESTURE events on WinCE, only if QT_WINCE_GESTURES is defined Otherwise, we get annoying qWarning messages. Reviewed-by: thartman --- src/gui/kernel/qapplication_win.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index aac834d..da6869d 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -2524,6 +2524,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam } result = false; break; +#if !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES) case WM_GESTURE: { GESTUREINFO gi; memset(&gi, 0, sizeof(GESTUREINFO)); @@ -2556,6 +2557,7 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam result = true; break; } +#endif // !defined(Q_WS_WINCE) || defined(QT_WINCE_GESTURES) default: result = false; // event was not processed break; -- cgit v0.12 From 4be79721e6db9e460d00eb13a0736be8eca36721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 1 Mar 2010 15:07:02 +0100 Subject: Fix windowflags example --- examples/widgets/windowflags/controllerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/windowflags/controllerwindow.cpp b/examples/widgets/windowflags/controllerwindow.cpp index a1e5455..fb82b8f 100644 --- a/examples/widgets/windowflags/controllerwindow.cpp +++ b/examples/widgets/windowflags/controllerwindow.cpp @@ -149,7 +149,7 @@ void ControllerWindow::createTypeGroupBox() splashScreenRadioButton = createRadioButton(tr("Splash screen")); windowRadioButton->setChecked(true); - QVBoxLayout *layout = new QGridLayout; + QGridLayout *layout = new QGridLayout; layout->addWidget(windowRadioButton, 0, 0); layout->addWidget(dialogRadioButton, 1, 0); layout->addWidget(sheetRadioButton, 2, 0); -- cgit v0.12 From d04f5336f769d9e5d2f9105e1da4a7d23ea91795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 1 Mar 2010 15:08:26 +0100 Subject: Fixed qDrawPixmaps() to draw on integer coordinates on Mac OS X. For some reason, doing a QPainter::translate(-0.5, 0) and then QPainter::drawPixmap(0.5, 0, ...) doesn't result in a zero transformation on Mac OS X. This is a workaround where we calculate the device coords ourselves if it's only a simple translate operation. Task-number: QTBUG-8455 Reviewed-by: Kim --- src/gui/painting/qdrawutil.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 5619a2e..35bf2bf 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1361,14 +1361,21 @@ void qDrawPixmaps(QPainter *painter, const QDrawPixmaps::Data *drawingData, int for (int i = 0; i < dataCount; ++i) { QTransform transform = oldTransform; - transform.translate(drawingData[i].point.x(), drawingData[i].point.y()); - transform.rotate(drawingData[i].rotation); - painter->setOpacity(oldOpacity * drawingData[i].opacity); + qreal xOffset = 0; + qreal yOffset = 0; + if (drawingData[i].rotation == 0) { + xOffset = drawingData[i].point.x(); + yOffset = drawingData[i].point.y(); + } else { + transform.translate(drawingData[i].point.x(), drawingData[i].point.y()); + transform.rotate(drawingData[i].rotation); + } painter->setTransform(transform); + painter->setOpacity(oldOpacity * drawingData[i].opacity); qreal w = drawingData[i].scaleX * drawingData[i].source.width(); qreal h = drawingData[i].scaleY * drawingData[i].source.height(); - painter->drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, drawingData[i].source); + painter->drawPixmap(QRectF(-0.5 * w + xOffset, -0.5 * h + yOffset, w, h), pixmap, drawingData[i].source); } painter->setOpacity(oldOpacity); -- cgit v0.12 From 65f993d679140fb2dc29b48c9d9d8d2fc5af893d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 1 Mar 2010 15:21:14 +0100 Subject: QObject: fix crash when deleteing the receiver object withing a DirectConncetion involving two threads. We did not set the sender(), but we tried to reset it anyway. Task-number: QTBUG-7935 Reviewed-by: Brad --- src/corelib/kernel/qobject.cpp | 17 ++++++++++------- tests/auto/qobject/tst_qobject.cpp | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 5298fff..689e44c 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3264,12 +3264,14 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign const int method = c->method; QObjectPrivate::Sender currentSender; - currentSender.sender = sender; - currentSender.signal = signal_absolute_index; - currentSender.ref = 1; + const bool receiverInSameThread = currentThreadData == receiver->d_func()->threadData; QObjectPrivate::Sender *previousSender = 0; - if (currentThreadData == receiver->d_func()->threadData) + if (receiverInSameThread) { + currentSender.sender = sender; + currentSender.signal = signal_absolute_index; + currentSender.ref = 1; previousSender = QObjectPrivate::setCurrentSender(receiver, ¤tSender); + } locker.unlock(); if (qt_signal_spy_callback_set.slot_begin_callback != 0) { @@ -3285,8 +3287,8 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign metacall(receiver, QMetaObject::InvokeMetaMethod, method, argv ? argv : empty_argv); } QT_CATCH(...) { locker.relock(); - - QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); + if (receiverInSameThread) + QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); --connectionLists->inUse; Q_ASSERT(connectionLists->inUse >= 0); @@ -3301,7 +3303,8 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign locker.relock(); - QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); + if (receiverInSameThread) + QObjectPrivate::resetCurrentSender(receiver, ¤tSender, previousSender); if (connectionLists->orphaned) break; diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp index 4fa6aaa..985dfa4 100644 --- a/tests/auto/qobject/tst_qobject.cpp +++ b/tests/auto/qobject/tst_qobject.cpp @@ -2647,6 +2647,16 @@ void tst_QObject::installEventFilter() QVERIFY(spy.eventList().isEmpty()); } +class EmitThread : public QThread +{ Q_OBJECT +public: + void run(void) { + emit work(); + } +signals: + void work(); +}; + class DeleteObject : public QObject { Q_OBJECT @@ -2712,6 +2722,16 @@ void tst_QObject::deleteSelfInSlot() QVERIFY(thread.wait(10000)); } + + { + EmitThread sender; + DeleteObject *receiver = new DeleteObject(); + connect(&sender, SIGNAL(work()), receiver, SLOT(deleteSelf()), Qt::DirectConnection); + QPointer p = receiver; + sender.start(); + QVERIFY(sender.wait(10000)); + QVERIFY(p.isNull()); + } } class DisconnectObject : public QObject -- cgit v0.12 From d6910f12cdaac746b0b336cb0d8b9b4ea830e9e2 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 1 Mar 2010 16:57:30 +0100 Subject: Fix crash using openPersistentEditor and setRowHidden on a QTableView Hiding widget might result in focus changes that will modify the list of editors while iterating over it. Same fixe as in commit 386726f7184cc77f0692e2ba24d85ebc53a39569 The test comes from the Task Task-number: QTBUG-8585 Reviewed-by: Thierry --- src/gui/itemviews/qabstractitemview.cpp | 8 ++++-- tests/auto/qtableview/tst_qtableview.cpp | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 4931b46..2faf755 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2568,6 +2568,7 @@ void QAbstractItemView::updateEditorGeometries() QStyleOptionViewItemV4 option = d->viewOptionsV4(); QList::iterator it = d->editors.begin(); QWidgetList editorsToRelease; + QWidgetList editorsToHide; while (it != d->editors.end()) { QModelIndex index = it->index; QWidget *editor = it->editor; @@ -2579,7 +2580,7 @@ void QAbstractItemView::updateEditorGeometries() if (delegate) delegate->updateEditorGeometry(editor, option, index); } else { - editor->hide(); + editorsToHide << editor; } ++it; } else { @@ -2588,8 +2589,11 @@ void QAbstractItemView::updateEditorGeometries() } } - //we release the editor outside of the loop because it might change the focus and try + //we hide and release the editor outside of the loop because it might change the focus and try //to change the d->editors list. + for (int i = 0; i < editorsToHide.count(); ++i) { + editorsToHide.at(i)->hide(); + } for (int i = 0; i < editorsToRelease.count(); ++i) { d->releaseEditor(editorsToRelease.at(i)); } diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 430712c..a5cbbd4 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -199,6 +199,7 @@ private slots: void taskQTBUG_5062_spansInconsistency(); void taskQTBUG_4516_clickOnRichTextLabel(); void taskQTBUG_5237_wheelEventOnHeader(); + void taskQTBUG_8585_crashForNoGoodReason(); void mouseWheel_data(); void mouseWheel(); @@ -3948,5 +3949,50 @@ void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader() QVERIFY(sbValueBefore != sbValueAfter); } +class TestTableView : public QTableView { +Q_OBJECT +public: + TestTableView(QWidget *parent = 0) : QTableView(parent) + { + connect(this, SIGNAL(entered(const QModelIndex&)), this, SLOT(openEditor(const QModelIndex&))); + } + ~TestTableView(){} +public slots: + void onDataChanged() + { + for (int i = 0; i < model()->rowCount(); i++) { + setRowHidden(i, model()->data(model()->index(i, 0)).toBool()); + } + } + + void openEditor(const QModelIndex& index) + { openPersistentEditor(index); } +}; + + +void tst_QTableView::taskQTBUG_8585_crashForNoGoodReason() +{ + QStandardItemModel model; + model.insertColumn(0, QModelIndex()); + for(int i = 0; i < 20; i++) + { + model.insertRow(i); + } + + TestTableView w; + w.setMouseTracking(true); + w.setModel(&model); + connect(&model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), &w, SLOT(onDataChanged())); + w.show(); + QTest::qWaitForWindowShown(&w); + for (int i = 0; i < 10; i++) + { + QTest::mouseMove(w.viewport(), QPoint(50, 20)); + w.model()->setData(w.indexAt(QPoint(50, 20)), true); + QTest::mouseMove(w.viewport(), QPoint(50, 25)); + } +} + + QTEST_MAIN(tst_QTableView) #include "tst_qtableview.moc" -- cgit v0.12 From 1dc72f731d3024a34fbcb1858cff6f460e4d2ddc Mon Sep 17 00:00:00 2001 From: ck Date: Mon, 1 Mar 2010 17:45:15 +0100 Subject: Help system: Build search index with low priority. Reviewed-by: kh1 --- tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp | 2 +- tools/assistant/lib/qhelpsearchindexwriter_default.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp index 59067cf..4f9fa3f 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp @@ -585,7 +585,7 @@ void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, this->m_indexFilesFolder = indexFilesFolder; mutex.unlock(); - start(QThread::NormalPriority); + start(QThread::LowestPriority); } void QHelpSearchIndexWriter::optimizeIndex() diff --git a/tools/assistant/lib/qhelpsearchindexwriter_default.cpp b/tools/assistant/lib/qhelpsearchindexwriter_default.cpp index cb3e49c..827d145 100644 --- a/tools/assistant/lib/qhelpsearchindexwriter_default.cpp +++ b/tools/assistant/lib/qhelpsearchindexwriter_default.cpp @@ -191,7 +191,7 @@ void QHelpSearchIndexWriter::updateIndex(const QString &collectionFile, this->m_collectionFile = collectionFile; this->m_indexFilesFolder = indexFilesFolder; - start(QThread::NormalPriority); + start(QThread::LowestPriority); } void QHelpSearchIndexWriter::run() -- cgit v0.12 From f97df3f53f133c7ea68816d9275dde5c153f3257 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 1 Mar 2010 18:17:21 +0100 Subject: Doc: QRegExp::WillcardUnix: the documentation did not show the slash Reviewed-by: David Boddie --- src/corelib/tools/qregexp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index 25255f9..b9e273f 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -523,7 +523,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from, \endtable In the mode Wildcard, the wildcard characters cannot be - escaped. In the mode WildcardUnix, the character '\' escapes the + escaped. In the mode WildcardUnix, the character '\\' escapes the wildcard. For example if we are in wildcard mode and have strings which @@ -3774,7 +3774,7 @@ static void invalidateEngine(QRegExpPrivate *priv) \value WildcardUnix This is similar to Wildcard but with the behavior of a Unix shell. The wildcard characters can be escaped - with the character "\". + with the character "\\". \value FixedString The pattern is a fixed string. This is equivalent to using the RegExp pattern on a string in -- cgit v0.12 From 6ff6998ad91a3cfee233cb25c750144eae8881b3 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Tue, 2 Mar 2010 08:53:12 +1000 Subject: Fix build breakage in windowflags example Reviewed-by: Sarah Smith --- examples/widgets/windowflags/controllerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/windowflags/controllerwindow.cpp b/examples/widgets/windowflags/controllerwindow.cpp index a1e5455..fb82b8f 100644 --- a/examples/widgets/windowflags/controllerwindow.cpp +++ b/examples/widgets/windowflags/controllerwindow.cpp @@ -149,7 +149,7 @@ void ControllerWindow::createTypeGroupBox() splashScreenRadioButton = createRadioButton(tr("Splash screen")); windowRadioButton->setChecked(true); - QVBoxLayout *layout = new QGridLayout; + QGridLayout *layout = new QGridLayout; layout->addWidget(windowRadioButton, 0, 0); layout->addWidget(dialogRadioButton, 1, 0); layout->addWidget(sheetRadioButton, 2, 0); -- cgit v0.12 From 9842e823a5a3df8d786ddc1c6fe355db8f511354 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 1 Mar 2010 13:11:52 -0800 Subject: Uncomment #DIRECTFB_DRAWINGOPERATIONS in pri-file This has no effect unless QT_DIRECTFB_WARN_ON_RASTERFALLBACKS or QT_DIRECTFB_DISABLE_RASTERFALLBACKS is defined but will decrease likelyhood of customers encountering strange compile errors if they don't uncomment it when using these defines. Reviewed-by: Noam Rosenthal --- src/gui/embedded/directfb.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/embedded/directfb.pri b/src/gui/embedded/directfb.pri index bd1d947..1795bbd 100644 --- a/src/gui/embedded/directfb.pri +++ b/src/gui/embedded/directfb.pri @@ -15,7 +15,7 @@ #DEFINES += QT_DIRECTFB_TIMING #DEFINES += QT_NO_DIRECTFB_OPAQUE_DETECTION #DEFINES += QT_NO_DIRECTFB_STRETCHBLIT -#DIRECTFB_DRAWINGOPERATIONS=DRAW_RECTS|DRAW_LINES|DRAW_IMAGE|DRAW_PIXMAP|DRAW_TILED_PIXMAP|STROKE_PATH|DRAW_PATH|DRAW_POINTS|DRAW_ELLIPSE|DRAW_POLYGON|DRAW_TEXT|FILL_PATH|FILL_RECT|DRAW_COLORSPANS|DRAW_ROUNDED_RECT +DIRECTFB_DRAWINGOPERATIONS=DRAW_RECTS|DRAW_LINES|DRAW_IMAGE|DRAW_PIXMAP|DRAW_TILED_PIXMAP|STROKE_PATH|DRAW_PATH|DRAW_POINTS|DRAW_ELLIPSE|DRAW_POLYGON|DRAW_TEXT|FILL_PATH|FILL_RECT|DRAW_COLORSPANS|DRAW_ROUNDED_RECT #DEFINES += \"QT_DIRECTFB_WARN_ON_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\" #DEFINES += \"QT_DIRECTFB_DISABLE_RASTERFALLBACKS=$$DIRECTFB_DRAWINGOPERATIONS\" -- cgit v0.12 From 8b90fe35a737a71dbc15de48088fc100241f701c Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 1 Mar 2010 13:10:37 -0800 Subject: Add support for composition mode DSPD_DST in DFB This porter duff rule was added in DirectFB 1.2 Reviewed-by: Noam Rosenthal --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 2b11058..d6e1a03 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -944,6 +944,11 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m case QPainter::CompositionMode_DestinationOut: surface->SetPorterDuff(surface, DSPD_DST_OUT); break; +#if (Q_DIRECTFB_VERSION >= 0x010200) + case QPainter::CompositionMode_Destination: + surface->SetPorterDuff(surface, DSPD_DST); + break; +#endif #if (Q_DIRECTFB_VERSION >= 0x010000) case QPainter::CompositionMode_SourceAtop: surface->SetPorterDuff(surface, DSPD_SRC_ATOP); -- cgit v0.12 From 629b3e0d03875665a75a5a1c40d53dd478fdc982 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 1 Mar 2010 14:45:40 -0800 Subject: Don't disable alpha when filling with opaque color Qt heuristics say that a QPixmap becomes an alpha pixmap when filled with a color with alpha != 255 but not that it returns to being opaque when filled with a color with alpha == 255 Reviewed-by: Noam Rosenthal --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index ba50329..b5ac67d 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -425,7 +425,7 @@ void QDirectFBPixmapData::fill(const QColor &color) Q_ASSERT(dfbSurface); - alpha = (color.alpha() < 255); + alpha |= (color.alpha() < 255); if (alpha && isOpaqueFormat(imageFormat)) { QSize size; -- cgit v0.12 From 6f20bd49782045897b5cb067aa42cc2e0d955770 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 1 Mar 2010 12:57:39 -0800 Subject: Make composition modes work better for DirectFB It seems that I have to premultiply the colors I pass to IDirectFBSurface->SetColor when composition mode != Source|SourceIn. It now seems to behave the same way as the raster engine which I guess should be considered the authority on this matter. Reviewed-by: Noam Rosenthal --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 99 +++++++++------------- 1 file changed, 39 insertions(+), 60 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index d6e1a03..388e369 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -68,11 +68,10 @@ public: }; enum CompositionModeStatus { - PorterDuff_None = 0x00, - PorterDuff_SupportedBlits = 0x01, - PorterDuff_SupportedPrimitives = 0x02, - PorterDuff_SupportedOpaquePrimitives = 0x04, - PorterDuff_Dirty = 0x10 + PorterDuff_None = 0x0, + PorterDuff_Supported = 0x1, + PorterDuff_PremultiplyColors = 0x2, + PorterDuff_AlwaysBlend = 0x4 }; enum ClipType { @@ -97,7 +96,6 @@ public: inline void unlock(); static inline void unlock(QDirectFBPaintDevice *device); - inline bool testCompositionMode(const QPen *pen, const QBrush *brush, const QColor *color = 0) const; inline bool isSimpleBrush(const QBrush &brush) const; void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos); @@ -130,6 +128,7 @@ public: ClipType clipType; QDirectFBPaintDevice *dfbDevice; uint compositionModeStatus; + bool isPremultiplied; bool inClip; QRect currentClip; @@ -287,6 +286,7 @@ bool QDirectFBPaintEngine::begin(QPaintDevice *device) qFatal("QDirectFBPaintEngine used on an invalid device: 0x%x", device->devType()); } + d->isPremultiplied = QDirectFBScreen::isPremultiplied(d->dfbDevice->format()); d->prepare(d->dfbDevice); gccaps = AllFeatures; @@ -413,7 +413,7 @@ void QDirectFBPaintEngine::drawRects(const QRect *rects, int rectCount) || !d->simplePen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip || !d->isSimpleBrush(brush) - || !d->testCompositionMode(&pen, &brush)) { + || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); @@ -443,7 +443,7 @@ void QDirectFBPaintEngine::drawRects(const QRectF *rects, int rectCount) || !d->simplePen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip || !d->isSimpleBrush(brush) - || !d->testCompositionMode(&pen, &brush)) { + || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { RASTERFALLBACK(DRAW_RECTS, rectCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawRects(rects, rectCount); @@ -468,7 +468,7 @@ void QDirectFBPaintEngine::drawLines(const QLine *lines, int lineCount) const QPen &pen = state()->pen; if (!d->simplePen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || !d->testCompositionMode(&pen, 0)) { + || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); @@ -488,7 +488,7 @@ void QDirectFBPaintEngine::drawLines(const QLineF *lines, int lineCount) const QPen &pen = state()->pen; if (!d->simplePen || d->clipType == QDirectFBPaintEnginePrivate::ComplexClip - || !d->testCompositionMode(&pen, 0)) { + || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { RASTERFALLBACK(DRAW_LINES, lineCount, VOID_ARG(), VOID_ARG()); d->lock(); QRasterPaintEngine::drawLines(lines, lineCount); @@ -526,7 +526,7 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image, */ #if !defined QT_NO_DIRECTFB_PREALLOCATED || defined QT_DIRECTFB_IMAGECACHE - if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits) + if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) || (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size()) @@ -575,7 +575,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, QPixmapData *data = pixmap.pixmapData(); Q_ASSERT(data->classId() == QPixmapData::DirectFBClass); QDirectFBPixmapData *dfbData = static_cast(data); - if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits) + if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) || (!d->supportsStretchBlit() && state()->matrix.mapRect(r).size() != sr.size())) { @@ -606,7 +606,7 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r, RASTERFALLBACK(DRAW_TILED_PIXMAP, r, pixmap.size(), offset); d->lock(); QRasterPaintEngine::drawTiledPixmap(r, pixmap, offset); - } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits) + } else if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) || (!d->supportsStretchBlit() && state()->matrix.isScaling())) { @@ -720,7 +720,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) switch (brush.style()) { case Qt::SolidPattern: { if (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported - || !d->testCompositionMode(0, &brush)) { + || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { break; } const QColor color = brush.color(); @@ -732,7 +732,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) return; } case Qt::TexturePattern: { - if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_SupportedBlits) + if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported) || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported) || (!d->supportsStretchBlit() && state()->matrix.isScaling())) { break; @@ -760,7 +760,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QColor &color) Q_D(QDirectFBPaintEngine); if ((d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported) || (d->clipType == QDirectFBPaintEnginePrivate::ComplexClip) - || !d->testCompositionMode(0, 0, &color)) { + || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { RASTERFALLBACK(FILL_RECT, rect, color, VOID_ARG()); d->lock(); QRasterPaintEngine::fillRect(rect, color); @@ -804,7 +804,7 @@ QDirectFBPaintEnginePrivate::QDirectFBPaintEnginePrivate(QDirectFBPaintEngine *p : surface(0), antialiased(false), simplePen(false), transformationType(0), opacity(255), clipType(ClipUnset), dfbDevice(0), - compositionModeStatus(0), inClip(false), q(p) + compositionModeStatus(0), isPremultiplied(false), inClip(false), q(p) { fb = QDirectFBScreen::instance()->dfb(); surfaceCache = new SurfaceCache; @@ -820,36 +820,6 @@ bool QDirectFBPaintEnginePrivate::isSimpleBrush(const QBrush &brush) const return (brush.style() == Qt::NoBrush) || (brush.style() == Qt::SolidPattern && !antialiased); } -bool QDirectFBPaintEnginePrivate::testCompositionMode(const QPen *pen, const QBrush *brush, const QColor *color) const -{ - Q_ASSERT(!pen || pen->style() == Qt::NoPen || pen->style() == Qt::SolidLine); - Q_ASSERT(!brush || brush->style() == Qt::NoBrush || brush->style() == Qt::SolidPattern); - switch (compositionModeStatus & (QDirectFBPaintEnginePrivate::PorterDuff_SupportedOpaquePrimitives - |QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives)) { - case QDirectFBPaintEnginePrivate::PorterDuff_SupportedPrimitives: - return true; - case QDirectFBPaintEnginePrivate::PorterDuff_SupportedOpaquePrimitives: - if (pen && pen->style() == Qt::SolidLine && pen->color().alpha() != 255) - return false; - if (brush) { - if (brush->style() == Qt::SolidPattern && brush->color().alpha() != 255) { - return false; - } - } else if (color && color->alpha() != 255) { - return false; - } - return true; - case QDirectFBPaintEnginePrivate::PorterDuff_None: - return false; - default: - // ### PorterDuff_SupportedOpaquePrimitives|PorterDuff_SupportedPrimitives can't be combined - break; - } - Q_ASSERT(0); - return false; -} - - void QDirectFBPaintEnginePrivate::lock() { // We will potentially get a new pointer to the buffer after a @@ -912,21 +882,23 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m static const bool forceRasterFallBack = qgetenv("QT_DIRECTFB_FORCE_RASTER").toInt() > 0; if (forceRasterFallBack) { - compositionModeStatus = 0; + compositionModeStatus = PorterDuff_None; return; } - compositionModeStatus = PorterDuff_SupportedBlits; + compositionModeStatus = PorterDuff_Supported|PorterDuff_PremultiplyColors|PorterDuff_AlwaysBlend; switch (mode) { case QPainter::CompositionMode_Clear: surface->SetPorterDuff(surface, DSPD_CLEAR); break; case QPainter::CompositionMode_Source: surface->SetPorterDuff(surface, DSPD_SRC); - compositionModeStatus |= PorterDuff_SupportedOpaquePrimitives; + compositionModeStatus &= ~PorterDuff_AlwaysBlend; + if (!isPremultiplied) + compositionModeStatus &= ~PorterDuff_PremultiplyColors; break; case QPainter::CompositionMode_SourceOver: - compositionModeStatus |= PorterDuff_SupportedPrimitives; + compositionModeStatus &= ~PorterDuff_AlwaysBlend; surface->SetPorterDuff(surface, DSPD_SRC_OVER); break; case QPainter::CompositionMode_DestinationOver: @@ -934,6 +906,8 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m break; case QPainter::CompositionMode_SourceIn: surface->SetPorterDuff(surface, DSPD_SRC_IN); + if (!isPremultiplied) + compositionModeStatus &= ~PorterDuff_PremultiplyColors; break; case QPainter::CompositionMode_DestinationIn: surface->SetPorterDuff(surface, DSPD_DST_IN); @@ -964,7 +938,7 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m break; #endif default: - compositionModeStatus = 0; + compositionModeStatus = PorterDuff_None; break; } } @@ -986,9 +960,6 @@ void QDirectFBPaintEnginePrivate::prepareForBlit(bool alpha) } surface->SetColor(surface, 0xff, 0xff, 0xff, opacity); surface->SetBlittingFlags(surface, blittingFlags); - if (compositionModeStatus & PorterDuff_Dirty) { - setCompositionMode(q->state()->composition_mode); - } } static inline uint ALPHA_MUL(uint x, uint a) @@ -1001,12 +972,20 @@ static inline uint ALPHA_MUL(uint x, uint a) void QDirectFBPaintEnginePrivate::setDFBColor(const QColor &color) { Q_ASSERT(surface); + Q_ASSERT(compositionModeStatus & PorterDuff_Supported); const quint8 alpha = (opacity == 255 ? color.alpha() : ALPHA_MUL(color.alpha(), opacity)); - surface->SetColor(surface, color.red(), color.green(), color.blue(), alpha); - surface->SetPorterDuff(surface, DSPD_NONE); - surface->SetDrawingFlags(surface, alpha == 255 ? DSDRAW_NOFX : DSDRAW_BLEND); - compositionModeStatus |= PorterDuff_Dirty; + QColor col; + if (compositionModeStatus & PorterDuff_PremultiplyColors) { + col = QColor(ALPHA_MUL(color.red(), alpha), + ALPHA_MUL(color.green(), alpha), + ALPHA_MUL(color.blue(), alpha), + alpha); + } else { + col = QColor(color.red(), color.green(), color.blue(), alpha); + } + surface->SetColor(surface, col.red(), col.green(), col.blue(), col.alpha()); + surface->SetDrawingFlags(surface, alpha == 255 && !(compositionModeStatus & PorterDuff_AlwaysBlend) ? DSDRAW_NOFX : DSDRAW_BLEND); } IDirectFBSurface *QDirectFBPaintEnginePrivate::getSurface(const QImage &img, bool *release) -- cgit v0.12 From 0fede209124a20ea8a8c75c6b83e5377a56dda4a Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 2 Mar 2010 10:05:49 +1000 Subject: Fix warnings in AudioInput example. Reviewed-by: Kurt Korbatits --- examples/multimedia/audioinput/audioinput.cpp | 2 ++ examples/multimedia/audioinput/audioinput.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/multimedia/audioinput/audioinput.cpp b/examples/multimedia/audioinput/audioinput.cpp index b01a396..7c2cc30 100644 --- a/examples/multimedia/audioinput/audioinput.cpp +++ b/examples/multimedia/audioinput/audioinput.cpp @@ -76,6 +76,7 @@ AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) case QAudioFormat::SignedInt: m_maxAmplitude = 127; break; + default: ; } break; case 16: @@ -86,6 +87,7 @@ AudioInfo::AudioInfo(const QAudioFormat &format, QObject *parent) case QAudioFormat::SignedInt: m_maxAmplitude = 32767; break; + default: ; } break; } diff --git a/examples/multimedia/audioinput/audioinput.h b/examples/multimedia/audioinput/audioinput.h index f87c682..be721de 100644 --- a/examples/multimedia/audioinput/audioinput.h +++ b/examples/multimedia/audioinput/audioinput.h @@ -119,8 +119,8 @@ private: QPushButton *m_suspendResumeButton; QComboBox *m_deviceBox; - AudioInfo *m_audioInfo; QAudioDeviceInfo m_device; + AudioInfo *m_audioInfo; QAudioFormat m_format; QAudioInput *m_audioInput; QIODevice *m_input; -- cgit v0.12 From 48a518bd4a761e2027729096f9a1bb552cb83f9e Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 2 Mar 2010 10:11:54 +1000 Subject: Fix Audio input on OSX 10.6. Task-number: QTBUG-5741 Reviewed-by: Kurt Korbatits --- src/multimedia/audio/qaudioinput_mac_p.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index 7251513..c52c6c4 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -169,8 +169,10 @@ public: void reset() { - for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) + for (UInt32 i = 0; i < bfs->mNumberBuffers; ++i) { bfs->mBuffers[i].mDataByteSize = dataSize; + bfs->mBuffers[i].mData = 0; + } } private: -- cgit v0.12 From b580c13afb26592b755956d809b02fd8fd5e99cd Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Tue, 2 Mar 2010 10:25:47 +1000 Subject: Fix namespace issues. Reviewed-by: Kurt Korbatits --- src/multimedia/audio/qaudioinput_mac_p.cpp | 8 ++++---- src/multimedia/audio/qaudioinput_mac_p.h | 4 ++-- src/multimedia/audio/qaudiooutput_mac_p.cpp | 10 +++++----- src/multimedia/audio/qaudiooutput_mac_p.h | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index c52c6c4..bd2de52 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE -namespace +namespace QtMultimediaInternal { static const int default_buffer_size = 4 * 1024; @@ -525,7 +525,7 @@ QAudioInputPrivate::QAudioInputPrivate(const QByteArray& device, QAudioFormat co startTime = 0; totalFrames = 0; audioBuffer = 0; - internalBufferSize = default_buffer_size; + internalBufferSize = QtMultimediaInternal::default_buffer_size; clockFrequency = AudioGetHostClockFrequency() / 1000; errorCode = QAudio::NoError; stateCode = QAudio::StoppedState; @@ -670,13 +670,13 @@ bool QAudioInputPrivate::open() else internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; - audioBuffer = new QAudioInputBuffer(internalBufferSize, + audioBuffer = new QtMultimediaInternal::QAudioInputBuffer(internalBufferSize, periodSizeBytes, deviceFormat, streamFormat, this); - audioIO = new MacInputDevice(audioBuffer, this); + audioIO = new QtMultimediaInternal::MacInputDevice(audioBuffer, this); // Init if (AudioUnitInitialize(audioUnit) != noErr) { diff --git a/src/multimedia/audio/qaudioinput_mac_p.h b/src/multimedia/audio/qaudioinput_mac_p.h index e1b8e4a..42f90e2 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.h +++ b/src/multimedia/audio/qaudioinput_mac_p.h @@ -75,7 +75,7 @@ QT_BEGIN_NAMESPACE class QTimer; class QIODevice; -namespace +namespace QtMultimediaInternal { class QAudioInputBuffer; } @@ -97,7 +97,7 @@ public: UInt64 startTime; QAudio::Error errorCode; QAudio::State stateCode; - QAudioInputBuffer* audioBuffer; + QtMultimediaInternal::QAudioInputBuffer* audioBuffer; QMutex mutex; QWaitCondition threadFinished; QAtomicInt audioThreadState; diff --git a/src/multimedia/audio/qaudiooutput_mac_p.cpp b/src/multimedia/audio/qaudiooutput_mac_p.cpp index 518f78f..6f32257 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.cpp +++ b/src/multimedia/audio/qaudiooutput_mac_p.cpp @@ -70,7 +70,7 @@ QT_BEGIN_NAMESPACE -namespace +namespace QtMultimediaInternal { static const int default_buffer_size = 8 * 1024; @@ -237,7 +237,7 @@ class MacOutputDevice : public QIODevice Q_OBJECT public: - MacOutputDevice(QAudioOutputBuffer* audioBuffer, QObject* parent): + MacOutputDevice(QtMultimediaInternal::QAudioOutputBuffer* audioBuffer, QObject* parent): QIODevice(parent), m_audioBuffer(audioBuffer) { @@ -263,7 +263,7 @@ public: } private: - QAudioOutputBuffer* m_audioBuffer; + QtMultimediaInternal::QAudioOutputBuffer* m_audioBuffer; }; @@ -285,7 +285,7 @@ QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray& device, const QAudioF startTime = 0; totalFrames = 0; audioBuffer = 0; - internalBufferSize = default_buffer_size; + internalBufferSize = QtMultimediaInternal::default_buffer_size; clockFrequency = AudioGetHostClockFrequency() / 1000; errorCode = QAudio::NoError; stateCode = QAudio::StoppedState; @@ -399,7 +399,7 @@ bool QAudioOutputPrivate::open() else internalBufferSize -= internalBufferSize % streamFormat.mBytesPerFrame; - audioBuffer = new QAudioOutputBuffer(internalBufferSize, periodSizeBytes, audioFormat); + audioBuffer = new QtMultimediaInternal::QAudioOutputBuffer(internalBufferSize, periodSizeBytes, audioFormat); connect(audioBuffer, SIGNAL(readyRead()), SLOT(inputReady())); // Pull audioIO = new MacOutputDevice(audioBuffer, this); diff --git a/src/multimedia/audio/qaudiooutput_mac_p.h b/src/multimedia/audio/qaudiooutput_mac_p.h index 1aacc67..752905c 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.h +++ b/src/multimedia/audio/qaudiooutput_mac_p.h @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE class QIODevice; -namespace +namespace QtMultimediaInternal { class QAudioOutputBuffer; } @@ -96,7 +96,7 @@ public: UInt64 startTime; AudioStreamBasicDescription deviceFormat; AudioStreamBasicDescription streamFormat; - QAudioOutputBuffer* audioBuffer; + QtMultimediaInternal::QAudioOutputBuffer* audioBuffer; QAtomicInt audioThreadState; QWaitCondition threadFinished; QMutex mutex; -- cgit v0.12 From c55a99965d8c08d5f924d49db4fe4aa49df80961 Mon Sep 17 00:00:00 2001 From: Bill King Date: Tue, 2 Mar 2010 15:20:10 +1000 Subject: Fixes: ODBC Driver expects 16bit when system is 32bit Fixed ODBC to use SQLTCHAR type and not assume that wchar's are 2 bytes wide. Task-number: QTBUG-6928 Reviewed-by: Justin McPherson --- src/plugins/sqldrivers/odbc/odbc.pro | 1 + src/sql/drivers/drivers.pri | 1 + src/sql/drivers/odbc/qsql_odbc.cpp | 273 +++++++++++++++++++++-------------- src/sql/drivers/odbc/qsql_odbc.h | 4 - 4 files changed, 170 insertions(+), 109 deletions(-) diff --git a/src/plugins/sqldrivers/odbc/odbc.pro b/src/plugins/sqldrivers/odbc/odbc.pro index 3de8ab2..2bf85f1 100644 --- a/src/plugins/sqldrivers/odbc/odbc.pro +++ b/src/plugins/sqldrivers/odbc/odbc.pro @@ -8,6 +8,7 @@ unix { !contains( LIBS, .*odbc.* ) { LIBS *= $$QT_LFLAGS_ODBC } + DEFINES += UNICODE } win32 { diff --git a/src/sql/drivers/drivers.pri b/src/sql/drivers/drivers.pri index 184eca9..7250c6e 100644 --- a/src/sql/drivers/drivers.pri +++ b/src/sql/drivers/drivers.pri @@ -49,6 +49,7 @@ contains(sql-drivers, odbc) { mac:!contains( LIBS, .*odbc.* ):LIBS *= -liodbc unix:!contains( LIBS, .*odbc.* ):LIBS *= -lodbc + unix:DEFINES += UNICODE win32 { !win32-borland:LIBS *= -lodbc32 diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 2049a76..f34aea5 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE //crude hack to get non-unicode capable driver managers to work # undef UNICODE # define SQLTCHAR SQLCHAR -# define SQL_C_WCHAR SQL_C_CHAR +# define SQL_C_TCHAR SQL_C_CHAR #endif // newer platform SDKs use SQLLEN instead of SQLINTEGER @@ -78,11 +78,54 @@ QT_BEGIN_NAMESPACE # define QSQLULEN SQLULEN #endif - static const int COLNAMESIZE = 256; //Map Qt parameter types to ODBC types static const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT }; +inline static QString fromSQLTCHAR(const QVarLengthArray& input, int size=-1) +{ + QString result; + + int realsize = qMin(size, input.size()); + if(realsize > 0 && input[realsize-1] == 0) + realsize--; + switch(sizeof(SQLTCHAR)) { + case 1: + result=QString::fromUtf8((const char *)input.constData(), realsize); + break; + case 2: + result=QString::fromUtf16((const ushort *)input.constData(), realsize); + break; + case 4: + result=QString::fromUcs4((const uint *)input.constData(), realsize); + break; + default: + qCritical() << "sizeof(SQLTCHAR) is " << sizeof(SQLTCHAR) << "Don't know how to handle this"; + } + return result; +} + +inline static QVarLengthArray toSQLTCHAR(const QString &input) +{ + QVarLengthArray result; + result.resize(input.size()); + switch(sizeof(SQLTCHAR)) { + case 1: + memcpy(result.data(), input.toUtf8().data(), input.size()); + break; + case 2: + memcpy(result.data(), input.unicode(), input.size() * 2); + break; + case 4: + memcpy(result.data(), input.toUcs4().data(), input.size() * 4); + break; + default: + qCritical() << "sizeof(SQLTCHAR) is " << sizeof(SQLTCHAR) << "Don't know how to handle this"; + } + result.append(0); // make sure it's null terminated, doesn't matter if it already is, it does if it isn't. + return result; +} + class QODBCDriverPrivate { public: @@ -98,8 +141,8 @@ public: SQLHANDLE hEnv; SQLHANDLE hDbc; - uint unicode :1; - uint useSchema :1; + bool unicode; + bool useSchema; int disconnectCount; bool isMySqlServer; bool isMSSqlServer; @@ -139,8 +182,8 @@ public: SQLHANDLE dpDbc() const { return driverPrivate ? driverPrivate->hDbc : 0;} SQLHANDLE hStmt; - uint unicode :1; - uint useSchema :1; + bool unicode; + bool useSchema; QSqlRecord rInf; QVector fieldCache; @@ -177,19 +220,18 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode int i = 1; description_[0] = 0; - r = SQLGetDiagRec(handleType, - handle, - i, - state_, - &nativeCode_, - 0, - NULL, - &msgLen); - if(r == SQL_NO_DATA) - return QString(); - description_.resize(msgLen+1); do { r = SQLGetDiagRec(handleType, + handle, + i, + state_, + &nativeCode_, + 0, + NULL, + &msgLen); + if ((r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) && msgLen > 0) + description_.resize(msgLen+1); + r = SQLGetDiagRec(handleType, handle, i, state_, @@ -202,9 +244,9 @@ static QString qWarnODBCHandle(int handleType, SQLHANDLE handle, int *nativeCode *nativeCode = nativeCode_; QString tmpstore; #ifdef UNICODE - tmpstore = QString((const QChar*)description_.data(), msgLen); + tmpstore = fromSQLTCHAR(description_, msgLen); #else - tmpstore = QString::fromLocal8Bit((const char*)description_.data(), msgLen); + tmpstore = QString::fromUtf8((const char*)description_.constData(), msgLen); #endif if(result != tmpstore) { if(!result.isEmpty()) @@ -223,13 +265,13 @@ static QString qODBCWarn(const QODBCPrivate* odbc, int *nativeCode = 0) { return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ') + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->dpDbc()) + QLatin1Char(' ') - + qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode)); + + qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode)).simplified(); } static QString qODBCWarn(const QODBCDriverPrivate* odbc, int *nativeCode = 0) { return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ') - + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc, nativeCode)); + + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc, nativeCode)).simplified(); } static void qSqlWarning(const QString& message, const QODBCPrivate* odbc) @@ -331,17 +373,22 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni colSize = 65536; } else { colSize++; // make sure there is room for more than the 0 termination - if (unicode) { - colSize *= 2; // a tiny bit faster, since it saves a SQLGetData() call - } } - QVarLengthArray buf(colSize); + r = SQLGetData(hStmt, + column+1, + SQL_C_TCHAR, + NULL, + 0, + &lengthIndicator); + if ((r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) && lengthIndicator > 0) + colSize = lengthIndicator/sizeof(SQLTCHAR) + 1; + QVarLengthArray buf(colSize); while (true) { r = SQLGetData(hStmt, column+1, - unicode ? SQL_C_WCHAR : SQL_C_CHAR, + SQL_C_TCHAR, (SQLPOINTER)buf.data(), - colSize, + colSize*sizeof(SQLTCHAR), &lengthIndicator); if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) { if (lengthIndicator == SQL_NULL_DATA || lengthIndicator == SQL_NO_TOTAL) { @@ -353,14 +400,9 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni // contain the number of bytes returned - it contains the // total number of bytes that CAN be fetched // colSize-1: remove 0 termination when there is more data to fetch - int rSize = (r == SQL_SUCCESS_WITH_INFO) ? (unicode ? colSize-2 : colSize-1) : lengthIndicator; - if (unicode) { - fieldVal += QString((const QChar*) buf.constData(), rSize / 2); - } else { - fieldVal += QString::fromAscii(buf.constData(), rSize); - } - memset(buf.data(), 0, colSize); - if (lengthIndicator < colSize) { + int rSize = (r == SQL_SUCCESS_WITH_INFO) ? colSize : lengthIndicator/sizeof(SQLTCHAR); + fieldVal += fromSQLTCHAR(buf, rSize); + if (lengthIndicator < (unsigned int)colSize*sizeof(SQLTCHAR)) { // workaround for Drivermanagers that don't return SQL_NO_DATA break; } @@ -386,10 +428,11 @@ static QVariant qGetBinaryData(SQLHANDLE hStmt, int column) QSQLLEN lengthIndicator = 0; SQLRETURN r = SQL_ERROR; - SQLTCHAR colName[COLNAMESIZE]; + QVarLengthArray colName(COLNAMESIZE); + r = SQLDescribeCol(hStmt, column + 1, - colName, + colName.data(), COLNAMESIZE, &colNameLen, &colType, @@ -522,10 +565,10 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) SQLSMALLINT colScale; SQLSMALLINT nullable; SQLRETURN r = SQL_ERROR; - SQLTCHAR colName[COLNAMESIZE]; + QVarLengthArray colName(COLNAMESIZE); r = SQLDescribeCol(p->hStmt, i+1, - colName, + colName.data(), (SQLSMALLINT)COLNAMESIZE, &colNameLen, &colType, @@ -551,9 +594,9 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) } #ifdef UNICODE - QString qColName((const QChar*)colName, colNameLen); + QString qColName(fromSQLTCHAR(colName, colNameLen)); #else - QString qColName = QString::fromLocal8Bit((const char*)colName); + QString qColName = QString::fromUtf8((const char *)colName.constData()); #endif // nullable can be SQL_NO_NULLS, SQL_NULLABLE or SQL_NULLABLE_UNKNOWN int required = -1; @@ -581,24 +624,33 @@ static int qGetODBCVersion(const QString &connOpts) if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive)) return SQL_OV_ODBC3; #endif + if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC2"), Qt::CaseInsensitive)) + return SQL_OV_ODBC2; +#ifdef _IODBCUNIX_H + return SQL_OV_ODBC3; +#else return SQL_OV_ODBC2; +#endif } QChar QODBCDriverPrivate::quoteChar() { if (!isQuoteInitialized) { - char driverResponse[4]; + SQLTCHAR driverResponse[4]; SQLSMALLINT length; int r = SQLGetInfo(hDbc, SQL_IDENTIFIER_QUOTE_CHAR, &driverResponse, sizeof(driverResponse), &length); - if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) { + if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) +#ifdef UNICODE + quote = QChar(driverResponse[0]); +#else quote = QLatin1Char(driverResponse[0]); - } else { +#endif + else quote = QLatin1Char('"'); - } isQuoteInitialized = true; } return quote; @@ -642,11 +694,11 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) val.utf16(); // 0 terminate r = SQLSetConnectAttr(hDbc, SQL_ATTR_CURRENT_CATALOG, #ifdef UNICODE - (SQLWCHAR*) val.unicode(), + toSQLTCHAR(val).constData(), #else - (SQLCHAR*) val.toLatin1().constData(), + (SQLCHAR*) val.toUtf8().constData(), #endif - SQL_NTS); + val.length()*sizeof(SQLTCHAR)); } else if (opt.toUpper() == QLatin1String("SQL_ATTR_METADATA_ID")) { if (val.toUpper() == QLatin1String("SQL_TRUE")) { v = SQL_TRUE; @@ -664,11 +716,11 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) val.utf16(); // 0 terminate r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACEFILE, #ifdef UNICODE - (SQLWCHAR*) val.unicode(), + toSQLTCHAR(val).constData(), #else - (SQLCHAR*) val.toLatin1().constData(), + (SQLCHAR*) val.toUtf8().constData(), #endif - SQL_NTS); + val.length()*sizeof(SQLTCHAR)); } else if (opt.toUpper() == QLatin1String("SQL_ATTR_TRACE")) { if (val.toUpper() == QLatin1String("SQL_OPT_TRACE_OFF")) { v = SQL_OPT_TRACE_OFF; @@ -880,10 +932,10 @@ bool QODBCResult::reset (const QString& query) #ifdef UNICODE r = SQLExecDirect(d->hStmt, - (SQLWCHAR*) query.unicode(), + toSQLTCHAR(query).constData(), (SQLINTEGER) query.length()); #else - QByteArray query8 = query.toLocal8Bit(); + QByteArray query8 = query.toUtf8(); r = SQLExecDirect(d->hStmt, (SQLCHAR*) query8.constData(), (SQLINTEGER) query8.length()); @@ -1231,10 +1283,10 @@ bool QODBCResult::prepare(const QString& query) #ifdef UNICODE r = SQLPrepare(d->hStmt, - (SQLWCHAR*) query.unicode(), + toSQLTCHAR(query).constData(), (SQLINTEGER) query.length()); #else - QByteArray query8 = query.toLocal8Bit(); + QByteArray query8 = query.toUtf8(); r = SQLPrepare(d->hStmt, (SQLCHAR*) query8.constData(), (SQLINTEGER) query8.length()); @@ -1435,43 +1487,44 @@ bool QODBCResult::exec() #ifndef Q_ODBC_VERSION_2 if (d->unicode) { QString str = val.toString(); - str.utf16(); if (*ind != SQL_NULL_DATA) - *ind = str.length() * sizeof(QChar); - int strSize = str.length() * sizeof(QChar); + *ind = str.length() * sizeof(SQLTCHAR); + int strSize = str.length() * sizeof(SQLTCHAR); if (bindValueType(i) & QSql::Out) { - QByteArray ba((char*)str.constData(), str.capacity() * sizeof(QChar)); + QVarLengthArray ba(toSQLTCHAR(str)); + ba.reserve(str.capacity()); r = SQLBindParameter(d->hStmt, i + 1, qParamType[(QFlag)(bindValueType(i)) & QSql::InOut], - SQL_C_WCHAR, + SQL_C_TCHAR, strSize > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR, 0, // god knows... don't change this! 0, (void *)ba.constData(), ba.size(), ind); - tmpStorage.append(ba); + tmpStorage.append(QByteArray((const char *)ba.constData(), ba.size()*sizeof(SQLTCHAR))); break; } - + QByteArray strba((const char *)toSQLTCHAR(str).constData(), str.size()*sizeof(SQLTCHAR)); r = SQLBindParameter(d->hStmt, i + 1, qParamType[(QFlag)(bindValueType(i)) & QSql::InOut], - SQL_C_WCHAR, + SQL_C_TCHAR, strSize > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR, strSize, 0, - (void *)str.constData(), - strSize, + (SQLPOINTER)strba.constData(), + strba.size(), ind); + tmpStorage.append(strba); break; } else #endif { - QByteArray str = val.toString().toAscii(); + QByteArray str = val.toString().toUtf8(); if (*ind != SQL_NULL_DATA) *ind = str.length(); int strSize = str.length(); @@ -1572,15 +1625,18 @@ bool QODBCResult::exec() break; case QVariant::String: if (d->unicode) { - if (bindValueType(i) & QSql::Out) - values[i] = QString::fromUtf16((ushort*)tmpStorage.takeFirst().constData()); + if (bindValueType(i) & QSql::Out) { + QByteArray first = tmpStorage.takeFirst(); + QVarLengthArray array; + array.append((SQLTCHAR *)first.constData(), first.size()); + values[i] = fromSQLTCHAR(array, first.size()/sizeof(SQLTCHAR*)); + } break; } // fall through default: { - QByteArray ba = tmpStorage.takeFirst(); if (bindValueType(i) & QSql::Out) - values[i] = QString::fromAscii(ba.constData()); + values[i] = tmpStorage.takeFirst(); break; } } if (indicators[i] == SQL_NULL_DATA) @@ -1789,19 +1845,20 @@ bool QODBCDriver::open(const QString & db, connQStr += QLatin1String(";PWD=") + password; SQLSMALLINT cb; - SQLTCHAR connOut[1024]; + QVarLengthArray connOut(1024); r = SQLDriverConnect(d->hDbc, NULL, #ifdef UNICODE - (SQLWCHAR*)connQStr.unicode(), + toSQLTCHAR(connQStr).constData(), #else - (SQLCHAR*)connQStr.toLatin1().constData(), + (SQLCHAR*)connQStr.toUtf8().constData(), #endif (SQLSMALLINT)connQStr.length(), - connOut, + connOut.data(), 1024, &cb, - SQL_DRIVER_NOPROMPT); + /*SQL_DRIVER_NOPROMPT*/0); + if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO) { setLastError(qMakeError(tr("Unable to connect"), QSqlError::ConnectionError, d)); setOpenError(true); @@ -1977,20 +2034,21 @@ void QODBCDriverPrivate::checkSchemaUsage() void QODBCDriverPrivate::checkSqlServer() { SQLRETURN r; - char serverString[200]; + QVarLengthArray serverString(200); SQLSMALLINT t; + memset(serverString.data(), 0, serverString.size() * sizeof(SQLTCHAR)); r = SQLGetInfo(hDbc, SQL_DBMS_NAME, - serverString, - sizeof(serverString), + serverString.data(), + serverString.size() * sizeof(SQLTCHAR), &t); if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) { QString serverType; #ifdef UNICODE - serverType = QString(reinterpret_cast(serverString), t/sizeof(QChar)); + serverType = fromSQLTCHAR(serverString, t/sizeof(SQLTCHAR)); #else - serverType = QString::fromLocal8Bit(serverString, t); + serverType = QString::fromUtf8((const char *)serverString.constData(), t); #endif isMySqlServer = serverType.contains(QLatin1String("mysql"), Qt::CaseInsensitive); isMSSqlServer = serverType.contains(QLatin1String("Microsoft SQL Server"), Qt::CaseInsensitive); @@ -2009,18 +2067,18 @@ void QODBCDriverPrivate::checkHasSQLFetchScroll() void QODBCDriverPrivate::checkHasMultiResults() { - char driverResponse[4]; + QVarLengthArray driverResponse(2); SQLSMALLINT length; SQLRETURN r = SQLGetInfo(hDbc, SQL_MULT_RESULT_SETS, - driverResponse, - sizeof(driverResponse), + driverResponse.data(), + driverResponse.size() * sizeof(SQLTCHAR), &length); if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO) #ifdef UNICODE - hasMultiResultSets = QString(reinterpret_cast(driverResponse), length/sizeof(QChar)).startsWith(QLatin1Char('Y')); + hasMultiResultSets = fromSQLTCHAR(driverResponse, length/sizeof(SQLTCHAR)).startsWith(QLatin1Char('Y')); #else - hasMultiResultSets = QString::fromLocal8Bit(driverResponse, length).startsWith(QLatin1Char('Y')); + hasMultiResultSets = QString::fromUtf8((const char *)driverResponse.constData(), length).startsWith(QLatin1Char('Y')); #endif } @@ -2134,9 +2192,9 @@ QStringList QODBCDriver::tables(QSql::TableType type) const NULL, 0, #ifdef UNICODE - (SQLWCHAR*)joinedTableTypeString.unicode(), + toSQLTCHAR(joinedTableTypeString).constData(), #else - (SQLCHAR*)joinedTableTypeString.toLatin1().constData(), + (SQLCHAR*)joinedTableTypeString.toUtf8().constData(), #endif joinedTableTypeString.length() /* characters, not bytes */); @@ -2150,6 +2208,11 @@ QStringList QODBCDriver::tables(QSql::TableType type) const else r = SQLFetch(hStmt); + if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r != SQL_NO_DATA) { + qWarning() << "QODBCDriver::tables failed to retrieve table/view list: (" << r << "," << qWarnODBCHandle(SQL_HANDLE_STMT, hStmt) << ")"; + return QStringList(); + } + while (r == SQL_SUCCESS) { QString fieldVal = qGetStringData(hStmt, 2, -1, false); tl.append(fieldVal); @@ -2208,21 +2271,21 @@ QSqlIndex QODBCDriver::primaryIndex(const QString& tablename) const SQL_IS_UINTEGER); r = SQLPrimaryKeys(hStmt, #ifdef UNICODE - catalog.length() == 0 ? NULL : (SQLWCHAR*)catalog.unicode(), + catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).constData(), #else - catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toLatin1().constData(), + catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().constData(), #endif catalog.length(), #ifdef UNICODE - schema.length() == 0 ? NULL : (SQLWCHAR*)schema.unicode(), + schema.length() == 0 ? NULL : toSQLTCHAR(schema).constData(), #else - schema.length() == 0 ? NULL : (SQLCHAR*)schema.toLatin1().constData(), + schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().constData(), #endif schema.length(), #ifdef UNICODE - (SQLWCHAR*)table.unicode(), + toSQLTCHAR(table).constData(), #else - (SQLCHAR*)table.toLatin1().constData(), + (SQLCHAR*)table.toUtf8().constData(), #endif table.length() /* in characters, not in bytes */); @@ -2233,21 +2296,21 @@ QSqlIndex QODBCDriver::primaryIndex(const QString& tablename) const r = SQLSpecialColumns(hStmt, SQL_BEST_ROWID, #ifdef UNICODE - catalog.length() == 0 ? NULL : (SQLWCHAR*)catalog.unicode(), + catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).constData(), #else - catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toLatin1().constData(), + catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().constData(), #endif catalog.length(), #ifdef UNICODE - schema.length() == 0 ? NULL : (SQLWCHAR*)schema.unicode(), + schema.length() == 0 ? NULL : toSQLTCHAR(schema).constData(), #else - schema.length() == 0 ? NULL : (SQLCHAR*)schema.toLatin1().constData(), + schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().constData(), #endif schema.length(), #ifdef UNICODE - (SQLWCHAR*)table.unicode(), + toSQLTCHAR(table).constData(), #else - (SQLCHAR*)table.toLatin1().constData(), + (SQLCHAR*)table.toUtf8().constData(), #endif table.length(), SQL_SCOPE_CURROW, @@ -2333,21 +2396,21 @@ QSqlRecord QODBCDriver::record(const QString& tablename) const SQL_IS_UINTEGER); r = SQLColumns(hStmt, #ifdef UNICODE - catalog.length() == 0 ? NULL : (SQLWCHAR*)catalog.unicode(), + catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).constData(), #else - catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toLatin1().constData(), + catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().constData(), #endif catalog.length(), #ifdef UNICODE - schema.length() == 0 ? NULL : (SQLWCHAR*)schema.unicode(), + schema.length() == 0 ? NULL : toSQLTCHAR(schema).constData(), #else - schema.length() == 0 ? NULL : (SQLCHAR*)schema.toLatin1().constData(), + schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().constData(), #endif schema.length(), #ifdef UNICODE - (SQLWCHAR*)table.unicode(), + toSQLTCHAR(table).constData(), #else - (SQLCHAR*)table.toLatin1().constData(), + (SQLCHAR*)table.toUtf8().constData(), #endif table.length(), NULL, diff --git a/src/sql/drivers/odbc/qsql_odbc.h b/src/sql/drivers/odbc/qsql_odbc.h index 145a902..13b2cc3 100644 --- a/src/sql/drivers/odbc/qsql_odbc.h +++ b/src/sql/drivers/odbc/qsql_odbc.h @@ -75,10 +75,6 @@ # undef _MSC_VER #endif -#ifndef Q_ODBC_VERSION_2 -#include -#endif - #include QT_BEGIN_HEADER -- cgit v0.12 From 26f3d40e99b6afa6e5205eb2fbe162dd30416888 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Mar 2010 09:18:21 +0100 Subject: Fix licenseCheck autotest --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 388e369..023bb28 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -1,4 +1,4 @@ - /**************************************************************************** +/**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -- cgit v0.12 From 9253b0dffc5e8a5d704f0a3d4960db4cd484d69a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 2 Mar 2010 09:22:12 +0100 Subject: skip tst_QDialog::throwInExec on WinCE, ARM platform Rethrowing exceptions across DLL boundaries crashes on Windows CE ARM devices. This is a restriction of the Microsoft tools. See thread "(Re)throwing from a catch block across dll boundaries" in microsoft.public.windowsce.embedded.vc Reviewed-by: ninerider --- tests/auto/qdialog/tst_qdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qdialog/tst_qdialog.cpp b/tests/auto/qdialog/tst_qdialog.cpp index 7b8213d..86f87b8 100644 --- a/tests/auto/qdialog/tst_qdialog.cpp +++ b/tests/auto/qdialog/tst_qdialog.cpp @@ -464,8 +464,8 @@ public slots: void tst_QDialog::throwInExec() { -#ifdef Q_WS_MAC - QSKIP("Qt/Mac: Throwing exceptions in exec() is not supported.", SkipAll); +#if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_)) + QSKIP("Throwing exceptions in exec() is not supported on this platform.", SkipAll); #endif int caughtExceptions = 0; try { -- cgit v0.12 From 94b2938086203bc6154b107c518df7a6fbfb4b2c Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Mar 2010 10:56:03 +0200 Subject: Fixed FEP crash when selected text was replaced with a a new T9 text. In T9 input mode StartFepInlineEditL gets called with empty initial text. In case there was text selected in editor when editing started, the selected text did not get removed since the logic in editors to detect input is as follows: bool isGettingInput = !event->commitString().isEmpty() || event->preeditString() != preeditAreaText() || event->replacementLength() > 0; This means that empty preeditString did not trigger selection removal, but the selected text was removed when non-empty inline text was provided by UpdateFepInlineTextL. However, the S60 FEP assumes that StartFepInlineEditL removes the selected text, i.e GetCursorSelectionForFep after StartFepInlineEditL must return empty selection. The above issue was fixed by removing the selected text explicitly in StartFepInlineEditL if aInitialInlineText is empty. Task-number: QTBUG-6363 Reviewed-by: Axis --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 1ac8ace..cc60246 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -551,6 +551,21 @@ void QCoeFepInputContext::StartFepInlineEditL(const TDesC& aInitialInlineText, m_formatRetriever = &aInlineTextFormatRetriever; m_pointerHandler = &aPointerEventHandlerDuringInlineEdit; + // With T9 aInitialInlineText is typically empty when StartFepInlineEditL is called, + // but FEP requires that selected text is always removed at StartFepInlineEditL. + // Let's remove the selected text if aInitialInlineText is empty and there is selected text + if (m_preeditString.isEmpty()) { + int anchor = w->inputMethodQuery(Qt::ImAnchorPosition).toInt(); + int replacementLength = qAbs(m_cursorPos-anchor); + if (replacementLength > 0) { + int replacementStart = m_cursorPos < anchor ? 0 : -replacementLength; + QList clearSelectionAttributes; + QInputMethodEvent clearSelectionEvent(QLatin1String(""), clearSelectionAttributes); + clearSelectionEvent.setCommitString(QLatin1String(""), replacementStart, replacementLength); + sendEvent(clearSelectionEvent); + } + } + applyFormat(&attributes); attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, -- cgit v0.12 From 2d0e06a495b5c5a723997eef9618fdd7a7bc98b1 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Tue, 2 Mar 2010 10:24:41 +0100 Subject: Carbon : Setting palette brush to a pixmap does not work. The problem occurs because we were drawing the pixmap and then clearing the buffer. This patch basically moves the clearing of the buffer to the start of the process instead of having it in the middle. Task-number: QTBUG-7800 Reviewed-by: Morten Sorvig --- src/gui/kernel/qwidget_mac.mm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index f78596e..c7acf69 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -1268,6 +1268,11 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if (widget->isVisible() && widget->updatesEnabled()) { //process the actual paint event. if(widget->testAttribute(Qt::WA_WState_InPaintEvent)) qWarning("QWidget::repaint: Recursive repaint detected"); + if (widget->isWindow() && !widget->d_func()->isOpaque + && !widget->testAttribute(Qt::WA_MacBrushedMetal)) { + QRect qrgnRect = qrgn.boundingRect(); + CGContextClearRect(cg, CGRectMake(qrgnRect.x(), qrgnRect.y(), qrgnRect.width(), qrgnRect.height())); + } QPoint redirectionOffset(0, 0); QWidget *tl = widget->window(); @@ -1318,13 +1323,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, widget->d_func()->restoreRedirected(); } - if (widget->isWindow() && !widget->d_func()->isOpaque - && !widget->testAttribute(Qt::WA_MacBrushedMetal)) { - QRect qrgnRect = qrgn.boundingRect(); - CGContextClearRect(cg, CGRectMake(qrgnRect.x(), qrgnRect.y(), qrgnRect.width(), qrgnRect.height())); - } - - if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) CallNextEventHandler(er, event); -- cgit v0.12 From b08f42e5cc0d94a3b54494f6fe0af90be858f1eb Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Tue, 2 Mar 2010 10:39:28 +0100 Subject: Make the icon visible when set on an action in a QSystemTrayIcon on Mac This was a Carbon specific problem, it was already working fine in Cocoa Task-number: QTBUG-8521 Reviewed-by: richard --- src/gui/util/qsystemtrayicon_mac.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/util/qsystemtrayicon_mac.mm b/src/gui/util/qsystemtrayicon_mac.mm index 0265a83..d829947 100644 --- a/src/gui/util/qsystemtrayicon_mac.mm +++ b/src/gui/util/qsystemtrayicon_mac.mm @@ -530,7 +530,11 @@ private: [item setToolTip:(NSString*)QCFString::toCFStringRef(action->toolTip())]; const QIcon icon = action->icon(); if(!icon.isNull()) { +#ifndef QT_MAC_USE_COCOA + const short scale = GetMBarHeight(); +#else const short scale = [[NSApp mainMenu] menuBarHeight]; +#endif NSImage *nsimage = static_cast(qt_mac_create_nsimage(icon.pixmap(QSize(scale, scale)))); [item setImage: nsimage]; [nsimage release]; -- cgit v0.12 From cb9051c79e5937ad8441100aaf67553e28ba0700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 2 Mar 2010 10:25:13 +0100 Subject: Prevented assert on 1 pixel wide / high images in qt_blurImage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't attempt to run qt_halfScaled on images less than 2px in either dimension. Particularly, avoid doing this from qt_blurImage, where that situation can happen as a result of a clipped QGraphicsEffect. Reviewed-by: Bjørn Erik Nilsen --- src/gui/image/qpixmapfilter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp index 2792e45..c605880 100644 --- a/src/gui/image/qpixmapfilter.cpp +++ b/src/gui/image/qpixmapfilter.cpp @@ -777,6 +777,9 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp Q_GUI_EXPORT QImage qt_halfScaled(const QImage &source) { + if (source.width() < 2 || source.height() < 2) + return QImage(); + QImage srcImage = source; if (source.format() == QImage::Format_Indexed8) { @@ -869,7 +872,7 @@ Q_GUI_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, boo } qreal scale = 1; - if (radius >= 4) { + if (radius >= 4 && blurImage.width() >= 2 && blurImage.height() >= 2) { blurImage = qt_halfScaled(blurImage); scale = 2; radius *= qreal(0.5); -- cgit v0.12 From 1bc449a16051f09028cfcb78ebdffa6ee0440572 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 2 Mar 2010 10:52:47 +0100 Subject: Revert "ItemViews: make it possible for chekcable items to get partiallyChecked" This reverts commit 435bbd4be73768f617e4a4083a345d1d8d62daa3. Reviewed-By: ogoffart --- src/gui/itemviews/qitemdelegate.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp index 9069ce4..7d8e103 100644 --- a/src/gui/itemviews/qitemdelegate.cpp +++ b/src/gui/itemviews/qitemdelegate.cpp @@ -1297,14 +1297,8 @@ bool QItemDelegate::editorEvent(QEvent *event, return false; } - Qt::CheckState state; - if ( flags & Qt::ItemIsTristate ) { - state = static_cast( (value.toInt() + 1) % 3 ); - } else { - state = (static_cast(value.toInt()) == Qt::Checked + Qt::CheckState state = (static_cast(value.toInt()) == Qt::Checked ? Qt::Unchecked : Qt::Checked); - } - return model->setData(index, state, Qt::CheckStateRole); } -- cgit v0.12 From 5a028f794fe48dc7141acedbf0e896b488bb8cd5 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 21 Dec 2009 17:03:13 +0100 Subject: Add DNS caching to QHostInfo By default enabled, but it can be disabled via a compile flag. Reviewed-by: Thiago --- src/network/kernel/qhostinfo.cpp | 129 +++++++++++++++++++++++++++++++-- src/network/kernel/qhostinfo_p.h | 32 ++++++++ tests/auto/qhostinfo/tst_qhostinfo.cpp | 55 +++++++++++++- 3 files changed, 208 insertions(+), 8 deletions(-) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index b23f6db..a65ca50 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -181,9 +181,26 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, receiver, member, Qt::QueuedConnection); result.data()->emitResultsReady(hostInfo); #else - QHostInfoRunnable* runnable = new QHostInfoRunnable(name, id); - QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); - theHostInfoLookupManager()->scheduleLookup(runnable); + QHostInfoLookupManager *manager = theHostInfoLookupManager(); + if (manager) { + // the application is still alive + if (manager->cache.isEnabled()) { + // check cache first + bool valid = false; + QHostInfo info = manager->cache.get(name, &valid); + if (valid) { + info.setLookupId(id); + QHostInfoResult result; + QObject::connect(&result, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); + result.emitResultsReady(info); + return id; + } + } + // cache is not enabled or it was not in the cache, do normal lookup + QHostInfoRunnable* runnable = new QHostInfoRunnable(name, id); + QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); + manager->scheduleLookup(runnable); + } #endif return id; @@ -418,14 +435,12 @@ void QHostInfoRunnable::run() return; } - // check cache - // FIXME - // if not in cache: OS lookup QHostInfo hostInfo = QHostInfoAgent::fromName(toBeLookedUp); // save to cache - // FIXME + if (manager->cache.isEnabled()) + manager->cache.put(toBeLookedUp, hostInfo); // check aborted again if (manager->wasAborted(id)) { @@ -575,6 +590,106 @@ void QHostInfoLookupManager::lookupFinished(QHostInfoRunnable *r) work(); } +// This function returns immediatly when we had a result in the cache, else it will later emit a signal +QHostInfo qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id) +{ + *valid = false; + *id = -1; + + // check cache + QHostInfoLookupManager* manager = theHostInfoLookupManager(); + if (manager && manager->cache.isEnabled()) { + QHostInfo info = manager->cache.get(name, valid); + if (*valid) { + return info; + } + } + + // was not in cache, trigger lookup + *id = QHostInfo::lookupHost(name, receiver, member); + + // return empty response, valid==false + return QHostInfo(); +} + +void qt_qhostinfo_clear_cache() +{ + QHostInfoLookupManager* manager = theHostInfoLookupManager(); + if (manager) { + manager->cache.clear(); + } +} + +void Q_NETWORK_EXPORT qt_qhostinfo_enable_cache(bool e) +{ + QHostInfoLookupManager* manager = theHostInfoLookupManager(); + if (manager) { + manager->cache.setEnabled(e); + } +} + +// cache for 60 seconds +// cache 64 items +QHostInfoCache::QHostInfoCache() : max_age(60), enabled(true), cache(64) +{ +#ifdef QT_QHOSTINFO_CACHE_DISABLED_BY_DEFAULT + enabled = false; +#endif +} + +bool QHostInfoCache::isEnabled() +{ + return enabled; +} + +// this function is currently only used for the auto tests +// and not usable by public API +void QHostInfoCache::setEnabled(bool e) +{ + enabled = e; +} + + +QHostInfo QHostInfoCache::get(const QString &name, bool *valid) +{ + QMutexLocker locker(&this->mutex); + + *valid = false; + if (cache.contains(name)) { + QHostInfoCacheElement *element = cache.object(name); + if (element->age.elapsed() < max_age*1000) + *valid = true; + return element->info; + + // FIXME idea: + // if too old but not expired, trigger a new lookup + // to freshen our cache + } + + return QHostInfo(); +} + +void QHostInfoCache::put(const QString &name, const QHostInfo &info) +{ + // if the lookup failed, don't cache + if (info.error() != QHostInfo::NoError) + return; + + QHostInfoCacheElement* element = new QHostInfoCacheElement(); + element->info = info; + element->age = QTime(); + element->age.start(); + + QMutexLocker locker(&this->mutex); + cache.insert(name, element); // cache will take ownership +} + +void QHostInfoCache::clear() +{ + QMutexLocker locker(&this->mutex); + cache.clear(); +} + #endif // QT_NO_THREAD QT_END_NAMESPACE diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index d6aa287..2b26b07 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -68,6 +68,8 @@ #include "QtCore/qrunnable.h" #include "QtCore/qlist.h" #include "QtCore/qqueue.h" +#include +#include #endif QT_BEGIN_NAMESPACE @@ -111,6 +113,34 @@ public: }; #ifndef QT_NO_THREAD +// These functions are outside of the QHostInfo class and strictly internal. +// Do NOT use them outside of QAbstractSocket. +QHostInfo Q_NETWORK_EXPORT qt_qhostinfo_lookup(const QString &name, QObject *receiver, const char *member, bool *valid, int *id); +void Q_NETWORK_EXPORT qt_qhostinfo_clear_cache(); +void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e); + +class QHostInfoCache +{ +public: + QHostInfoCache(); + const int max_age; // seconds + + QHostInfo get(const QString &name, bool *valid); + void put(const QString &name, const QHostInfo &info); + void clear(); + + bool isEnabled(); + void setEnabled(bool e); +private: + bool enabled; + struct QHostInfoCacheElement { + QHostInfo info; + QTime age; + }; + QCache cache; + QMutex mutex; +}; + // the following classes are used for the (normal) case: We use multiple threads to lookup DNS class QHostInfoRunnable : public QRunnable @@ -141,6 +171,7 @@ public: void lookupFinished(QHostInfoRunnable *r); bool wasAborted(int id); + QHostInfoCache cache; protected: QList currentLookups; // in progress QList postponedLookups; // postponed because in progress for same host @@ -154,6 +185,7 @@ protected: bool wasDeleted; }; + #endif QT_END_NAMESPACE diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index d5411d0..cbadcf5 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -72,6 +72,7 @@ #endif #include +#include "private/qhostinfo_p.h" #if !defined(QT_NO_GETADDRINFO) # if !defined(Q_OS_WINCE) @@ -108,10 +109,11 @@ public: public slots: void init(); void cleanup(); + void initTestCase(); + private slots: void getSetCheck(); void staticInformation(); - void initTestCase(); void lookupIPv4_data(); void lookupIPv4(); void lookupIPv6_data(); @@ -128,6 +130,8 @@ private slots: void multipleSameLookups(); void multipleDifferentLookups(); + void cache(); + protected slots: void resultsReady(const QHostInfo &); @@ -205,10 +209,21 @@ void tst_QHostInfo::initTestCase() // We have IPv6 support ipv6Available = true; } + + + // run each testcase with and without test enabled + QTest::addColumn("cache"); + QTest::newRow("WithCache") << false; + QTest::newRow("WithoutCache") << true; } void tst_QHostInfo::init() { + // delete the cache so inidividual testcase results are independant from each other + qt_qhostinfo_clear_cache(); + + QFETCH_GLOBAL(bool, cache); + qt_qhostinfo_enable_cache(cache); } void tst_QHostInfo::cleanup() @@ -458,6 +473,44 @@ void tst_QHostInfo::multipleDifferentLookups() QTRY_VERIFY(lookupsDoneCounter == COUNT); } +void tst_QHostInfo::cache() +{ + QFETCH_GLOBAL(bool, cache); + if (!cache) + return; // test makes only sense when cache enabled + + // reset slot counter + lookupsDoneCounter = 0; + + // lookup once, wait in event loop, result should not come directly. + bool valid = true; + QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(valid == false); + QVERIFY(result.addresses().isEmpty()); + + // loopkup second time, result should come directly + valid = false; + result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid); + QVERIFY(valid == true); + QVERIFY(!result.addresses().isEmpty()); + + // clear the cache + qt_qhostinfo_clear_cache(); + + // lookup third time, result should not come directly. + valid = true; + result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid); + QTestEventLoop::instance().enterLoop(5); + QVERIFY(!QTestEventLoop::instance().timeout()); + QVERIFY(valid == false); + QVERIFY(result.addresses().isEmpty()); + + // the slot should have been called 2 times. + QVERIFY(lookupsDoneCounter == 2); +} + void tst_QHostInfo::resultsReady(const QHostInfo &hi) { lookupDone = true; -- cgit v0.12 From daace2df3eb80f1b62f38151f5cc3f3b355927e7 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 2 Mar 2010 10:39:54 +0100 Subject: QAbstractSocket: Use new faster DNS function Use qt_qhostinfo_lookup which avoids the event loop when the DNS result is already cached. Reviewed-by: Thiago --- src/network/socket/qabstractsocket.cpp | 18 ++++++++++++++++-- tests/auto/qsslsocket/qsslsocket.pro | 2 ++ tests/auto/qsslsocket/tst_qsslsocket.cpp | 6 +++++- tests/auto/qtcpsocket/qtcpsocket.pro | 3 +++ tests/auto/qtcpsocket/tst_qtcpsocket.cpp | 13 +++++++++++-- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 275c436..d990448 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -354,6 +354,8 @@ #include "qabstractsocket.h" #include "qabstractsocket_p.h" +#include "private/qhostinfo_p.h" + #include #include #include @@ -1369,8 +1371,20 @@ void QAbstractSocket::connectToHostImplementation(const QString &hostName, quint return; #endif } else { - if (d->threadData->eventDispatcher) - d->hostLookupId = QHostInfo::lookupHost(hostName, this, SLOT(_q_startConnecting(QHostInfo))); + if (d->threadData->eventDispatcher) { + // this internal API for QHostInfo either immediatly gives us the desired + // QHostInfo from cache or later calls the _q_startConnecting slot. + bool immediateResultValid = false; + QHostInfo hostInfo = qt_qhostinfo_lookup(hostName, + this, + SLOT(_q_startConnecting(QHostInfo)), + &immediateResultValid, + &d->hostLookupId); + if (immediateResultValid) { + d->hostLookupId = -1; + d->_q_startConnecting(hostInfo); + } + } } #if defined(QABSTRACTSOCKET_DEBUG) diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index 147175e..541b2d9 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -32,3 +32,5 @@ wince* { } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } + +requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/qsslsocket/tst_qsslsocket.cpp b/tests/auto/qsslsocket/tst_qsslsocket.cpp index abd3237..ad2b50d 100644 --- a/tests/auto/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/qsslsocket/tst_qsslsocket.cpp @@ -54,6 +54,8 @@ #include #include +#include "private/qhostinfo_p.h" + #include "../network-settings.h" Q_DECLARE_METATYPE(QAbstractSocket::SocketState) @@ -288,6 +290,8 @@ void tst_QSslSocket::init() } QNetworkProxy::setApplicationProxy(proxy); } + + qt_qhostinfo_clear_cache(); } void tst_QSslSocket::cleanup() @@ -477,7 +481,7 @@ void tst_QSslSocket::simpleConnectWithIgnore() // Start connecting socket.connectToHost(QtNetworkSettings::serverName(), 993); - QCOMPARE(socket.state(), QAbstractSocket::HostLookupState); + QVERIFY(socket.state() != QAbstractSocket::UnconnectedState); // something must be in progress enterLoop(10); // Start handshake diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro index 4bbec23..3d4eba3 100644 --- a/tests/auto/qtcpsocket/qtcpsocket.pro +++ b/tests/auto/qtcpsocket/qtcpsocket.pro @@ -3,3 +3,6 @@ TEMPLATE = subdirs !wince*: SUBDIRS = test stressTest wince*|symbian*|vxworks* : SUBDIRS = test + + +requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp index e638e287..ef7ff83 100644 --- a/tests/auto/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/qtcpsocket/tst_qtcpsocket.cpp @@ -92,6 +92,8 @@ #include #endif +#include "private/qhostinfo_p.h" + #include "../network-settings.h" Q_DECLARE_METATYPE(QAbstractSocket::SocketError) @@ -315,6 +317,8 @@ void tst_QTcpSocket::init() } QNetworkProxy::setApplicationProxy(proxy); } + + qt_qhostinfo_clear_cache(); } QTcpSocket *tst_QTcpSocket::newSocket() const @@ -1059,7 +1063,9 @@ void tst_QTcpSocket::disconnectWhileLookingUp() // just connect and disconnect, then make sure nothing weird happened QTcpSocket *socket = newSocket(); socket->connectToHost(QtNetworkSettings::serverName(), 21); - QVERIFY(socket->state() == QAbstractSocket::HostLookupState); + + // check that connect is in progress + QVERIFY(socket->state() != QAbstractSocket::UnconnectedState); QFETCH(bool, doClose); if (doClose) { @@ -1665,7 +1671,10 @@ void tst_QTcpSocket::waitForConnectedInHostLookupSlot() connect(tmpSocket, SIGNAL(hostFound()), this, SLOT(hostLookupSlot())); tmpSocket->connectToHost(QtNetworkSettings::serverName(), 143); - loop.exec(); + // only execute the loop if not already connected + if (tmpSocket->state() != QAbstractSocket::ConnectedState) + loop.exec(); + QCOMPARE(timerSpy.count(), 0); delete tmpSocket; -- cgit v0.12 From b6e312df6cc087dbf45becb91bd43b35913e3684 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Tue, 2 Mar 2010 11:26:51 +0100 Subject: 2nd part of revert of commit 435bbd4be73768f617e4a After a mess-up by git rebase... Reviewed-by: ogoffart --- src/gui/itemviews/qstyleditemdelegate.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp index 9aac554..880f8ab 100644 --- a/src/gui/itemviews/qstyleditemdelegate.cpp +++ b/src/gui/itemviews/qstyleditemdelegate.cpp @@ -747,13 +747,8 @@ bool QStyledItemDelegate::editorEvent(QEvent *event, return false; } - Qt::CheckState state; - if ( flags & Qt::ItemIsTristate ) { - state = static_cast( (value.toInt() + 1) % 3 ); - } else { - state = (static_cast(value.toInt()) == Qt::Checked + Qt::CheckState state = (static_cast(value.toInt()) == Qt::Checked ? Qt::Unchecked : Qt::Checked); - } return model->setData(index, state, Qt::CheckStateRole); } -- cgit v0.12 From 6711f49a6c08c08759cb2185bf202d4b316d33df Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 2 Mar 2010 14:27:52 +0100 Subject: QNAM HTTP: Fix invoking a method when being destructed right now Reviewed-by: Olivier Goffart --- src/network/access/qhttpnetworkconnectionchannel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index e92b2f3..806452c 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -681,7 +681,11 @@ void QHttpNetworkConnectionChannel::requeueCurrentlyPipelinedRequests() connection->d_func()->requeueRequest(alreadyPipelinedRequests.at(i)); alreadyPipelinedRequests.clear(); - QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); + // only run when the QHttpNetworkConnection is not currently being destructed, e.g. + // this function is called from _q_disconnected which is called because + // of ~QHttpNetworkConnectionPrivate + if (qobject_cast(connection)) + QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } void QHttpNetworkConnectionChannel::eatWhitespace() -- cgit v0.12 From c1b067ea8169e1d37e2a120334406f1f115298bb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 1 Mar 2010 22:40:04 +0100 Subject: Fix strict-aliasing breakage with SunCC: the union trick is a GCC extension. It's probably also an MSVC extension, because the MSVC compiler has never complained about this fact, nor generated unintended code. Anyway, the only way is to reinterpret_cast the quintptr. It's not an aliasing violation to do it because we never access the integer as anything other than quintptr. Reviewed-By: Bradley T. Hughes --- src/corelib/thread/qmutex.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index 80b50fc..677412e 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -95,7 +95,7 @@ class Q_CORE_EXPORT QMutexLocker { public: inline explicit QMutexLocker(QMutex *m) - : mtx(m) + : val(reinterpret_cast(m)) { Q_ASSERT_X((val & quintptr(1u)) == quintptr(0), "QMutexLocker", "QMutex pointer is misaligned"); @@ -105,19 +105,19 @@ public: inline void unlock() { - if (mtx) { + if (val) { if ((val & quintptr(1u)) == quintptr(1u)) { val &= ~quintptr(1u); - mtx->unlock(); + mutex()->unlock(); } } } inline void relock() { - if (mtx) { + if (val) { if ((val & quintptr(1u)) == quintptr(0u)) { - mtx->lock(); + mutex()->lock(); val |= quintptr(1u); } } @@ -140,10 +140,7 @@ public: private: Q_DISABLE_COPY(QMutexLocker) - union { - QMutex *mtx; - quintptr val; - }; + quintptr val; }; #else // QT_NO_THREAD -- cgit v0.12 From a76d12862122504bae2e75cb78bdb21d180aaca0 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Tue, 2 Mar 2010 16:03:26 +0200 Subject: Re-applied a fix which get lost during softkey refactoring. See original commit (b461da1040c32d6690870290d6716a3b5cb7e9e9) for more information. Task-number: QTBUG-6220 Reviewed-By: TrustMe --- src/gui/kernel/qsoftkeymanager_s60.cpp | 7 ++++++- src/gui/widgets/qmainwindow.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 2a1ecc5..dedf0a1 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -284,7 +284,12 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba, TPtrC nativeText = qt_QString2TPtrC(text); int command = S60_COMMAND_START + position; setNativeSoftkey(cba, position, command, nativeText); - cba.DimCommand(command, !action->isEnabled()); + // QMainWindow "Options" action is set to invisible in order it does not appear in context menu + // and all invisible actions are by default disabled. + // However we never want to dim options softkey, even it is set to invisible + QVariant property = action->property(MENU_ACTION_PROPERTY); + const bool dimmed = (property.isValid() && property.toBool()) ? false : !action->isEnabled(); + cba.DimCommand(command, dimmed); realSoftKeyActions.insert(command, action); return true; } diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index e7c4f45..7e59bb0 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -119,6 +119,7 @@ void QMainWindowPrivate::init() q->setAttribute(Qt::WA_Hover); #ifdef QT_SOFTKEYS_ENABLED menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, q); + menuBarAction->setVisible(false); #endif } -- cgit v0.12 From fd30cc9fabe6fc023fbca5b93cfdb116fe194514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 2 Mar 2010 13:49:33 +0100 Subject: Fixed rendering bugs when scrolling graphics items with drop shadows. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't clip source pixmaps to the device rect, as there's no way of knowing which parts of the source pixmap are needed for the part of the graphics effect that's unclipped. Reviewed-by: Bjørn Erik Nilsen --- src/gui/graphicsview/qgraphicsitem.cpp | 28 +++------------------- src/gui/graphicsview/qgraphicsscene.cpp | 23 ++++-------------- tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp | 23 ++++++++++++++++++ 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index bd214e1..368af58 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -10810,6 +10810,7 @@ void QGraphicsItemEffectSourcePrivate::draw(QPainter *painter) } } +// sourceRect must be in the given coordinate system QRect QGraphicsItemEffectSourcePrivate::paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded) const { QRectF effectRectF; @@ -10819,7 +10820,8 @@ QRect QGraphicsItemEffectSourcePrivate::paddedEffectRect(Qt::CoordinateSystem sy if (mode == QGraphicsEffect::PadToEffectiveBoundingRect) { if (info) { - effectRectF = item->graphicsEffect()->boundingRectFor(boundingRect(Qt::DeviceCoordinates)); + QRectF deviceRect = system == Qt::DeviceCoordinates ? sourceRect : info->painter->worldTransform().mapRect(sourceRect); + effectRectF = item->graphicsEffect()->boundingRectFor(deviceRect); if (unpadded) *unpadded = (effectRectF.size() == sourceRect.size()); if (info && system == Qt::LogicalCoordinates) @@ -10868,30 +10870,6 @@ QPixmap QGraphicsItemEffectSourcePrivate::pixmap(Qt::CoordinateSystem system, QP return static_cast(item)->pixmap(); } - if (deviceCoordinates) { - // Clip to viewport rect. - int left, top, right, bottom; - effectRect.getCoords(&left, &top, &right, &bottom); - if (left < 0) { - if (offset) - offset->rx() += -left; - effectRect.setX(0); - } - if (top < 0) { - if (offset) - offset->ry() += -top; - effectRect.setY(0); - } - // NB! We use +-1 for historical reasons (see QRect documentation). - QPaintDevice *device = info->painter->device(); - const int deviceWidth = device->width(); - const int deviceHeight = device->height(); - if (right + 1 > deviceWidth) - effectRect.setRight(deviceWidth - 1); - if (bottom + 1 > deviceHeight) - effectRect.setBottom(deviceHeight -1); - - } if (effectRect.isEmpty()) return QPixmap(); diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index afea082..4ee2301 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4714,31 +4714,18 @@ void QGraphicsScenePrivate::drawSubtreeRecursive(QGraphicsItem *item, QPainter * if (sourced->currentCachedSystem() != Qt::LogicalCoordinates && sourced->lastEffectTransform != painter->worldTransform()) { - bool unclipped = false; if (sourced->lastEffectTransform.type() <= QTransform::TxTranslate && painter->worldTransform().type() <= QTransform::TxTranslate) { - QRectF itemRect = item->boundingRect(); - if (!item->d_ptr->children.isEmpty()) - itemRect |= item->childrenBoundingRect(); + QRectF sourceRect = sourced->boundingRect(Qt::DeviceCoordinates); + QRect effectRect = sourced->paddedEffectRect(Qt::DeviceCoordinates, sourced->currentCachedMode(), sourceRect); - QRectF oldSourceRect = sourced->lastEffectTransform.mapRect(itemRect); - QRectF newSourceRect = painter->worldTransform().mapRect(itemRect); - - QRect oldEffectRect = sourced->paddedEffectRect(sourced->currentCachedSystem(), sourced->currentCachedMode(), oldSourceRect); - QRect newEffectRect = sourced->paddedEffectRect(sourced->currentCachedSystem(), sourced->currentCachedMode(), newSourceRect); - - QRect deviceRect(0, 0, painter->device()->width(), painter->device()->height()); - if (deviceRect.contains(oldEffectRect) && deviceRect.contains(newEffectRect)) { - sourced->setCachedOffset(newEffectRect.topLeft()); - unclipped = true; - } + sourced->setCachedOffset(effectRect.topLeft()); + } else { + sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged); } sourced->lastEffectTransform = painter->worldTransform(); - - if (!unclipped) - sourced->invalidateCache(QGraphicsEffectSourcePrivate::TransformChanged); } item->d_ptr->graphicsEffect->draw(painter); diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 795431b..1007d61 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -72,6 +72,7 @@ private slots: void drawPixmapItem(); void deviceCoordinateTranslateCaching(); void inheritOpacity(); + void dropShadowClipping(); }; void tst_QGraphicsEffect::initTestCase() @@ -590,6 +591,28 @@ void tst_QGraphicsEffect::inheritOpacity() QTRY_VERIFY(item->numRepaints > numRepaints); } +void tst_QGraphicsEffect::dropShadowClipping() +{ + QImage img(128, 128, QImage::Format_ARGB32_Premultiplied); + img.fill(0xffffffff); + + QGraphicsScene scene; + QGraphicsRectItem *item = new QGraphicsRectItem(-5, -500, 10, 1000); + item->setGraphicsEffect(new QGraphicsDropShadowEffect); + item->setPen(Qt::NoPen); + item->setBrush(Qt::red); + + scene.addItem(item); + + QPainter p(&img); + scene.render(&p, img.rect(), QRect(-64, -64, 128, 128)); + p.end(); + + for (int y = 1; y < img.height(); ++y) + for (int x = 0; x < img.width(); ++x) + QCOMPARE(img.pixel(x, y), img.pixel(x, y-1)); +} + QTEST_MAIN(tst_QGraphicsEffect) #include "tst_qgraphicseffect.moc" -- cgit v0.12 From d6aba8dd917e8306799743dd33905f2037e00d10 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Mar 2010 15:26:03 +0100 Subject: Compile with GCC 3.3 Task-number: QTBUG-8554 Reviewed-by: Gabriel --- src/corelib/kernel/qmetaobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index cd7418a..b151040 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -943,7 +943,7 @@ QByteArray QMetaObject::normalizedType(const char *type) if (!type || !*type) return result; - QVarLengthArray stackbuf(int(strlen(type)) + 1); + QVarLengthArray stackbuf(qstrlen(type) + 1); qRemoveWhitespace(type, stackbuf.data()); int templdepth = 0; qNormalizeType(stackbuf.data(), templdepth, result); -- cgit v0.12 From 120905fbc48ac7658fac392113bf45e00880c456 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 24 Feb 2010 16:55:15 +0100 Subject: Expand indicator would not be displayed after removal of a collapsed item's child While setting the hasChildren property of QTreeViewItem, "collapsed" and "not visible" were being mistaken. Auto-test included. Reviewed-by: Olivier Task-number: QTBUG-7443 (cherry picked from commit 77670c3c0fdc3021356e212e94042a0b5a4f4f8c) --- src/gui/itemviews/qtreeview.cpp | 13 +++++++++---- tests/auto/qtreeview/tst_qtreeview.cpp | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 706d2a8..37168eb 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -3770,10 +3770,15 @@ void QTreeViewPrivate::rowsRemoved(const QModelIndex &parent, if (previousSibiling != -1 && after && model->rowCount(parent) == start) viewItems[previousSibiling].hasMoreSiblings = false; - - updateChildCount(parentItem, -removedCount); - if (parentItem != -1 && viewItems.at(parentItem).total == 0) - viewItems[parentItem].hasChildren = false; //every children have been removed; + if (parentItem != -1) { + if (viewItems.at(parentItem).expanded) { + updateChildCount(parentItem, -removedCount); + if (viewItems.at(parentItem).total == 0) + viewItems[parentItem].hasChildren = false; //every children have been removed; + } else if (viewItems[parentItem].hasChildren && !hasVisibleChildren(parent)) { + viewItems[parentItem].hasChildren = false; + } + } if (after) { q->updateGeometries(); viewport->update(); diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index fd4815e..e39cf6c 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3083,6 +3083,20 @@ void tst_QTreeView::styleOptionViewItem() QApplication::processEvents(); QTRY_VERIFY(delegate.count >= 3); QApplication::processEvents(); + + item00->setText("OnlyOne"); + item0->insertRow(2, new QStandardItem("OnlyOne Last")); + view.collapse(item0->index()); + item0->removeRow(0); + delegate.count = 0; + QTRY_VERIFY(delegate.count >= 2); + QApplication::processEvents(); + + item0->removeRow(1); + item0->setText("OnlyOne"); + delegate.count = 0; + QTRY_VERIFY(delegate.count >= 2); + QApplication::processEvents(); } } -- cgit v0.12 From dfcbab749e51cddbbdec35d58c37814d4d21f30f Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Tue, 2 Mar 2010 16:20:12 +0200 Subject: Symbian event dispatcher needs to run all active objects. Symbian event dispatcher runs only active objects that have priority CActive::EPriorityIdle or above. CActive defines standard priorities but priority can be anything from KMinTInt to KMaxTInt Task-number: QTBUG-8654 Reviewed-by: axis --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index 1d7be79..191be6c 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -733,7 +733,7 @@ bool QEventDispatcherSymbian::processEvents ( QEventLoop::ProcessEventsFlags fla } TInt error; - handledSymbianEvent = CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle); + handledSymbianEvent = CActiveScheduler::RunIfReady(error, KMinTInt); if (error) { qWarning("CActiveScheduler::RunIfReady() returned error: %i\n", error); CActiveScheduler::Current()->Error(error); -- cgit v0.12 From 7fc63dd0ff368a637dcd17e692b9d6b26278b538 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 2 Mar 2010 16:41:05 +0100 Subject: QString::section: Fix crash with SectionIncludeLeadingSep flag And start is out of bounds. Reviewed-by: Thiago Reviewed-by: Joao Task-number: QTBUG-4306 --- src/corelib/tools/qstring.cpp | 2 +- tests/auto/qstring/tst_qstring.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3ef0e66..03bc053 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3185,7 +3185,7 @@ QString QString::section(const QRegExp ®, int start, int end, SectionFlags fl if (!empty || !(flags & SectionSkipEmpty)) x++; } - if((flags & SectionIncludeLeadingSep)) { + if((flags & SectionIncludeLeadingSep) && first_i < sections.size()) { const qt_section_chunk §ion = sections.at(first_i); ret.prepend(section.string.left(section.length)); } diff --git a/tests/auto/qstring/tst_qstring.cpp b/tests/auto/qstring/tst_qstring.cpp index c9b3436..4ebcade 100644 --- a/tests/auto/qstring/tst_qstring.cpp +++ b/tests/auto/qstring/tst_qstring.cpp @@ -3503,7 +3503,10 @@ void tst_QString::section_data() << QString("\\b") << 3 << 3 << int(QString::SectionDefault) << QString("is") << true; - + QTest::newRow( "task257941-rx" ) << QString("99.0 42.3") + << QString("\\s*[AaBb]\\s*") << 1 << 1 + << int(QString::SectionIncludeLeadingSep) + << QString() << true; } void tst_QString::section() -- cgit v0.12 From e3ae141989743b62dd4acc565801ff0898897065 Mon Sep 17 00:00:00 2001 From: Raino Priha Date: Tue, 2 Mar 2010 15:38:29 +0200 Subject: Allow platform specific values for the double click radius. Task-number: QT-2883 Reviewed-by: Volker Hilsheimer --- mkspecs/linux-g++-maemo/qplatformdefs.h | 2 ++ src/gui/kernel/qapplication.cpp | 4 ++++ src/gui/kernel/qapplication_x11.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mkspecs/linux-g++-maemo/qplatformdefs.h b/mkspecs/linux-g++-maemo/qplatformdefs.h index 7e8d1d4..d7feb9e 100644 --- a/mkspecs/linux-g++-maemo/qplatformdefs.h +++ b/mkspecs/linux-g++-maemo/qplatformdefs.h @@ -40,3 +40,5 @@ ****************************************************************************/ #include "../linux-g++/qplatformdefs.h" + +#define QT_GUI_DOUBLE_CLICK_RADIUS 20 diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4fe3900..6dda961 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -117,6 +117,10 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp #include #endif +#ifndef QT_GUI_DOUBLE_CLICK_RADIUS +#define QT_GUI_DOUBLE_CLICK_RADIUS 5 +#endif + //#define ALIEN_DEBUG static void initResources() diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index afd927b..15761f4 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -4215,8 +4215,8 @@ bool QETWidget::translateMouseEvent(const XEvent *event) mouseButtonPressed == button && (long)event->xbutton.time -(long)mouseButtonPressTime < QApplication::doubleClickInterval() && - qAbs(event->xbutton.x - mouseXPos) < 5 && - qAbs(event->xbutton.y - mouseYPos) < 5) { + qAbs(event->xbutton.x - mouseXPos) < QT_GUI_DOUBLE_CLICK_RADIUS && + qAbs(event->xbutton.y - mouseYPos) < QT_GUI_DOUBLE_CLICK_RADIUS) { type = QEvent::MouseButtonDblClick; mouseButtonPressTime -= 2000; // no double-click next time } else { -- cgit v0.12 From 7f68ac15cb2a0b0caa5c56186ed672bebdb3a5b0 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Tue, 2 Mar 2010 18:39:11 +0100 Subject: update russian translations and phrasebook Merge-request: 485 Reviewed-by: Oswald Buddenhagen --- tools/linguist/phrasebooks/russian.qph | 40 + translations/assistant_adp_ru.ts | 235 +++-- translations/assistant_ru.ts | 143 +-- translations/designer_ru.ts | 569 ++++++----- translations/linguist_ru.ts | 562 ++++++----- translations/qt_help_ru.ts | 89 +- translations/qt_ru.ts | 1645 +++++++++++++++++++++++++------- translations/qtconfig_ru.ts | 297 +++--- translations/qvfb_ru.ts | 88 +- 9 files changed, 2287 insertions(+), 1381 deletions(-) diff --git a/tools/linguist/phrasebooks/russian.qph b/tools/linguist/phrasebooks/russian.qph index 9d40bd3..ae1a9b9 100644 --- a/tools/linguist/phrasebooks/russian.qph +++ b/tools/linguist/phrasebooks/russian.qph @@ -1164,4 +1164,44 @@ Table of Contents Оглавление + + parse + разобрать + + + parsing + разбор + + + phrasebook + глоссарий + + + phrase book + глоссарий + + + In use + Используется + + + Access denied + Доступ запрещён + + + No error + Нет ошибки + + + Not supported + Не поддерживается + + + Already exists + Уже существует + + + Permission denied + Доступ запрещён + diff --git a/translations/assistant_adp_ru.ts b/translations/assistant_adp_ru.ts index db0c9df..a421cd2 100644 --- a/translations/assistant_adp_ru.ts +++ b/translations/assistant_adp_ru.ts @@ -73,63 +73,62 @@ HelpDialog - + &Index &Указатель - + &Look For: &Искать: - + &New &Новая - - + &Search &Поиск - + <b>Enter a keyword.</b><p>The list will select an item that matches the entered string best.</p> <b>Указание ключевого слова.</b><p>Список заполняется элементами, лучше соответствующими указанному ключевому слову.</p> - + <b>Enter search word(s).</b><p>Enter here the word(s) you are looking for. The words may contain wildcards (*). For a sequence of words quote them.</p> <b>Указание слов для поиска.</b><p>Введите одно или несколько слов, по которым требуется осуществить поиск. Слова могут содержкать символы-заменители (*). Если требуется найти сочетание слов, заключите искомую фразу в кавычки.</p> - + <b>Found documents</b><p>This list contains all found documents from the last search. The documents are ordered, i.e. the first document has the most matches.</p> <b>Найденные документы</b><p>В данном списке представлены все найденные при последнем поиске документы. Документы упорядочены по релевантности, т.е. чем выше в списке, тем чаще в нём встречаются искомые слова.</p> - + <b>Help topics organized by category.</b><p>Double-click an item to see the topics in that category. To view a topic, just double-click it.</p> <b>Разделы справки, распределённые по категориям.</b><p>Дважды щёлкните по одному из пунктов для отображения разделов в данной категории. Для открытия раздела дважды щёлкните по нему.</p> - + <b>Help</b><p>Choose the topic you want help on from the contents list, or search the index for keywords.</p> <b>Справка</b><p>Выберите раздел справки из оглавления или воспользуйтесь поиском по предметному указателю.</p> - + <b>List of available help topics.</b><p>Double-click on an item to open its help page. If more than one is found, you must specify which page you want.</p> <b>Список доступных разделов справки.</b><p>Дважды щёлкните по одному из пунктов для открытия страницы справки. Если найдено более одной страницы, выберите желаемую.</p> - + Add new bookmark Добавить закладку - + Add the currently displayed page as a new bookmark. Добавить отображаемую страницу в закладки. @@ -139,47 +138,47 @@ Не удаётся открыть файл индекса %1 - + Con&tents &Оглавление - + Delete bookmark Удалить закладку - + Delete the selected bookmark. Удалить выбранную закладку. - + Enter searchword(s) Введите одно или несколько слов для поиска - + Display the help page Показать страницу справки - + Display the help page for the full text search. Показать справку по полнотекстовому поиску. - + Start searching Начать поиск - + Displays help topics organized by category, index or bookmarks. Another tab inherits the full text search. Отображает список разделов, распредёленных по категориям, указатель или закладки. Последняя вкладка содержит панель полнотекстового поиска. - + Displays the list of bookmarks. Отображает список закладок. @@ -205,7 +204,7 @@ Skipping file. Готово - + Enter keyword Введите ключевое слово @@ -224,7 +223,7 @@ Assistant will not work! Qt Assistant не будет работать! - + Found &Documents: Найденные &документы: @@ -235,12 +234,12 @@ Qt Assistant не будет работать! Полнотекстовый поиск - + He&lp &Справка - + Help Справка @@ -272,12 +271,12 @@ Qt Assistant не будет работать! Подготовка... - + Preparing... Подготовка... - + Pressing this button starts the search. Нажатие на эту кнопку запустит процесс поиска. @@ -294,7 +293,7 @@ Qt Assistant не будет работать! Чтение каталога... - + Searching f&or: &Искать: @@ -316,8 +315,7 @@ Qt Assistant не будет работать! Предупреждение - - + column 1 столбец 1 @@ -336,12 +334,12 @@ Qt Assistant не будет работать! - + &Bookmarks &Закладки - + &Delete &Удалить @@ -407,73 +405,72 @@ Qt Assistant не будет работать! MainWindow - - + "What's This?" context sensitive help. Контекстная справка "Что это?". - + &Add Bookmark &Добавить закладку - + &Close &Закрыть - + &Copy &Копировать - + &Edit &Правка - + &File &Файл - + &Find in Text... П&оиск по тексту... - + &Go &Перейти - + &Help &Справка - + &Home &Домой - + &Next Сл&едующий - + &Previous &Предыдущий - + &Print... &Печать... - + &View &Вид @@ -488,27 +485,27 @@ Qt Assistant не будет работать! ... - + About Qt О Qt - + About Qt Assistant О Qt Assistant - + Add Tab Добавить вкладку - + Add the currently displayed page as a new bookmark. Добавить отображаемую страницу в закладки. - + Boo&kmarks &Закладки @@ -518,17 +515,17 @@ Qt Assistant не будет работать! Не удалось открыть файл для записи! - + Close Tab Закрыть вкладку - + Close the current window. Закрыть текущее окно. - + Display further information about Qt Assistant. Показать дополнительную информацию о Qt Assistant. @@ -538,7 +535,7 @@ Qt Assistant не будет работать! Открывает стартовую страницу выбранного набора документации. - + E&xit В&ыход @@ -548,32 +545,32 @@ Qt Assistant не будет работать! Не удалось получить информацию о приложении из файла: '%1' - + Find &Next Найти &следующее - + Find &Previous Найти &предыдущее - + Font Settings... Настройки шрифта... - + Go Перейти - + Go to the home page. Qt Assistant's home page is the Qt Reference Documentation. Перейти на домашнюю страницу. Домашная страница Qt Assistant - Справочная документация по Qt. - + Go to the next page. Переход на следующую страницу. @@ -588,32 +585,32 @@ Qt Assistant не будет работать! Свернуть - + New Window Новое окно - + Next Tab Следующая вкладка - + Open a new window. Открыть новое окно. - + Open the Find dialog. Qt Assistant will search the currently displayed page for the text you enter. Открыть окно поиска. Qt Assistant произведёт поиск введённого текста на отображаемой странице. - + Previous Tab Предыдущая вкладка - + Print the currently displayed page. Печатать отображаемую страницу. @@ -624,17 +621,17 @@ Qt Assistant не будет работать! Qt Assistant - + Qt Assistant Manual Руководство по Qt Assistant - + Qt Assistant by Nokia Qt Assistant от Nokia - + Quit Qt Assistant. Выйти из Qt Assistant. @@ -645,12 +642,12 @@ Qt Assistant не будет работать! Сохранить страницу - + Save Page As... Сохранить страницу как... - + Select the page in contents tab. Выбрать страницу во вкладке оглавления. @@ -660,12 +657,12 @@ Qt Assistant не будет работать! Боковая панель - + Sync with Table of Contents Синхронизировать с оглавлением - + Toolbar Панель инструментов @@ -675,27 +672,27 @@ Qt Assistant не будет работать! Виды - + What's This? Что это? - + Zoom &in У&величить - + Zoom &out У&меньшить - + Zoom in on the document, i.e. increase the font size. Увеличить размер шрифта. - + Zoom out on the document, i.e. decrease the font size. Уменьшить размер шрифта. @@ -740,112 +737,112 @@ Qt Assistant не будет работать! - + Ctrl+P - + Ctrl+Q - + Copy the selected text to the clipboard. Скопировать выделенный текст в буфер обмена. - + Ctrl+C - + Ctrl+F - + F3 - + Shift+F3 - + Ctrl+Home - + Go to the previous page. Переход на предыдущую страницу. - + Alt+Left - + Alt+Right - + Ctrl++ - + Ctrl+- - + Ctrl+N - + Ctrl+W - + Shift+F1 - + Ctrl+Alt+N - + Ctrl+Alt+Right - + Ctrl+Alt+Left - + Ctrl+Alt+Q - + F1 - + Ctrl+Alt+S @@ -866,7 +863,7 @@ Qt Assistant не будет работать! ... - + <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Search wrapped <img src=":/trolltech/assistant/images/wrap.png">&nbsp;Поиск с начала @@ -876,7 +873,7 @@ Qt Assistant не будет работать! Добавить вкладку - + Case Sensitive Учитывать регистр @@ -901,50 +898,50 @@ Qt Assistant не будет работать! Новая вкладка - + Next Следующее - + Previous Предыдущее - + Untitled Безымянный - + Whole words Слова целиком - + TabbedBrowser - + TabbedBrowser TopicChooser - + &Close &Закрыть - + &Display &Показать - + &Topics &Разделы - + Choose Topic Выбор раздела @@ -954,22 +951,22 @@ Qt Assistant не будет работать! Выберите раздел для <b>%1</b> - + Close the Dialog. Закрыть диалог. - + Displays a list of available help topics for the keyword. Показывает список доступных разделов справки, найденных по ключевому слову. - + Open the topic selected in the list. Открыть выбранный раздел. - + Select a topic from the list and click the <b>Display</b>-button to open the online help. Выберите раздел из списка и нажмите на кнопку <b>Показать</b> для открытия онлайн справки. diff --git a/translations/assistant_ru.ts b/translations/assistant_ru.ts index 992cf18..ade4c85 100644 --- a/translations/assistant_ru.ts +++ b/translations/assistant_ru.ts @@ -32,41 +32,41 @@ BookmarkDialog - + Add Bookmark Добавление закладки - + Bookmark: Закладка: - + Add in Folder: Добавить в папку: - + + + - + New Folder Новая папка - + - + Bookmarks Закладки - + Delete Folder Удалить папку @@ -79,7 +79,7 @@ BookmarkManager - + Bookmarks Закладки @@ -103,7 +103,7 @@ BookmarkWidget - + Delete Folder Удалить папку @@ -151,7 +151,7 @@ CentralWidget - + Add new page Открыть новую страницу @@ -166,7 +166,7 @@ Печать документа - + unknown безымянная вкладка @@ -192,7 +192,7 @@ Добавить закладку для этой страницы... - + Search Поиск @@ -213,12 +213,12 @@ FilterNameDialogClass - + Add Filter Name Добавление фильтра - + Filter Name: Название фильтра: @@ -226,7 +226,7 @@ FindWidget - + Previous Предыдущее @@ -282,7 +282,7 @@ HelpViewer - + Open Link in New Tab Открыть ссылку в новой вкладке @@ -327,7 +327,7 @@ &Искать: - + Open Link Открыть ссылку @@ -340,7 +340,7 @@ InstallDialog - + Install Documentation Установка документации @@ -407,32 +407,32 @@ %1 - + Available Documentation: Доступная документация: - + Install Установить - + Cancel Отмена - + Close Закрыть - + Installation Path: Путь установки: - + ... ... @@ -441,31 +441,31 @@ MainWindow - + Index Указатель - - + + Contents Содержание - - + + Bookmarks Закладки - - - + + + Qt Assistant Qt Assistant - + Unfiltered Без фильтрации @@ -526,7 +526,12 @@ П&оиск в тексте... - + + &Find + &Поиск + + + Find &Next Найти &следующее @@ -621,7 +626,12 @@ Синхронизировать с оглавлением - + + Sync + Синхронизировать + + + Next Page Следующая страница @@ -706,7 +716,7 @@ Отфильтровано по: - + Address Toolbar Панель адреса @@ -783,118 +793,117 @@ PreferencesDialogClass - + Preferences Настройки - + Fonts Шрифты - + Font settings: Настройки шрифта: - + Browser Обозреватель - + Application Приложение - + Filters Фильтры - + Filter: Фильтр: - + Attributes: Атрибуты: - + 1 1 - + Add Добавить - - + Remove Удалить - + Documentation Документация - + Registered Documentation: Зарегистрированная документация: - + Add... Добавить... - + Options Параметры - + Homepage Стартовая страница - + Current Page Текущая страница - + Restore to default Страница по умолчанию - + On help start: При запуске: - + Show my home page Отобразить стартовую страницу - + Show a blank page Отобразить пустую страницу - + Show my tabs from last session Восстановить предыдущую сессиию - + Blank Page Пустая страница @@ -964,7 +973,7 @@ Qt Assistant - + Could not register documentation file %1 @@ -1026,7 +1035,7 @@ Reason: SearchWidget - + &Copy &Копировать @@ -1054,22 +1063,22 @@ Reason: Выберите раздел для <b>%1</b>: - + Choose Topic Выбор раздела - + &Topics &Разделы - + &Display &Показать - + &Close &Закрыть diff --git a/translations/designer_ru.ts b/translations/designer_ru.ts index 932c611..412be47 100644 --- a/translations/designer_ru.ts +++ b/translations/designer_ru.ts @@ -32,17 +32,17 @@ AddLinkDialog - + Insert Link Вставить ссылку - + Title: Заголовок: - + URL: URL: @@ -149,12 +149,12 @@ AppearanceOptionsWidget - + Form Форма - + User Interface Mode Режим пользовательского интерфейса @@ -585,7 +585,7 @@ Изменить компоновку '%1' с %2 на %3 - + Set action text Установить текст действия @@ -596,12 +596,12 @@ - + Move action Переместить действие - + Change Title Изменить заголовок @@ -680,24 +680,22 @@ ConnectDialog - + Configure Connection Настройка соединения - - + GroupBox GroupBox - - + Edit... Изменить... - + Show signals and slots inherited from QWidget Показывать сигналы и слоты, унаследованные от QWidget @@ -705,7 +703,7 @@ ConnectionDelegate - + <object> <объект> @@ -761,12 +759,12 @@ Invalid UI file: The root element <ui> is missing. - Некорректный файл UI: Отсутствует корневой элемент <ui>. + Некорректный файл UI: Отсутствует корневой элемент <ui>. An error has occurred while reading the UI file at line %1, column %2: %3 - При чтении файла UI в строке %1 позиции %2 возникла ошибка: %3 + При чтении файла UI в строке %1 позиции %2 возникла ошибка: %3 @@ -808,7 +806,7 @@ This file cannot be read because the extra info extension failed to load. - Не удалось прочитать файл, так как возникла ошибка при загрузке расширения дополнительной информации. + Не удалось прочитать файл, так как возникла ошибка при загрузке расширения дополнительной информации. @@ -869,27 +867,27 @@ DeviceProfileDialog - + &Family &Шрифт - + &Point Size &Размер - + Style Начертание - + Device DPI DPI устройства - + Name Название @@ -1030,7 +1028,7 @@ FormBuilder - + Invalid stretch value for '%1': '%2' Parsing layout stretch values Некорректный коэффициент растяжения для '%1': '%2' @@ -1074,38 +1072,38 @@ FormLayoutRowDialog - + Add Form Layout Row нелепица какая-то Добавление строки компоновки компоновщика формы - + &Label text: Текст &метки: - + Field &type: &Тип поля: - + &Field name: Имя п&оля: - + &Buddy: П&артнёр: - + &Row: &Строка: - + Label &name: Имя м&етки: @@ -1126,62 +1124,62 @@ FormWindowSettings - + Form Settings Настройки формы - + Layout &Default Компоновка по &умолчанию - + &Spacing: &Отступ: - + &Margin: &Границы: - + &Layout Function &Функция компоновки - + Ma&rgin: Г&раницы: - + Spa&cing: О&тступ: - + &Author &Автор - + &Include Hints &Подключить подсказки - + &Pixmap Function &Загрузчик изображений - + Grid Сетка - + Embedded Design Оформление портативных устройств @@ -1329,12 +1327,12 @@ PluginDialog - + Plugin Information Информация о модуле - + 1 1 @@ -1342,7 +1340,7 @@ PreferencesDialog - + Preferences Настройки @@ -1350,34 +1348,32 @@ PreviewConfigurationWidget - + Form Форма - + Print/Preview Configuration Настройка печати/предпросмотра - + Style Стиль - + Style sheet Таблица стилей - - - + ... ... - + Device skin Обложка устройства @@ -1410,15 +1406,15 @@ An error has occurred while reading the UI file at line %1, column %2: %3 - Возникла ошибка при чтении файла UI в строке %1 позиции %2: %3 + Возникла ошибка при чтении файла UI в строке %1 позиции %2: %3 Invalid UI file: The root element <ui> is missing. - Неверный файл UI: Отсутствует корневой элемент <ui>. + Некорректный файл UI: отсутствует корневой элемент <ui>. - + The creation of a widget of the class '%1' failed. Не удалось создание виджета класса '%1'. @@ -1932,7 +1928,7 @@ Would you like to retry? Reset control - Сбросить элемент управления + Сбросить элемент управления @@ -1994,7 +1990,7 @@ Would you like to retry? QDesignerMenu - + Type Here Пишите здесь @@ -2020,7 +2016,7 @@ Would you like to retry? - + Add separator Добавить разделитель @@ -2283,7 +2279,7 @@ Container pages should only be added by specifying them in XML returned by the d QFormBuilder - + An empty class name was passed on to %1 (object name: '%2'). Empty class name passed to widget factory method Методу %1 (объекта '%2') было передано пустое имя класса. @@ -2323,6 +2319,16 @@ Container pages should only be added by specifying them in XML returned by the d The property %1 could not be written. The type %2 is not supported yet. Не удалось записать свойство %1. Тип %2 ещё не поддерживается. + + + The enumeration-value '%1' is invalid. The default value '%2' will be used instead. + Значение '%1' перечисляемого типа некорректно. Будет использовано значение '%2'. + + + + The flag-value '%1' is invalid. Zero will be used instead. + Значение флага '%1' перечисляемого типа некорректно. Будет использовано значение '0' (нуль). + QStackedWidgetEventFilter @@ -2456,36 +2462,36 @@ Container pages should only be added by specifying them in XML returned by the d QtBoolEdit - + True - Вкл. + Вкл. False - Выкл. + Выкл. QtBoolPropertyManager - + True - Да + Вкл. False - Нет + Выкл. QtCharEdit - + Clear Char Стереть символ @@ -2501,7 +2507,7 @@ Container pages should only be added by specifying them in XML returned by the d QtColorPropertyManager - + Red Красный @@ -2524,7 +2530,7 @@ Container pages should only be added by specifying them in XML returned by the d QtCursorDatabase - + Arrow Arrow @@ -2673,7 +2679,7 @@ Container pages should only be added by specifying them in XML returned by the d QtGradientDialog - + Edit Gradient Правка градиента @@ -2763,234 +2769,222 @@ Container pages should only be added by specifying them in XML returned by the d Зеркальная - + Form Форма - + Gradient Editor Редактор градиента - + This area shows a preview of the gradient being edited. It also allows you to edit parameters specific to the gradient's type such as start and final point, radius, etc. by drag & drop. Эта область отображает предварительный вариант настраиваемого градиента. Также она позволяет менять с помощью перетаскивания характерные для градиента параметры, такие как: начальная и конечная точки, радиус и пр. - + 1 1 - + 2 2 - + 3 3 - + 4 4 - + 5 5 - + Gradient Stops Editor Редактор опорных точек градиента - + This area allows you to edit gradient stops. Double click on the existing stop handle to duplicate it. Double click outside of the existing stop handles to create a new stop. Drag & drop the handle to reposition it. Use right mouse button to popup context menu with extra actions. Эта область позволяет редактировать опорные точки градиента. Двойной щелчок на существующей точке создаст её копию. Двойной клик вне существующей точки создаст новую. Точки можно перемещать путем удерживания левой кнопки. По правой кнопке можно получить контекстное меню дополнительных действий. - + Zoom Масштаб - - + Reset Zoom 100% - + Position Положение - - - + Hue Оттенок - + H H - - + Saturation Насыщенность - + S S - + Sat Насыщение - - + Value Значение - + V V - + Val Значение - - - + Alpha Альфа - + A A - + Type Тип - + Spread Заливка - + Color Цвет - + Current stop's color Цвет текущей точки - + Show HSV specification Настройки в виде HSV - + HSV HSV - + Show RGB specification Настройки в виде RGB - + RGB RGB - + Current stop's position Положение текущей точки - + % % - + Zoom In Увеличить - + Zoom Out Уменьшить - + Toggle details extension Показать/скрыть детальные настройки - + > > - + Linear Type Линейный тип - - - - - - + ... ... - + Radial Type Радиальный тип - + Conical Type Конический тип - + Pad Spread Равномерная заливка - + Repeat Spread Цикличная заливка - + Reflect Spread Зеркальная заливка @@ -3015,7 +3009,7 @@ Container pages should only be added by specifying them in XML returned by the d Select All - Выделить все + Выделить всё @@ -3038,7 +3032,7 @@ Container pages should only be added by specifying them in XML returned by the d Grad - Градиент + Градиент @@ -3051,31 +3045,31 @@ Container pages should only be added by specifying them in XML returned by the d Вы действительно желаете удалить выбранный градиент? - + New... Новый... - + Edit... Правка... - + Rename Переименовать - + Remove Удалить - + Gradient View Просмотр градиента @@ -3083,7 +3077,8 @@ Container pages should only be added by specifying them in XML returned by the d QtGradientViewDialog - + + Select Gradient Выбрать градиент @@ -3091,7 +3086,7 @@ Container pages should only be added by specifying them in XML returned by the d QtKeySequenceEdit - + Clear Shortcut Удалить комбинацию горячих клавиш @@ -3153,7 +3148,7 @@ Container pages should only be added by specifying them in XML returned by the d QtPropertyBrowserUtils - + [%1, %2, %3] (%4) [%1, %2, %3] (%4) @@ -3269,7 +3264,7 @@ Do you want to replace it? newPrefix - + newPrefix @@ -3460,49 +3455,47 @@ to Предупреждение - + Dialog Диалог - + New File Новый файл - - + N N - + Remove File Удалить файл - - + R R - + I I - + New Resource Новый ресурс - + A A - + Remove Resource or File Удалить ресурс или файл @@ -3623,97 +3616,97 @@ to < Р А З Д Е Л И Т Е Л Ь > - + Customize Toolbars Настройка панелей инструментов - + 1 1 - + Actions Действия - + Toolbars Панель инструментов - + Add new toolbar Добавить новую панель инструментов - + New Новая - + Remove selected toolbar Удалить выбранную панель инструментов - + Remove Удалить - + Rename toolbar Переименовать панель инструментов - + Rename Переименовать - + Move action up Переместить действие вверх - + Up Вверх - + Remove action from toolbar Удалить действие из панели инструментов - + <- <- - + Add action to toolbar Добавить действие на панель инструментов - + -> -> - + Move action down Переместить действие вниз - + Down Вниз - + Current Toolbar Actions Текущие действия панели инструментов @@ -3781,17 +3774,17 @@ Do you want overwrite the template? Выберите каталог для сохранения шаблонов - + Save Form As Template Сохранить форму как шаблон - + &Category: &Категория: - + &Name: &Имя: @@ -3809,22 +3802,22 @@ Do you want overwrite the template? SelectSignalDialog - + Go to slot Переход к слоту - + Select signal Выбор сигнала - + signal сигнал - + class класс @@ -3840,37 +3833,32 @@ Do you want overwrite the template? SignalSlotDialogClass - + Signals and slots Сигналы и слоты - + Slots Слоты - - + Add Добавить - - - - + ... ... - - + Delete Удалить - + Signals Сигналы @@ -3934,7 +3922,7 @@ Do you want overwrite the template? VersionDialog - + <h3>%1</h3><br/><br/>Version %2 <h3>%1</h3><br/><br/>Версия %2 @@ -4053,7 +4041,7 @@ Do you want overwrite the template? qdesigner_internal::ActionModel - + Name Имя @@ -4609,57 +4597,57 @@ Do you want overwrite the template? qdesigner_internal::Dialog - + Dialog Диалог - + StringList Список строк - + New String Новая строка - + &New &Новая - + Delete String Удалить строку - + &Delete &Удалить - + &Value: &Значение: - + Move String Up Переместить строку вверх - + Up Вверх - + Move String Down Переместить строку вниз - + Down Вниз @@ -4828,7 +4816,7 @@ Do you want overwrite the template? Выбрать предка - + Lay out Компоновка @@ -4860,7 +4848,7 @@ Do you want overwrite the template? qdesigner_internal::FormWindowManager - + Cu&t &Вырезать @@ -5074,38 +5062,37 @@ Do you want overwrite the template? qdesigner_internal::GridPanel - + Form Форма - + Grid Сетка - + Visible Видимая - + Grid &X Сетка &X - - + Snap Прилипать - + Reset Сбросить - + Grid &Y Сетка &Y @@ -5227,53 +5214,53 @@ Do you want overwrite the template? Свойства &<< - + Properties &>> Свойства &>> - + Items List Список элементов - + New Item Новый элемент - + &New &Новый - + Delete Item Удалить элемент - + &Delete &Удалить - + Move Item Up Переместить элемент вверх - + U U - + Move Item Down Переместить элемент вниз - + D D @@ -5380,43 +5367,42 @@ Do you want overwrite the template? qdesigner_internal::NewActionDialog - + New Action... Новое действие... - + &Text: &Текст: - + Object &name: &Имя объекта: - + &Icon: &Значок: - + Shortcut: Горячая клавиша: - + Checkable: Триггерное: - + ToolTip: Подсказка: - - + ... ... @@ -5443,22 +5429,22 @@ Please select another name. Укажите другое имя. - + Create Dynamic Property Создание динамического свойства - + Property Name Имя свойства - + horizontalSpacer - + Property Type Тип свойства @@ -5522,27 +5508,27 @@ Please select another name. Внутренняя ошибка: Шаблон не выбран. - + 0 0 - + Choose a template for a preview Выберите шаблон для предпросмотра - + Embedded Design Оформление портативных устройств - + Device: Устройство: - + Screen Size: Размер экрана: @@ -5592,9 +5578,6 @@ Please select another name. &Find in Text... &Найти в тексте... - - - qdesigner_internal::ObjectInspector::ObjectInspectorPrivate Change Current Page @@ -5614,22 +5597,22 @@ Please select another name. %1 %2 - + Change Page Order Изменение порядка страниц - + Page Order Порядок страниц - + Move page up Переместить страницу выше - + Move page down Переместить страницу ниже @@ -5637,47 +5620,47 @@ Please select another name. qdesigner_internal::PaletteEditor - + Edit Palette Правка палитры - + Tune Palette Настройка палитры - + Show Details Показывать детали - + Compute Details Расчитывать детали - + Quick Быстрый - + Preview Предпросмотр - + Disabled Выключенная - + Inactive Неактивная - + Active Активная @@ -5813,9 +5796,6 @@ Please select another name. Browse... Обзор... - - - qdesigner_internal::PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate Load Custom Device Skin @@ -5895,57 +5875,57 @@ ate the goose who was loose. qdesigner_internal::PreviewWidget - + Preview Window Окно предпросмотра - + LineEdit LineEdit - + ComboBox ComboBox - + PushButton PushButton - + ButtonGroup2 ButtonGroup2 - + CheckBox1 CheckBox1 - + CheckBox2 CheckBox2 - + ButtonGroup ButtonGroup - + RadioButton1 RadioButton1 - + RadioButton2 RadioButton2 - + RadioButton3 RadioButton3 @@ -6628,23 +6608,23 @@ Class: %2 qdesigner_internal::TableWidgetEditor - + Properties &>> Свойства &>> - + Edit Table Widget Правка табличного виджета - + &Items &Элементы - + Table Items Элементы таблицы @@ -6690,18 +6670,17 @@ Class: %2 Выберите каталог для сохранения шаблонов - + Form Форма - + Additional Template Paths Дополнительные пути к шаблонам - - + ... ... @@ -6803,13 +6782,13 @@ Class: %2 Общие свойства - + New Item Новый элемент - + New Subitem Новый дочерний элемент @@ -6820,88 +6799,88 @@ Class: %2 Свойства &<< - + Properties &>> Свойства &>> - + Edit Tree Widget - Изменение виджета Tree + Изменение виджета Дерево - + &Items &Элементы - + Tree Items Элементы дерева - + 1 1 - + &New &Новый - + New &Subitem Новый &дочерний элемент - + Delete Item Удалить элемент - + &Delete &Удалить - + Move Item Left (before Parent Item) Переместить элемент влево (перед родительским) - + L L - + Move Item Right (as a First Subitem of the Next Sibling Item) Переместить элемент вправо (сделать первым дочерним элементом соседнего элемента) - + R - + Move Item Up Переместить элемент вверх - + U U - + Move Item Down Переместить элемент вниз - + D D diff --git a/translations/linguist_ru.ts b/translations/linguist_ru.ts index 1749d48..3f26c49 100644 --- a/translations/linguist_ru.ts +++ b/translations/linguist_ru.ts @@ -4,7 +4,7 @@ AboutDialog - + Qt Linguist Qt Linguist @@ -12,52 +12,52 @@ BatchTranslationDialog - + Qt Linguist - Batch Translation Qt Linguist - Пакетный перевод - + Options Параметры - + Set translated entries to finished Помечать переведенные записи как завершённые - + Retranslate entries with existing translation Переводить записи, уже имеющие перевод - + Translate also finished entries Также переводить записи с завершёнными переводами - + Phrase book preference - Предпочитаемые разговорники + Предпочитаемые глоссарии - + Move up Поднять - + Move down Опустить - + &Run &Выполнить - + Cancel Отмена @@ -91,14 +91,14 @@ - + Note that the modified entries will be reset to unfinished if 'Set translated entries to finished' above is unchecked Имейте в виду, что изменённые записи будут отмечены как незавершённые, если не включен параметр "Помечать переведенные записи как завершённые" - + The batch translator will search through the selected phrase books in the order given above - Пакетный переводчик будет искать в выбранных разговорниках в указанном выше порядке + Пакетный переводчик будет искать в выбранных глоссариях в указанном выше порядке @@ -110,11 +110,17 @@ + <p>[more duplicates omitted] <p>[остальные повторы не указаны] - + + <p>* ID: %1 + <p>* ID: %1 + + + <p>* Context: %1<br>* Source: %2 <p>* Контекст: %1<br>* Источник: %2 @@ -124,7 +130,7 @@ <br>* Комментарий: %3 - + Linguist does not know the plural rules for '%1'. Will assume a single universal form. Qt Linguist не знает правила множественных форм для '%1'. @@ -161,7 +167,7 @@ Will assume a single universal form. A phrase book suggestion for '%1' was ignored. - Предложение разговорника для '%1' пропущено. + Предложение глоссария для '%1' пропущено. @@ -188,92 +194,92 @@ Will assume a single universal form. - + Find Поиск - + This window allows you to search for some text in the translation source file. Данное окно позволяет искать текст в файле перевода. - + &Find what: &Искать: - + Type in the text to search for. Введите искомый текст. - + Options Параметры - + Source texts are searched when checked. Если отмечено, поиск будет вестись в исходных текстах. - + &Source texts &Исходные тексты - + Translations are searched when checked. Если отмечено, поиск будет вестись в переведённых текстах. - + &Translations &Переводы - + Texts such as 'TeX' and 'tex' are considered as different when checked. Если отмечено, строки "ПрИмЕр" и "пример" будет считаться разными. - + &Match case С учётом &регистра - + Comments and contexts are searched when checked. Если отмечено, поиск будет вестись по контекстам и комментариям. - + &Comments &Комментарии - + Ignore &accelerators Пропускать &акселераторы - + Click here to find the next occurrence of the text you typed in. Найти следующее совпадение для введённого текста. - + Find Next Найти далее - + Click here to close this window. Закрыть окно. - + Cancel Отмена @@ -281,7 +287,7 @@ Will assume a single universal form. FormMultiWidget - + Alt+Delete translate, but don't change @@ -306,23 +312,27 @@ Will assume a single universal form. Delete non-empty length variant? - + Удалить непустой вариант длины? LRelease - + Dropped %n message(s) which had no ID. - + Удалено %n сообщение, у которого не было ID. + Удалено %n сообщения, у которых не было ID. + Удалено %n сообщений, у которых не было ID. Excess context/disambiguation dropped from %n message(s). - + Удалён лишний контекст из %n сообщения. + Удалён лишний контекст из %n сообщений. + Удалён лишний контекст из %n сообщений. @@ -355,14 +365,14 @@ Will assume a single universal form. MainWindow - + This is the application's main window. Основное окно программы. - + Source text Исходный текст @@ -374,27 +384,27 @@ Will assume a single universal form. - + Context Контекст - + Items Записи - + This panel lists the source contexts. В данной панели перечислены исходные контексты. - + Strings Строки - + Phrases and guesses Фразы и похожие переводы @@ -415,7 +425,7 @@ Will assume a single universal form. ИЗМ - + Loading... Загрузка... @@ -453,7 +463,7 @@ Skip loading the first named file? - + Related files (%1);; Связанные файлы (%1);; @@ -469,7 +479,7 @@ Skip loading the first named file? Файл сохранён. - + Release @@ -586,29 +596,29 @@ All files (*) Create New Phrase Book - Создать разговорник + Создать глоссарий Qt phrase books (*.qph) All files (*) - Разговорники Qt (*.qph) + Глоссарии Qt (*.qph) Все файлы (*) Phrase book created. - Разговорник создан. + Глоссарий создан. Open Phrase Book - Открыть разговорник + Открыть глоссарий Qt phrase books (*.qph);;All files (*) - Разговорники Qt (*.qph);;Все файлы (*) + Глоссарии Qt (*.qph);;Все файлы (*) @@ -624,22 +634,22 @@ All files (*) Add to phrase book - Добавить в разговорник + Добавить в глоссарий No appropriate phrasebook found. - Подходящий разговорник не найден. + Подходящий глоссарий не найден. Adding entry to phrasebook %1 - Добавление записи в разговорник %1 + Добавление записи в глоссарий %1 Select phrase book to add to - Выберите разговорник, в который желаете добавить фразу + Выберите глоссарий, в который желаете добавить фразу @@ -739,15 +749,14 @@ All files (*) &Сохранить - + Save &As... Сохранить &как... - - + Release As... @@ -765,7 +774,7 @@ All files (*) Сохранить все - + &Release All С&компилировать все @@ -796,13 +805,13 @@ All files (*) &Найти и перевести в '%1'... - + Translation File &Settings... &Параметры файла перевода... - + &Batch Translation... Пак&етный перевод... @@ -813,31 +822,31 @@ All files (*) &Найти и перевести... - + File Файл - + Edit Правка - + Translation Перевод - + Validation Проверка - + Help Справка @@ -845,658 +854,655 @@ All files (*) Cannot read from phrase book '%1'. - Не удалось прочитать из разговорника '%1'. + Не удалось прочитать из глоссария '%1'. Close this phrase book. - Закрыть разговорник. + Закрыть глоссарий. Enables you to add, modify, or delete entries in this phrase book. - Позволяет добавлять, изменять и удалять записи в разговорнике. + Позволяет добавлять, изменять и удалять записи в глоссарии. Print the entries in this phrase book. - Печать записей фраз разговорника. + Печать записей фраз глоссария. Cannot create phrase book '%1'. - Не удалось создать разговорник '%1'. + Не удалось создать глоссарий '%1'. Do you want to save phrase book '%1'? - Желаете сохранить разговорник '%1'? + Желаете сохранить глоссарий '%1'? - + All Все - + MainWindow Главное окно - + &Phrases Фра&зы - + &Close Phrase Book - &Закрыть разговорник + &Закрыть глоссарий - + &Edit Phrase Book - &Редактироваь разговорник + &Редактироваь глоссарий - + &Print Phrase Book - &Печатать разговорник + &Печатать глоссарий - + V&alidation П&роверка - + &View &Вид - + Vie&ws Вид&ы - + &Toolbars Пан&ели инструментов - + &Help &Справка - + &Translation П&еревод - + &File &Файл - + Recently Opened &Files Недавно открытые &файлы - + &Edit &Правка - + &Open... &Открыть... - + Open a Qt translation source file (TS file) for editing Открыть исходный файл переводов Qt (файл TS) для изменения - + Ctrl+O - + E&xit В&ыход - + Close this window and exit. Закрыть окно и выйти. - + Ctrl+Q - + Save Сохранить - + Save changes made to this Qt translation source file Сохранить изменения в данном исходном файле перевода Qt - + Save As... Сохранить как... - + Save changes made to this Qt translation source file into a new file. Сохранить изменения в данном исходном файле перевода Qt в новый файл. - + Create a Qt message file suitable for released applications from the current message file. Скомпилировать файл перевода Qt из текущего файла. - + &Print... &Печать... - + Print a list of all the translation units in the current translation source file. Печать списка всех записей перевода из текущего файла. - + Ctrl+P - + &Undo &Отменить - + Undo the last editing operation performed on the current translation. Отменить последнее изменение текущего перевода. - + Ctrl+Z - + &Redo &Повторить - + Redo an undone editing operation performed on the translation. Повторить отменённую правку перевода. - + Ctrl+Y - + Cu&t Выр&езать - + Copy the selected translation text to the clipboard and deletes it. Скопировать отмеченный текст в буфер обмена и удалить его из оригинала. - + Ctrl+X - + &Copy &Копировать - + Copy the selected translation text to the clipboard. Скопировать отмеченный текст в буфер обмена. - + Ctrl+C - + &Paste &Вставить - + Paste the clipboard text into the translation. Вставить текст из буфера обмена в перевод. - + Ctrl+V - + Select &All В&ыделить всё - + Select the whole translation text. Выделить весь текст перевода. - + Ctrl+A - + &Find... &Найти... - + Search for some text in the translation source file. Найти текст в исходном файле перевода. - + Ctrl+F - + Find &Next Найти д&алее - + Continue the search where it was left. Продолжить поиск с места, где он был остановлен. - + F3 - + &Prev Unfinished &Предыдущий незавершённый - + Create a Qt message file suitable for released applications from the current message file. The filename will automatically be determined from the name of the TS file. Создание готового файла перевода Qt из текущего файла. Имя файла будет автоматически определено из имени .ts файла. - + Length Variants - + Варианты длины - + Move to the previous unfinished item. Перейти к предыдущему незавершённому переводу. - + Ctrl+K - + &Next Unfinished &Следующий незавершённый - + Move to the next unfinished item. Перейти к следующему незавершённому переводу. - + Ctrl+J - + P&rev Пр&едыдущий - + Move to the previous item. Перейти к предыдущему переводу. - + Ctrl+Shift+K - + Ne&xt С&ледующий - + Move to the next item. Перейти к следующему переводу. - + Ctrl+Shift+J - + &Done and Next &Готово и далее - + Mark this item as done and move to the next unfinished item. Пометить перевод как завершённый и перейти к следующему незавершённому. - - + Copy from source text Скопировать из исходного текста - + Copies the source text into the translation field. Скопировать исходный текст в поле перевода. - + Ctrl+B - + &Accelerators &Акселераторы - + Toggle the validity check of accelerators, i.e. whether the number of ampersands in the source and translation text is the same. If the check fails, a message is shown in the warnings window. Переключение проверки акселераторов, т.е. совпадает ли количество амперсандов в исходном и переведённом текстах. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. - + &Ending Punctuation &Знаки препинания - + Toggle the validity check of ending punctuation. If the check fails, a message is shown in the warnings window. Переключение проверки знаков препинания в конце текста. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. - + &Phrase matches Совпадение &фраз - + Toggle checking that phrase suggestions are used. If the check fails, a message is shown in the warnings window. Переключение проверки использования предложений для фраз. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. - + Place &Marker Matches Совпадение &маркеров - + Toggle the validity check of place markers, i.e. whether %1, %2, ... are used consistently in the source text and translation text. If the check fails, a message is shown in the warnings window. Переключение проверки маркеров форматирования, т.е. все ли маркеры (%1, %2, ...) исходного текста присутствуют в переведённом. Если выявлено несовпадение, будет показано сообщение в окне предупреждений. - + &New Phrase Book... - &Новый разговорник... + &Новый глоссарий... - + Create a new phrase book. - Создать разговорник. + Создать глоссарий. - + Ctrl+N - + &Open Phrase Book... - &Открыть разговорник... + &Открыть глоссарий... - + Open a phrase book to assist translation. - Открыть разговорник для помощи в переводе. + Открыть глоссарий для помощи в переводе. - + Ctrl+H - + &Reset Sorting &Сброс сортировки - + Sort the items back in the same order as in the message file. Упорядочить элементы в той последовательности, в которой они находятся в файле. - + &Display guesses &Предлагать похожие - + Set whether or not to display translation guesses. Определяет необходимо или нет отображать похожие переводы. - + &Statistics &Статистика - + Display translation statistics. Показать статистику перевода. - + &Manual &Руководство - + F1 - + About Qt Linguist О Qt Linguist - + About Qt О Qt - + Display information about the Qt toolkit by Trolltech. Показать информацию об инструментарии Qt от Nokia. - + &What's This? &Что это? - - + What's This? Что это? - + Enter What's This? mode. Переход в режим "Что это?". - + Shift+F1 - + &Search And Translate... &Найти и перевести... - + Replace the translation on all entries that matches the search source text. Заменить перевод всех записей, которые совпадают с искомым исходным текстом. - + Batch translate all entries using the information in the phrase books. - Перевести все записи в пакетном режиме, используя информацию из разговорника. + Перевести все записи в пакетном режиме, используя информацию из глоссария. - + Open/Refresh Form &Preview Открыть/обновить предпрос&мотр формы - - + Form Preview Tool Инструмент предпросмотра форм - + F5 - + &Add to Phrase Book - &Добавить в разговорник + &Добавить в глоссарий - + Ctrl+T - + Open Read-O&nly... Открыть только для &чтения... - + &Save All &Сохранить все - + Ctrl+S - + Close Закрыть - + &Close All &Закрыть все - + Ctrl+W - + Previous unfinished item Предыдущий незавершённый перевод - + Next unfinished item Следующий незавершённый перевод - + Move to previous item Перейти к предыдущему переводу - + Next item Следующий перевод - + Mark item as done and move to the next unfinished item Пометить перевод как завершённый и перейти к следующему незавершённому - + Copies the source text into the translation field Скопировать исходный текст в поле перевода - + Toggle the validity check of accelerators Переключение проверки акселераторов - + Toggle the validity check of ending punctuation Переключение проверки знаков препинания в конце текста - + Toggle checking that phrase suggestions are used Переключение проверки использования предложений для фраз - + Toggle the validity check of place markers Переключение проверки маркеров форматирования @@ -1541,12 +1547,12 @@ All files (*) Китайский - + This whole panel allows you to view and edit the translation of some source text. Данная панель позволяет просматривать и редактировать перевод исходного текста. - + Source text Исходный текст @@ -1581,7 +1587,7 @@ All files (*) Здесь вы можете оставить комментарий для собственного использования. Комментарии не влияют на перевод приложений. - + %1 translation (%2) %1 перевод (%2) @@ -1611,7 +1617,7 @@ Line: %2 MessageModel - + Completion status for %1 Состояние завершённости для %1 @@ -1657,90 +1663,90 @@ Line: %2 Cannot save phrase book '%1'. - Не удалось сохранить разговорник '%1'. + Не удалось сохранить глоссарий '%1'. - + Edit Phrase Book - Правка разговорника + Правка глоссария - + This window allows you to add, modify, or delete entries in a phrase book. - Данное окно позволяет добавлять, изменять и удалять записи в разговорнике. + Данное окно позволяет добавлять, изменять и удалять записи в глоссарии. - + &Translation: &Перевод: - + This is the phrase in the target language corresponding to the source phrase. Перевод, соответствующий исходной фразе. - + S&ource phrase: &Исходная фраза: - + This is a definition for the source phrase. Определение исходной фразы. - + This is the phrase in the source language. Фраза на исходном языке. - + &Definition: &Определение: - + Click here to add the phrase to the phrase book. - Добавить фразу в разговорник. + Добавить фразу в глоссарий. - + &New Entry Новая &запись - + Click here to remove the entry from the phrase book. - Удалить фразу из разговорника. + Удалить фразу из глоссария. - + &Remove Entry &Удалить - + Settin&gs... &Настройки... - + Click here to save the changes made. Сохранить изменения. - + &Save &Сохранить - + Click here to close this window. Закрыть окно. - + Close Закрыть @@ -1789,7 +1795,7 @@ Line: %2 QObject - + Translation files (%1);; Файлы перевода (%1);; @@ -1799,8 +1805,8 @@ Line: %2 Все файлы (*) - - + + @@ -1820,9 +1826,9 @@ Line: %2 Скомпилированные переводы Qt - + Qt Linguist 'Phrase Book' - 'Разговорник' Qt Linguist + 'Глоссарий' Qt Linguist @@ -1866,47 +1872,42 @@ Line: %2 Statistics - + Statistics Статистика - + Close Закрыть - + Translation Перевод - + Source Источник - - - - - - + 0 0 - + Words: Слов: - + Characters: Символов: - + Characters (with spaces): Символов (с пробелами): @@ -1914,73 +1915,72 @@ Line: %2 TranslateDialog - + This window allows you to search for some text in the translation source file. Данное окно позволяет искать текст в файле перевода. - - + Type in the text to search for. Введите искомый текст. - + Find &source text: &Найти текст: - + &Translate to: &Перевести как: - + Search options Параметры поиска - + Texts such as 'TeX' and 'tex' are considered as different when checked. Если отмечено, строки "ПрИмЕр" и "пример" будет считаться разными. - + Match &case С учётом &регистра - + Mark new translation as &finished Помечать перевод как завер&шённый - + Click here to find the next occurrence of the text you typed in. Найти следующее совпадение для введённого текста. - + Find Next Найти далее - + Translate Перевести - + Translate All Перевести все - + Click here to close this window. Закрыть окно. - + Cancel Отмена @@ -1988,34 +1988,32 @@ Line: %2 TranslationSettingsDialog - + Source language Исходный язык - - + Language Язык - - + Country/Region Страна/Регион - + Target language Язык перевода - + Any Country Любая страна - + Settings for '%1' - Qt Linguist Настройки для '%1' - Qt Linguist diff --git a/translations/qt_help_ru.ts b/translations/qt_help_ru.ts index 006a90b..341cf19 100644 --- a/translations/qt_help_ru.ts +++ b/translations/qt_help_ru.ts @@ -33,32 +33,52 @@ QHelpCollectionHandler - The collection file is not set up yet! - Файл набора ещё не установлен! + The collection file '%1' is not set up yet! + Файл набора '%1' ещё не установлен! - + Cannot load sqlite database driver! Не удалось загрузить драйвер базы данных sqlite! - + Cannot open collection file: %1 Не удалось открыть файл набора: %1 - + Cannot create tables in file %1! Не удалось создать таблицы в файле %1! - The specified collection file already exists! - Указанный файла набора уже существует! + The collection file '%1' already exists! + Файл набора '%1' уже существует! - + + Unknown filter '%1'! + Неизвестный фильтр '%1'! + + + + Invalid documentation file '%1'! + Некорректный файл документации '%1'! + + + + Cannot register namespace '%1'! + Не удалось зарегистрировать пространство имён %1! + + + + Cannot open database '%1' to optimize! + Не удалось открыть базу данных '%1' для оптимизации! + + + Cannot create directory: %1 Не удалось создать каталог: %1 @@ -68,12 +88,7 @@ Не удалось скопировать файл набора: %1 - - Unknown filter! - Неизвестный фильтр! - - - + Cannot register filter %1! Не удалось зарегистрировать фильтр %1! @@ -83,12 +98,7 @@ Не удалось открыть файл документации %1! - - Invalid documentation file! - Некорректный файл документации! - - - + The namespace %1 was not registered! Пространство имён %1 не зарегистрировано! @@ -97,16 +107,6 @@ Namespace %1 already exists! Пространство имён %1 уже существует! - - - Cannot register namespace! - Не удалось зарегистрировать пространство имён! - - - - Cannot open database to optimize! - Не удалось открыть базу данных для оптимизации! - QHelpDBReader @@ -120,7 +120,7 @@ QHelpEngineCore - + The specified namespace does not exist! Указанное пространство имён не существует! @@ -128,7 +128,7 @@ QHelpEngineCorePrivate - + Cannot open documentation file %1: %2! Не удалось открыть файл документации %1: %2! @@ -249,52 +249,52 @@ QHelpSearchQueryWidget - + Search for: Искать: - + Previous search Предыдущий запрос - + Next search Следующий запрос - + Search Поиск - + Advanced search Расширенный поиск - + words <B>similar</B> to: <B>похожие</B> слова: - + <B>without</B> the words: <B>не содержит</B> слов: - + with <B>exact phrase</B>: содержит <B>точную фразу</B>: - + with <B>all</B> of the words: содержит <B>все</B> слова: - + with <B>at least one</B> of the words: содержит <B>хотя бы одно</B> из слов: @@ -318,11 +318,6 @@ QObject - - Untitled - Безымянный - - Unknown token. Неизвестный идентификатор. diff --git a/translations/qt_ru.ts b/translations/qt_ru.ts index f2d1af2..9a2ad84 100644 --- a/translations/qt_ru.ts +++ b/translations/qt_ru.ts @@ -4,7 +4,7 @@ CloseButton - + Close Tab Закрыть вкладку @@ -12,7 +12,7 @@ FakeReply - + Fake error ! @@ -58,7 +58,7 @@ Phonon::AudioOutput - + <html>The audio playback device <b>%1</b> does not work.<br/>Falling back to <b>%2</b>.</html> <html>Звуковое устройство <b>%1</b> не работает.<br/>Будет использоваться <b>%2</b>.</html> @@ -76,7 +76,7 @@ Phonon::Gstreamer::Backend - + Warning: You do not seem to have the package gstreamer0.10-plugins-good installed. Some video features have been disabled. Внимание: Похоже, пакет gstreamer0.10-plugins-good не установлен. @@ -96,11 +96,11 @@ Cannot start playback. -Check your Gstreamer installation and make sure you +Check your GStreamer installation and make sure you have libgstreamer-plugins-base installed. Невозможно начать воспроизведение. -Проверьте установку Gstreamer и убедитесь, +Проверьте установку GStreamer и убедитесь, что пакет libgstreamer-plugins-base установлен. @@ -109,10 +109,10 @@ have libgstreamer-plugins-base installed. Отсутствует необходимый кодек. Вам нужно установить следующие кодеки для воспроизведения данного содержимого: %0 - + - + @@ -121,12 +121,12 @@ have libgstreamer-plugins-base installed. Не удалось открыть источник медиа-данных. - + Invalid source type. Неверный тип источника медиа-данных. - + Could not locate media source. Не удалось найти источник медиа-данных. @@ -144,7 +144,7 @@ have libgstreamer-plugins-base installed. Phonon::MMF - + Audio Output Воспроизведение звука @@ -153,52 +153,334 @@ have libgstreamer-plugins-base installed. The audio output device Устройство воспроизведения звука - - - Phonon::MMF::AudioEqualizer - - Frequency band, %1 Hz - Полоса частот, %1 Гц + + No error + Нет ошибки + + + + Not found + Не найден + + + + Out of memory + Недостаточно ресурсов + + + + Not supported + Не поддерживается + + + + Overflow + + + + + Underflow + + + + + Already exists + Уже существует + + + + Path not found + Путь не найден + + + + In use + Используется + + + + Not ready + Не готов + + + + Access denied + Доступ запрещён + + + + Could not connect + Не удалось установить соединение + + + + Disconnected + Соединение разорвано + + + + Permission denied + Доступ запрещён + + + + Insufficient bandwidth + Недостаточная ширина канала + + + + Network unavailable + Сеть недоступна + + + + Network communication error + Ошибка сетевого обмена данными + + + + Streaming not supported + + + + + Server alert + + + + + Invalid protocol + Некорректный протокол - - - Phonon::MMF::EffectFactory - - audio equalizer - Аудиоэквалайзер + + Invalid URL + Некорректный URL - Bass boost - Усиление басов + Multicast error + + + + + Proxy server error + Ошибка прокси-сервера - Distance Attenuation - Ослабление при отдалении + Proxy server not supported + Прокси-сервер не поддерживается + Audio output error + Ошибка воспроизведения звука + + - Environmental Reverb - Реверберация + Video output error + Ошибка воспроизведения видео - Loudness - Громкость + Decoder error + Ошибка декодирования - Source Orientation - Ориентация источника + Audio or video components could not be played + Аудио- или видео-состовляющая не может быть воспроизведена - Stereo Widening - Расширение стереобазы + DRM error + Ошибка DRM + + + + Unknown error (%1) + Неизвестная ошибка (%1) + + + + Phonon::MMF::AbstractMediaPlayer + + + Not ready to play + Не готов к воспроизведению + + + + + Error opening file + Ошибка открытия файла + + + + Error opening URL + Ошибка открытия URL + + + + Setting volume failed + Не удалось установить уровень громкости + + + + Playback complete + Воспроизведение завершено + + + + Phonon::MMF::AudioEqualizer + + + %1 Hz + %1 Гц + + + + Phonon::MMF::AudioPlayer + + + Getting position failed + + + + + Opening clip failed + + + + + Phonon::MMF::EffectFactory + + + Enabled + Активно + + + + Phonon::MMF::EnvironmentalReverb + + + Decay HF ratio (%) + DecayHFRatio: Ratio of high-frequency decay time to the value specified by DecayTime. + + + + + Decay time (ms) + DecayTime: Time over which reverberation is diminished. + + + + + Density (%) + Density Delay between first and subsequent reflections. Note that the S60 platform documentation does not make clear the distinction between this value and the Diffusion value. + + + + + Diffusion (%) + Diffusion: Delay between first and subsequent reflections. Note that the S60 platform documentation does not make clear the distinction between this value and the Density value. + + + + + Reflections delay (ms) + ReflectionsDelay: Amount of delay between the arrival the direct path from the source and the arrival of the first reflection. + + + + + Reflections level (mB) + ReflectionsLevel: Amplitude of reflections. This value is corrected by the RoomLevel to give the final reflection amplitude. + + + + + Reverb delay (ms) + ReverbDelay: Amount of time between arrival of the first reflection and start of the late reverberation. + + + + + Reverb level (mB) + ReverbLevel Amplitude of reverberations. This value is corrected by the RoomLevel to give the final reverberation amplitude. + + + + + Room HF level + RoomHFLevel: Amplitude of low-pass filter used to attenuate the high frequency component of reflected sound. + + + + + Room level (mB) + RoomLevel: Master volume control for all reflected sound. + + + + + Phonon::MMF::MediaObject + + + Error opening source: type not supported + Ошибка открытыия источника: тип не поддерживается + + + + Error opening source: media type could not be determined + Ошибка открытыия источника: тип медиа-данных не определён + + + + Phonon::MMF::StereoWidening + + + Level (%) + Уровень (%) + + + + Phonon::MMF::VideoPlayer + + + Pause failed + + + + + Seek failed + + + + + Getting position failed + + + + + Opening clip failed + + + + + Buffering clip failed + + + + + + + + + Video display error + @@ -268,7 +550,7 @@ have libgstreamer-plugins-base installed. Q3FileDialog - + Copy or Move a File Копировать или переместить файл @@ -293,7 +575,7 @@ have libgstreamer-plugins-base installed. - + All Files (*) Все файлы (*) @@ -905,8 +1187,8 @@ to QAbstractSocket - - + + Host not found @@ -925,19 +1207,20 @@ to Время на соединение истекло - - + + Operation on socket is not supported Операция с сокетом не поддерживается - + + Socket operation timed out Время на операцию с сокетом истекло - + Socket is not connected Сокет не подключён @@ -950,7 +1233,7 @@ to QAbstractSpinBox - + &Step up Шаг вв&ерх @@ -966,6 +1249,14 @@ to + QAccessibleButton + + + Press + Нажать + + + QApplication @@ -983,7 +1274,7 @@ to Ошибка совместимости библиотеки Qt - + QT_LAYOUT_DIRECTION Translate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout. LTR @@ -1020,7 +1311,7 @@ to QCheckBox - + Uncheck Снять отметку @@ -1038,7 +1329,7 @@ to QColorDialog - + Hu&e: &Тон: @@ -1078,7 +1369,7 @@ to Выбор цвета - + &Basic colors &Основные цвета @@ -1165,7 +1456,7 @@ to QDB2Driver - + Unable to connect Невозможно соединиться @@ -1188,7 +1479,7 @@ to QDB2Result - + Unable to execute statement Невозможно выполнить выражение @@ -1263,7 +1554,7 @@ to QDialog - + What's This? Что это? @@ -1276,9 +1567,9 @@ to QDialogButtonBox - + - + OK ОК @@ -1390,7 +1681,7 @@ to Restore Defaults - Восстановить значения + Восстановить значения @@ -1477,7 +1768,7 @@ to Критическая ошибка: - + &Show this message again &Показывать это сообщение в дальнейшем @@ -1490,7 +1781,7 @@ to QFile - + Destination file exists Файл существует @@ -1529,36 +1820,36 @@ to QFileDialog - - + + All Files (*) Все файлы (*) - + Directories Каталоги - - + + &Open &Открыть - - + + &Save &Сохранить - + Open Открыть - + %1 already exists. Do you want to replace it? %1 уже существует. @@ -1579,7 +1870,7 @@ Please verify the correct file name was given. Мой компьютер - + &Rename &Переименовать @@ -1625,12 +1916,12 @@ Please verify the correct file name was given. - + Directory: Каталог: - + %1 Directory not found. @@ -1657,7 +1948,7 @@ Do you want to delete it anyway? Не удалось удалить каталог. - + Recent Places Недавние документы @@ -1667,12 +1958,12 @@ Do you want to delete it anyway? Все файлы (*.*) - + Save As Сохранить как - + Drive Диск @@ -1728,18 +2019,18 @@ Do you want to delete it anyway? Вперёд - + New Folder Новая папка - + &New Folder &Новая папка - - + + &Choose &Выбрать @@ -1749,8 +2040,8 @@ Do you want to delete it anyway? Удалить - - + + File &name: &Имя файла: @@ -1770,6 +2061,11 @@ Do you want to delete it anyway? QFileSystemModel + + %1 byte(s) + %1 байт + + Invalid filename Некорректное имя файла @@ -1818,7 +2114,7 @@ Do you want to delete it anyway? - + %1 TB %1 Тб @@ -1842,7 +2138,6 @@ Do you want to delete it anyway? - %1 bytes %1 байт @@ -1851,55 +2146,55 @@ Do you want to delete it anyway? QFontDatabase - + Normal Обычный - + - + Bold Жирный - - + + Demi Bold Полужирный - + - + Black Чёрный - + Demi Средний - + Light Светлый - - + + Italic Курсив - - + + Oblique Наклонный - + Any Любая @@ -1941,12 +2236,12 @@ Do you want to delete it anyway? Thaana - Таана + Таана Devanagari - Деванагири + Деванагири @@ -1956,17 +2251,17 @@ Do you want to delete it anyway? Gurmukhi - Гурмукхи + Гурмукхи Gujarati - Гуджарати + Гуджарати Oriya - Ория + Ория @@ -1976,17 +2271,17 @@ Do you want to delete it anyway? Telugu - Телугу + Телугу Kannada - Каннада + Каннада Malayalam - Малайялам + Малаяльская @@ -2011,7 +2306,7 @@ Do you want to delete it anyway? Myanmar - Мьянма + Майанмарская @@ -2026,7 +2321,7 @@ Do you want to delete it anyway? Simplified Chinese - Китайская упрощенная + Китайская упрощённая @@ -2063,6 +2358,11 @@ Do you want to delete it anyway? Runic Руническая + + + N'Ko + Нко + QFontDialog @@ -2262,7 +2562,7 @@ Do you want to delete it anyway? QHostInfo - + Unknown error Неизвестная ошибка @@ -2272,7 +2572,7 @@ Do you want to delete it anyway? - + Host not found Узел не найден @@ -2306,7 +2606,7 @@ Do you want to delete it anyway? QHttp - + @@ -2338,7 +2638,7 @@ Do you want to delete it anyway? Сервер неожиданно разорвал соединение - + Unknown authentication method Неизвестный метод авторизации @@ -2348,13 +2648,13 @@ Do you want to delete it anyway? Ошибка записи ответа на устройство - + Connection refused Отказано в соединении - + Host %1 not found @@ -2362,14 +2662,12 @@ Do you want to delete it anyway? - - HTTP request failed HTTP-запрос не удался - + Invalid HTTP response header Некорректный HTTP-заголовок ответа @@ -2408,7 +2706,7 @@ Do you want to delete it anyway? Соединение с узлом установлено - + Connection closed Соединение закрыто @@ -2424,7 +2722,7 @@ Do you want to delete it anyway? Требуется авторизация - + Connection refused (or timed out) В соединении отказано (или время ожидания истекло) @@ -2623,7 +2921,7 @@ Do you want to delete it anyway? QIODevice - + Permission denied Доступ запрещён @@ -2643,7 +2941,7 @@ Do you want to delete it anyway? Нет свободного места на устройстве - + Unknown error Неизвестная ошибка @@ -2707,7 +3005,7 @@ Do you want to delete it anyway? Не удалось выполнить unmap '%1': %2 - + The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5] Модуль '%1' использует несоместимую библиотеку Qt. (%2.%3.%4) [%5] @@ -2759,7 +3057,7 @@ Do you want to delete it anyway? QLineEdit - + &Undo &Отменить действие @@ -2769,27 +3067,27 @@ Do you want to delete it anyway? &Повторить действие - + Cu&t &Вырезать - + &Copy &Копировать - + &Paste В&ставить - + Delete Удалить - + Select All Выделить всё @@ -2798,7 +3096,7 @@ Do you want to delete it anyway? QLocalServer - + %1: Name error %1: Некорректное имя @@ -2836,7 +3134,7 @@ Do you want to delete it anyway? - + %1: Invalid name %1: Некорректное имя @@ -2867,7 +3165,7 @@ Do you want to delete it anyway? - + %1: Connection error %1: Ошибка соединения @@ -2892,7 +3190,7 @@ Do you want to delete it anyway? QMYSQLDriver - + Unable to open database ' Невозможно открыть базу данных ' @@ -2902,7 +3200,7 @@ Do you want to delete it anyway? Невозможно соединиться - + Unable to begin transaction Невозможно начать транзакцию @@ -2920,12 +3218,13 @@ Do you want to delete it anyway? QMYSQLResult - + + Unable to fetch data Невозможно получить данные - + Unable to execute query Невозможно выполнить запрос @@ -3103,7 +3402,7 @@ Do you want to delete it anyway? QMenuBar - + Actions Действия @@ -3129,7 +3428,7 @@ Do you want to delete it anyway? О Qt - + Show Details... Показать подробности... @@ -3139,7 +3438,7 @@ Do you want to delete it anyway? Скрыть подробности... - + <h3>About Qt</h3><p>This program uses Qt version %1.</p> <h3>О Qt</h3><p>Данная программа использует Qt версии %1.</p> @@ -3323,27 +3622,30 @@ Do you want to delete it anyway? QNetworkAccessFileBackend + Request for opening non-local file %1 Запрос на открытие файла вне файловой системы %1 - + + Error opening %1: %2 Ошибка открытия %1: %2 - + Write error writing to %1: %2 Ошибка записи в %1: %2 - + + Cannot open %1: Path is a directory Невозможно открыть %1: Указан путь к каталогу - + Read error reading from %1: %2 Ошибка чтения из %1: %2 @@ -3379,7 +3681,7 @@ Do you want to delete it anyway? QNetworkAccessHttpBackend - + No suitable proxy found Подходящий прокси-сервер не найден @@ -3387,12 +3689,12 @@ Do you want to delete it anyway? QNetworkReply - + Error downloading %1 - server replied: %2 Ошибка загрузки %1 - ответ сервера: %2 - + Protocol "%1" is unknown Неизвестный протокол "%1" @@ -3400,7 +3702,7 @@ Do you want to delete it anyway? QNetworkReplyImpl - + Operation canceled Операция отменена @@ -3409,7 +3711,7 @@ Do you want to delete it anyway? QOCIDriver - + Unable to logon Невозможно авторизоваться @@ -3438,8 +3740,8 @@ Do you want to delete it anyway? QOCIResult - - + + Unable to bind column for batch execute Невозможно привязать столбец для пакетного выполнения @@ -3483,7 +3785,7 @@ Do you want to delete it anyway? QODBCDriver - + Unable to connect Невозможно соединиться @@ -3516,14 +3818,14 @@ Do you want to delete it anyway? QODBCResult - - + + QODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configuration QODBCResult::reset: Невозможно установить 'SQL_CURSOR_STATIC' атрибутом выражение. Проверьте настройки драйвера ODBC - - + + Unable to execute statement Невозможно выполнить выражение @@ -3543,7 +3845,7 @@ Do you want to delete it anyway? Невозможно привязать значение - + Unable to fetch last @@ -3593,7 +3895,7 @@ Do you want to delete it anyway? Удалённый узел неожиданно прервал соединение для %1 - + No host name given Имя узла не задано @@ -3602,7 +3904,7 @@ Do you want to delete it anyway? QPPDOptionsModel - + Name Имя @@ -3777,7 +4079,7 @@ Do you want to delete it anyway? QPrintDialog - + locally connected соединено локально @@ -3788,7 +4090,7 @@ Do you want to delete it anyway? Псевдонимы: %1 - + unknown неизвестно @@ -3956,7 +4258,7 @@ Do you want to delete it anyway? Печать - + Print To File ... Печать в файл ... @@ -3971,7 +4273,7 @@ Do you want to delete it anyway? Печатать все - + File %1 is not writable. Please choose a different file name. %1 недоступен для записи. @@ -4162,7 +4464,7 @@ Please choose a different file name. Пользовательский - + &Options >> &Параметры >> @@ -4212,12 +4514,12 @@ Please choose a different file name. Параметры страницы - + %1% %1% - + Print Preview Просмотр печати @@ -4297,7 +4599,12 @@ Please choose a different file name. Параметры страницы - + + Close + Закрыть + + + Export to PDF Экспорт в PDF @@ -4474,7 +4781,7 @@ Please choose a different file name. QProcess - + Could not open input redirection for reading Не удалось открыть перенаправление ввода для чтения @@ -4491,7 +4798,7 @@ Please choose a different file name. Ошибка выделения ресурсов (сбой fork): %1 - + @@ -4504,7 +4811,7 @@ Please choose a different file name. Время на операцию с процессом истекло - + @@ -4619,7 +4926,7 @@ Please choose a different file name. QSQLite2Driver - + Error opening database Ошибка открытия базы данных @@ -4642,12 +4949,12 @@ Please choose a different file name. QSQLite2Result - + Unable to fetch results Невозможно получить результаты - + Unable to execute statement Невозможно выполнить выражение @@ -4655,7 +4962,7 @@ Please choose a different file name. QSQLiteDriver - + Error opening database Ошибка открытия базы данных @@ -4683,8 +4990,8 @@ Please choose a different file name. QSQLiteResult - - + + Unable to fetch row Невозможно получить строку @@ -4710,7 +5017,7 @@ Please choose a different file name. Количество параметров не совпадает - + No query Отсутствует запрос @@ -4725,7 +5032,7 @@ Please choose a different file name. Location - Размещение + Расположение @@ -4735,17 +5042,17 @@ Please choose a different file name. Ignore-count - Пропустить + Пропущено Single-shot - Один раз + Однократно Hit-count - Попаданий + Совпадений @@ -4837,12 +5144,12 @@ Please choose a different file name. Run to New Script - Выполнить до нового сценария + Выполнить до нового сценария Toggle Breakpoint - Установить/убрать точку останова + Установить/убрать точку останова @@ -4974,22 +5281,22 @@ Please choose a different file name. Toggle Breakpoint - Установить/убрать точку останова + Установить/убрать точку останова Disable Breakpoint - Убрать точку останова + Убрать точку останова Enable Breakpoint - Установить точку останова + Установить точку останова Breakpoint Condition: - Условие точки останова: + Условие точки останова: @@ -5163,7 +5470,7 @@ Please choose a different file name. - + %1: permission denied %1: доступ запрещён @@ -5255,117 +5562,117 @@ Please choose a different file name. Space - + Пробел Esc - + Esc Tab - + Tab Backtab - + Backtab Backspace - + Backspace Return - + Return Enter - + Enter Ins - + Ins Del - + Del Pause - + Pause Print - + Print SysReq - + SysReq Home - + Home End - + End Left - + Влево Up - + Вверх Right - + Вправо Down - + Вниз PgUp - + PgUp PgDown - + PgDown CapsLock - + CapsLock NumLock - + NumLock ScrollLock - + ScrollLock @@ -5378,7 +5685,7 @@ Please choose a different file name. Справка - + Back Назад @@ -5415,27 +5722,27 @@ Please choose a different file name. Bass Boost - + Усиление басов Bass Up - + Басы выше Bass Down - + Басы ниже Treble Up - + Высокие частоты выше Treble Down - + Высокие частоты ниже @@ -5529,83 +5836,529 @@ Please choose a different file name. - Launch (7) - Запустить (7) + Launch (7) + Запустить (7) + + + + Launch (8) + Запустить (8) + + + + Launch (9) + Запустить (9) + + + + Launch (A) + Запустить (A) + + + + Launch (B) + Запустить (B) + + + + Launch (C) + Запустить (C) + + + + Launch (D) + Запустить (D) + + + + Launch (E) + Запустить (E) + + + + Launch (F) + Запустить (F) + + + + Monitor Brightness Up + Яркость монитора выше + + + + Monitor Brightness Down + Яркость монитора ниже + + + + Keyboard Light On/Off + Вкл/выкл подсветку клавиатуры + + + + Keyboard Brightness Up + Подсветка клавиатуры ярче + + + + Keyboard Brightness Down + Подсветка клавиатуры бледнее + + + + Power Off + Выключение питания + + + + Wake Up + Пробуждение + + + + Eject + Извлечение + + + + Screensaver + Хранитель экрана + + + + WWW + WWW + + + + Sleep + Засыпание + + + + LightBulb + лампочка? + + + + + Shop + Магазин + + + + History + История + + + + Add Favorite + Добавить в избранное + + + + Hot Links + Горячие ссылки + + + + Adjust Brightness + Настройка яркости + + + + Finance + Финансы + + + + Community + Сообщество + + + + Audio Rewind + Перемотка + + + + Back Forward + + + + + Application Left + + + + + Application Right + + + + + Book + Книга + + + + CD + CD + + + + Calculator + Калькулятор + + + + Clear + Очистить + + + + Clear Grab + + + + + Close + Закрыть + + + + Copy + Копировать + + + + Cut + Вырезать + + + + Display + + + + + DOS + DOS + + + + Documents + Документы + + + + Spreadsheet + Электронная таблицы + + + + Browser + Обозреватель + + + + Game + Игра + + + + Go + Перейти + + + + iTouch + iTouch + + + + Logoff + Выйти из системы + + + + Market + Рынок + + + + Meeting + Встреча + + + + Keyboard Menu + Клавиатурное меню + + + + Menu PB + + + + + My Sites + Мои сайты + + + + News + Новости + + + + Home Office + Домашний офис + + + + Option + Опция + + + + Paste + Вставить + + + + Phone + Телефон + + + + Reply + Ответить + + + + Reload + Перезагрузить + + + + Rotate Windows + Повернуть окна + + + + Rotation PB + + + + + Rotation KB + + + + + Save + Сохранить + + + + Send + Отправить + + + + Spellchecker + Проверка орфографии + + + + Split Screen + Разделить экран + + + + Support + Поддержка + + + + Task Panel + Панель задач + + + + Terminal + Терминал + + + + Tools + Инструменты + + + + Travel + Путешествие + + + + Video + Видео + + + + Word Processor + Текстовый редактор + + + + XFer + + + + + Zoom In + Увеличить + + + + Zoom Out + Уменьшить + + + + Away + Ушёл + + + + Messenger + Клиент обмена мгновенными сообщениями + + + + WebCam + Вэб-камера + + + + Mail Forward + Переслать письмо + + + + Pictures + Изображения + + + + Music + Музыка + + + + Battery + Батарея + + + + Bluetooth + Bluetooth + + + + Wireless + Беспроводная сеть + + + + Ultra Wide Band + + + + + Audio Forward + - Launch (8) - Запустить (8) + Audio Repeat + - Launch (9) - Запустить (9) + Audio Random Play + - Launch (A) - Запустить (A) + Subtitle + Субтитры - Launch (B) - Запустить (B) + Audio Cycle Track + - Launch (C) - Запустить (C) + Time + Время + + + + View + Вид - Launch (D) - Запустить (D) + Top Menu + Главное меню - Launch (E) - Запустить (E) + Suspend + - Launch (F) - Запустить (F) + Hibernate + Print Screen - + Печать экрана Page Up - + На страницу вверх Page Down - + На страницу вниз Caps Lock - + Верний регистр Num Lock - + Цифровые клавиши Number Lock - + Цифровые клавиши Scroll Lock - + Scroll Lock @@ -5620,15 +6373,16 @@ Please choose a different file name. Escape - + Escape System Request - + Системный запрос - + + Select Выбрать @@ -5665,12 +6419,12 @@ Please choose a different file name. Call - + Позвонить Hangup - + Положить трубку @@ -5678,43 +6432,43 @@ Please choose a different file name. - + Ctrl - + Ctrl Shift - + Shift Alt - + Alt Meta - + Meta + - + + F%1 - + F%1 - + Home Page - + Домашняя страница @@ -5813,7 +6567,7 @@ Please choose a different file name. Неизвестная ошибка SOCKSv5 прокси (код 0x%1) - + Network operation timed out Время на сетевую операцию истекло @@ -5821,7 +6575,7 @@ Please choose a different file name. QSoftKeyManager - + Ok ОК @@ -5846,7 +6600,7 @@ Please choose a different file name. Отмена - + Exit Выход @@ -5929,7 +6683,12 @@ Please choose a different file name. Невозможно записать данные: %1 - + + Unable to decrypt data: %1 + Невозможно расшифровать данные: %1 + + + Error while reading: %1 Ошибка чтения: %1 @@ -5939,7 +6698,7 @@ Please choose a different file name. Ошибка квитирования SSL: %1 - + Error creating SSL context (%1) Ошибка создания контекста SSL: (%1) @@ -5949,7 +6708,12 @@ Please choose a different file name. Неправильный или пустой список шифров (%1) - + + Private key does not certify public key, %1 + Закрытый ключ не соответствует открытому ключу, %1 + + + Error creating SSL session, %1 Ошибка создания сессии SSL, %1 @@ -5974,15 +6738,126 @@ Please choose a different file name. Ошибка загрузки закрытого ключа, %1 - - Private key does not certificate public key, %1 - Закрытый ключ не соответствует открытому ключу, %1 + + No error + Нет ошибки + + + + The issuer certificate could not be found + издателя ? + Не удалось найти сертификат запрашивающей стороны + + + + The certificate signature could not be decrypted + Не удалось расшифровать подпись сертификата + + + + The public key in the certificate could not be read + Не удалось прочитать открытый ключ сертификата + + + + The signature of the certificate is invalid + Некорректная подпись сертификата + + + + The certificate is not yet valid + Срок действия сертификата ещё не наступил + + + + The certificate has expired + Срок действия сертификата истёк + + + + The certificate's notBefore field contains an invalid time + Поле сертификата notBefore содержит некорректное время + + + + The certificate's notAfter field contains an invalid time + Поле сертификата notAfter содержит некорректное время + + + + The certificate is self-signed, and untrusted + Самоподписанный сертификат не является заверенным + + + + The root certificate of the certificate chain is self-signed, and untrusted + Корневой сертификат цепочки сертификатов самоподписанный и не является заверенным + + + + The issuer certificate of a locally looked up certificate could not be found + + + + + No certificates could be verified + Не удалось проверить сертификаты + + + + One of the CA certificates is invalid + Один из CA сертификатов некорректный + + + + The basicConstraints path length parameter has been exceeded + Путь параметра basicConstraints слишком длинный + + + + The supplied certificate is unsuitable for this purpose + Представленный сертификат не предназначен для данного использования + + + + The root CA certificate is not trusted for this purpose + Корневой CA сертификат не является заверенным для данного использования + + + + The root CA certificate is marked to reject the specified purpose + Корневой CA сертификат отмечен как 'отказывать' для данного использования + + + + The current candidate issuer certificate was rejected because its subject name did not match the issuer name of the current certificate + + + + + The current candidate issuer certificate was rejected because its issuer name and serial number was present and did not match the authority key identifier of the current certificate + + + + + The peer did not present any certificate + Узел не предоставил сертификат + + + + The host name did not match any of the valid hosts for this certificate + Название узла не совпадает ни с одним из допустимых узлов данного сертификата + + + + Unknown error + Неизвестная ошибка QStateMachine - + Missing initial state in compound state '%1' @@ -6036,7 +6911,7 @@ Please choose a different file name. QTDSDriver - + Unable to open connection Невозможно открыть соединение @@ -6070,7 +6945,7 @@ Please choose a different file name. QTextControl - + &Undo &Отменить действие @@ -6113,7 +6988,7 @@ Please choose a different file name. QToolButton - + Press Нажать @@ -6170,14 +7045,14 @@ Please choose a different file name. QUnicodeControlCharacterMenu - + LRM Left-to-right mark - LRM Признак письма слева направо + LRM Индикатор написания слева направо RLM Right-to-left mark - RLM Признак письма справа налево + RLM Индикатор написания справа налево @@ -6187,7 +7062,7 @@ Please choose a different file name. ZWNJ Zero width non-joiner - ZWNJ Не объединяющий символ нулевой ширины + ZWNJ Разделитель нулевой ширины @@ -6197,27 +7072,27 @@ Please choose a different file name. LRE Start of left-to-right embedding - + LRE Индикатор написания слева направо внутри текста, написанного справа налево RLE Start of right-to-left embedding - + RLE Индикатор написания справа налево внутри текста, написанного слева направо LRO Start of left-to-right override - + LRO Перекрывающий индикатор написания слева направо RLO Start of right-to-left override - + RLO Перекрывающий индикатор написания справа налево PDF Pop directional formatting - + PDF Индикатор конца текста с другим направлением @@ -6228,7 +7103,7 @@ Please choose a different file name. QWebFrame - + Request cancelled Запрос отменён @@ -6266,7 +7141,7 @@ Please choose a different file name. Некорректный HTTP-запрос - + Submit default label for Submit buttons in forms on web pages Отправить @@ -6284,7 +7159,7 @@ Please choose a different file name. Сбросить - + This is a searchable index. Enter search keywords: text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' Индекс поиска. Введите ключевые слова для поиска: @@ -6541,19 +7416,19 @@ Please choose a different file name. Audio Element Media controller element - + Аудио-элемент Video Element Media controller element - + Видео-элемент Mute Button Media controller element - + Кнопка "приглушить" @@ -6565,13 +7440,13 @@ Please choose a different file name. Play Button Media controller element - + Кнопка "воспроизведение" Pause Button Media controller element - + Кнопка "пауза" @@ -6589,7 +7464,7 @@ Please choose a different file name. Rewind Button Media controller element - + Кнопка "перемотать" @@ -6601,73 +7476,73 @@ Please choose a different file name. Elapsed Time Media controller element - + Прошло времени Remaining Time Media controller element - + Осталось времени Status Display Media controller element - + Отображение состояния Fullscreen Button Media controller element - + Кнопка "полноэкранный режим" Seek Forward Button Media controller element - + Кнопка "перемотка вперёд" Seek Back Button Media controller element - + Кнопка "перемотка назад" Audio element playback controls and status display Media controller element - + Элементы управления воспроизведением звука и отображения состояния Video element playback controls and status display Media controller element - + Элементы управления воспроизведением видео и отображения состояния Mute audio tracks Media controller element - + Выключить звуковые дорожки Unmute audio tracks Media controller element - + Включить звуковые дорожки Begin playback Media controller element - + Начать воспроизведение Pause playback Media controller element - + Приостановить воспроизведение @@ -6685,7 +7560,7 @@ Please choose a different file name. Rewind movie Media controller element - + Начать фильм сначала @@ -6697,67 +7572,67 @@ Please choose a different file name. Current movie time Media controller element - + Текущее время фильма Remaining movie time Media controller element - + Осталось времени фильма Current movie status Media controller element - + Текущее состояние фильма Play movie in full-screen mode Media controller element - + Воспроизводить фильм в полноэкранном режиме Seek quickly back Media controller element - + Быстрая перемотка назад Seek quickly forward Media controller element - + Быстрая перемотка вперёд Indefinite time Media time description - + Время не определено %1 days %2 hours %3 minutes %4 seconds Media time description - + %1 дней %2 часов %3 минут %4 секунд %1 hours %2 minutes %3 seconds Media time description - + %1 часов %2 минут %3 секунд %1 minutes %2 seconds Media time description - + %1 минут %2 секунд %1 seconds Media time description - + %1 секунд @@ -6796,7 +7671,7 @@ Please choose a different file name. %1 (%2x%3 px) - + Web Inspector - %2 Web-инспектор - %2 @@ -6876,7 +7751,7 @@ Please choose a different file name. - + JavaScript Alert - %1 JavaScript: Предупреждение - %1 @@ -6886,7 +7761,7 @@ Please choose a different file name. JavaScript: Подтверждение - %1 - + JavaScript Prompt - %1 JavaScript: Запрос - %1 @@ -6901,7 +7776,7 @@ Please choose a different file name. Сбой выполнения сценария на данной странице. Желаете остановить выполение сценария? - + Move the cursor to the next character Переместить указатель к следующему символу @@ -7122,7 +7997,7 @@ Please choose a different file name. QWidget - + * * @@ -7374,6 +8249,34 @@ Please choose a different file name. + QXmlPatternistCLI + + + Warning in %1, at line %2, column %3: %4 + Предупреждение в %1, в строке %2, столбце %3: %4 + + + + Warning in %1: %2 + Предупреждение в %1: %2 + + + + Unknown location + Неизвестное расположение + + + + Error %1 in %2, at line %3, column %4: %5 + Ошибка %1 в %2, в строке %3, столбце %4: %5 + + + + Error %1 in %2: %3 + Ошибка %1 в %2: %3 + + + QXmlStream @@ -7588,7 +8491,7 @@ Please choose a different file name. Overflow: Can't represent date %1. - Переполнение: Не удается представить дату %1. + Переполнение: Не удаётся представить дату %1. @@ -7759,7 +8662,7 @@ Please choose a different file name. - The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, is %2 invalid. + The target name in a processing instruction cannot be %1 in any combination of upper and lower case. Therefore, %2 is invalid. Целевое имя в обрабатываемой инструкции не может быть %1 в любой комбинации нижнего и верхнего регистров. Имя %2 некорректно. @@ -7943,7 +8846,12 @@ Please choose a different file name. %1 является схемой неизвестного типа. - + + A template with name %1 has already been declared. + Шаблон с именем %1 уже был объявлен. + + + Only one %1 declaration can occur in the query prolog. Только одно объявление %1 может присутствовать в прологе запроса. @@ -7953,17 +8861,12 @@ Please choose a different file name. Инициализация переменной %1 зависит от себя самой - - No variable by name %1 exists - Переменная с именем %1 отсутствует - - The variable %1 is unused Переменная %1 не используется - + Version %1 is not supported. The supported XQuery version is 1.0. Версия %1 не поддерживается. Поддерживается XQuery версии 1.0. @@ -8024,37 +8927,12 @@ Please choose a different file name. Возможность импорта модулей не поддерживается - - No value is available for the external variable by name %1. - Отсутствует значение для внешней переменной с именем %1. - - - - A template by name %1 has already been declared. - Шаблон с именем %1 уже был объявлен. - - - + The keyword %1 cannot occur with any other mode name. - Ключевое слово %1 не может встречаться с любым другим названием режима. - - - - The value of attribute %1 must of type %2, which %3 isn't. - Значение атрибута %1 должно быть типа %2, но %3 ему не соответствует. - - - - The prefix %1 can not be bound. By default, it is already bound to the namespace %2. - Не удается связать префикс %1. По умолчанию префикс связан с пространством имён %2. - - - - A variable by name %1 has already been declared. - Переменная с именем %1 уже объявлена. + Ключевое слово %1 не может встречаться с любым другим названием режима. - + A stylesheet function must have a prefixed name. Функция стилей должна иметь имя с префиксом. @@ -8084,8 +8962,33 @@ Please choose a different file name. Внешние функции не поддерживаются. Все поддерживаемые функции могут использоваться напрямую без первоначального объявления их в качестве внешних - - An argument by name %1 has already been declared. Every argument name must be unique. + + No variable with name %1 exists + Переменная с именем %1 отсутствует + + + + The value of attribute %1 must be of type %2, which %3 isn't. + Значение атрибута %1 должно быть типа %2, но %3 не соответствует данному типу. + + + + The prefix %1 cannot be bound. By default, it is already bound to the namespace %2. + Не удаётся связать префикс %1. По умолчанию префикс связан с пространством имён %2. + + + + A variable with name %1 has already been declared. + Переменная с именем %1 уже объявлена. + + + + No value is available for the external variable with name %1. + Отсутствует значение для внешней переменной с именем %1. + + + + An argument with name %1 has already been declared. Every argument name must be unique. Аргумент с именем %1 уже объявлен. Имя каждого аргумента должно быть уникальным. @@ -8149,7 +9052,17 @@ Please choose a different file name. Ось %1 не поддерживается в XQuery - + + No function with name %1 is available. + Функция с именем %1 отсутствует. + + + + An attribute with name %1 has already appeared on this element. + Атрибут с именем %1 уже существует для данного элемента. + + + %1 is not a valid name for a processing-instruction. %1 является неверным названием для инструкции обработки. @@ -8174,12 +9087,7 @@ Please choose a different file name. Встречена конструкция, запрещённая для текущего языка (%1). - - No function by name %1 is available. - Функция с именем %1 отсутствует. - - - + The namespace URI cannot be the empty string when binding to a prefix, %1. URI пространства имён не может быть пустой строкой при связывании с префиксом %1. @@ -8214,12 +9122,7 @@ Please choose a different file name. URI пространства имён должно быть константой и не может содержать выражений. - - An attribute by name %1 has already appeared on this element. - Атрибут с именем %1 уже существует для данного элемента. - - - + A direct element constructor is not well-formed. %1 is ended with %2. Прямой конструктор элемента составлен некорректно. %1 заканчивается на %2. @@ -8926,7 +9829,7 @@ Please choose a different file name. - Derived attribute %1 does not exists in the base definition. + Derived attribute %1 does not exist in the base definition. @@ -9378,7 +10281,7 @@ Please choose a different file name. - Component with id %1 has been defined previously. + Component with ID %1 has been defined previously. @@ -9792,11 +10695,16 @@ Please choose a different file name. - Fixed value constrained not allowed if element is nillable. + Fixed value constraint not allowed if element is nillable. - + + Element %1 cannot contain other elements, as it has a fixed content. + + + + Specified type %1 is not validly substitutable with element type %2. @@ -9840,12 +10748,7 @@ Please choose a different file name. - - Element %1 can not contain other elements, as it has a fixed content. - - - - + Element %1 is missing required attribute %2. diff --git a/translations/qtconfig_ru.ts b/translations/qtconfig_ru.ts index 26db840..334a801 100644 --- a/translations/qtconfig_ru.ts +++ b/translations/qtconfig_ru.ts @@ -45,7 +45,7 @@ Phonon GStreamer backend not available. - Модуль Phonon поддержки GStreamer недоступен. + Модуль поддержки GStreamer недоступен. @@ -156,363 +156,347 @@ MainWindowBase - + Qt Configuration Конфигурация Qt - + Appearance Внешний вид - + GUI Style Стиль пользовательского графического интерфейса - + Select GUI &Style: &Стиль интерфейса: - + Build Palette Палитра - + &3-D Effects: Эффекты &3D: - + Window Back&ground: &Фон окна: - + &Tune Palette... &Настроить палитру... - + Please use the KDE Control Center to set the palette. Используйте Центр управления KDE для настройки цветов. - + Preview Предпросмотр - + Select &Palette: Выбор &палитры: - + Active Palette Палитра активных элементов - + Inactive Palette Палитра неактивных элементов - + Disabled Palette Палитра выключенных элементов - + Fonts Шрифты - + Default Font Шрифт по умолчанию - + &Style: &Начертание: - + &Point Size: &Размер: - + F&amily: &Шрифт: - + Sample Text Текст для примера (Sample Text) - + Font Substitution Подстановка шрифтов - + S&elect or Enter a Family: &Выберите шрифт для замены: - + Current Substitutions: Текущие замены: - - + Up Выше - - + Down Ниже - - + Remove Удалить - + Select s&ubstitute Family: &Заменять на шрифт: - - + Add Добавить - + Interface Интерфейс - + Feel Settings Настройка указателя - - + ms мс - + &Double Click Interval: &Интервал двойного щелчка: - + No blinking Без мигания - + &Cursor Flash Time: &Период мигания курсора: - + lines строк - + Wheel &Scroll Lines: &Прокручивать строк при повороте колёсика: - + Resolve symlinks in URLs Разрешать символьные ссылки в URL-ах - + GUI Effects Эффекты пользовательского интерфейса - + &Enable &Включить - + Alt+E Alt+D - + &Menu Effect: Эффект &меню: - + C&omboBox Effect: Эффект C&omboBox: - + &ToolTip Effect: Эффект &ToolTip: - + Tool&Box Effect: Эффект Tool&Box: - - - - + Disable Выключен - - - - + Animate Анимация - - + Fade Затухание - + Global Strut Специальные возможности - + Minimum &Width: Минимальная &ширина: - + Minimum Hei&ght: Минимальная в&ысота: - - + pixels пикселей - + Enhanced support for languages written right-to-left Расширенная поддержка письма справа налево - + XIM Input Style: Стиль ввода XIM: - + On The Spot - + Over The Spot - + Off The Spot - + Root - + Default Input Method: Метод ввода по умолчанию: - + Printer Принтер - + Enable Font embedding Разрешить встраивание шрифтов - + Font Paths Пути к шрифтам - + Browse... Обзор... - + Press the <b>Browse</b> button or enter a directory and press Enter to add them to the list. Нажмите кнопку <b>Обзор...</b> или укажите каталог и нажмите Ввод для добавления его в список. - + Phonon Phonon - + About Phonon О Phonon - - + Current Version: Текущая версия: - - + Not available Недоступно - - + Website: Вэб-сайт: - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -525,12 +509,12 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://phonon.kde.org"><span style=" text-decoration: underline; color:#0000ff;">http://phonon.kde.org</span></a></p></body></html> - + About GStreamer О GStreamer - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -543,22 +527,22 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="http://gstreamer.freedesktop.org/"><span style=" text-decoration: underline; color:#0000ff;">http://gstreamer.freedesktop.org/</span></a></p></body></html> - + GStreamer backend settings Настройки модуля GStreamer - + Preferred audio sink: Предпочитаемое звуковое устройство: - + Preferred render method: Предпочитаемый метод отрисовки: - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -571,57 +555,57 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-style:italic;">Внимание: Изменение данных настроек может повлечь невозможность корректного запуска приложений.</span></p></body></html> - + &File &Файл - + &Help &Справка - + &Save &Сохранить - + Save Сохранить - + Ctrl+S - + E&xit В&ыход - + Exit Выход - + &About &О программе - + About О программе - + About &Qt О &Qt - + About Qt О Qt @@ -629,208 +613,207 @@ p, li { white-space: pre-wrap; } PaletteEditorAdvancedBase - + Tune Palette Настройка палитры - + <b>Edit Palette</b><p>Change the palette of the current widget or form.</p><p>Use a generated palette or select colors for each color group and each color role.</p><p>The palette can be tested with different widget layouts in the preview section.</p> <b>Изменение палитры</b><p>Изменение палитры текущего виджета или формы.</p><p>Используйте сформированную палитру или выберите цвета для каждой группы цветов и каждой их роли.</p><p>Палитру можно проверить на виджетах в разных режимах отображения в разделе предпросмотра.</p> - + Select &Palette: Выбор &палитры: - + Active Palette Палитра активных элементов - + Inactive Palette Палитра неактивных элементов - + Disabled Palette Палитра выключенных элементов - + Auto Автоматически - + Build inactive palette from active Создать неактивную палитру из активной - + Build disabled palette from active Создать выключенную палитру из активной - + Central color &roles Роли &цветов - + Choose central color role Выберите роль цвета - + <b>Select a color role.</b><p>Available central roles are: <ul> <li>Window - general background color.</li> <li>WindowText - general foreground color. </li> <li>Base - used as background color for e.g. text entry widgets, usually white or another light color. </li> <li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. </li> <li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. </li> <li>ButtonText - a foreground color used with the Button color. </li> <li>Highlight - a color to indicate a selected or highlighted item. </li> <li>HighlightedText - a text color that contrasts to Highlight. </li> <li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. </li> </ul> </p> <b>Выбор роли цвета.</b><p>Доступны следующие роли: <ul><li>Window - основной цвет фона.</li> <li>WindowText - основной цвет текста.</li> <li>Base - используется в качестве фона для, например, виджетов с текстовыми полями, обычно, белый или другой светлый цвет.</li> <li>Text - цвет текста используемый совместно с Base. Обычно, он совпадает с WindowText, так как в этом случае получается максимальный контраст и с Window, и с Base.</li> <li>Button - основной цвет фона кнопки, которой требуется цвет отличный от Window, например, в стиле Macintosh.</li> <li>ButtonText - цвет текста используемый совместно с Button.</li> <li>Highlight - цвет для обозначения выбранного или выделенного элемента.</li> <li>HighlightedText - цвет текста контрастирующий с Highlight.</li> <li>BrightText - цвет текста, который отличается от WindowText и хорошо контрастирует с черным.</li></ul></p> - + Window - + WindowText - + Button - + Base - + Text - + BrightText - + ButtonText - + Highlight - + HighlightedText - + &Select Color: &Выбор цвета: - - + Choose a color Выберите цвет - + Choose a color for the selected central color role. Выберите цвет для указанной роли. - + 3-D shadow &effects Эффекты т&рехмерной тени - + Build &from button color Получ&ить из цвета кнопки - + Generate shadings Создание полутонов - + Check to let 3D-effect colors be calculated from button-color. Включите, чтобы цвета эффекта трёхмерности были получены из цвета кнопки. - + Choose 3D-effect color role Выбор роли цвета дял эффекта трёхмерности - + <b>Select a color role.</b><p>Available effect roles are: <ul> <li>Light - lighter than Button color. </li> <li>Midlight - between Button and Light. </li> <li>Mid - between Button and Dark. </li> <li>Dark - darker than Button. </li> <li>Shadow - a very dark color. </li> </ul> <b>Выбор роли цвета.</b><p>Доступны следующие роли: <ul> <li>Light - светлее цвета Button. </li> <li>Midlight - среднее между Light и Button. </li> <li>Mid - среднее между Button и Dark. </li> <li>Dark - темнее цвета Button. </li> <li>Shadow - очень темный цвет. </li> </ul> - + Light - + Midlight - + Mid - + Dark - + Shadow - + Select Co&lor: Выбор &цвета: - + Choose a color for the selected effect color role. Выбор цвета для указанной роли. - + OK Принять - + Close dialog and apply all changes. Закрыть окно с применением изменений. - + Cancel Отмена - + Close dialog and discard all changes. Закрыть окно с отменой изменений. @@ -846,62 +829,62 @@ p, li { white-space: pre-wrap; } PreviewWidgetBase - + Preview Window Окно предпросмотра - + ButtonGroup ButtonGroup - + RadioButton1 RadioButton1 - + RadioButton2 RadioButton2 - + RadioButton3 RadioButton3 - + ButtonGroup2 ButtonGroup2 - + CheckBox1 CheckBox1 - + CheckBox2 CheckBox2 - + LineEdit LineEdit - + ComboBox ComboBox - + PushButton PushButton - + <p> <a href="http://qt.nokia.com">http://qt.nokia.com</a> </p> diff --git a/translations/qvfb_ru.ts b/translations/qvfb_ru.ts index 6d8681e..28f7010 100644 --- a/translations/qvfb_ru.ts +++ b/translations/qvfb_ru.ts @@ -4,7 +4,7 @@ AnimationSaveWidget - + Record Записать @@ -76,191 +76,193 @@ Config - + Configure Настройка - + Size Размер - + 176x220 "SmartPhone" 176x220 "SmartPhone" - + 240x320 "PDA" 240x320 "PDA" - + 320x240 "TV" / "QVGA" 320x240 "TV" / "QVGA" - + 640x480 "VGA" 640x480 "VGA" - + + 800x480 + 800x480 + + + 800x600 800x600 - + 1024x768 1024x768 - + Custom Особый - + Depth Глубина - + 1 bit monochrome 1 бит (монохромный) - + 2 bit grayscale 2 бита (градации серого) - + 4 bit grayscale 4 бита (градации серого) - + 8 bit 8 бит - + 12 (16) bit 12 (16) бит - + 15 bit 15 бит - + 16 bit 16 бит - + 18 bit 18 бит - + 24 bit 24 бита - + 32 bit 32 бита - + 32 bit ARGB 32 бита (ARGB) - + Swap red and blue channels Поменять синий и красный каналы - + BGR format Формат BGR - + Skin Обложка - + None Нет - + Emulate touch screen (no mouse move) указателя? Эмулировать тачскрин (без перемещения мыши) - + Emulate LCD screen (Only with fixed zoom of 3.0 times magnification) Эмулировать ж/к экран (только с 3-х кратным увеличением) - + <p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>. <p>Имейте в виду, что программы, использующие фрэймбуфер, будут завершены, если изменится <i>размер</i> и/или <i>глубина</i> экрана. - + Gamma Гамма - + Blue Синий - - - - + 1.0 1.0 - + Green Зеленый - + All Все - + Red Красный - + Set all to 1.0 Выставить все в 1.0 - + &OK &ОК - + &Cancel От&мена @@ -326,12 +328,12 @@ QVFb - + Browse... Обзор... - + Load Custom Skin... Загрузить обложку пользователя... -- cgit v0.12 From 1d656b760c75de5f98ff3cf0542015a641bc692c Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Tue, 2 Mar 2010 11:00:55 -0800 Subject: Simplify DirectFB performance debugging Allow people to control whether or not to warn on/disable raster fallbacks using the following mechanism: export QT_DIRECTFB_DISABLE_RASTERFALLBACKS="draw_pixmap|draw_text" export QT_DIRECTFB_WARN_ON_RASTERFALLBACKS="draw_lines" It's still possible to define QT_DIRECTFB_WARN_ON_RASTERFALLBACKS to something for legacy reasons. The environment variable check is only available in debug mode. --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 103 +++++++++++++++++---- 1 file changed, 87 insertions(+), 16 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 023bb28..537baf5 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -167,7 +167,7 @@ struct CachedImage static QCache imageCache(4*1024*1024); // 4 MB #endif -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS +#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS || defined QT_DEBUG #define VOID_ARG() static_cast(false) enum PaintOperation { DRAW_RECTS = 0x0001, DRAW_LINES = 0x0002, DRAW_IMAGE = 0x0004, @@ -177,9 +177,74 @@ enum PaintOperation { FILL_RECT = 0x1000, DRAW_COLORSPANS = 0x2000, DRAW_ROUNDED_RECT = 0x4000, ALL = 0xffff }; + +#ifdef QT_DEBUG +static void initRasterFallbacksMasks(int *warningMask, int *disableMask) +{ + struct { + const char *name; + PaintOperation operation; + } const operations[] = { + { "DRAW_RECTS", DRAW_RECTS }, + { "DRAW_LINES", DRAW_LINES }, + { "DRAW_IMAGE", DRAW_IMAGE }, + { "DRAW_PIXMAP", DRAW_PIXMAP }, + { "DRAW_TILED_PIXMAP", DRAW_TILED_PIXMAP }, + { "STROKE_PATH", STROKE_PATH }, + { "DRAW_PATH", DRAW_PATH }, + { "DRAW_POINTS", DRAW_POINTS }, + { "DRAW_ELLIPSE", DRAW_ELLIPSE }, + { "DRAW_POLYGON", DRAW_POLYGON }, + { "DRAW_TEXT", DRAW_TEXT }, + { "FILL_PATH", FILL_PATH }, + { "FILL_RECT", FILL_RECT }, + { "DRAW_COLORSPANS", DRAW_COLORSPANS }, + { "DRAW_ROUNDED_RECT", DRAW_ROUNDED_RECT }, + { "ALL", ALL }, + { 0, ALL } + }; + + const QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|')); + const QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|')); + *warningMask = 0; + *disableMask = 0; + if (!warning.isEmpty() || !disable.isEmpty()) { + for (int i=0; operations[i].name; ++i) { + const QString name = QString::fromLatin1(operations[i].name); + if (warning.contains(name)) { + *warningMask |= operations[i].operation; + } + if (disable.contains(name)) { + *disableMask |= operations[i].operation; + } + } + } +} #endif +static inline int rasterFallbacksMask(bool warn) +{ #ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS + if (warn) + return QT_DIRECTFB_WARN_ON_RASTERFALLBACKS; +#endif +#ifdef QT_DIRECTFB_DISABLE_RASTERFALLBACKS + if (!warn) + return QT_DIRECTFB_DISABLE_RASTERFALLBACKS; +#endif +#ifndef QT_DEBUG + return 0; +#else + static int warnMask = -1; + static int disableMask = -1; + if (warnMask == -1) + initRasterFallbacksMasks(&warnMask, &disableMask); + return warn ? warnMask : disableMask; +#endif +} +#endif + +#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG template static void rasterFallbackWarn(const char *msg, const char *func, const device *dev, uint transformationType, bool simplePen, @@ -189,25 +254,31 @@ static void rasterFallbackWarn(const char *msg, const char *func, const device * const char *nameThree, const T3 &three); #endif -#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS +#if defined QT_DEBUG || (defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS && defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS) #define RASTERFALLBACK(op, one, two, three) \ - if (op & (QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)) \ - rasterFallbackWarn("Disabled raster engine operation", \ - __FUNCTION__, state()->painter->device(), \ - d_func()->transformationType, \ - d_func()->simplePen, \ - d_func()->clipType, \ - d_func()->compositionModeStatus, \ - #one, one, #two, two, #three, three); \ - if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \ - return; + { \ + const bool disable = op & rasterFallbacksMask(false); \ + if (op & rasterFallbacksMask(true)) \ + rasterFallbackWarn(disable \ + ? "Disabled raster engine operation" \ + : "Falling back to raster engine for", \ + __FUNCTION__, \ + state()->painter->device(), \ + d_func()->transformationType, \ + d_func()->simplePen, \ + d_func()->clipType, \ + d_func()->compositionModeStatus, \ + #one, one, #two, two, #three, three); \ + if (disable) \ + return; \ + } #elif defined QT_DIRECTFB_DISABLE_RASTERFALLBACKS -#define RASTERFALLBACK(op, one, two, three) \ - if (op & (QT_DIRECTFB_DISABLE_RASTERFALLBACKS)) \ +#define RASTERFALLBACK(op, one, two, three) \ + if (op & rasterFallbacksMask(false)) \ return; #elif defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS #define RASTERFALLBACK(op, one, two, three) \ - if (op & (QT_DIRECTFB_WARN_ON_RASTERFALLBACKS)) \ + if (op & rasterFallbacksMask(true)) \ rasterFallbackWarn("Falling back to raster engine for", \ __FUNCTION__, state()->painter->device(), \ d_func()->transformationType, \ @@ -1267,7 +1338,7 @@ static inline void drawRects(const T *rects, int n, const QTransform &transform, } } -#ifdef QT_DIRECTFB_WARN_ON_RASTERFALLBACKS +#if defined QT_DIRECTFB_WARN_ON_RASTERFALLBACKS || defined QT_DEBUG template inline const T *ptr(const T &t) { return &t; } template <> inline const bool* ptr(const bool &) { return 0; } template -- cgit v0.12 From 0c12cec56c73342735b51e8aa21c8f0d7fe20c16 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 3 Mar 2010 09:17:41 +1000 Subject: Fix compile. Stupid inconsistent constness/overall api Task-number: QTBUG-6928 --- src/sql/drivers/odbc/qsql_odbc.cpp | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index f34aea5..e75c19d 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -694,9 +694,9 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) val.utf16(); // 0 terminate r = SQLSetConnectAttr(hDbc, SQL_ATTR_CURRENT_CATALOG, #ifdef UNICODE - toSQLTCHAR(val).constData(), + toSQLTCHAR(val).data(), #else - (SQLCHAR*) val.toUtf8().constData(), + (SQLCHAR*) val.toUtf8().data(), #endif val.length()*sizeof(SQLTCHAR)); } else if (opt.toUpper() == QLatin1String("SQL_ATTR_METADATA_ID")) { @@ -716,9 +716,9 @@ bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts) val.utf16(); // 0 terminate r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACEFILE, #ifdef UNICODE - toSQLTCHAR(val).constData(), + toSQLTCHAR(val).data(), #else - (SQLCHAR*) val.toUtf8().constData(), + (SQLCHAR*) val.toUtf8().data(), #endif val.length()*sizeof(SQLTCHAR)); } else if (opt.toUpper() == QLatin1String("SQL_ATTR_TRACE")) { @@ -932,12 +932,12 @@ bool QODBCResult::reset (const QString& query) #ifdef UNICODE r = SQLExecDirect(d->hStmt, - toSQLTCHAR(query).constData(), + toSQLTCHAR(query).data(), (SQLINTEGER) query.length()); #else QByteArray query8 = query.toUtf8(); r = SQLExecDirect(d->hStmt, - (SQLCHAR*) query8.constData(), + (SQLCHAR*) query8.data(), (SQLINTEGER) query8.length()); #endif if (r != SQL_SUCCESS && r != SQL_SUCCESS_WITH_INFO && r!= SQL_NO_DATA) { @@ -1283,12 +1283,12 @@ bool QODBCResult::prepare(const QString& query) #ifdef UNICODE r = SQLPrepare(d->hStmt, - toSQLTCHAR(query).constData(), + toSQLTCHAR(query).data(), (SQLINTEGER) query.length()); #else QByteArray query8 = query.toUtf8(); r = SQLPrepare(d->hStmt, - (SQLCHAR*) query8.constData(), + (SQLCHAR*) query8.data(), (SQLINTEGER) query8.length()); #endif @@ -1849,9 +1849,9 @@ bool QODBCDriver::open(const QString & db, r = SQLDriverConnect(d->hDbc, NULL, #ifdef UNICODE - toSQLTCHAR(connQStr).constData(), + toSQLTCHAR(connQStr).data(), #else - (SQLCHAR*)connQStr.toUtf8().constData(), + (SQLCHAR*)connQStr.toUtf8().data(), #endif (SQLSMALLINT)connQStr.length(), connOut.data(), @@ -2192,9 +2192,9 @@ QStringList QODBCDriver::tables(QSql::TableType type) const NULL, 0, #ifdef UNICODE - toSQLTCHAR(joinedTableTypeString).constData(), + toSQLTCHAR(joinedTableTypeString).data(), #else - (SQLCHAR*)joinedTableTypeString.toUtf8().constData(), + (SQLCHAR*)joinedTableTypeString.toUtf8().data(), #endif joinedTableTypeString.length() /* characters, not bytes */); @@ -2271,21 +2271,21 @@ QSqlIndex QODBCDriver::primaryIndex(const QString& tablename) const SQL_IS_UINTEGER); r = SQLPrimaryKeys(hStmt, #ifdef UNICODE - catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).constData(), + catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).data(), #else - catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().constData(), + catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().data(), #endif catalog.length(), #ifdef UNICODE - schema.length() == 0 ? NULL : toSQLTCHAR(schema).constData(), + schema.length() == 0 ? NULL : toSQLTCHAR(schema).data(), #else - schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().constData(), + schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().data(), #endif schema.length(), #ifdef UNICODE - toSQLTCHAR(table).constData(), + toSQLTCHAR(table).data(), #else - (SQLCHAR*)table.toUtf8().constData(), + (SQLCHAR*)table.toUtf8().data(), #endif table.length() /* in characters, not in bytes */); @@ -2296,21 +2296,21 @@ QSqlIndex QODBCDriver::primaryIndex(const QString& tablename) const r = SQLSpecialColumns(hStmt, SQL_BEST_ROWID, #ifdef UNICODE - catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).constData(), + catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).data(), #else - catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().constData(), + catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().data(), #endif catalog.length(), #ifdef UNICODE - schema.length() == 0 ? NULL : toSQLTCHAR(schema).constData(), + schema.length() == 0 ? NULL : toSQLTCHAR(schema).data(), #else - schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().constData(), + schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().data(), #endif schema.length(), #ifdef UNICODE - toSQLTCHAR(table).constData(), + toSQLTCHAR(table).data(), #else - (SQLCHAR*)table.toUtf8().constData(), + (SQLCHAR*)table.toUtf8().data(), #endif table.length(), SQL_SCOPE_CURROW, @@ -2396,21 +2396,21 @@ QSqlRecord QODBCDriver::record(const QString& tablename) const SQL_IS_UINTEGER); r = SQLColumns(hStmt, #ifdef UNICODE - catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).constData(), + catalog.length() == 0 ? NULL : toSQLTCHAR(catalog).data(), #else - catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().constData(), + catalog.length() == 0 ? NULL : (SQLCHAR*)catalog.toUtf8().data(), #endif catalog.length(), #ifdef UNICODE - schema.length() == 0 ? NULL : toSQLTCHAR(schema).constData(), + schema.length() == 0 ? NULL : toSQLTCHAR(schema).data(), #else - schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().constData(), + schema.length() == 0 ? NULL : (SQLCHAR*)schema.toUtf8().data(), #endif schema.length(), #ifdef UNICODE - toSQLTCHAR(table).constData(), + toSQLTCHAR(table).data(), #else - (SQLCHAR*)table.toUtf8().constData(), + (SQLCHAR*)table.toUtf8().data(), #endif table.length(), NULL, -- cgit v0.12 From 6c44ab0f6edebce1e7190b94ac5b74c81812f482 Mon Sep 17 00:00:00 2001 From: Bill King Date: Wed, 3 Mar 2010 10:01:47 +1000 Subject: Updating SQL binding docs to reflect reality. Task-number: QTBUG-7218 Reviewed-by: Justin McPherson --- src/sql/kernel/qsqlquery.cpp | 8 ++++++++ src/sql/kernel/qsqlresult.cpp | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index 6c6436f..430cf1a 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -999,10 +999,18 @@ bool QSqlQuery::execBatch(BatchExecutionMode mode) must be included when specifying the placeholder name. If \a paramType is QSql::Out or QSql::InOut, the placeholder will be overwritten with data from the database after the exec() call. + In this case, sufficient space must be pre-allocated to store + the result into. To bind a NULL value, use a null QVariant; for example, use \c {QVariant(QVariant::String)} if you are binding a string. + Values cannot be bound to multiple locations in the query, eg: + \code + INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name) + \endcode + Binding to name will bind to the first :name, but not the second. + \sa addBindValue(), prepare(), exec(), boundValue() boundValues() */ void QSqlQuery::bindValue(const QString& placeholder, const QVariant& val, diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 3d63f88..0c0c31c 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -707,7 +707,15 @@ void QSqlResult::bindValue(int index, const QVariant& val, QSql::ParamType param Binds the value \a val of parameter type \a paramType to the \a placeholder name in the current record (row). - Note that binding an undefined placeholder will result in undefined behavior. + Values cannot be bound to multiple locations in the query, eg: + \code + INSERT INTO testtable (id, name, samename) VALUES (:id, :name, :name) + \endcode + Binding to name will bind to the first :name, but not the second. + + \note Binding an undefined placeholder will result in undefined behavior. + + \sa QSqlQuery::bindValue() */ void QSqlResult::bindValue(const QString& placeholder, const QVariant& val, QSql::ParamType paramType) -- cgit v0.12 From 28803715e55b3dc0b017f8e3731920516959894f Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Mar 2010 09:16:15 +0200 Subject: Reduced S60 softkey flickering caused by softkey image support. EikSoftkeyImage::SetLabel call seems to clear and redraw the softkeys every time when called. This commit removes the unnecessary calls to the method if given CBA is already in text mode. Reviewed-By: Sami Merila --- src/gui/kernel/qsoftkeymanager_s60.cpp | 13 ++++++++++--- src/gui/kernel/qsoftkeymanager_s60_p.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index dedf0a1..3a0304c 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -60,7 +60,7 @@ const int LSK_POSITION = 0; const int MSK_POSITION = 3; const int RSK_POSITION = 2; -QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60() +QSoftKeyManagerPrivateS60::QSoftKeyManagerPrivateS60() : cbaHasImage(4) // 4 since MSK position index is 3 { cachedCbaIconSize[0] = QSize(0,0); cachedCbaIconSize[1] = QSize(0,0); @@ -265,10 +265,14 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba, myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership + cbaHasImage[position] = true; ret = true; } else { // Restore softkey to text based - EikSoftkeyImage::SetLabel(cba, left); + if (cbaHasImage[position]) { + EikSoftkeyImage::SetLabel(cba, left); + cbaHasImage[position] = false; + } } } return ret; @@ -326,7 +330,10 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba) if (windowType != Qt::Dialog && windowType != Qt::Popup) { QString text(QSoftKeyManager::tr("Exit")); TPtrC nativeText = qt_QString2TPtrC(text); - EikSoftkeyImage::SetLabel(&cba, false); + if (cbaHasImage[RSK_POSITION]) { + EikSoftkeyImage::SetLabel(&cba, false); + cbaHasImage[RSK_POSITION] = false; + } setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText); return true; } diff --git a/src/gui/kernel/qsoftkeymanager_s60_p.h b/src/gui/kernel/qsoftkeymanager_s60_p.h index 823a2db..a5e5016 100644 --- a/src/gui/kernel/qsoftkeymanager_s60_p.h +++ b/src/gui/kernel/qsoftkeymanager_s60_p.h @@ -53,6 +53,7 @@ // We mean it. // +#include "qbitarray.h" #include "private/qobject_p.h" #include "private/qsoftkeymanager_common_p.h" @@ -98,6 +99,7 @@ private: private: QHash realSoftKeyActions; QSize cachedCbaIconSize[4]; + QBitArray cbaHasImage; }; -- cgit v0.12 From f7b64c3f9bb76bc8dbd96852e54e698af68331cb Mon Sep 17 00:00:00 2001 From: Justin McPherson Date: Wed, 3 Mar 2010 16:04:47 +1000 Subject: QSound OSX; Fix memory leak. Reviewed-by:Dmytro Poplavskiy --- src/gui/kernel/qsound_mac.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qsound_mac.mm b/src/gui/kernel/qsound_mac.mm index 61e42ba..71fd663 100644 --- a/src/gui/kernel/qsound_mac.mm +++ b/src/gui/kernel/qsound_mac.mm @@ -174,6 +174,7 @@ NSSound *QAuServerMac::createNSSound(const QString &fileName, QSound *qSound) NSSound * const nsSound = [[NSSound alloc] initWithContentsOfFile: nsFileName byReference:YES]; QMacSoundDelegate * const delegate = [[QMacSoundDelegate alloc] initWithQSound:qSound:this]; [nsSound setDelegate:delegate]; + [nsFileName release]; return nsSound; } -- cgit v0.12 From e94d0397ea69573d170fd9bc5706e392d9885dbe Mon Sep 17 00:00:00 2001 From: Adrian Constantin Date: Wed, 3 Mar 2010 09:51:44 +0200 Subject: Fix build break in qapplication_x11.cpp. Reviewed-by: TrustMe --- src/gui/kernel/qapplication_x11.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 15761f4..121e9ec 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -96,6 +96,11 @@ extern "C" { } #endif +#ifndef QT_GUI_DOUBLE_CLICK_RADIUS +#define QT_GUI_DOUBLE_CLICK_RADIUS 5 +#endif + + //#define ALIEN_DEBUG #if !defined(QT_NO_GLIB) -- cgit v0.12 From 9b50db437abb5766751d00e5c51fadd0bc79b6d4 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Wed, 3 Mar 2010 11:06:17 +0100 Subject: Bug with toolbar focus on Mac Before doing anything we need to make sure that we don't leave anything in a non-consistent state. When hiding a widget we need to make sure that no mouse_down events are active, because the mouse_up event will never be received by a hidden widget or one of its descendants. The solution is simple, before going through with this we check if there are any mouse_down events in progress, if so we check if it is related to this widget or not. If so, we just reset the mouse_down and then we continue. In X11 and Windows we send a mouse_release event, however we don't do that here because we were already ignoring that from before. I.e. Carbon did not send the mouse release event, so we will not send the mouse release event. There are two ways to interpret this: 1. If we don't send the mouse release event, the widget might get into an inconsistent state, i.e. it might be waiting for a release event that will never arrive. 2. If we send the mouse release event, then the widget might decide to trigger an action that is not supposed to trigger because it is not visible. Task-number: QTBUG-8604 Reviewed-by: denis --- src/gui/kernel/qwidget.cpp | 18 ++++++++++++++++++ src/gui/kernel/qwidget_mac.mm | 6 +----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 29ae51f..66140ca 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -160,6 +160,7 @@ static inline bool hasBackingStoreSupport() extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp +extern QPointer qt_button_down; //qapplication_mac.cpp QWidgetPrivate::QWidgetPrivate(int version) : QObjectPrivate(version) @@ -7535,6 +7536,23 @@ void QWidgetPrivate::hideChildren(bool spontaneous) QWidget *widget = qobject_cast(childList.at(i)); if (!widget || widget->isWindow() || widget->testAttribute(Qt::WA_WState_Hidden)) continue; +#ifdef QT_MAC_USE_COCOA + // Before doing anything we need to make sure that we don't leave anything in a non-consistent state. + // When hiding a widget we need to make sure that no mouse_down events are active, because + // the mouse_up event will never be received by a hidden widget or one of its descendants. + // The solution is simple, before going through with this we check if there are any mouse_down events in + // progress, if so we check if it is related to this widget or not. If so, we just reset the mouse_down and + // then we continue. + // In X11 and Windows we send a mouse_release event, however we don't do that here because we were already + // ignoring that from before. I.e. Carbon did not send the mouse release event, so we will not send the + // mouse release event. There are two ways to interpret this: + // 1. If we don't send the mouse release event, the widget might get into an inconsistent state, i.e. it + // might be waiting for a release event that will never arrive. + // 2. If we send the mouse release event, then the widget might decide to trigger an action that is not + // supposed to trigger because it is not visible. + if(widget == qt_button_down) + qt_button_down = 0; +#endif // QT_MAC_USE_COCOA if (spontaneous) widget->setAttribute(Qt::WA_Mapped, false); else diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index c7acf69..5bce17f 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -152,6 +152,7 @@ static bool qt_mac_raise_process = true; static OSWindowRef qt_root_win = 0; QWidget *mac_mouse_grabber = 0; QWidget *mac_keyboard_grabber = 0; +extern QPointer qt_button_down; //qapplication_mac.cpp #ifndef QT_MAC_USE_COCOA #ifdef QT_NAMESPACE @@ -866,7 +867,6 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event, & ~Qt::WindowMaximized)); QApplication::sendSpontaneousEvent(widget, &e); } - extern QPointer qt_button_down; //qapplication_mac.cpp qt_button_down = 0; } else if(ekind == kEventWindowCollapsed) { if (!widget->isMinimized()) { @@ -894,7 +894,6 @@ OSStatus QWidgetPrivate::qt_window_event(EventHandlerCallRef er, EventRef event, //we send a hide to be like X11/Windows QEvent e(QEvent::Hide); QApplication::sendSpontaneousEvent(widget, &e); - extern QPointer qt_button_down; //qapplication_mac.cpp qt_button_down = 0; } else if(ekind == kEventWindowToolbarSwitchMode) { macSendToolbarChangeEvent(widget); @@ -1519,7 +1518,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, if (widget) { qt_event_request_window_change(widget); if (!HIViewIsVisible(HIViewRef(widget->winId()))) { - extern QPointer qt_button_down; //qapplication_mac.cpp if (widget == qt_button_down) qt_button_down = 0; } @@ -1528,7 +1526,6 @@ OSStatus QWidgetPrivate::qt_widget_event(EventHandlerCallRef er, EventRef event, break; } case kEventClassMouse: { bool send_to_app = false; - extern QPointer qt_button_down; //qapplication_mac.cpp if(qt_button_down) send_to_app = true; if(send_to_app) { @@ -3405,7 +3402,6 @@ void QWidgetPrivate::hide_sys() Q_Q(QWidget); if((q->windowType() == Qt::Desktop)) //you can't hide the desktop! return; - QMacCocoaAutoReleasePool pool; if(q->isWindow()) { OSWindowRef window = qt_mac_window_for(q); -- cgit v0.12 From ffc3dc445afe38d006e1fb036b9b90ff19fa204e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 2 Mar 2010 15:20:06 +0100 Subject: Follow-up to c1b067e: fix aliasing in QReadWriteLock too. The same pattern used in QMutexLocker was used in QReadLocker and QWriteLocker. Reviewed-by: Trust Me --- src/corelib/thread/qreadwritelock.h | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/corelib/thread/qreadwritelock.h b/src/corelib/thread/qreadwritelock.h index 278b8d4..9521ac3 100644 --- a/src/corelib/thread/qreadwritelock.h +++ b/src/corelib/thread/qreadwritelock.h @@ -96,19 +96,19 @@ public: inline void unlock() { - if (q_lock) { + if (q_val) { if ((q_val & quintptr(1u)) == quintptr(1u)) { q_val &= ~quintptr(1u); - q_lock->unlock(); + readWriteLock()->unlock(); } } } inline void relock() { - if (q_lock) { + if (q_val) { if ((q_val & quintptr(1u)) == quintptr(0u)) { - q_lock->lockForRead(); + readWriteLock()->lockForRead(); q_val |= quintptr(1u); } } @@ -119,14 +119,11 @@ public: private: Q_DISABLE_COPY(QReadLocker) - union { - QReadWriteLock *q_lock; - quintptr q_val; - }; + quintptr q_val; }; inline QReadLocker::QReadLocker(QReadWriteLock *areadWriteLock) - : q_lock(areadWriteLock) + : q_val(reinterpret_cast(areadWriteLock)) { Q_ASSERT_X((q_val & quintptr(1u)) == quintptr(0), "QReadLocker", "QReadWriteLock pointer is misaligned"); @@ -143,19 +140,19 @@ public: inline void unlock() { - if (q_lock) { + if (q_val) { if ((q_val & quintptr(1u)) == quintptr(1u)) { q_val &= ~quintptr(1u); - q_lock->unlock(); + readWriteLock()->unlock(); } } } inline void relock() { - if (q_lock) { + if (q_val) { if ((q_val & quintptr(1u)) == quintptr(0u)) { - q_lock->lockForWrite(); + readWriteLock()->lockForWrite(); q_val |= quintptr(1u); } } @@ -167,14 +164,11 @@ public: private: Q_DISABLE_COPY(QWriteLocker) - union{ - QReadWriteLock *q_lock; - quintptr q_val; - }; + quintptr q_val; }; inline QWriteLocker::QWriteLocker(QReadWriteLock *areadWriteLock) - : q_lock(areadWriteLock) + : q_val(reinterpret_cast(areadWriteLock)) { Q_ASSERT_X((q_val & quintptr(1u)) == quintptr(0), "QWriteLocker", "QReadWriteLock pointer is misaligned"); -- cgit v0.12 From 971f19473a7e9c35f14140235c2be3b68006b5f2 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 3 Mar 2010 12:05:15 +0100 Subject: Properly fixes crash when destroying a QGraphicsItem. The focus is now properly cleared when hiding or showing focus scopes or when a child of a focus scope is destroyed. No change of behavior in how focus scope works for QML. Autotest included. Task-number: QT-2649 Reviewed-by: Andreas Aardal Hanssen --- src/gui/graphicsview/qgraphicsitem.cpp | 103 ++++++++++++++++--------- src/gui/graphicsview/qgraphicsitem_p.h | 3 +- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 68 ++++++++++++++++ 3 files changed, 137 insertions(+), 37 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 368af58..f3c90ca 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -641,10 +641,10 @@ are children of a modal panel are not blocked. The values are: - + \value NonModal The panel is not modal and does not block input to other panels. This is the default value for panels. - + \value PanelModal The panel is modal to a single item hierarchy and blocks input to its parent pane, all grandparent panels, and all siblings of its parent and grandparent panels. @@ -2181,6 +2181,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } // Certain properties are dropped as an item becomes invisible. + bool hasFocus = q_ptr->hasFocus(); if (!newVisible) { if (scene) { if (scene->d_func()->mouseGrabberItems.contains(q)) @@ -2190,7 +2191,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo if (q->isPanel() && panelModality != QGraphicsItem::NonModal) scene->d_func()->leaveModal(q_ptr); } - if (q_ptr->hasFocus() && scene) { + if (hasFocus && scene) { // Hiding the closest non-panel ancestor of the focus item QGraphicsItem *focusItem = scene->focusItem(); bool clear = true; @@ -2203,7 +2204,7 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } while ((focusItem = focusItem->parentWidget()) && !focusItem->isPanel()); } if (clear) - q_ptr->clearFocus(); + clearFocusHelper(/* giveFocusToParent = */ false); } if (q_ptr->isSelected()) q_ptr->setSelected(false); @@ -2241,26 +2242,45 @@ void QGraphicsItemPrivate::setVisibleHelper(bool newVisible, bool explicitly, bo } // Enable subfocus - if (scene && newVisible) { - QGraphicsItem *p = parent; - bool done = false; - while (p) { - if (p->flags() & QGraphicsItem::ItemIsFocusScope) { - QGraphicsItem *fsi = p->d_ptr->focusScopeItem; - if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) { - done = true; - while (fsi->d_ptr->focusScopeItem && fsi->d_ptr->focusScopeItem->isVisible()) - fsi = fsi->d_ptr->focusScopeItem; - scene->setFocusItem(fsi); + if (scene) { + if (newVisible) { + // Item is shown + QGraphicsItem *p = parent; + bool done = false; + while (p) { + if (p->flags() & QGraphicsItem::ItemIsFocusScope) { + QGraphicsItem *fsi = p->d_ptr->focusScopeItem; + if (q_ptr == fsi || q_ptr->isAncestorOf(fsi)) { + done = true; + while (fsi->d_ptr->focusScopeItem && fsi->d_ptr->focusScopeItem->isVisible()) + fsi = fsi->d_ptr->focusScopeItem; + fsi->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ true, + /* focusFromShow = */ true); + } + break; } - break; + p = p->d_ptr->parent; } - p = p->d_ptr->parent; - } - if (!done) { - QGraphicsItem *fi = subFocusItem; - if (fi && fi != scene->focusItem()) { - scene->setFocusItem(fi); + if (!done) { + QGraphicsItem *fi = subFocusItem; + if (fi && fi != scene->focusItem()) { + scene->setFocusItem(fi); + } + } + } else { + // Item is hidden + if (hasFocus) { + QGraphicsItem *p = parent; + while (p) { + if (p->flags() & QGraphicsItem::ItemIsFocusScope) { + if (p->d_ptr->visible) { + p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ true, + /* focusFromShow = */ true); + } + break; + } + p = p->d_ptr->parent; + } } } } @@ -3111,13 +3131,13 @@ bool QGraphicsItem::hasFocus() const */ void QGraphicsItem::setFocus(Qt::FocusReason focusReason) { - d_ptr->setFocusHelper(focusReason, /* climb = */ true); + d_ptr->setFocusHelper(focusReason, /* climb = */ true, /* focusFromShow = */ false); } /*! \internal */ -void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb) +void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromShow) { // Disabled / unfocusable items cannot accept focus. if (!q_ptr->isEnabled() || !(flags & QGraphicsItem::ItemIsFocusable)) @@ -3137,7 +3157,7 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim while (p) { if (p->flags() & QGraphicsItem::ItemIsFocusScope) { p->d_ptr->focusScopeItem = q_ptr; - if (!p->focusItem()) { + if (!p->focusItem() && !focusFromShow) { // If you call setFocus on a child of a focus scope that // doesn't currently have a focus item, then stop. return; @@ -3178,24 +3198,35 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim */ void QGraphicsItem::clearFocus() { - // Pass focus to the closest parent focus scope. - if (!d_ptr->inDestructor) { - QGraphicsItem *p = d_ptr->parent; - while (p) { - if (p->flags() & ItemIsFocusScope) { - p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false); - return; + d_ptr->clearFocusHelper(/* giveFocusToParent = */ true); +} + +/*! + \internal +*/ +void QGraphicsItemPrivate::clearFocusHelper(bool giveFocusToParent) +{ + if (giveFocusToParent) { + // Pass focus to the closest parent focus scope + if (!inDestructor) { + QGraphicsItem *p = parent; + while (p) { + if (p->flags() & QGraphicsItem::ItemIsFocusScope) { + p->d_ptr->setFocusHelper(Qt::OtherFocusReason, /* climb = */ false, + /* focusFromShow = */ false); + return; + } + p = p->d_ptr->parent; } - p = p->d_ptr->parent; } } // Invisible items with focus must explicitly clear subfocus. - d_ptr->clearSubFocus(this); + clearSubFocus(q_ptr); - if (hasFocus()) { + if (q_ptr->hasFocus()) { // If this item has the scene's input focus, clear it. - d_ptr->scene->setFocusItem(0); + scene->setFocusItem(0); } } diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index b3ca3b5..ea04e0b 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -414,7 +414,8 @@ public: inline void markParentDirty(bool updateBoundingRect = false); - void setFocusHelper(Qt::FocusReason focusReason, bool climb); + void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromShow); + void clearFocusHelper(bool giveFocusToParent); void setSubFocus(QGraphicsItem *rootItem = 0); void clearSubFocus(QGraphicsItem *rootItem = 0); void resetFocusProxy(); diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 7c1b97e..4d9f23f 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -438,6 +438,7 @@ private slots: void QTBUG_6738_missingUpdateWithSetParent(); void QTBUG_7714_fullUpdateDiscardingOpacityUpdate2(); void QT_2653_fullUpdateDiscardingOpacityUpdate(); + void QT_2649_focusScope(); private: QList paintedItems; @@ -10002,5 +10003,72 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2() QTRY_COMPARE(view.repaints, 1); } +void tst_QGraphicsItem::QT_2649_focusScope() +{ + QGraphicsScene *scene = new QGraphicsScene; + + QGraphicsRectItem *subFocusItem = new QGraphicsRectItem; + subFocusItem->setFlags(QGraphicsItem::ItemIsFocusable); + subFocusItem->setFocus(); + QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem); + + QGraphicsRectItem *scope = new QGraphicsRectItem; + scope->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope); + scope->setFocus(); + subFocusItem->setParentItem(scope); + QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem); + + QGraphicsRectItem *rootItem = new QGraphicsRectItem; + rootItem->setFlags(QGraphicsItem::ItemIsFocusable); + scope->setParentItem(rootItem); + QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem); + + scene->addItem(rootItem); + + QEvent windowActivate(QEvent::WindowActivate); + qApp->sendEvent(scene, &windowActivate); + scene->setFocus(); + + QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0); + QVERIFY(subFocusItem->hasFocus()); + + scope->hide(); + + QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)0); + QCOMPARE(scope->focusItem(), (QGraphicsItem *)0); + QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)0); + QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0); + QVERIFY(!subFocusItem->hasFocus()); + + scope->show(); + + QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem); + QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0); + QVERIFY(subFocusItem->hasFocus()); + + // This should not crash + scope->hide(); + delete scene; +} + QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" -- cgit v0.12 From 735078c807126c0e8af382d9a60fc47766affdc7 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 3 Mar 2010 12:51:03 +0100 Subject: Fix compile Reviewed-by: cduclos --- src/gui/kernel/qwidget.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 66140ca..b5ccb3e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -160,7 +160,6 @@ static inline bool hasBackingStoreSupport() extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp extern QDesktopWidget *qt_desktopWidget; // qapplication.cpp -extern QPointer qt_button_down; //qapplication_mac.cpp QWidgetPrivate::QWidgetPrivate(int version) : QObjectPrivate(version) -- cgit v0.12 From 4db16da585655e5d832eb0e03300bd3211f1631b Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 3 Mar 2010 13:44:38 +0100 Subject: Fix runtime warning on Gtk versions < 2.16 The label property was not added until version 2.16 of Gtk+ and using it will trigger a warning on older versions. Instead we create it with the label set instead which should work for 2.0 and up. Task-number: QTBUG-8537 Reviewed-by: Harald Fernengel --- src/gui/styles/qgtkstyle_p.cpp | 17 +++++++---------- src/gui/styles/qgtkstyle_p.h | 8 ++++---- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp index a033407..f3c7a5b 100644 --- a/src/gui/styles/qgtkstyle_p.cpp +++ b/src/gui/styles/qgtkstyle_p.cpp @@ -91,8 +91,8 @@ Ptr_gtk_widget_set_default_direction QGtkStylePrivate::gtk_widget_set_default_di Ptr_gtk_widget_modify_color QGtkStylePrivate::gtk_widget_modify_fg = 0; Ptr_gtk_widget_modify_color QGtkStylePrivate::gtk_widget_modify_bg = 0; Ptr_gtk_arrow_new QGtkStylePrivate::gtk_arrow_new = 0; -Ptr_gtk_menu_item_new QGtkStylePrivate::gtk_menu_item_new = 0; -Ptr_gtk_check_menu_item_new QGtkStylePrivate::gtk_check_menu_item_new = 0; +Ptr_gtk_menu_item_new_with_label QGtkStylePrivate::gtk_menu_item_new_with_label = 0; +Ptr_gtk_check_menu_item_new_with_label QGtkStylePrivate::gtk_check_menu_item_new_with_label = 0; Ptr_gtk_menu_bar_new QGtkStylePrivate::gtk_menu_bar_new = 0; Ptr_gtk_menu_new QGtkStylePrivate::gtk_menu_new = 0; Ptr_gtk_button_new QGtkStylePrivate::gtk_button_new = 0; @@ -347,8 +347,8 @@ void QGtkStylePrivate::resolveGtk() const gtk_widget_modify_fg = (Ptr_gtk_widget_modify_color)libgtk.resolve("gtk_widget_modify_fg"); gtk_widget_modify_bg = (Ptr_gtk_widget_modify_color)libgtk.resolve("gtk_widget_modify_bg"); gtk_arrow_new = (Ptr_gtk_arrow_new)libgtk.resolve("gtk_arrow_new"); - gtk_menu_item_new = (Ptr_gtk_menu_item_new)libgtk.resolve("gtk_menu_item_new"); - gtk_check_menu_item_new = (Ptr_gtk_check_menu_item_new)libgtk.resolve("gtk_check_menu_item_new"); + gtk_menu_item_new_with_label = (Ptr_gtk_menu_item_new_with_label)libgtk.resolve("gtk_menu_item_new_with_label"); + gtk_check_menu_item_new_with_label = (Ptr_gtk_check_menu_item_new_with_label)libgtk.resolve("gtk_check_menu_item_new_with_label"); gtk_menu_bar_new = (Ptr_gtk_menu_bar_new)libgtk.resolve("gtk_menu_bar_new"); gtk_menu_new = (Ptr_gtk_menu_new)libgtk.resolve("gtk_menu_new"); gtk_toolbar_new = (Ptr_gtk_toolbar_new)libgtk.resolve("gtk_toolbar_new"); @@ -439,7 +439,7 @@ void QGtkStylePrivate::initGtkMenu() const GtkWidget *gtkMenuBar = QGtkStylePrivate::gtk_menu_bar_new(); setupGtkWidget(gtkMenuBar); - GtkWidget *gtkMenuBarItem = QGtkStylePrivate::gtk_menu_item_new(); + GtkWidget *gtkMenuBarItem = QGtkStylePrivate::gtk_menu_item_new_with_label("X"); gtk_menu_shell_append((GtkMenuShell*)(gtkMenuBar), gtkMenuBarItem); gtk_widget_realize(gtkMenuBarItem); @@ -448,14 +448,11 @@ void QGtkStylePrivate::initGtkMenu() const gtk_menu_item_set_submenu((GtkMenuItem*)(gtkMenuBarItem), gtkMenu); gtk_widget_realize(gtkMenu); - GtkWidget *gtkMenuItem = QGtkStylePrivate::gtk_menu_item_new(); - g_object_set(gtkMenuItem, "label", "X", NULL); - + GtkWidget *gtkMenuItem = QGtkStylePrivate::gtk_menu_item_new_with_label("X"); gtk_menu_shell_append((GtkMenuShell*)gtkMenu, gtkMenuItem); gtk_widget_realize(gtkMenuItem); - GtkWidget *gtkCheckMenuItem = QGtkStylePrivate::gtk_check_menu_item_new(); - g_object_set(gtkCheckMenuItem, "label", "X", NULL); + GtkWidget *gtkCheckMenuItem = QGtkStylePrivate::gtk_check_menu_item_new_with_label("X"); gtk_menu_shell_append((GtkMenuShell*)gtkMenu, gtkCheckMenuItem); gtk_widget_realize(gtkCheckMenuItem); diff --git a/src/gui/styles/qgtkstyle_p.h b/src/gui/styles/qgtkstyle_p.h index db5b9b9..31a16db 100644 --- a/src/gui/styles/qgtkstyle_p.h +++ b/src/gui/styles/qgtkstyle_p.h @@ -87,9 +87,9 @@ typedef void (*Ptr_gtk_widget_realize) (GtkWidget *); typedef void (*Ptr_gtk_widget_set_default_direction) (GtkTextDirection); typedef void (*Ptr_gtk_widget_modify_color)(GtkWidget *widget, GtkStateType state, const GdkColor *color); typedef GtkWidget* (*Ptr_gtk_arrow_new)(GtkArrowType, GtkShadowType); -typedef GtkWidget* (*Ptr_gtk_menu_item_new)(void); +typedef GtkWidget* (*Ptr_gtk_menu_item_new_with_label)(const gchar *); typedef GtkWidget* (*Ptr_gtk_separator_menu_item_new)(void); -typedef GtkWidget* (*Ptr_gtk_check_menu_item_new)(void); +typedef GtkWidget* (*Ptr_gtk_check_menu_item_new_with_label)(const gchar *); typedef GtkWidget* (*Ptr_gtk_menu_bar_new)(void); typedef GtkWidget* (*Ptr_gtk_menu_new)(void); typedef GtkWidget* (*Ptr_gtk_combo_box_entry_new)(void); @@ -306,9 +306,9 @@ public: static Ptr_gtk_widget_set_default_direction gtk_widget_set_default_direction; static Ptr_gtk_widget_modify_color gtk_widget_modify_fg; static Ptr_gtk_widget_modify_color gtk_widget_modify_bg; - static Ptr_gtk_menu_item_new gtk_menu_item_new; + static Ptr_gtk_menu_item_new_with_label gtk_menu_item_new_with_label; static Ptr_gtk_arrow_new gtk_arrow_new; - static Ptr_gtk_check_menu_item_new gtk_check_menu_item_new; + static Ptr_gtk_check_menu_item_new_with_label gtk_check_menu_item_new_with_label; static Ptr_gtk_menu_bar_new gtk_menu_bar_new; static Ptr_gtk_menu_new gtk_menu_new; static Ptr_gtk_expander_new gtk_expander_new; -- cgit v0.12 From 57b6629507e97c63cf2445eef12443dcb2639887 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 3 Mar 2010 15:41:38 +0100 Subject: Support keypad input with vnc driver Task-number: QT-1849 Reviewed-by: Jeremy --- src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp index 7bcb74d..e78fec1 100644 --- a/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp +++ b/src/plugins/gfxdrivers/vnc/qscreenvnc_qws.cpp @@ -325,6 +325,36 @@ static const struct { { 0xffe8, Qt::Key_Meta }, { 0xffe9, Qt::Key_Alt }, { 0xffea, Qt::Key_Alt }, + + { 0xffb0, Qt::Key_0 }, + { 0xffb1, Qt::Key_1 }, + { 0xffb2, Qt::Key_2 }, + { 0xffb3, Qt::Key_3 }, + { 0xffb4, Qt::Key_4 }, + { 0xffb5, Qt::Key_5 }, + { 0xffb6, Qt::Key_6 }, + { 0xffb7, Qt::Key_7 }, + { 0xffb8, Qt::Key_8 }, + { 0xffb9, Qt::Key_9 }, + + { 0xff8d, Qt::Key_Return }, + { 0xffaa, Qt::Key_Asterisk }, + { 0xffab, Qt::Key_Plus }, + { 0xffad, Qt::Key_Minus }, + { 0xffae, Qt::Key_Period }, + { 0xffaf, Qt::Key_Slash }, + + { 0xff95, Qt::Key_Home }, + { 0xff96, Qt::Key_Left }, + { 0xff97, Qt::Key_Up }, + { 0xff98, Qt::Key_Right }, + { 0xff99, Qt::Key_Down }, + { 0xff9a, Qt::Key_PageUp }, + { 0xff9b, Qt::Key_PageDown }, + { 0xff9c, Qt::Key_End }, + { 0xff9e, Qt::Key_Insert }, + { 0xff9f, Qt::Key_Delete }, + { 0, 0 } }; @@ -483,6 +513,10 @@ bool QRfbKeyEvent::read(QTcpSocket *s) keycode = keyMap[i].keycode; i++; } + + if (keycode >= ' ' && keycode <= '~') + unicode = keycode; + if (!keycode) { if (key <= 0xff) { unicode = key; -- cgit v0.12 From be1037d7b6bcdf0ab34fe7fab00d706f8daa01b5 Mon Sep 17 00:00:00 2001 From: Adrian Constantin Date: Wed, 3 Mar 2010 17:21:37 +0200 Subject: Removed unused macro. Reviewed-by: Stefano Pironato --- src/gui/kernel/qapplication.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 6dda961..4fe3900 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -117,10 +117,6 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp #include #endif -#ifndef QT_GUI_DOUBLE_CLICK_RADIUS -#define QT_GUI_DOUBLE_CLICK_RADIUS 5 -#endif - //#define ALIEN_DEBUG static void initResources() -- cgit v0.12 From 13e08bb43bc7c972e77fc7b77ae5de14235cb897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Wed, 3 Mar 2010 15:54:54 +0100 Subject: Fixes wrong composition mode for cached backgrounds in Graphics View. This change partially reverts commit a589005f and therefore fully reverts 68be6457. We cannot assume that only opaque pixels are painted in drawBackground(). Regression against 4.5. Auto-test included. Task-number: QTBUG-8168 Reviewed-by: trond --- src/gui/graphicsview/qgraphicsview.cpp | 6 ----- tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 34 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 1ced3d7..a767987 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3360,12 +3360,6 @@ void QGraphicsView::paintEvent(QPaintEvent *event) backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip); if (viewTransformed) backgroundPainter.setTransform(viewTransform); -#ifdef Q_WS_X11 -#undef X11 - if (backgroundPainter.paintEngine()->type() != QPaintEngine::X11) -#define X11 qt_x11Data -#endif - backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source); QRectF backgroundExposedSceneRect = mapToScene(d->backgroundPixmapExposed.boundingRect()).boundingRect(); drawBackground(&backgroundPainter, backgroundExposedSceneRect); d->backgroundPixmapExposed = QRegion(); diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index c77f76d..1c19fab 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -219,6 +219,7 @@ private slots: void inputMethodSensitivity(); void inputContextReset(); void indirectPainting(); + void compositionModeInDrawBackground(); // task specific tests below me void task172231_untransformableItems(); @@ -3825,6 +3826,39 @@ void tst_QGraphicsView::indirectPainting() QTRY_VERIFY(scene.drawCount > 0); } +void tst_QGraphicsView::compositionModeInDrawBackground() +{ + class MyView : public QGraphicsView + { public: + MyView(QGraphicsScene *scene) : QGraphicsView(scene), + painted(false), compositionMode(QPainter::CompositionMode_SourceOver) {} + bool painted; + QPainter::CompositionMode compositionMode; + void drawBackground(QPainter *painter, const QRectF &) + { + compositionMode = painter->compositionMode(); + painted = true; + } + }; + + QGraphicsScene dummy; + MyView view(&dummy); + view.show(); + QTest::qWaitForWindowShown(&view); + + // Make sure the painter's composition mode is SourceOver in drawBackground. + QTRY_VERIFY(view.painted); + QCOMPARE(view.compositionMode, QPainter::CompositionMode_SourceOver); + + view.painted = false; + view.setCacheMode(QGraphicsView::CacheBackground); + view.viewport()->update(); + + // Make sure the painter's composition mode is SourceOver in drawBackground + // with background cache enabled. + QTRY_VERIFY(view.painted); + QCOMPARE(view.compositionMode, QPainter::CompositionMode_SourceOver); +} void tst_QGraphicsView::task253415_reconnectUpdateSceneOnSceneChanged() { QGraphicsView view; -- cgit v0.12 From e98d4aece51fa8691cf33325ab96634fcf9baa81 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 3 Mar 2010 17:37:09 +0100 Subject: Fix compositing when QWS background is completely transparent. Specifying the wrong composition mode triggered an optimization which caused uninitialized values to be blended in. Task-number: QTBUG-6625, QTBUG-6906 Reviewed-by: Samuel --- src/gui/embedded/qscreen_qws.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 8eb8123..9bd73a4 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -2739,7 +2739,7 @@ void QScreen::compose(int level, const QRegion &exposed, QRegion &blend, default: break; } - spanData.setup(qwsServer->backgroundBrush(), 256, QPainter::CompositionMode_SourceOver); + spanData.setup(qwsServer->backgroundBrush(), 256, QPainter::CompositionMode_Source); spanData.dx = off.x(); spanData.dy = off.y(); } else if (!surface->isBuffered()) { -- cgit v0.12 From a4d7572059b5b56d49d7e0c3f3466686e1dc6e16 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 3 Mar 2010 20:47:13 +0100 Subject: QVariant: Fix crash when comparing two variant with the same undefined type. If the type is the same, but not registered, the returned string could be null (or empty if a empty string was registered) In that case, QVariant compare() function would access invalid memory. Protect against that case. qstrcmp returns 0 if 0 is given as a parametter. Task-number: QTBUG-8700 Reviewed-by: Markus Goetz --- src/corelib/kernel/qvariant.cpp | 3 ++- tests/auto/qvariant/tst_qvariant.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index e1b5825..95b2352 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -466,7 +466,8 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include * user defined pointer types. */ const char *const typeName = QMetaType::typeName(a->type); - if (typeName[qstrlen(typeName) - 1] == '*') + uint typeNameLen = qstrlen(typeName); + if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*') return *static_cast(a_ptr) == *static_cast(b_ptr); return a_ptr == b_ptr; diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index a316dda..b7e2c81 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -1968,6 +1968,10 @@ void tst_QVariant::operator_eq_eq_data() QTest::newRow("HashSecondLarger") << QVariant(hash1) << QVariant(hash2) << false; } + + QTest::newRow( "UserType" ) << QVariant(QVariant::UserType) << QVariant(QVariant::UserType) << false; + QVariant mUserType(QVariant::UserType); + QTest::newRow( "Shared UserType" ) << mUserType << mUserType << true; } void tst_QVariant::operator_eq_eq() -- cgit v0.12 From 9e5cc0da3cdcf3ddddc35dc78e670994237a180f Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 4 Mar 2010 08:22:27 +1000 Subject: Move tests into separate .pro files, based on Qt module. Having the tests in separate projects allows for some optimization strategies when running the tests (e.g. start running corelib tests while the rest of Qt is still compiling), and allows developers to run only a subset of tests when appropriate. --- tests/auto/auto.pro | 604 +-------------------- tests/auto/corelib.pro | 102 ++++ tests/auto/dbus.pro | 20 + tests/auto/gui.pro | 223 ++++++++ tests/auto/host.pro | 18 + .../auto/maketestselftest/tst_maketestselftest.cpp | 33 +- tests/auto/multimedia.pro | 11 + tests/auto/network.pro | 40 ++ tests/auto/opengl.pro | 4 + tests/auto/other.pro | 58 ++ tests/auto/phonon.pro | 5 + tests/auto/qstringmatcher/qstringmatcher.pro | 2 +- tests/auto/qt3support.pro | 54 ++ tests/auto/script.pro | 16 + tests/auto/sql.pro | 14 + tests/auto/svg.pro | 6 + tests/auto/webkit.pro | 8 + tests/auto/xml.pro | 8 + tests/auto/xmlpatterns.pro | 47 ++ 19 files changed, 671 insertions(+), 602 deletions(-) create mode 100644 tests/auto/corelib.pro create mode 100644 tests/auto/dbus.pro create mode 100644 tests/auto/gui.pro create mode 100644 tests/auto/host.pro create mode 100644 tests/auto/multimedia.pro create mode 100644 tests/auto/network.pro create mode 100644 tests/auto/opengl.pro create mode 100644 tests/auto/other.pro create mode 100644 tests/auto/phonon.pro create mode 100644 tests/auto/qt3support.pro create mode 100644 tests/auto/script.pro create mode 100644 tests/auto/sql.pro create mode 100644 tests/auto/svg.pro create mode 100644 tests/auto/webkit.pro create mode 100644 tests/auto/xml.pro create mode 100644 tests/auto/xmlpatterns.pro diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index f3885a7..0d48522 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,592 +1,22 @@ -QT = core TEMPLATE = subdirs -# These tests use host tools and therefore can't work for cross-compiled Qt. -!cross_compile:SUBDIRS += \ - headers \ - bic \ - compiler \ - compilerwarnings \ - linguist \ - maketestselftest \ - moc \ - uic \ - guiapplauncher \ - #atwrapper \ # These tests need significant updating, - #uiloader \ # they have hardcoded machine names etc. - -Q3SUBDIRS += \ - q3accel \ - q3action \ - q3actiongroup \ - q3buttongroup \ - q3canvas \ - q3checklistitem \ - q3cstring \ - q3databrowser \ - q3dateedit \ - q3datetimeedit \ - q3deepcopy \ - q3dict \ - q3dns \ - q3dockwindow \ - q3filedialog \ - q3groupbox \ - q3hbox \ - q3header \ - q3iconview \ - q3listbox \ - q3listview \ - q3listviewitemiterator \ - q3mainwindow \ - q3popupmenu \ - q3process \ - q3progressbar \ - q3progressdialog \ - q3ptrlist \ - q3richtext \ - q3scrollview \ - q3semaphore \ - q3serversocket \ - q3socket \ - q3socketdevice \ - q3sqlcursor \ - q3sqlselectcursor \ - q3stylesheet \ - q3tabdialog \ - q3table \ - q3textbrowser \ - q3textedit \ - q3textstream \ - q3timeedit \ - q3toolbar \ - q3urloperator \ - q3valuelist \ - q3valuevector \ - q3combobox \ - q3frame \ - q3uridrag \ - q3widgetstack - -!cross_compile:Q3SUBDIRS += \ - uic3 - SUBDIRS += \ -# exceptionsafety_objects \ shouldn't enable it - languagechange \ - collections \ - exceptionsafety \ - mediaobject \ -# mediaobject_wince_ds9 \ This is Windows CE only (we test the second phonon backend ds9 here) - modeltest \ - networkselftest \ - qabstractbutton \ - qabstractitemmodel \ - qabstractitemview \ - qabstractprintdialog \ - qabstractscrollarea \ - qabstractslider \ - qabstractsocket \ - qabstractspinbox \ - qabstracttextdocumentlayout \ - qabstractvideobuffer \ - qabstractvideosurface \ - qaccessibility \ - qaction \ - qactiongroup \ - qalgorithms \ - qanimationgroup \ - qapplication \ - qatomicint \ - qatomicpointer \ - qbitarray \ - qboxlayout \ - qbrush \ - qbuffer \ - qbuttongroup \ - qbytearray \ - qcache \ - qchar \ - qcheckbox \ - qclipboard \ - qcolor \ - qcolordialog \ - qcombobox \ - qcompleter \ - qcomplextext \ - qcoreapplication \ - qcryptographichash \ - qcssparser \ - qdatastream \ - qdatawidgetmapper \ - qdate \ - qdatetime \ - qdatetimeedit \ - qdebug \ - qdesktopservices \ - qdesktopwidget \ - qdial \ - qdialog \ - qdialogbuttonbox \ - qdir \ - qdirmodel \ - qdockwidget \ - qdom \ - qdoublespinbox \ - qdoublevalidator \ - qdrag \ - qerrormessage \ - qevent \ - qeventloop \ - qexplicitlyshareddatapointer \ - qfile \ - qfiledialog \ - qfiledialog2 \ - qfileinfo \ - qfilesystemwatcher \ - qfilesystemmodel \ - qflags \ - qfocusevent \ - qfocusframe \ - qfont \ - qfontcombobox \ - qfontdatabase \ - qfontdialog \ - qfontmetrics \ - qftp \ - qgetputenv \ - qglobal \ - qgraphicseffect \ - qgraphicseffectsource \ - qgraphicsgridlayout \ - qgraphicsitem \ - qgraphicsitemanimation \ - qgraphicsanchorlayout \ - qgraphicsanchorlayout1 \ - qgraphicslayout \ - qgraphicslayoutitem \ - qgraphicslinearlayout \ - qgraphicsobject \ - qgraphicspixmapitem \ - qgraphicspolygonitem \ - qgraphicsproxywidget \ - qgraphicsscene \ - qgraphicssceneindex \ - qgraphicstransform \ - qgraphicsview \ - qgraphicswidget \ - qgridlayout \ - qgroupbox \ - qguivariant \ - qhash \ - qheaderview \ - qhelpcontentmodel \ - qhelpenginecore \ - qhelpgenerator \ - qhelpindexmodel \ - qhelpprojectdata \ - qhostaddress \ - qhostinfo \ - qhttp \ - qhttpnetworkreply \ - qhttpnetworkconnection \ - qicon \ - qicoimageformat \ - qimage \ - qimageiohandler \ - qimagereader \ - qimagewriter \ - qinputdialog \ - qintvalidator \ - qiodevice \ - qitemdelegate \ - qitemeditorfactory \ - qitemmodel \ - qitemselectionmodel \ - qitemview \ - qkeysequence \ - qlabel \ - qlayout \ - qlcdnumber \ - qlibrary \ - qline \ - qlineedit \ - qlist \ - qlistview \ - qlistwidget \ - qlocale \ - qmainwindow \ - qmake \ - qmap \ - qmath \ - qmatrixnxn \ - qmdiarea \ - qmdisubwindow \ - qmenu \ - qmenubar \ - qmessagebox \ - qmetaobject \ - qmetatype \ - qmouseevent \ - qmouseevent_modal \ - qmovie \ - qmutex \ - qmutexlocker \ - qnativesocketengine \ - qnetworkcookie \ - qnetworkcookiejar \ - qnetworkinterface \ - qnetworkproxy \ - qnetworkrequest \ - qnetworkreply \ - qnetworkaccessmanager_and_qprogressdialog \ - qnumeric \ - qobject \ - qobjectrace \ - qcontiguouscache \ - qpaintengine \ - qpainter \ - qpainterpath \ - qpalette \ - qparallelanimationgroup \ - qpauseanimation \ - qpathclipper \ - qpen \ - qpicture \ - qpixmap \ - qpixmapcache \ - qpixmapfilter \ - qplaintextedit \ - qpoint \ - qpointer \ - qpolygon \ - qprinter \ - qprinterinfo \ - qprocess \ - qprocessenvironment \ - qprogressbar \ - qprogressdialog \ - qpropertyanimation \ - qpushbutton \ - qquaternion \ - qqueue \ - qradiobutton \ - qreadlocker \ - qreadwritelock \ - qrect \ - qregexp \ - qregexpvalidator \ - qregion \ - qresourceengine \ - qringbuffer \ - qscopedpointer \ - qscrollarea \ - qsemaphore \ - qsharedpointer \ - qsharedpointer_and_qwidget \ - qsequentialanimationgroup \ - qset \ - qsettings \ - qshortcut \ - qsignalmapper \ - qsignalspy \ - qsize \ - qsizef \ - qslider \ - qsocketnotifier \ - qsocks5socketengine \ - qsortfilterproxymodel \ - qsound \ - qaudiodeviceinfo \ - qaudioformat \ - qaudiooutput \ - qaudioinput \ - qspinbox \ - qsplitter \ - qsql \ - qsqldatabase \ - qsqlerror \ - qsqlfield \ - qsqlquery \ - qsqlquerymodel \ - qsqlrecord \ - qsqlrelationaltablemodel \ - qsqltablemodel \ - qsqlthread \ - qsslcertificate \ - qsslcipher \ - qsslerror \ - qsslkey \ - qsslsocket \ - qstackedlayout \ - qstackedwidget \ - qstandarditem \ - qstandarditemmodel \ - qstate \ - qstatemachine \ - qstatusbar \ - qstl \ - qstring \ - qstringbuilder1 \ - qstringbuilder2 \ - qstringbuilder3 \ - qstringbuilder4 \ - qstringmatcher \ - qstringlist \ - qstringlistmodel \ - qstyle \ - qstyleoption \ - qstylesheetstyle \ - qsvgdevice \ - qsvggenerator \ - qsvgrenderer \ - qsyntaxhighlighter \ - qsystemtrayicon \ - qtabbar \ - qtableview \ - qtablewidget \ - qtabwidget \ - qtcpserver \ - qtcpsocket \ - qtemporaryfile \ - qtessellator \ - qtextblock \ - qtextboundaryfinder \ - qtextbrowser \ - qtextcodec \ - qtextcursor \ - qtextdocument \ - qtextdocumentfragment \ - qtextdocumentlayout \ - qtextedit \ - qtextformat \ - qtextlayout \ - qtextlist \ - qtextobject \ - qtextscriptengine \ - qtextstream \ - qtexttable \ - qthread \ - qthreadonce \ - qthreadstorage \ - qtime \ - qtimeline \ - qtimer \ - qtmd5 \ - qtoolbar \ - qtoolbox \ - qtoolbutton \ - qtooltip \ - qtranslator \ - qtransform \ - qtransformedscreen \ - qtreeview \ - qtreewidget \ - qtreewidgetitemiterator \ - qtwidgets \ - qudpsocket \ - qundogroup \ - qundostack \ - qurl \ - quuid \ - qvariant \ - qvarlengtharray \ - qvector \ - qvideoframe \ - qvideosurfaceformat \ - qvectornd \ - qwaitcondition \ - qwidget \ - qwidgetaction \ - qwindowsurface \ - qwineventnotifier \ - qwizard \ - qwmatrix \ - qworkspace \ - qwritelocker \ - qwsembedwidget \ - qwsinputmethod \ - qwswindowsystem \ - qx11info \ - qxml \ - qxmlinputsource \ - qxmlsimplereader \ - qxmlstream \ - selftests \ - symbols \ - qrand \ - utf8 \ - gestures \ - qabstractnetworkcache \ - qabstractproxymodel \ - qbytearraymatcher \ - qcalendarwidget \ - qcolumnview \ - qcommandlinkbutton \ - qdbuscontext \ - qdbusserver \ - qdbusservicewatcher \ - qdiriterator \ - qeasingcurve \ - qfileiconprovider \ - qformlayout \ - q_func_info \ - qfuture \ - qfuturewatcher \ - qguard \ - qhttpsocketengine \ - qinputcontext \ - qlocalsocket \ - qmacstyle \ - qmargins \ - qnetworkaddressentry \ - qnetworkcachemetadata \ - qnetworkdiskcache \ - qobjectperformance \ - qpainterpathstroker \ - qplugin \ - qpluginloader \ - qscrollbar \ - qsidebar \ - qsizegrip \ - qsqldriver \ - qtconcurrentfilter \ - qtconcurrentiteratekernel \ - qtconcurrentmap \ - qtconcurrentrun \ - qtconcurrentthreadengine \ - qthreadpool \ - qtipc \ - qtokenautomaton \ - qtouchevent \ - qwidget_window \ - rcc \ - windowsmobile - -contains(QT_CONFIG,opengl):SUBDIRS += qgl - -contains(QT_CONFIG,qt3support):!wince*:SUBDIRS += $$Q3SUBDIRS - -contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter -mac: { - SUBDIRS += macgui \ - macplist \ - qaccessibility_mac -} - -embedded:!wince* { - SUBDIRS += qcopchannel \ - qdirectpainter \ - qmultiscreen -} -!win32: { - SUBDIRS += qtextpiecetable -} - -symbian { - SUBDIRS += qsoftkeymanager \ - qs60mainapplication -} - -# Enable the tests specific to QtXmlPatterns. If you add a test, remember to -# update runQtXmlPatternsTests.sh too. Remember that this file, auto.pro, is -# not respected by some test system, they just have a script which loop over -# the folders. -contains(QT_CONFIG, xmlpatterns) { -SUBDIRS += checkxmlfiles \ - patternistexamplefiletree \ - patternistexamples \ - patternistheaders \ - qabstractmessagehandler \ - qabstracturiresolver \ - qabstractxmlforwarditerator \ - qabstractxmlnodemodel \ - qabstractxmlreceiver \ - qapplicationargumentparser \ - qautoptr \ - qsimplexmlnodemodel \ - qsourcelocation \ - qxmlformatter \ - qxmlitem \ - qxmlname \ - qxmlnamepool \ - qxmlnodemodelindex \ - qxmlquery \ - qxmlresultitems \ - qxmlschema \ - qxmlschemavalidator \ - qxmlserializer \ - xmlpatterns \ - xmlpatternsdiagnosticsts \ - xmlpatternsschema \ - xmlpatternsschemats \ - xmlpatternssdk \ - xmlpatternsvalidator \ - xmlpatternsview \ - xmlpatternsxqts \ - xmlpatternsxslts - -xmlpatternsdiagnosticsts.depends = xmlpatternssdk -xmlpatternsview.depends = xmlpatternssdk -xmlpatternsxslts.depends = xmlpatternssdk -xmlpatternsschemats.depends = xmlpatternssdk -} - -unix:!embedded:contains(QT_CONFIG, dbus):SUBDIRS += \ - qdbusabstractadaptor \ - qdbusabstractinterface \ - qdbusconnection \ - qdbusinterface \ - qdbuslocalcalls \ - qdbusmarshall \ - qdbusmetaobject \ - qdbusmetatype \ - qdbuspendingcall \ - qdbuspendingreply \ - qdbusperformance \ - qdbusreply \ - qdbusthreading \ - qdbusxmlparser - -contains(QT_CONFIG, script): SUBDIRS += \ - qscriptable \ - qscriptclass \ - qscriptcontext \ - qscriptcontextinfo \ - qscriptengine \ - qscriptengineagent \ - qscriptextqobject \ - qscriptjstestsuite \ - qscriptv8testsuite \ - qscriptstring \ - qscriptvalue \ - qscriptvalueiterator \ - qscriptenginedebugger - -contains(QT_CONFIG, webkit): SUBDIRS += \ - qwebframe \ - qwebpage \ - qwebhistoryinterface \ - qwebelement \ - qwebhistory - -contains(QT_CONFIG, declarative): SUBDIRS += declarative + corelib.pro \ + gui.pro \ + network.pro \ + sql.pro \ + xml.pro \ + other.pro + +!cross_compile: SUBDIRS += host.pro +contains(QT_CONFIG, qt3support):!wince*: SUBDIRS += qt3support.pro +contains(QT_CONFIG, opengl): SUBDIRS += opengl.pro +contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns.pro +unix:!embedded:contains(QT_CONFIG, dbus): SUBDIRS += dbus.pro +contains(QT_CONFIG, script): SUBDIRS += script.pro +contains(QT_CONFIG, webkit): SUBDIRS += webkit.pro +contains(QT_CONFIG, multimedia): SUBDIRS += multimedia.pro +contains(QT_CONFIG, phonon): SUBDIRS += phonon.pro +contains(QT_CONFIG, svg): SUBDIRS += svg.pro -# Following tests depends on private API -!contains(QT_CONFIG, private_tests): SUBDIRS -= \ - qcssparser \ - qgraphicssceneindex \ - qhttpnetworkconnection \ - qhttpnetworkreply \ - qnativesocketengine \ - qnetworkreply \ - qpathclipper \ - qsocketnotifier \ - qsocks5socketengine \ - qstylesheetstyle \ - qtextpiecetable \ - xmlpatternsdiagnosticsts \ - xmlpatternsview \ - xmlpatternsxqts \ - xmlpatternsxslts diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro new file mode 100644 index 0000000..c08e372 --- /dev/null +++ b/tests/auto/corelib.pro @@ -0,0 +1,102 @@ +# The tests in this .pro file _MUST_ use QtCore only (i.e. QT=core). +# The test system is allowed to run these tests before the test of Qt has +# been compiled. + +TEMPLATE=subdirs +SUBDIRS=\ + collections \ + exceptionsafety \ + q_func_info \ + qanimationgroup \ + qatomicint \ + qatomicpointer \ + qbitarray \ + qbuffer \ + qbytearray \ + qbytearraymatcher \ + qcache \ + qchar \ + qcontiguouscache \ + qcoreapplication \ + qcryptographichash \ + qdate \ + qdatetime \ + qdebug \ + qdiriterator \ + qeasingcurve \ + qevent \ + qexplicitlyshareddatapointer \ + qfileinfo \ + qfilesystemwatcher \ + qflags \ + qfuture \ + qfuturewatcher \ + qgetputenv \ + qglobal \ + qhash \ + qlibrary \ + qline \ + qmap \ + qmargins \ + qmath \ + qmetatype \ + qmutex \ + qmutexlocker \ + qnumeric \ + qobject \ + qobjectrace \ + qplugin \ + qpluginloader \ + qpoint \ + qprocessenvironment \ + qqueue \ + qrand \ + qreadlocker \ + qreadwritelock \ + qrect \ + qregexp \ + qresourceengine \ + qringbuffer \ + qscopedpointer \ + qsemaphore \ + qsequentialanimationgroup \ + qset \ + qsharedpointer \ + qsignalspy \ + qsize \ + qsizef \ + qstate \ + qstl \ + qstring \ + qstringbuilder1 \ + qstringbuilder2 \ + qstringbuilder3 \ + qstringbuilder4 \ + qstringlist \ + qstringmatcher \ + qtconcurrentfilter \ + qtconcurrentiteratekernel \ + qtconcurrentmap \ + qtconcurrentrun \ + qtconcurrentthreadengine \ + qtemporaryfile \ + qtextboundaryfinder \ + qthread \ + qthreadonce \ + qthreadpool \ + qthreadstorage \ + qtime \ + qtimeline \ + qtimer \ + qtmd5 \ + qtokenautomaton \ + qurl \ + quuid \ + qvarlengtharray \ + qvector \ + qwaitcondition \ + qwineventnotifier \ + qwritelocker \ + selftests \ + utf8 \ + diff --git a/tests/auto/dbus.pro b/tests/auto/dbus.pro new file mode 100644 index 0000000..1c808df --- /dev/null +++ b/tests/auto/dbus.pro @@ -0,0 +1,20 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qdbusabstractadaptor \ + qdbusabstractinterface \ + qdbusconnection \ + qdbuscontext \ + qdbusinterface \ + qdbuslocalcalls \ + qdbusmarshall \ + qdbusmetaobject \ + qdbusmetatype \ + qdbuspendingcall \ + qdbuspendingreply \ + qdbusperformance \ + qdbusreply \ + qdbusserver \ + qdbusservicewatcher \ + qdbusthreading \ + qdbusxmlparser \ + diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro new file mode 100644 index 0000000..f79420f --- /dev/null +++ b/tests/auto/gui.pro @@ -0,0 +1,223 @@ +# The tests in this .pro file _MUST_ use QtCore, QtNetwork and QtGui only +# (i.e. QT=core gui network). +# The test system is allowed to run these tests before the rest of Qt has +# been compiled. +# +TEMPLATE=subdirs +SUBDIRS=\ + gestures \ + languagechange \ + modeltest \ + qabstractbutton \ + qabstractitemmodel \ + qabstractitemview \ + qabstractprintdialog \ + qabstractproxymodel \ + qabstractscrollarea \ + qabstractslider \ + qabstractspinbox \ + qabstracttextdocumentlayout \ + qaction \ + qactiongroup \ + qapplication \ + qboxlayout \ + qbrush \ + qbuttongroup \ + qcalendarwidget \ + qcheckbox \ + qclipboard \ + qcolor \ + qcolordialog \ + qcolumnview \ + qcommandlinkbutton \ + qcompleter \ + qcomplextext \ + qdatawidgetmapper \ + qdatetimeedit \ + qdesktopservices \ + qdesktopwidget \ + qdial \ + qdialog \ + qdialogbuttonbox \ + qdirmodel \ + qdockwidget \ + qdoublespinbox \ + qdoublevalidator \ + qdrag \ + qerrormessage \ + qfile \ + qfiledialog \ + qfiledialog2 \ + qfileiconprovider \ + qfilesystemmodel \ + qfocusframe \ + qfont \ + qfontcombobox \ + qfontdatabase \ + qfontdialog \ + qfontmetrics \ + qformlayout \ + qgraphicsanchorlayout \ + qgraphicsanchorlayout1 \ + qgraphicseffect \ + qgraphicseffectsource \ + qgraphicsgridlayout \ + qgraphicsitem \ + qgraphicsitemanimation \ + qgraphicslayout \ + qgraphicslayoutitem \ + qgraphicslinearlayout \ + qgraphicsobject \ + qgraphicspixmapitem \ + qgraphicspolygonitem \ + qgraphicsproxywidget \ + qgraphicsscene \ + qgraphicssceneindex \ + qgraphicstransform \ + qgraphicsview \ + qgraphicswidget \ + qgridlayout \ + qgroupbox \ + qguard \ + qguivariant \ + qheaderview \ + qhelpcontentmodel \ + qhelpenginecore \ + qhelpgenerator \ + qhelpindexmodel \ + qhelpprojectdata \ + qicoimageformat \ + qicon \ + qimageiohandler \ + qimagereader \ + qimagewriter \ + qinputcontext \ + qinputdialog \ + qintvalidator \ + qitemdelegate \ + qitemeditorfactory \ + qitemselectionmodel \ + qitemview \ + qkeysequence \ + qlabel \ + qlcdnumber \ + qlineedit \ + qlist \ + qlistview \ + qlistwidget \ + qlocale \ + qlocalsocket \ + qmacstyle \ + qmainwindow \ + qmatrixnxn \ + qmdisubwindow \ + qmessagebox \ + qmetaobject \ + qmouseevent_modal \ + qmovie \ + qnetworkaccessmanager_and_qprogressdialog \ + qnetworkcachemetadata \ + qnetworkdiskcache \ + qnetworkreply \ + qpaintengine \ + qpainterpath \ + qpainterpathstroker \ + qpalette \ + qparallelanimationgroup \ + qpathclipper \ + qpauseanimation \ + qpen \ + qpicture \ + qpixmapcache \ + qpixmapfilter \ + qplaintextedit \ + qpointer \ + qpolygon \ + qprinterinfo \ + qprocess \ + qprogressbar \ + qprogressdialog \ + qpropertyanimation \ + qpushbutton \ + qquaternion \ + qradiobutton \ + qregexpvalidator \ + qregion \ + qscrollarea \ + qscrollbar \ + qsharedpointer_and_qwidget \ + qshortcut \ + qsidebar \ + qsignalmapper \ + qsizegrip \ + qslider \ + qsortfilterproxymodel \ + qsound \ + qspinbox \ + qstackedlayout \ + qstackedwidget \ + qstandarditem \ + qstandarditemmodel \ + qstatemachine \ + qstatusbar \ + qstringlistmodel \ + qstyle \ + qstyleoption \ + qstylesheetstyle \ + qsyntaxhighlighter \ + qsystemtrayicon \ + qtabbar \ + qtableview \ + qtablewidget \ + qtcpserver \ + qtcpsocket \ + qtessellator \ + qtextblock \ + qtextcodec \ + qtextcursor \ + qtextdocumentfragment \ + qtextdocumentlayout \ + qtextformat \ + qtextlayout \ + qtextlist \ + qtextobject \ + qtextpiecetable \ + qtextscriptengine \ + qtextstream \ + qtexttable \ + qtipc \ + qtoolbar \ + qtoolbox \ + qtooltip \ + qtouchevent \ + qtransform \ + qtransformedscreen \ + qtranslator \ + qtreeview \ + qtreewidget \ + qtreewidgetitemiterator \ + qtwidgets \ + qudpsocket \ + qundogroup \ + qundostack \ + qvectornd \ + qwidget_window \ + qwidgetaction \ + qwindowsurface \ + qwizard \ + qwmatrix \ + qwsembedwidget \ + qwsinputmethod \ + qwswindowsystem \ + qx11info \ + windowsmobile \ + +win32:SUBDIRS -= qtextpiecetable + +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qgraphicssceneindex \ + qnetworkreply \ + qpathclipper \ + qstylesheetstyle \ + qtextpiecetable \ + diff --git a/tests/auto/host.pro b/tests/auto/host.pro new file mode 100644 index 0000000..6a7cea7 --- /dev/null +++ b/tests/auto/host.pro @@ -0,0 +1,18 @@ +TEMPLATE=subdirs +SUBDIRS=\ + headers \ + bic \ + compiler \ + compilerwarnings \ + linguist \ + maketestselftest \ + moc \ + uic \ + uic3 \ + guiapplauncher \ + qmake \ + rcc \ + symbols \ + #atwrapper \ # These tests need significant updating, + #uiloader \ # they have hardcoded machine names etc. + diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp index 1dde44b..8264e27 100644 --- a/tests/auto/maketestselftest/tst_maketestselftest.cpp +++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp @@ -50,23 +50,27 @@ class tst_MakeTestSelfTest: public QObject Q_OBJECT private slots: - void auto_dot_pro(); - void auto_dot_pro_data(); + void tests_pro_files(); + void tests_pro_files_data(); }; -/* Verify that all tests are listed somewhere in auto.pro */ -void tst_MakeTestSelfTest::auto_dot_pro() +/* Verify that all tests are listed somewhere in one of the autotest .pro files */ +void tst_MakeTestSelfTest::tests_pro_files() { static QStringList lines; if (lines.isEmpty()) { - QString filename = QString::fromLatin1(SRCDIR "/../auto.pro"); - QFile file(filename); - if (!file.open(QIODevice::ReadOnly)) { - QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString()))); - } - while (!file.atEnd()) { - lines << file.readLine().trimmed(); + QDir dir(SRCDIR "/.."); + QStringList proFiles = dir.entryList(QStringList() << "*.pro"); + foreach (QString const& proFile, proFiles) { + QString filename = QString("%1/../%2").arg(SRCDIR).arg(proFile); + QFile file(filename); + if (!file.open(QIODevice::ReadOnly)) { + QFAIL(qPrintable(QString("open %1: %2").arg(filename).arg(file.errorString()))); + } + while (!file.atEnd()) { + lines << file.readLine().trimmed(); + } } } @@ -79,13 +83,14 @@ void tst_MakeTestSelfTest::auto_dot_pro() } QFAIL(qPrintable(QString( - "Subdir `%1' is missing from tests/auto/auto.pro\n" + "Subdir `%1' is missing from tests/auto/*.pro\n" "This means the test won't be compiled or run on any platform.\n" - "If this is intentional, please put the test name in a comment in auto.pro.").arg(subdir)) + "If this is intentional, please put the test name in a comment in one of the .pro files.").arg(subdir)) ); + } -void tst_MakeTestSelfTest::auto_dot_pro_data() +void tst_MakeTestSelfTest::tests_pro_files_data() { QTest::addColumn("subdir"); QDir dir(SRCDIR "/.."); diff --git a/tests/auto/multimedia.pro b/tests/auto/multimedia.pro new file mode 100644 index 0000000..20d1f7f --- /dev/null +++ b/tests/auto/multimedia.pro @@ -0,0 +1,11 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qabstractvideobuffer \ + qabstractvideosurface \ + qaudiodeviceinfo \ + qaudioformat \ + qaudioinput \ + qaudiooutput \ + qvideoframe \ + qvideosurfaceformat \ + diff --git a/tests/auto/network.pro b/tests/auto/network.pro new file mode 100644 index 0000000..bda03d3 --- /dev/null +++ b/tests/auto/network.pro @@ -0,0 +1,40 @@ +# The tests in this .pro file _MUST_ use QtCore and QtNetwork only +# (i.e. QT=core network). +# The test system is allowed to run these tests before the rest of Qt has +# been compiled. +TEMPLATE=subdirs +SUBDIRS=\ + networkselftest \ + qabstractnetworkcache \ + qabstractsocket \ + qeventloop \ + qftp \ + qhostaddress \ + qhostinfo \ + qhttp \ + qhttpnetworkconnection \ + qhttpnetworkreply \ + qhttpsocketengine \ + qnativesocketengine \ + qnetworkaddressentry \ + qnetworkcookie \ + qnetworkcookiejar \ + qnetworkinterface \ + qnetworkproxy \ + qnetworkrequest \ + qobjectperformance \ + qsocketnotifier \ + qsocks5socketengine \ + qsslcertificate \ + qsslcipher \ + qsslerror \ + qsslkey \ + qsslsocket \ + +contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qhttpnetworkconnection \ + qhttpnetworkreply \ + qnativesocketengine \ + qsocketnotifier \ + qsocks5socketengine \ + diff --git a/tests/auto/opengl.pro b/tests/auto/opengl.pro new file mode 100644 index 0000000..0d23219 --- /dev/null +++ b/tests/auto/opengl.pro @@ -0,0 +1,4 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qgl \ + diff --git a/tests/auto/other.pro b/tests/auto/other.pro new file mode 100644 index 0000000..e220d1a --- /dev/null +++ b/tests/auto/other.pro @@ -0,0 +1,58 @@ +# These tests don't nicely fit into one of the other .pro files. +# They are testing too many Qt modules at the same time. + +TEMPLATE=subdirs +SUBDIRS=\ +# exceptionsafety_objects \ shouldn't enable it + qaccessibility \ + qalgorithms \ + qcombobox \ + qcssparser \ + qdatastream \ + qdir \ + qfocusevent \ + qimage \ + qiodevice \ + qitemmodel \ + qlayout \ + qmdiarea \ + qmenu \ + qmenubar \ + qmouseevent \ + qpainter \ + qpixmap \ + qprinter \ + qsettings \ + qsplitter \ + qtabwidget \ + qtextbrowser \ + qtextdocument \ + qtextedit \ + qtoolbutton \ + qvariant \ + qwidget \ + qworkspace \ + windowsmobile + +contains(QT_CONFIG, OdfWriter):SUBDIRS += qzip qtextodfwriter +mac: { + SUBDIRS += macgui \ + macplist \ + qaccessibility_mac +} + +embedded:!wince* { + SUBDIRS += qcopchannel \ + qdirectpainter \ + qmultiscreen +} + +symbian { + SUBDIRS += qsoftkeymanager \ + qs60mainapplication +} + +# Following tests depends on private API +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + qcssparser \ + diff --git a/tests/auto/phonon.pro b/tests/auto/phonon.pro new file mode 100644 index 0000000..7549428 --- /dev/null +++ b/tests/auto/phonon.pro @@ -0,0 +1,5 @@ +TEMPLATE=subdirs +SUBDIRS=\ + mediaobject \ +# mediaobject_wince_ds9 \ This is Windows CE only (we test the second phonon backend ds9 here) + diff --git a/tests/auto/qstringmatcher/qstringmatcher.pro b/tests/auto/qstringmatcher/qstringmatcher.pro index e478d4e..2c15097 100644 --- a/tests/auto/qstringmatcher/qstringmatcher.pro +++ b/tests/auto/qstringmatcher/qstringmatcher.pro @@ -1,5 +1,5 @@ load(qttest_p4) SOURCES += tst_qstringmatcher.cpp - +QT = core DEFINES += QT_NO_CAST_TO_ASCII diff --git a/tests/auto/qt3support.pro b/tests/auto/qt3support.pro new file mode 100644 index 0000000..3657cfe --- /dev/null +++ b/tests/auto/qt3support.pro @@ -0,0 +1,54 @@ +TEMPLATE=subdirs +SUBDIRS=\ + q3accel \ + q3action \ + q3actiongroup \ + q3buttongroup \ + q3canvas \ + q3checklistitem \ + q3cstring \ + q3databrowser \ + q3dateedit \ + q3datetimeedit \ + q3deepcopy \ + q3dict \ + q3dns \ + q3dockwindow \ + q3filedialog \ + q3groupbox \ + q3hbox \ + q3header \ + q3iconview \ + q3listbox \ + q3listview \ + q3listviewitemiterator \ + q3mainwindow \ + q3popupmenu \ + q3process \ + q3progressbar \ + q3progressdialog \ + q3ptrlist \ + q3richtext \ + q3scrollview \ + q3semaphore \ + q3serversocket \ + q3socket \ + q3socketdevice \ + q3sqlcursor \ + q3sqlselectcursor \ + q3stylesheet \ + q3tabdialog \ + q3table \ + q3textbrowser \ + q3textedit \ + q3textstream \ + q3timeedit \ + q3toolbar \ + q3urloperator \ + q3valuelist \ + q3valuevector \ + q3combobox \ + q3frame \ + q3uridrag \ + q3widgetstack + diff --git a/tests/auto/script.pro b/tests/auto/script.pro new file mode 100644 index 0000000..06f51b5 --- /dev/null +++ b/tests/auto/script.pro @@ -0,0 +1,16 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qscriptable \ + qscriptclass \ + qscriptcontext \ + qscriptcontextinfo \ + qscriptengine \ + qscriptengineagent \ + qscriptenginedebugger \ + qscriptextqobject \ + qscriptjstestsuite \ + qscriptstring \ + qscriptv8testsuite \ + qscriptvalue \ + qscriptvalueiterator \ + diff --git a/tests/auto/sql.pro b/tests/auto/sql.pro new file mode 100644 index 0000000..7cfd137 --- /dev/null +++ b/tests/auto/sql.pro @@ -0,0 +1,14 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qsql \ + qsqldatabase \ + qsqldriver \ + qsqlerror \ + qsqlfield \ + qsqlquery \ + qsqlquerymodel \ + qsqlrecord \ + qsqlrelationaltablemodel \ + qsqltablemodel \ + qsqlthread \ + diff --git a/tests/auto/svg.pro b/tests/auto/svg.pro new file mode 100644 index 0000000..cb3cccb --- /dev/null +++ b/tests/auto/svg.pro @@ -0,0 +1,6 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qsvgdevice \ + qsvggenerator \ + qsvgrenderer \ + diff --git a/tests/auto/webkit.pro b/tests/auto/webkit.pro new file mode 100644 index 0000000..8c7ccba --- /dev/null +++ b/tests/auto/webkit.pro @@ -0,0 +1,8 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qwebelement \ + qwebframe \ + qwebhistory \ + qwebhistoryinterface \ + qwebpage \ + diff --git a/tests/auto/xml.pro b/tests/auto/xml.pro new file mode 100644 index 0000000..76afec8 --- /dev/null +++ b/tests/auto/xml.pro @@ -0,0 +1,8 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qdom \ + qxml \ + qxmlinputsource \ + qxmlsimplereader \ + qxmlstream \ + diff --git a/tests/auto/xmlpatterns.pro b/tests/auto/xmlpatterns.pro new file mode 100644 index 0000000..f670266 --- /dev/null +++ b/tests/auto/xmlpatterns.pro @@ -0,0 +1,47 @@ +TEMPLATE=subdirs +SUBDIRS=\ + checkxmlfiles \ + patternistexamplefiletree \ + patternistexamples \ + patternistheaders \ + qabstractmessagehandler \ + qabstracturiresolver \ + qabstractxmlforwarditerator \ + qabstractxmlnodemodel \ + qabstractxmlreceiver \ + qapplicationargumentparser \ + qautoptr \ + qsimplexmlnodemodel \ + qsourcelocation \ + qxmlformatter \ + qxmlitem \ + qxmlname \ + qxmlnamepool \ + qxmlnodemodelindex \ + qxmlquery \ + qxmlresultitems \ + qxmlschema \ + qxmlschemavalidator \ + qxmlserializer \ + xmlpatterns \ + xmlpatternsdiagnosticsts \ + xmlpatternsschema \ + xmlpatternsschemats \ + xmlpatternssdk \ + xmlpatternsvalidator \ + xmlpatternsview \ + xmlpatternsxqts \ + xmlpatternsxslts \ + +xmlpatternsdiagnosticsts.depends = xmlpatternssdk +xmlpatternsview.depends = xmlpatternssdk +xmlpatternsxslts.depends = xmlpatternssdk +xmlpatternsschemats.depends = xmlpatternssdk + +!contains(QT_CONFIG, private_tests): SUBDIRS -= \ + xmlpatternsdiagnosticsts \ + xmlpatternsview \ + xmlpatternssdk \ + xmlpatternsxqts \ + xmlpatternsxslts \ + -- cgit v0.12 From 60a0a4bb680d9f3780cadd25b834492171ef7d38 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 4 Mar 2010 09:36:12 +1000 Subject: Remove vgClearPath() change to OpenVG paint engine Upon further investigation, vgClearPath() doesn't help as much on target devices as just making a new path. Revert "Improve performance of VGPath creation by reusing the same path" This reverts commit 8597e03495f54614e53c6063f1f13077a08109fd. --- src/openvg/qpaintengine_vg.cpp | 124 +++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 67 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 4192dbb..da47f06 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -131,9 +131,8 @@ public: void draw(VGPath path, const QPen& pen, const QBrush& brush, VGint rule = VG_EVEN_ODD); void stroke(VGPath path, const QPen& pen); void fill(VGPath path, const QBrush& brush, VGint rule = VG_EVEN_ODD); - inline void releasePath(VGPath path); - VGPath vectorPathToVGPath(const QVectorPath& path, bool forceNewPath = false); - VGPath painterPathToVGPath(const QPainterPath& path, bool forceNewPath = false); + VGPath vectorPathToVGPath(const QVectorPath& path); + VGPath painterPathToVGPath(const QPainterPath& path); VGPath roundedRectPath(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode); VGPaintType setBrush (VGPaint paint, const QBrush& brush, VGMatrixMode mode, @@ -179,8 +178,6 @@ public: VGPath roundRectPath; // Cached path for quick drawing of rounded rects. #endif - VGPath reusablePath; // Reusable path for vectorPathToVGPath(), etc. - QTransform transform; // Currently active transform. bool simpleTransform; // True if the transform is simple (non-projective). qreal penScale; // Pen scaling factor from "transform". @@ -353,8 +350,6 @@ void QVGPaintEnginePrivate::init() roundRectPath = 0; #endif - reusablePath = 0; - simpleTransform = true; pathTransformSet = false; penScale = 1.0; @@ -451,15 +446,6 @@ void QVGPaintEnginePrivate::initObjects() VG_PATH_CAPABILITY_ALL); vgAppendPathData(linePath, 2, segments, coords); #endif - - // This path can be reused over and over by calling vgClearPath(). - reusablePath = vgCreatePath(VG_PATH_FORMAT_STANDARD, - VG_PATH_DATATYPE_F, - 1.0f, // scale - 0.0f, // bias - 32 + 1, // segmentCapacityHint - 32 * 2, // coordCapacityHint - VG_PATH_CAPABILITY_ALL); } void QVGPaintEnginePrivate::destroy() @@ -479,8 +465,6 @@ void QVGPaintEnginePrivate::destroy() if (roundRectPath) vgDestroyPath(roundRectPath); #endif - if (reusablePath) - vgDestroyPath(reusablePath); #if !defined(QVG_NO_DRAW_GLYPHS) QVGFontCache::Iterator it; @@ -557,32 +541,19 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) qt_scaleForTransform(transform, &penScale); } -inline void QVGPaintEnginePrivate::releasePath(VGPath path) -{ - if (path == reusablePath) - vgClearPath(path, VG_PATH_CAPABILITY_ALL); - else - vgDestroyPath(path); -} - -VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path, bool forceNewPath) +VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path) { int count = path.elementCount(); const qreal *points = path.points(); const QPainterPath::ElementType *elements = path.elements(); - VGPath vgpath; - if (forceNewPath) { - vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD, - VG_PATH_DATATYPE_F, - 1.0f, // scale - 0.0f, // bias - count + 1, // segmentCapacityHint - count * 2, // coordCapacityHint - VG_PATH_CAPABILITY_ALL); - } else { - vgpath = reusablePath; - } + VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD, + VG_PATH_DATATYPE_F, + 1.0f, // scale + 0.0f, // bias + count + 1, // segmentCapacityHint + count * 2, // coordCapacityHint + VG_PATH_CAPABILITY_ALL); // Size is sufficient segments for drawRoundedRect() paths. QVarLengthArray segments; @@ -754,22 +725,17 @@ VGPath QVGPaintEnginePrivate::vectorPathToVGPath(const QVectorPath& path, bool f return vgpath; } -VGPath QVGPaintEnginePrivate::painterPathToVGPath(const QPainterPath& path, bool forceNewPath) +VGPath QVGPaintEnginePrivate::painterPathToVGPath(const QPainterPath& path) { int count = path.elementCount(); - VGPath vgpath; - if (forceNewPath) { - vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD, - VG_PATH_DATATYPE_F, - 1.0f, // scale - 0.0f, // bias - count + 1, // segmentCapacityHint - count * 2, // coordCapacityHint - VG_PATH_CAPABILITY_ALL); - } else { - vgpath = reusablePath; - } + VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD, + VG_PATH_DATATYPE_F, + 1.0f, // scale + 0.0f, // bias + count + 1, // segmentCapacityHint + count * 2, // coordCapacityHint + VG_PATH_CAPABILITY_ALL); if (count == 0) return vgpath; @@ -988,7 +954,13 @@ VGPath QVGPaintEnginePrivate::roundedRectPath(const QRectF &rect, qreal xRadius, vgModifyPathCoords(vgpath, 0, 9, pts); } #else - VGPath vgpath = reusablePath; + VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD, + VG_PATH_DATATYPE_F, + 1.0f, // scale + 0.0f, // bias + 10, // segmentCapacityHint + 17 * 2, // coordCapacityHint + VG_PATH_CAPABILITY_ALL); vgAppendPathData(vgpath, 10, roundedrect_types, pts); #endif @@ -1544,7 +1516,7 @@ void QVGPaintEngine::draw(const QVectorPath &path) d->draw(vgpath, s->pen, s->brush, VG_EVEN_ODD); else d->draw(vgpath, s->pen, s->brush, VG_NON_ZERO); - d->releasePath(vgpath); + vgDestroyPath(vgpath); } void QVGPaintEngine::fill(const QVectorPath &path, const QBrush &brush) @@ -1555,7 +1527,7 @@ void QVGPaintEngine::fill(const QVectorPath &path, const QBrush &brush) d->fill(vgpath, brush, VG_EVEN_ODD); else d->fill(vgpath, brush, VG_NON_ZERO); - d->releasePath(vgpath); + vgDestroyPath(vgpath); } void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen) @@ -1563,7 +1535,7 @@ void QVGPaintEngine::stroke(const QVectorPath &path, const QPen &pen) Q_D(QVGPaintEngine); VGPath vgpath = d->vectorPathToVGPath(path); d->stroke(vgpath, pen); - d->releasePath(vgpath); + vgDestroyPath(vgpath); } // Determine if a co-ordinate transform is simple enough to allow @@ -1759,7 +1731,7 @@ void QVGPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) default: break; } - d->releasePath(vgpath); + vgDestroyPath(vgpath); vgSeti(VG_MASKING, VG_TRUE); d->maskValid = true; @@ -2076,7 +2048,7 @@ void QVGPaintEngine::clip(const QPainterPath &path, Qt::ClipOperation op) default: break; } - d->releasePath(vgpath); + vgDestroyPath(vgpath); vgSeti(VG_MASKING, VG_TRUE); d->maskValid = true; @@ -2515,7 +2487,7 @@ void QVGPaintEngine::drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, VGPath vgpath = d->roundedRectPath(rect, xrad, yrad, mode); d->draw(vgpath, s->pen, s->brush); #if defined(QVG_NO_MODIFY_PATH) - d->releasePath(vgpath); + vgDestroyPath(vgpath); #endif } else { QPaintEngineEx::drawRoundedRect(rect, xrad, yrad, mode); @@ -2664,7 +2636,13 @@ void QVGPaintEngine::drawEllipse(const QRectF &r) Q_D(QVGPaintEngine); if (d->simpleTransform) { QVGPainterState *s = state(); - VGPath path = d->reusablePath; + VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, + VG_PATH_DATATYPE_F, + 1.0f, // scale + 0.0f, // bias + 4, // segmentCapacityHint + 12, // coordCapacityHint + VG_PATH_CAPABILITY_ALL); static VGubyte segments[4] = { VG_MOVE_TO_ABS, VG_SCCWARC_TO_REL, @@ -2688,7 +2666,7 @@ void QVGPaintEngine::drawEllipse(const QRectF &r) coords[11] = 0.0f; vgAppendPathData(path, 4, segments, coords); d->draw(path, s->pen, s->brush); - d->releasePath(path); + vgDestroyPath(path); } else { // The projective transform version of an ellipse is difficult. // Generate a QVectorPath containing cubic curves and transform that. @@ -2712,7 +2690,7 @@ void QVGPaintEngine::drawPath(const QPainterPath &path) d->draw(vgpath, s->pen, s->brush, VG_EVEN_ODD); else d->draw(vgpath, s->pen, s->brush, VG_NON_ZERO); - d->releasePath(vgpath); + vgDestroyPath(vgpath); } void QVGPaintEngine::drawPoints(const QPointF *points, int pointCount) @@ -2787,7 +2765,13 @@ void QVGPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonD { Q_D(QVGPaintEngine); QVGPainterState *s = state(); - VGPath path = d->reusablePath; + VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, + VG_PATH_DATATYPE_F, + 1.0f, // scale + 0.0f, // bias + pointCount + 1, // segmentCapacityHint + pointCount * 2, // coordCapacityHint + VG_PATH_CAPABILITY_ALL); QVarLengthArray coords; QVarLengthArray segments; for (int i = 0; i < pointCount; ++i, ++points) { @@ -2821,14 +2805,20 @@ void QVGPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonD d->draw(path, s->pen, s->brush, VG_EVEN_ODD); break; } - d->releasePath(path); + vgDestroyPath(path); } void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) { Q_D(QVGPaintEngine); QVGPainterState *s = state(); - VGPath path = d->reusablePath; + VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, + VG_PATH_DATATYPE_F, + 1.0f, // scale + 0.0f, // bias + pointCount + 1, // segmentCapacityHint + pointCount * 2, // coordCapacityHint + VG_PATH_CAPABILITY_ALL); QVarLengthArray coords; QVarLengthArray segments; for (int i = 0; i < pointCount; ++i, ++points) { @@ -2862,7 +2852,7 @@ void QVGPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDr d->draw(path, s->pen, s->brush, VG_EVEN_ODD); break; } - d->releasePath(path); + vgDestroyPath(path); } void QVGPaintEnginePrivate::setImageOptions() @@ -3261,7 +3251,7 @@ void QVGFontGlyphCache::cacheGlyphs ti.fontEngine->getUnscaledGlyph(glyph, &path, &metrics); VGPath vgPath; if (!path.isEmpty()) { - vgPath = d->painterPathToVGPath(path, true); + vgPath = d->painterPathToVGPath(path); } else { // Probably a "space" character with no visible outline. vgPath = VG_INVALID_HANDLE; -- cgit v0.12 From 243fa0427cfb9878c39946dcf5429aab581c47c3 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 4 Mar 2010 09:38:54 +1000 Subject: Make `make check' build the checked project. The `check' rule ought to depend on the project being built, so one can simply do `make check' instead of `make && make check'. Note that there was already an attempt to do this for the autotests, but it did not work on non-Windows platforms, because $(DESTDIR_TARGET) is only used in the Windows makefile generators. Reviewed-By: Lincoln Ramsay --- mkspecs/features/default_post.prf | 4 ++++ mkspecs/features/qttest_p4.prf | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 155bfc3..d844385 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -17,5 +17,9 @@ QMAKE_LIBDIR += $$QMAKE_LIBDIR_POST check.recurse = $$SUBDIRS check.recurse_target = check } + # `make check' should imply building the project + else { + check.depends = first + } QMAKE_EXTRA_TARGETS += check } diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf index 53c0d74..e3faef1 100644 --- a/mkspecs/features/qttest_p4.prf +++ b/mkspecs/features/qttest_p4.prf @@ -27,7 +27,7 @@ embedded: check.commands += -qws QMAKE_EXTRA_TARGETS += check !debug_and_release|build_pass { - check.depends = $(DESTDIR_TARGET) + check.depends = first } else { check.CONFIG = recursive # In debug and release mode, only run the test once. -- cgit v0.12 From 4f884f13a53a18d925054d3773d06cb487a7eb86 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 4 Mar 2010 12:17:16 +1000 Subject: Do not process uic3 test unless qt3support is enabled. --- tests/auto/host.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/host.pro b/tests/auto/host.pro index 6a7cea7..9852d91 100644 --- a/tests/auto/host.pro +++ b/tests/auto/host.pro @@ -8,7 +8,6 @@ SUBDIRS=\ maketestselftest \ moc \ uic \ - uic3 \ guiapplauncher \ qmake \ rcc \ @@ -16,3 +15,5 @@ SUBDIRS=\ #atwrapper \ # These tests need significant updating, #uiloader \ # they have hardcoded machine names etc. +contains(QT_CONFIG,qt3support):SUBDIRS+=uic3 + -- cgit v0.12 From b0323ac9e117397509de898b21d63767eddfb289 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 4 Mar 2010 16:01:58 +1000 Subject: Fixed duplicate entry for windowsmobile in tests/auto/*.pro --- tests/auto/gui.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index f79420f..a4ed04a 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -210,7 +210,6 @@ SUBDIRS=\ qwsinputmethod \ qwswindowsystem \ qx11info \ - windowsmobile \ win32:SUBDIRS -= qtextpiecetable -- cgit v0.12 From e3fb16c08a0b219703c6d3ca47d0c62bafdd013c Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 4 Mar 2010 16:35:07 +1000 Subject: SqlBrowser not respecting casings. A previous fix broke assumed behaviour. Make it do the correct thing, ie we know the casing, so quote it to tell the system leave it be. Task-number: QTBUG-4001 --- demos/sqlbrowser/browser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/sqlbrowser/browser.cpp b/demos/sqlbrowser/browser.cpp index 6aed73a..1232428 100644 --- a/demos/sqlbrowser/browser.cpp +++ b/demos/sqlbrowser/browser.cpp @@ -146,7 +146,7 @@ void Browser::showTable(const QString &t) { QSqlTableModel *model = new QSqlTableModel(table, connectionWidget->currentDatabase()); model->setEditStrategy(QSqlTableModel::OnRowChange); - model->setTable(t); + model->setTable(connectionWidget->currentDatabase().driver()->escapeIdentifier(t, QSqlDriver::TableName)); model->select(); if (model->lastError().type() != QSqlError::NoError) emit statusMessage(model->lastError().text()); -- cgit v0.12 From fa882a7cb91aca4574f0e939068fd37716a923c7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 4 Mar 2010 09:58:56 +0100 Subject: Avoid QString reallocation in QTextEngine Calling QString::utf16() will cause reallocation (for null-termination) if the string was created via fromRawData(). Reviewed-by: Benjamin Poulain Reviewed-by: Simon Hausmann --- src/gui/text/qtextengine.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 02eae98..b826588 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -81,7 +81,7 @@ public: void generate(int start, int length, QFont::Capitalization caps) { if ((int)caps == (int)QFont::SmallCaps) - generateScriptItemsSmallCaps(m_string.utf16(), start, length); + generateScriptItemsSmallCaps(reinterpret_cast(m_string.unicode()), start, length); else if(caps == QFont::Capitalize) generateScriptItemsCapitalize(start, length); else if(caps != QFont::MixedCase) { @@ -1434,9 +1434,7 @@ void QTextEngine::itemize() const layoutData->hasBidi = bidiItemize(const_cast(this), analysis, control); } - const ushort *unicode = layoutData->string.utf16(); - // correctly assign script, isTab and isObject to the script analysis - const ushort *uc = unicode; + const ushort *uc = reinterpret_cast(layoutData->string.unicode()); const ushort *e = uc + length; int lastScript = QUnicodeTables::Common; while (uc < e) { -- cgit v0.12 From 6f974452ec60ec03fd64bb2d12be6544435ae6be Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Mar 2010 11:11:16 +0100 Subject: Doc: document what the timeout of -1 means in D-Bus Task-number: QTBUG-8729 --- src/dbus/qdbusconnection.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index ce3e1a0..abaa486 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -491,6 +491,12 @@ bool QDBusConnection::callWithCallback(const QDBusMessage &message, QObject *rec its return value, which will be either of type QDBusMessage::ReplyMessage or QDBusMessage::ErrorMessage. + If no reply is received within \a timeout milliseconds, an automatic + error will be delivered indicating the expiration of the call. + The default \a timeout is -1, which will be replaced with an + implementation-defined value that is suitable for inter-process + communications (generally, 25 seconds). + See the QDBusInterface::call() function for a more friendly way of placing calls. @@ -526,9 +532,14 @@ QDBusMessage QDBusConnection::call(const QDBusMessage &message, QDBus::CallMode Sends the \a message over this connection and returns immediately. This function is suitable for method calls only. It returns an object of type QDBusPendingCall which can be used to - track the status of the reply. The \a timeout parameter is used to - determine when an auto-generated error reply may be emitted and is - also the upper limit for waiting in QDBusPendingCall::waitForFinished(). + track the status of the reply. + + If no reply is received within \a timeout milliseconds, an automatic + error will be delivered indicating the expiration of the call. The + default \a timeout is -1, which will be replaced with an + implementation-defined value that is suitable for inter-process + communications (generally, 25 seconds). This timeout is also the + upper limit for waiting in QDBusPendingCall::waitForFinished(). See the QDBusInterface::asyncCall() function for a more friendly way of placing calls. -- cgit v0.12 From 7727a4355876607a1a022ff54e2570dae883f79c Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 4 Mar 2010 11:16:16 +0100 Subject: Do not crash when loading themed icons statically We do not officially support static loading of icons. In fact they still crash for simple png cases due to missing X11 resources. But since we lazily create themed icons we can certainly avoid the crash in this case. You will not be able to use fallbacks here though, since we cannot know if a fallback should be used or not in this case. Reviewed-by: ogoffart Task-number: QTBUG-8666 --- src/gui/image/qicon.cpp | 4 +++- src/gui/image/qiconloader.cpp | 32 +++++++++++++++++++++++--------- src/gui/image/qiconloader_p.h | 2 ++ tests/auto/qicon/tst_qicon.cpp | 6 ++++++ 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index bf6eb8d..fad51f4 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -982,7 +982,9 @@ QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback) icon = *cachedIcon; } - if (icon.availableSizes().isEmpty()) + // Note the qapp check is to allow lazy loading of static icons + // Supporting fallbacks will not work for this case. + if (qApp && icon.availableSizes().isEmpty()) return fallback; return icon; diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index b35e80a..72ec2e8 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -85,19 +85,30 @@ static QString fallbackTheme() } QIconLoader::QIconLoader() : - m_themeKey(1), m_supportsSvg(false) + m_themeKey(1), m_supportsSvg(false), m_initialized(false) { - m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName(); - if (m_systemTheme.isEmpty()) - m_systemTheme = fallbackTheme(); +} + +// We lazily initialize the loader to make static icons +// work. Though we do not officially support this. +void QIconLoader::ensureInitialized() +{ + if (!m_initialized) { + m_initialized = true; + + Q_ASSERT(qApp); + m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName(); + if (m_systemTheme.isEmpty()) + m_systemTheme = fallbackTheme(); #ifndef QT_NO_LIBRARY - QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid, - QLatin1String("/iconengines"), - Qt::CaseInsensitive); - if (iconFactoryLoader.keys().contains(QLatin1String("svg"))) - m_supportsSvg = true; + QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid, + QLatin1String("/iconengines"), + Qt::CaseInsensitive); + if (iconFactoryLoader.keys().contains(QLatin1String("svg"))) + m_supportsSvg = true; #endif //QT_NO_LIBRARY + } } QIconLoader *QIconLoader::instance() @@ -339,6 +350,9 @@ bool QIconLoaderEngine::hasIcon() const // Lazily load the icon void QIconLoaderEngine::ensureLoaded() { + + iconLoaderInstance()->ensureInitialized(); + if (!(iconLoaderInstance()->themeKey() == m_key)) { while (!m_entries.isEmpty()) diff --git a/src/gui/image/qiconloader_p.h b/src/gui/image/qiconloader_p.h index 19f2dda..a6b5f5b 100644 --- a/src/gui/image/qiconloader_p.h +++ b/src/gui/image/qiconloader_p.h @@ -169,6 +169,7 @@ public: static QIconLoader *instance(); void updateSystemTheme(); void invalidateKey() { m_themeKey++; } + void ensureInitialized(); private: QThemeIconEntries findIconHelper(const QString &themeName, @@ -176,6 +177,7 @@ private: QStringList &visited) const; uint m_themeKey; bool m_supportsSvg; + bool m_initialized; mutable QString m_userTheme; mutable QString m_systemTheme; diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp index f861e40..fae9cc0 100644 --- a/tests/auto/qicon/tst_qicon.cpp +++ b/tests/auto/qicon/tst_qicon.cpp @@ -86,8 +86,14 @@ private slots: private: QString oldCurrentDir; + + const static QIcon staticIcon; }; +// Creating an icon statically should not cause a crash. +// But we do not officially support this. See QTBUG-8666 +const QIcon tst_QIcon::staticIcon = QIcon::fromTheme("edit-find"); + void tst_QIcon::init() { QString srcdir(QLatin1String(SRCDIR)); -- cgit v0.12 From 2aaf4d1a35792ba7d0d0f217dbda1c1297389f3e Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 4 Mar 2010 11:55:46 +0100 Subject: Fix tst_QVariant::operator_eq_eq(UserType) It was comparing uninitialized memory. Reviewed-by: Thierry --- src/corelib/kernel/qvariant.cpp | 3 +++ tests/auto/qvariant/tst_qvariant.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 95b2352..9a278bd 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -470,6 +470,9 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) if (typeNameLen > 0 && typeName[typeNameLen - 1] == '*') return *static_cast(a_ptr) == *static_cast(b_ptr); + if (a->is_null && b->is_null) + return true; + return a_ptr == b_ptr; } diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp index b7e2c81..1fd6564 100644 --- a/tests/auto/qvariant/tst_qvariant.cpp +++ b/tests/auto/qvariant/tst_qvariant.cpp @@ -1969,7 +1969,7 @@ void tst_QVariant::operator_eq_eq_data() QTest::newRow("HashSecondLarger") << QVariant(hash1) << QVariant(hash2) << false; } - QTest::newRow( "UserType" ) << QVariant(QVariant::UserType) << QVariant(QVariant::UserType) << false; + QTest::newRow( "UserType" ) << QVariant(QVariant::UserType) << QVariant(QVariant::UserType) << true; QVariant mUserType(QVariant::UserType); QTest::newRow( "Shared UserType" ) << mUserType << mUserType << true; } -- cgit v0.12 From a9bf9766f18e15fbecf53ac1cc9cf57c9dba259c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Thu, 4 Mar 2010 12:06:19 +0100 Subject: Fixed an exit crash that could occur in the GL 2 engine under X11. The global destructor for the clean up hooks might be called before the global destructor for QPixmap objects. We shouldn't leave pixmaps around that is destroyed after the QApplication destructor is called. Task-number: QTBUG-8681 Reviewed-by: Tom Cooksey --- src/gui/image/qimagepixmapcleanuphooks.cpp | 10 ++++++++++ src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp index 517fcb0..521e348 100644 --- a/src/gui/image/qimagepixmapcleanuphooks.cpp +++ b/src/gui/image/qimagepixmapcleanuphooks.cpp @@ -96,6 +96,11 @@ void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook) void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* pmd) { QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); + // the global destructor for the pixmap and image hooks might have + // been called already if the app is "leaking" global + // pixmaps/images + if (!h) + return; for (int i = 0; i < h->pixmapModificationHooks.count(); ++i) h->pixmapModificationHooks[i](pmd); @@ -106,6 +111,11 @@ void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* p void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(QPixmapData* pmd) { QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks(); + // the global destructor for the pixmap and image hooks might have + // been called already if the app is "leaking" global + // pixmaps/images + if (!h) + return; for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i) h->pixmapDestructionHooks[i](pmd); diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index c08d04a..2b8e097 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1597,6 +1597,7 @@ bool QGL2PaintEngineEx::end() delete d->shaderManager; d->shaderManager = 0; + d->currentBrush = QBrush(); #ifdef QT_OPENGL_CACHE_AS_VBOS if (!d->unusedVBOSToClean.isEmpty()) { -- cgit v0.12 From a3bc8b9ac990cf07b2b9775a1e281a10a9804086 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 12:18:58 +0100 Subject: Do not use realpath() with uclibc Task-number: QTBUG-8365 Reviewed-by: denis --- src/corelib/io/qfsfileengine.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index c842e49..eeee970 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -145,6 +145,8 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) #endif // Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here. #if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN) + // ... but Linux with uClibc does not have it +#if !defined(__UCLIBC__) char *ret = realpath(path.toLocal8Bit().constData(), (char*)0); if (ret) { QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret)); @@ -152,6 +154,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path) return canonicalPath; } #endif +#endif QFileInfo fi; const QChar slash(QLatin1Char('/')); -- cgit v0.12 From 05f6f721408930381eafd02fa4274080694d57e9 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 4 Mar 2010 12:34:09 +0100 Subject: Fix atk warning on startup in Qt apps wit QGtkStyle While this is acknowledged as a bug in Gtk+ and confirmed fixed upstream, since some distros such as Ubuntu are not backporting this fix and it is easy to work around we should simply fix this for 4.6.3 instead. The problem is simply that atk assumes the button has a label or a labeled icon and spits out a warning if it does not. Additional info can be found here: https://bugs.launchpad.net/ubuntu/+source/gtk+2.0/+bug/484182 Reviewed-by:thorbjorn Task-number: QTBUG-8425 --- src/gui/styles/qgtkstyle_p.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp index f3c7a5b..ad6746f 100644 --- a/src/gui/styles/qgtkstyle_p.cpp +++ b/src/gui/styles/qgtkstyle_p.cpp @@ -530,7 +530,7 @@ void QGtkStylePrivate::initGtkWidgets() const GtkWidget *gtkButton = QGtkStylePrivate::gtk_button_new(); addWidget(gtkButton); g_signal_connect(gtkButton, "style-set", G_CALLBACK(gtkStyleSetCallback), 0); - addWidget(QGtkStylePrivate::gtk_tool_button_new(NULL, NULL)); + addWidget(QGtkStylePrivate::gtk_tool_button_new(NULL, "Qt")); addWidget(QGtkStylePrivate::gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE)); addWidget(QGtkStylePrivate::gtk_hbutton_box_new()); addWidget(QGtkStylePrivate::gtk_check_button_new()); -- cgit v0.12 From 17c5b2620178ce59d0d85d91c03880fc8b0d9992 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Thu, 4 Mar 2010 11:38:48 +0100 Subject: showFullscreen() broken if UnifiedTitleAndToolBarOnMac is enabled The problem here is caused by the fix to QTBUG-6200. For this fix we removed the lines that deleted the item because the iterator might be invalid at that point. However, we still need to delete the iterator. The solution is to not use the iterator and ask the hash to delete the item, since the remove function will not crash if the item is invalid. Task-number: QTBUG-8633 Reviewed-by: Prasanth --- src/gui/widgets/qmainwindowlayout_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index d92168a..9527057 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -463,6 +463,8 @@ void QMainWindowLayout::removeFromMacToolbar(QToolBar *toolbar) NSToolbarItem *item = static_cast(it.key()); [[qt_mac_window_for(layoutState.mainWindow->window()) toolbar] removeItemAtIndex:toolbarItemsCopy.indexOf(item)]; + unifiedToolbarHash.remove(item); + qtoolbarsInUnifiedToolbarList.removeAll(toolbar); #endif break; } -- cgit v0.12 From 8327f68945134b8057b0ade7d19897e226d3a7b5 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Wed, 24 Feb 2010 17:53:07 +0100 Subject: Dont use gestures if there is no touch screen. If there is no touch input device attached on Windows7, we shouldn't even bother subscribing to native gesture events. Task-number: QTBUG-6007 Reviewed-by: Thierry Reviewed-by: Prasanth --- src/gui/kernel/qapplication_p.h | 1 + src/gui/kernel/qapplication_win.cpp | 35 ++++++++++++++++++++++ src/gui/kernel/qgesturemanager.cpp | 4 ++- src/gui/kernel/qwidget_win.cpp | 2 ++ .../kernel/qwinnativepangesturerecognizer_win_p.h | 32 ++++++++++++++++++++ 5 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index b3ec732..ce39334 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -530,6 +530,7 @@ public: const QList &touchPoints); #if defined(Q_WS_WIN) + static bool HasTouchSupport; static PtrRegisterTouchWindow RegisterTouchWindow; static PtrGetTouchInputInfo GetTouchInputInfo; static PtrCloseTouchInputHandle CloseTouchInputHandle; diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index da6869d..49cb0f2 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -115,6 +115,8 @@ extern void qt_wince_hide_taskbar(HWND hwnd); //defined in qguifunctions_wince.c # include #endif +#include "private/qwinnativepangesturerecognizer_win_p.h" + #ifndef WM_TOUCH # define WM_TOUCH 0x0240 @@ -4000,12 +4002,45 @@ void QSessionManager::cancel() #endif //QT_NO_SESSIONMANAGER +bool QApplicationPrivate::HasTouchSupport = false; PtrRegisterTouchWindow QApplicationPrivate::RegisterTouchWindow = 0; PtrGetTouchInputInfo QApplicationPrivate::GetTouchInputInfo = 0; PtrCloseTouchInputHandle QApplicationPrivate::CloseTouchInputHandle = 0; void QApplicationPrivate::initializeMultitouch_sys() { + static const IID QT_IID_IInkTablets = {0x112086D9, 0x7779, 0x4535, {0xA6, 0x99, 0x86, 0x2B, 0x43, 0xAC, 0x18, 0x63} }; + static const IID QT_IID_IInkTablet2 = {0x90c91ad2, 0xfa36, 0x49d6, {0x95, 0x16, 0xce, 0x8d, 0x57, 0x0f, 0x6f, 0x85} }; + static const CLSID QT_CLSID_InkTablets = {0x6E4FCB12, 0x510A, 0x4d40, {0x93, 0x04, 0x1D, 0xA1, 0x0A, 0xE9, 0x14, 0x7C} }; + + IInkTablets *iInkTablets = 0; + HRESULT hr = CoCreateInstance(QT_CLSID_InkTablets, NULL, CLSCTX_ALL, QT_IID_IInkTablets, (void**)&iInkTablets); + if (SUCCEEDED(hr)) { + long count = 0; + iInkTablets->get_Count(&count); + for (long i = 0; i < count; ++i) { + IInkTablet *iInkTablet = 0; + hr = iInkTablets->Item(i, &iInkTablet); + if (FAILED(hr)) + continue; + IInkTablet2 *iInkTablet2 = 0; + hr = iInkTablet->QueryInterface(QT_IID_IInkTablet2, (void**)&iInkTablet2); + iInkTablet->Release(); + if (FAILED(hr)) + continue; + TabletDeviceKind kind; + hr = iInkTablet2->get_DeviceKind(&kind); + iInkTablet2->Release(); + if (FAILED(hr)) + continue; + if (kind == TDK_Touch) { + QApplicationPrivate::HasTouchSupport = true; + break; + } + } + iInkTablets->Release(); + } + QLibrary library(QLatin1String("user32")); // MinGW (g++ 3.4.5) accepts only C casts. RegisterTouchWindow = (PtrRegisterTouchWindow)(library.resolve("RegisterTouchWindow")); diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 89ad94d..aa6720e 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -45,6 +45,7 @@ #include "private/qgesture_p.h" #include "private/qgraphicsitem_p.h" #include "private/qevent_p.h" +#include "private/qapplication_p.h" #include "qgesture.h" #include "qevent.h" #include "qgraphicsitem.h" @@ -86,7 +87,8 @@ QGestureManager::QGestureManager(QObject *parent) #endif #if defined(Q_OS_WIN) #if !defined(QT_NO_NATIVE_GESTURES) - registerGestureRecognizer(new QWinNativePanGestureRecognizer); + if (QApplicationPrivate::HasTouchSupport) + registerGestureRecognizer(new QWinNativePanGestureRecognizer); #endif #else registerGestureRecognizer(new QTapAndHoldGestureRecognizer); diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 10522ed..9acfb70 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -2052,6 +2052,8 @@ void QWidgetPrivate::winSetupGestures() if (!q || !q->isVisible() || !nativeGesturePanEnabled) return; + if (!QApplicationPrivate::HasTouchSupport) + return; QApplicationPrivate *qAppPriv = QApplicationPrivate::instance(); if (!qAppPriv->SetGestureConfig) return; diff --git a/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h b/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h index c65fa50..146b067 100644 --- a/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h +++ b/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h @@ -54,6 +54,38 @@ // #include +#include + +class IInkRectangle; +class TabletHardwareCapabilities; +class TabletPropertyMetricUnit; +DECLARE_INTERFACE_(IInkTablet, IDispatch) +{ + STDMETHOD(get_Name)(THIS_ BSTR *Name) PURE; + STDMETHOD(get_PlugAndPlayId)(THIS_ BSTR *Id) PURE; + STDMETHOD(get_MaximumInputRectangle)(THIS_ IInkRectangle **Rectangle) PURE; + STDMETHOD(get_HardwareCapabilities)(THIS_ TabletHardwareCapabilities *Capabilities) PURE; + STDMETHOD(IsPacketPropertySupported)(THIS_ BSTR packetPropertyName) PURE; + STDMETHOD(GetPropertyMetrics)(THIS_ BSTR propertyName, long *Minimum, long *Maximum, TabletPropertyMetricUnit *Units, float *Resolution) PURE; +}; +enum TabletDeviceKind +{ + TDK_Mouse = 0, + TDK_Pen = 1, + TDK_Touch = 2 +}; +DECLARE_INTERFACE_(IInkTablet2, IDispatch) +{ + STDMETHOD(get_DeviceKind)(THIS_ TabletDeviceKind *Kind) PURE; +}; +DECLARE_INTERFACE_(IInkTablets, IDispatch) +{ + STDMETHOD(get_Count)(THIS_ long *Count) PURE; + STDMETHOD(get__NewEnum)(THIS_ IUnknown **_NewEnum) PURE; + STDMETHOD(get_DefaultTablet)(THIS_ IInkTablet **DefaultTablet) PURE; + STDMETHOD(Item)(THIS_ long Index, IInkTablet **Tablet) PURE; + STDMETHOD(IsPacketPropertySupported)(THIS_ BSTR packetPropertyName, VARIANT_BOOL *Supported) PURE; +}; QT_BEGIN_NAMESPACE -- cgit v0.12 From f1e39e7dea8634695263435f0bf912ce19c43195 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Thu, 4 Mar 2010 13:16:09 +0100 Subject: Make tablet detection work with new wacom drivers wacom driver fixed a bug in assigning atom names where it messed up the device names. Their solution apparently renamed the atoms The type names used now are "STYLUS", "CURSOR", "ERASER", "PAD" and "TOUCH" for each respective device. This change detects those as our tablet input devices. Reviewed-by: Benjamin Poulain Task-number: QTBUG-8599 --- src/gui/kernel/qapplication_x11.cpp | 9 +++++++-- src/gui/kernel/qt_x11_p.h | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index 121e9ec..25a7750 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -320,9 +320,14 @@ static const char * x11_atomnames = { "_XEMBED\0" "_XEMBED_INFO\0" + // Wacom old. (before version 0.10) "Wacom Stylus\0" "Wacom Cursor\0" "Wacom Eraser\0" + + // Tablet + "STYLUS\0" + "ERASER\0" }; Q_GUI_EXPORT QX11Data *qt_x11Data = 0; @@ -2366,12 +2371,12 @@ void qt_init(QApplicationPrivate *priv, int, gotStylus = true; } #else - if (devs->type == ATOM(XWacomStylus)) { + if (devs->type == ATOM(XWacomStylus) || devs->type == ATOM(XTabletStylus)) { deviceType = QTabletEvent::Stylus; if (wacomDeviceName()->isEmpty()) wacomDeviceName()->append(devs->name); gotStylus = true; - } else if (devs->type == ATOM(XWacomEraser)) { + } else if (devs->type == ATOM(XWacomEraser) || devs->type == ATOM(XTabletEraser)) { deviceType = QTabletEvent::XFreeEraser; gotEraser = true; } diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h index d110084..14e04bb 100644 --- a/src/gui/kernel/qt_x11_p.h +++ b/src/gui/kernel/qt_x11_p.h @@ -675,6 +675,9 @@ struct QX11Data XWacomCursor, XWacomEraser, + XTabletStylus, + XTabletEraser, + NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, -- cgit v0.12 From d644fcf668203a6d2f4af8fee350c672196ad11b Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 13:20:06 +0100 Subject: tst_qftp: Do not use 1.2.3.4 as IP Believe it or not, that IP is reachable on port 21. Reviewed-by: TrustMe --- tests/auto/qftp/tst_qftp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qftp/tst_qftp.cpp b/tests/auto/qftp/tst_qftp.cpp index 240885d..638c810 100644 --- a/tests/auto/qftp/tst_qftp.cpp +++ b/tests/auto/qftp/tst_qftp.cpp @@ -308,7 +308,7 @@ void tst_QFtp::connectToUnresponsiveHost() if (setProxy) QSKIP( "This test takes too long if we test with proxies too", SkipSingle ); - QString host = "1.2.3.4"; + QString host = "192.0.2.42"; // IP out of TEST-NET, should be unreachable uint port = 21; ftp = newFtp(); -- cgit v0.12 From ce7f914e8db0cad698d934569f1c323e5b231bc9 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 13:52:03 +0100 Subject: qhostinfo benchmark: Benchmark the with-cache and without-cache Reviewed-by: joao --- tests/benchmarks/network/kernel/qhostinfo/main.cpp | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/benchmarks/network/kernel/qhostinfo/main.cpp b/tests/benchmarks/network/kernel/qhostinfo/main.cpp index 0ae1b7f..ebdea5e 100644 --- a/tests/benchmarks/network/kernel/qhostinfo/main.cpp +++ b/tests/benchmarks/network/kernel/qhostinfo/main.cpp @@ -48,9 +48,14 @@ #include #include +#include "private/qhostinfo_p.h" + class tst_qhostinfo : public QObject { Q_OBJECT +public slots: + void initTestCase(); + void init(); private slots: void lookupSpeed(); }; @@ -70,14 +75,38 @@ public slots: } }; +void tst_qhostinfo::initTestCase() +{ + // run each testcase with and without cache enabled + QTest::addColumn("cache"); + QTest::newRow("WithCache") << true; + QTest::newRow("WithoutCache") << false; +} + +void tst_qhostinfo::init() +{ + // delete the cache so inidividual testcase results are independant from each other + qt_qhostinfo_clear_cache(); + + QFETCH_GLOBAL(bool, cache); + qt_qhostinfo_enable_cache(cache); +} + + void tst_qhostinfo::lookupSpeed() { + QFETCH_GLOBAL(bool, cache); + qDebug() << "Cache enabled:" << cache; + QStringList hostnameList; hostnameList << "www.ovi.com" << "www.nokia.com" << "qt.nokia.com" << "www.trolltech.com" << "troll.no" << "www.qtcentre.org" << "forum.nokia.com" << "www.forum.nokia.com" << "wiki.forum.nokia.com" << "www.nokia.no" << "nokia.de" << "127.0.0.1" << "----"; // also add some duplicates: hostnameList << "www.nokia.com" << "127.0.0.1" << "www.trolltech.com"; + // and some more + hostnameList << hostnameList; + const int COUNT = hostnameList.size(); SignalReceiver receiver(COUNT); -- cgit v0.12 From d38158bbba32ce6a80b4443ca92f37f485ebfa93 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 14:23:51 +0100 Subject: DNS Cache: Also check inside the DNS threads Reviewed-by: joao --- src/network/kernel/qhostinfo.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index a65ca50..9c559ec 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -435,12 +435,24 @@ void QHostInfoRunnable::run() return; } - // if not in cache: OS lookup - QHostInfo hostInfo = QHostInfoAgent::fromName(toBeLookedUp); - - // save to cache - if (manager->cache.isEnabled()) - manager->cache.put(toBeLookedUp, hostInfo); + QHostInfo hostInfo; + + // QHostInfo::lookupHost already checks the cache. However we need to check + // it here too because it might have been cache saved by another QHostInfoRunnable + // in the meanwhile while this QHostInfoRunnable was scheduled but not running + if (manager->cache.isEnabled()) { + // check the cache first + bool valid = false; + hostInfo = manager->cache.get(toBeLookedUp, &valid); + if (!valid) { + // not in cache, we need to do the lookup and store the result in the cache + hostInfo = QHostInfoAgent::fromName(toBeLookedUp); + manager->cache.put(toBeLookedUp, hostInfo); + } + } else { + // cache is not enabled, just do the lookup and continue + hostInfo = QHostInfoAgent::fromName(toBeLookedUp); + } // check aborted again if (manager->wasAborted(id)) { -- cgit v0.12 From f68597ee9f63d3a7c5254062b752e8a91b816919 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 15:03:10 +0100 Subject: qhostinfo benchmark: Use local _data instead of _global Qt's benchmark lib does not support global data tags yet. --- tests/benchmarks/network/kernel/qhostinfo/main.cpp | 23 +++++++++------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/tests/benchmarks/network/kernel/qhostinfo/main.cpp b/tests/benchmarks/network/kernel/qhostinfo/main.cpp index ebdea5e..f4648d6 100644 --- a/tests/benchmarks/network/kernel/qhostinfo/main.cpp +++ b/tests/benchmarks/network/kernel/qhostinfo/main.cpp @@ -54,9 +54,9 @@ class tst_qhostinfo : public QObject { Q_OBJECT public slots: - void initTestCase(); void init(); private slots: + void lookupSpeed_data(); void lookupSpeed(); }; @@ -75,28 +75,23 @@ public slots: } }; -void tst_qhostinfo::initTestCase() -{ - // run each testcase with and without cache enabled - QTest::addColumn("cache"); - QTest::newRow("WithCache") << true; - QTest::newRow("WithoutCache") << false; -} - void tst_qhostinfo::init() { // delete the cache so inidividual testcase results are independant from each other qt_qhostinfo_clear_cache(); - - QFETCH_GLOBAL(bool, cache); - qt_qhostinfo_enable_cache(cache); } +void tst_qhostinfo::lookupSpeed_data() +{ + QTest::addColumn("cache"); + QTest::newRow("WithCache") << true; + QTest::newRow("WithoutCache") << false; +} void tst_qhostinfo::lookupSpeed() { - QFETCH_GLOBAL(bool, cache); - qDebug() << "Cache enabled:" << cache; + QFETCH(bool, cache); + qt_qhostinfo_enable_cache(cache); QStringList hostnameList; hostnameList << "www.ovi.com" << "www.nokia.com" << "qt.nokia.com" << "www.trolltech.com" << "troll.no" -- cgit v0.12 From d998a761e35bb53f29477e3956421de38c9cf641 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 15:07:30 +0100 Subject: tst_qhostinfo: Mixed up descriptions for test case data --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index cbadcf5..ae4ffde 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -213,8 +213,8 @@ void tst_QHostInfo::initTestCase() // run each testcase with and without test enabled QTest::addColumn("cache"); - QTest::newRow("WithCache") << false; - QTest::newRow("WithoutCache") << true; + QTest::newRow("WithCache") << true; + QTest::newRow("WithoutCache") << false; } void tst_QHostInfo::init() -- cgit v0.12 From bd8c5da79174d18422d9db55c18d8f11ad41e27f Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 15:28:27 +0100 Subject: Document some stuff in QHostInfo and QAbstractSocket --- src/network/kernel/qhostinfo.cpp | 7 +++++++ src/network/socket/qabstractsocket.cpp | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 9c559ec..9092ad6 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -112,6 +112,13 @@ Q_GLOBAL_STATIC(QHostInfoLookupManager, theHostInfoLookupManager) To retrieve the name of the local host, use the static QHostInfo::localHostName() function. + \note Since Qt 4.6.1 QHostInfo is using multiple threads for DNS lookup + instead of one dedicated DNS thread. This improves performance, + but also changes the order of signal emissions when using lookupHost() + compared to previous versions of Qt. + \note Since Qt 4.6.3 QHostInfo is using a small internal 60 second DNS cache + for performance improvements. + \sa QAbstractSocket, {http://www.rfc-editor.org/rfc/rfc3492.txt}{RFC 3492} */ diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index d990448..95721ee 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -172,6 +172,10 @@ This signal is emitted after connectToHost() has been called and the host lookup has succeeded. + \note Since Qt 4.6.3 QAbstractSocket may emit hostFound() + directly from the connectToHost() call since a DNS result could have been + cached. + \sa connected() */ @@ -181,6 +185,10 @@ This signal is emitted after connectToHost() has been called and a connection has been successfully established. + \note On some operating systems the connected() signal may + be directly emitted from the connectToHost() call for connections + to the localhost. + \sa connectToHost(), disconnected() */ -- cgit v0.12 From c28a7828a28295d66d37cddca9d23a70f37f2c75 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 4 Mar 2010 15:53:09 +0100 Subject: Make translucent windows work, and support WA_TranslucentBackground QWS will make a window translucent if the background brush is not opaque. Now we also support the cross-platform way of doing it. This also includes fixes for bugs caused by behavioural changes in the internal windowsurface/backingstore implementation. Task-number: QTBUG-5739 Reviewed-by: Tom --- src/gui/painting/qbackingstore.cpp | 11 ++++++++++- src/gui/painting/qwindowsurface_qws.cpp | 17 ++++++++++++++++- src/gui/painting/qwindowsurface_qws_p.h | 2 ++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index c73d9f4..8de9eaa 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -352,6 +352,10 @@ void QWidgetBackingStore::beginPaint(QRegion &toClean, QWidget *widget, QWindowS // Always flush repainted areas. dirtyOnScreen += toClean; +#ifdef Q_WS_QWS + toClean.translate(tlwOffset); +#endif + #ifdef QT_NO_PAINT_DEBUG windowSurface->beginPaint(toClean); #else @@ -766,7 +770,12 @@ void QWidgetBackingStore::paintWindowDecoration() if (decorationRegion.isEmpty()) return; - windowSurface->beginPaint(decorationRegion); + //### The QWS decorations do not always paint the pixels they promise to paint. + // This causes painting problems with QWSMemorySurface. Since none of the other + // window surfaces actually use the region, passing an empty region is a safe + // workaround. + + windowSurface->beginPaint(QRegion()); QPaintEngine *engine = windowSurface->paintDevice()->paintEngine(); Q_ASSERT(engine); diff --git a/src/gui/painting/qwindowsurface_qws.cpp b/src/gui/painting/qwindowsurface_qws.cpp index d3fc9de..a816ed2 100644 --- a/src/gui/painting/qwindowsurface_qws.cpp +++ b/src/gui/painting/qwindowsurface_qws.cpp @@ -80,7 +80,7 @@ static void qt_insertWindowSurface(int winId, QWSWindowSurface *surface) inline bool isWidgetOpaque(const QWidget *w) { - return w->d_func()->isOpaque; + return w->d_func()->isOpaque && !w->testAttribute(Qt::WA_TranslucentBackground); } static inline QScreen *getScreen(const QWidget *w) @@ -873,6 +873,21 @@ bool QWSMemorySurface::isValid() const return true; } +// ### copied from qwindowsurface_raster.cpp -- should be cross-platform +void QWSMemorySurface::beginPaint(const QRegion &rgn) +{ + if (!isWidgetOpaque(window())) { + QPainter p(&img); + p.setCompositionMode(QPainter::CompositionMode_Source); + const QVector rects = rgn.rects(); + const QColor blank = Qt::transparent; + for (QVector::const_iterator it = rects.begin(); it != rects.end(); ++it) { + p.fillRect(*it, blank); + } + } + QWSWindowSurface::beginPaint(rgn); +} + // from qwindowsurface.cpp extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset); diff --git a/src/gui/painting/qwindowsurface_qws_p.h b/src/gui/painting/qwindowsurface_qws_p.h index a8371c8..30900dc 100644 --- a/src/gui/painting/qwindowsurface_qws_p.h +++ b/src/gui/painting/qwindowsurface_qws_p.h @@ -176,6 +176,8 @@ public: QImage image() const { return img; } QPoint painterOffset() const; + void beginPaint(const QRegion &rgn); + bool lock(int timeout = -1); void unlock(); -- cgit v0.12 From 95786655e304a22bd922b40184d314eddb72b002 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 4 Mar 2010 18:01:24 +0100 Subject: tst_qhostinfo: Compile fix --- tests/auto/qhostinfo/tst_qhostinfo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/auto/qhostinfo/tst_qhostinfo.cpp b/tests/auto/qhostinfo/tst_qhostinfo.cpp index ae4ffde..4282062 100644 --- a/tests/auto/qhostinfo/tst_qhostinfo.cpp +++ b/tests/auto/qhostinfo/tst_qhostinfo.cpp @@ -484,7 +484,8 @@ void tst_QHostInfo::cache() // lookup once, wait in event loop, result should not come directly. bool valid = true; - QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid); + int id = -1; + QHostInfo result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id); QTestEventLoop::instance().enterLoop(5); QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(valid == false); @@ -492,7 +493,7 @@ void tst_QHostInfo::cache() // loopkup second time, result should come directly valid = false; - result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid); + result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id); QVERIFY(valid == true); QVERIFY(!result.addresses().isEmpty()); @@ -501,7 +502,7 @@ void tst_QHostInfo::cache() // lookup third time, result should not come directly. valid = true; - result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid); + result = qt_qhostinfo_lookup("localhost", this, SLOT(resultsReady(QHostInfo)), &valid, &id); QTestEventLoop::instance().enterLoop(5); QVERIFY(!QTestEventLoop::instance().timeout()); QVERIFY(valid == false); -- cgit v0.12 From 98ade3747d44543bcb6b8a0e82cbb2c32d0cc20a Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Fri, 5 Mar 2010 09:41:53 +1000 Subject: Linux QAudioOutput playback stuttering Adjust buffer and period sizes if system cannot work with defaults (alsa). Task-number:QTBUG-8339 Reviewed-by:Derick Hawcroft --- src/multimedia/audio/qaudiooutput_alsa_p.cpp | 44 +++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp index b127103..e49c75a 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -369,10 +369,52 @@ bool QAudioOutputPrivate::open() } } if ( !fatal ) { + unsigned int maxBufferTime = 0; + unsigned int minBufferTime = 0; + unsigned int maxPeriodTime = 0; + unsigned int minPeriodTime = 0; + + err = snd_pcm_hw_params_get_buffer_time_max(hwparams, &maxBufferTime, &dir); + if ( err >= 0) + err = snd_pcm_hw_params_get_buffer_time_min(hwparams, &minBufferTime, &dir); + if ( err >= 0) + err = snd_pcm_hw_params_get_period_time_max(hwparams, &maxPeriodTime, &dir); + if ( err >= 0) + err = snd_pcm_hw_params_get_period_time_min(hwparams, &minPeriodTime, &dir); + + if ( err < 0 ) { + fatal = true; + errMessage = QString::fromLatin1("QAudioOutput: buffer/period min and max: err = %1").arg(err); + } else { + if (maxBufferTime < buffer_time || buffer_time < minBufferTime || maxPeriodTime < period_time || minPeriodTime > period_time) { +#ifdef DEBUG_AUDIO + qDebug()<<"defaults out of range"; + qDebug()<<"pmin="< Date: Fri, 5 Mar 2010 10:08:52 +1000 Subject: When using OpenVG alpha mask, turn off scissor-as-mask Task-number: QT-3033 Reviewed-by: Julian de Bhal --- src/openvg/qpaintengine_vg.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index da47f06..c46bc27 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -2062,6 +2062,7 @@ void QVGPaintEngine::clip(const QPainterPath &path, Qt::ClipOperation op) void QVGPaintEnginePrivate::ensureMask (QVGPaintEngine *engine, int width, int height) { + scissorMask = false; if (maskIsSet) { vgMask(VG_INVALID_HANDLE, VG_FILL_MASK, 0, 0, width, height); maskRect = QRect(); -- cgit v0.12 From 2f8141dc3c922619bbe577902c2ef8a9e2195d70 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 5 Mar 2010 11:52:10 +1000 Subject: Image drawing in OpenVG was off by 0.5 of a pixel Path transforms need to be adjusted by 0.5 for the difference in OpenVG and Qt co-ordinate systems. Image transforms do not need to be adjusted because OpenVG implicitly adjusts by 0.5. Task-number: QT-2999 Reviewed-by: Sarah Smith --- src/openvg/qpaintengine_vg.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index c46bc27..4a97a6f 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -516,14 +516,11 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) 0.0f, -1.0f, 0.0f, 0.5f, devh + 0.5f, 1.0f); - // The image transform is always the full transformation, - // because it can be projective. - imageTransform = transform * viewport; - - // Determine if the transformation is projective. - bool projective = (imageTransform.m13() != 0.0f || - imageTransform.m23() != 0.0f || - imageTransform.m33() != 1.0f); + // Compute the path transform and determine if it is projective. + pathTransform = transform * viewport; + bool projective = (pathTransform.m13() != 0.0f || + pathTransform.m23() != 0.0f || + pathTransform.m33() != 1.0f); if (projective) { // The engine cannot do projective path transforms for us, // so we will have to convert the co-ordinates ourselves. @@ -531,11 +528,19 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) pathTransform = viewport; simpleTransform = false; } else { - pathTransform = imageTransform; simpleTransform = true; } pathTransformSet = false; + // The image transform is always the full transformation, + // because it can be projective. It also does not need the + // (0.5, -0.5) translation because vgDrawImage() implicitly + // adds 0.5 to each co-ordinate. + QTransform viewport2(1.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + 0.0f, devh, 1.0f); + imageTransform = transform * viewport2; + // Calculate the scaling factor to use for turning cosmetic pens // into ordinary non-cosmetic pens. qt_scaleForTransform(transform, &penScale); -- cgit v0.12 From 57c847ed2c0b4116ea791828c41db5edc40fe2f2 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Fri, 5 Mar 2010 12:39:17 +1000 Subject: Make the star example recreate its path if the VG context is destroyed. Task-number: QT-2809 Reviewed-by: trustme --- examples/openvg/star/starwidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/openvg/star/starwidget.cpp b/examples/openvg/star/starwidget.cpp index bde0719..794ede9 100644 --- a/examples/openvg/star/starwidget.cpp +++ b/examples/openvg/star/starwidget.cpp @@ -93,8 +93,9 @@ void StarWidget::paintEvent(QPaintEvent *) // and prepare to perform raw OpenVG calls. painter.beginNativePainting(); - // Cache the path if we haven't already. - if (path == VG_INVALID_HANDLE) { + // Cache the path if we haven't already or if the path has + // become invalid because the window's context has changed. + if (path == VG_INVALID_HANDLE || !vgGetPathCapabilities(path)) { path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, // scale -- cgit v0.12 From 3e6a330d2aa6f139347fe29947721368a5186cc3 Mon Sep 17 00:00:00 2001 From: Bill King Date: Fri, 5 Mar 2010 13:09:08 +1000 Subject: Update documentation with warning about setForwardOnly Task-number: QTBUG-8752 --- src/sql/kernel/qsqlquery.cpp | 3 +++ src/sql/kernel/qsqlresult.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp index 430cf1a..f253c82 100644 --- a/src/sql/kernel/qsqlquery.cpp +++ b/src/sql/kernel/qsqlquery.cpp @@ -822,6 +822,9 @@ bool QSqlQuery::isForwardOnly() const scrollable. isForwardOnly() will always return the correct status of the result set. + \note Calling setForwardOnly after execution of the query will result + in unexpected results at best, and crashes at worst. + \sa isForwardOnly(), next(), seek(), QSqlResult::setForwardOnly() */ void QSqlQuery::setForwardOnly(bool forward) diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp index 0c0c31c..6382b42 100644 --- a/src/sql/kernel/qsqlresult.cpp +++ b/src/sql/kernel/qsqlresult.cpp @@ -564,6 +564,9 @@ bool QSqlResult::isForwardOnly() const scrollable. isForwardOnly() will always return the correct status of the result set. + \note Calling setForwardOnly after execution of the query will result + in unexpected results at best, and crashes at worst. + \sa isForwardOnly(), fetchNext(), QSqlQuery::setForwardOnly() */ void QSqlResult::setForwardOnly(bool forward) -- cgit v0.12 From b837e7024afcf4597082998f97dcc663c13c6380 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Thu, 4 Mar 2010 15:45:33 +0200 Subject: Fixed crash in Symbian when having empty QMenu in menubar. Typically cascade menus in Symbian/S60 are created from resources. When cascade menus are defined in resources the RestoreMenuL is responsible for instantiating the cascade menu item array and items. In Qt for Symbian the menus need to be created dynamically from QActions, that's why RestoreMenuL is reimplemeted in Qt for Symbian to dynamically init the menu pane content. Adding a first dynamic item to cascase menu pane creates the CEikMenuPane internal item array. In case where empty QMenu was added to QMenubar, the item array for cascade menupane was never constructed. Then later on CEikMenuPane code assumes that item array exist. To avoid access violation crash we now create the item array manually when building submenu. Task-number: QTBUG-4897 Reviewed-by: Jason Barron --- src/gui/widgets/qmenu_symbian.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp index eae97a6..e46688c 100644 --- a/src/gui/widgets/qmenu_symbian.cpp +++ b/src/gui/widgets/qmenu_symbian.cpp @@ -256,6 +256,14 @@ void qt_symbian_show_submenu( CEikMenuPane* menuPane, int id) { SymbianMenuItem* menu = qt_symbian_find_menu(id, symbianMenus); if (menu) { + // Normally first AddMenuItemL call for menuPane will create the item array. + // However if we don't have any items, we still need the item array. Otherwise + // menupane will crash. That's why we create item array here manually, and + // AddMenuItemL will then use the existing array. + CEikMenuPane::CItemArray* itemArray = q_check_ptr(new CEikMenuPane::CItemArray); + menuPane->SetItemArray(itemArray); + menuPane->SetItemArrayOwnedExternally(EFalse); + for (int i = 0; i < menu->children.count(); ++i) QT_TRAP_THROWING(menuPane->AddMenuItemL(menu->children.at(i)->menuItemData)); } -- cgit v0.12 From 46d5f85a03bd87708152baba2674f2e5f36afe22 Mon Sep 17 00:00:00 2001 From: Bill King Date: Fri, 5 Mar 2010 16:53:54 +1000 Subject: Fixes: Mysql truncation of integer values + some autotest cleanup Task-number: QTBUG-5765 --- src/sql/drivers/mysql/qsql_mysql.cpp | 17 ++++++ tests/auto/qsqlquery/tst_qsqlquery.cpp | 101 ++++++++++++++++++++++++++++----- 2 files changed, 103 insertions(+), 15 deletions(-) diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index c0f866e..2261887 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -320,6 +320,16 @@ static bool qIsBlob(int t) || t == MYSQL_TYPE_LONG_BLOB; } +static bool qIsInteger(int t) +{ + return t == MYSQL_TYPE_TINY + || t == MYSQL_TYPE_SHORT + || t == MYSQL_TYPE_LONG + || t == MYSQL_TYPE_LONGLONG + || t == MYSQL_TYPE_INT24; +} + + void QMYSQLResultPrivate::bindBlobs() { int i; @@ -368,6 +378,13 @@ bool QMYSQLResultPrivate::bindInValues() fieldInfo->length = 0; hasBlobs = true; } else { + // fieldInfo->length specifies the display width, which may be too + // small to hold valid integer values (see + // http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html ), so + // always use the MAX_BIGINT_WIDTH for integer types + if (qIsInteger(fieldInfo->type)) { + fieldInfo->length = MAX_BIGINT_WIDTH; + } fieldInfo->type = MYSQL_TYPE_STRING; } bind = &inBinds[i]; diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index 41b9734..5339132 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -205,6 +205,13 @@ private slots: void QTBUG_6618(); void QTBUG_6852_data() { generic_data("QMYSQL"); } void QTBUG_6852(); + void QTBUG_5765_data() { generic_data("QMYSQL"); } + void QTBUG_5765(); + +#if 0 + void benchmark_data() { generic_data(); } + void benchmark(); +#endif private: // returns all database connections @@ -309,7 +316,14 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) << qTableName( "blobstest" ) << qTableName( "oraRowId" ) << qTableName( "qtest_batch" ) - << qTableName(QLatin1String("bug6421")).toUpper(); + << qTableName("bug6421").toUpper() + << qTableName("bug5765") + << qTableName("bug6852") + << qTableName( "qtest_lockedtable" ) + << qTableName( "Planet" ) + << qTableName( "task_250026" ) + << qTableName( "task_234422" ) + << qTableName("test141895"); if ( db.driverName().startsWith("QPSQL") ) tablenames << qTableName("task_233829"); @@ -320,19 +334,11 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db ) if ( tst_Databases::isSqlServer( db ) || db.driverName().startsWith( "QOCI" ) ) tablenames << qTableName( "qtest_longstr" ); - tablenames << qTableName( "qtest_lockedtable" ); - - tablenames << qTableName( "Planet" ); + if (tst_Databases::isSqlServer( db )) + db.exec("DROP PROCEDURE " + qTableName("test141895_proc")); - tablenames << qTableName( "task_250026" ); - tablenames << qTableName( "task_234422" ); - - if (tst_Databases::isSqlServer( db )) { - QSqlQuery q( db ); - q.exec("DROP PROCEDURE " + qTableName("test141895_proc")); - } - - tablenames << qTableName("test141895"); + if (tst_Databases::isMySQL( db )) + db.exec("DROP PROCEDURE IF EXISTS "+qTableName("bug6852_proc")); tst_Databases::safeDropTables( db, tablenames ); @@ -2996,10 +3002,9 @@ void tst_QSqlQuery::QTBUG_6852() QSKIP( "Test requires MySQL >= 5.0", SkipSingle ); QSqlQuery q(db); - QString tableName(qTableName(QLatin1String("bug6421"))), procName(qTableName(QLatin1String("bug6421_proc"))); + QString tableName(qTableName(QLatin1String("bug6852"))), procName(qTableName(QLatin1String("bug6852_proc"))); QVERIFY_SQL(q, exec("DROP PROCEDURE IF EXISTS "+procName)); - tst_Databases::safeDropTable(db, tableName); QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(\n" "MainKey INT NOT NULL,\n" "OtherTextCol VARCHAR(45) NOT NULL,\n" @@ -3022,6 +3027,72 @@ void tst_QSqlQuery::QTBUG_6852() QCOMPARE(q.value(1).toString(), QLatin1String("Disabled")); } +void tst_QSqlQuery::QTBUG_5765() +{ + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + if ( tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 1 ).toFloat()<4.1 ) + QSKIP( "Test requires MySQL >= 4.1", SkipSingle ); + + QSqlQuery q(db); + QString tableName(qTableName(QLatin1String("bug5765"))); + + QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(testval TINYINT(1) DEFAULT 0)")); + q.prepare("INSERT INTO "+tableName+" SET testval = :VALUE"); + q.bindValue(":VALUE", 1); + QVERIFY_SQL(q, exec()); + q.bindValue(":VALUE", 12); + QVERIFY_SQL(q, exec()); + q.bindValue(":VALUE", 123); + QVERIFY_SQL(q, exec()); + QString sql="select testval from "+tableName; + QVERIFY_SQL(q, exec(sql)); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 1); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 12); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 123); + QVERIFY_SQL(q, prepare(sql)); + QVERIFY_SQL(q, exec()); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 1); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 12); + QVERIFY_SQL(q, next()); + QCOMPARE(q.value(0).toInt(), 123); +} + +#if 0 +void tst_QSqlQuery::benchmark() +{ + QFETCH( QString, dbName ); + QSqlDatabase db = QSqlDatabase::database( dbName ); + CHECK_DATABASE( db ); + if ( tst_Databases::getMySqlVersion( db ).section( QChar('.'), 0, 0 ).toInt()<5 ) + QSKIP( "Test requires MySQL >= 5.0", SkipSingle ); + + QSqlQuery q(db); + QString tableName(qTableName(QLatin1String("benchmark"))); + + tst_Databases::safeDropTable( db, tableName ); + + QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+"(\n" + "MainKey INT NOT NULL,\n" + "OtherTextCol VARCHAR(45) NOT NULL,\n" + "PRIMARY KEY(`MainKey`))")); + + int i=1; + + QBENCHMARK { + QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" VALUES("+QString::number(i)+", \"Value"+QString::number(i)+"\")")); + i++; + } + + tst_Databases::safeDropTable( db, tableName ); +} +#endif QTEST_MAIN( tst_QSqlQuery ) #include "tst_qsqlquery.moc" -- cgit v0.12 From 92c42901344ae654d8bc102e566d47d735cb3954 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Wed, 3 Mar 2010 16:15:22 +0200 Subject: Tab to space fixes to qdilaog.cpp Reviewed-By: TrustMe --- src/gui/dialogs/qdialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index 9ff2ad8..d86d63e 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -807,11 +807,11 @@ void QDialog::setVisible(bool visible) void QDialog::showEvent(QShowEvent *event) { if (!event->spontaneous() && !testAttribute(Qt::WA_Moved)) { - Qt::WindowStates state = windowState(); + Qt::WindowStates state = windowState(); adjustPosition(parentWidget()); setAttribute(Qt::WA_Moved, false); // not really an explicit position - if (state != windowState()) - setWindowState(state); + if (state != windowState()) + setWindowState(state); } } -- cgit v0.12 From aff7468baf9a27fad9fa8a180b90d2a0db8b8c10 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 5 Mar 2010 09:09:56 +0100 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( f3110d2f94c825477afac054ed448e45d47f5670 ) Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog 2010-03-04 Simon Hausmann Reviewed by Kenneth Rohde Christiansen. [Qt] qwebelement.h does not include QtCore headers correctly https://bugs.webkit.org/show_bug.cgi?id=35748 The header files of QtCore must be included as QtCore/foo.h. See also http://bugreports.qt.nokia.com/browse/QTBUG-8661 * Api/qwebelement.h: --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/WebCore.pro | 2 +- src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp | 2 +- src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h | 10 +++++----- src/3rdparty/webkit/WebKit/qt/ChangeLog | 13 +++++++++++++ 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index cc0e04f..6a2e75f 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - ffae5e11181a3961193fa21ea405851cad714d4b + f3110d2f94c825477afac054ed448e45d47f5670 diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index c9b622a..5654a18 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -26,7 +26,7 @@ symbian: { # RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target. # Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000. - QMAKE_LFLAGS.ARMCC += --rw-base 0xE00000 + MMP_RULES += "LINKEROPTION armcc --rw-base 0xE00000" } include($$PWD/../WebKit.pri) diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp index 714cac9..d13c9a9 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h index 3833070..13c341c 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h @@ -20,11 +20,11 @@ #ifndef QWEBELEMENT_H #define QWEBELEMENT_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "qwebkitglobal.h" namespace WebCore { diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 1026ac5..e54c176 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,16 @@ +2010-03-04 Simon Hausmann + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] qwebelement.h does not include QtCore headers correctly + https://bugs.webkit.org/show_bug.cgi?id=35748 + + The header files of QtCore must be included as QtCore/foo.h. + + See also http://bugreports.qt.nokia.com/browse/QTBUG-8661 + + * Api/qwebelement.h: + 2010-01-28 Kenneth Rohde Christiansen Reviewed by Simon Hausmann. -- cgit v0.12 From 0f89d7ef7b5e961cfc6ee7960ad6bf07eff71691 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 4 Mar 2010 17:00:46 +0100 Subject: Wrong dirty region after row selection in right-to-left mode in QTableView When computing the region from the selection range, we didn't take care of the actual position of the cells, which is reverted when in RtoL mode. Also gets fixed a 2-pixel error introduced in commit 718905c097a7f3bbf9805a2561cd855a0b2d8f59, and that was responsible for (potentialy) painting more cells than needed. Auto-test included. Reviewed-by: Olivier Task-number: QTBUG-7774 --- src/gui/itemviews/qtableview.cpp | 14 +++++++++++--- tests/auto/qtableview/tst_qtableview.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 3111896..cf1b542 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -1908,6 +1908,7 @@ QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) co width, rowHeight(r))); } } else { // nothing moved + const int gridAdjust = showGrid() ? 1 : 0; for (int i = 0; i < selection.count(); ++i) { QItemSelectionRange range = selection.at(i); if (range.parent() != d->root || !range.isValid()) @@ -1916,9 +1917,16 @@ QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) co const int rtop = rowViewportPosition(range.top()); const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom()); - const int rleft = columnViewportPosition(range.left()); - const int rright = columnViewportPosition(range.right()) + columnWidth(range.right()); - selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright, rbottom)); + int rleft; + int rright; + if (isLeftToRight()) { + rleft = columnViewportPosition(range.left()); + rright = columnViewportPosition(range.right()) + columnWidth(range.right()); + } else { + rleft = columnViewportPosition(range.right()); + rright = columnViewportPosition(range.left()) + columnWidth(range.left()); + } + selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust)); if (d->hasSpans()) { foreach (QSpanCollection::Span *s, d->spans.spansInRect(range.left(), range.top(), range.width(), range.height())) { diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index a5cbbd4..35fba52 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -200,6 +200,7 @@ private slots: void taskQTBUG_4516_clickOnRichTextLabel(); void taskQTBUG_5237_wheelEventOnHeader(); void taskQTBUG_8585_crashForNoGoodReason(); + void taskQTBUG_7774_RtoLVisualRegionForSelection(); void mouseWheel_data(); void mouseWheel(); @@ -3994,5 +3995,30 @@ void tst_QTableView::taskQTBUG_8585_crashForNoGoodReason() } +class TableView7774 : public QTableView +{ +public: + QRegion visualRegionForSelection(const QItemSelection &selection) const + { + return QTableView::visualRegionForSelection(selection); + } +}; + +void tst_QTableView::taskQTBUG_7774_RtoLVisualRegionForSelection() +{ + TableView7774 view; + QStandardItemModel model(5,5); + view.setModel(&model); + view.setLayoutDirection(Qt::RightToLeft); + view.show(); + QTest::qWaitForWindowShown(&view); + + QItemSelectionRange range(model.index(2, 0), model.index(2, model.columnCount() - 1)); + QItemSelection selection; + selection << range; + QRegion region = view.visualRegionForSelection(selection); + QCOMPARE(region.rects().at(0), view.visualRect(range.topLeft()) | view.visualRect(range.bottomRight())); +} + QTEST_MAIN(tst_QTableView) #include "tst_qtableview.moc" -- cgit v0.12 From 68eea46d309ff82e45c243a7689013f36454c85b Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 5 Mar 2010 11:05:54 +0200 Subject: QMessageBox is not stretched to screen width if the content is narrow Currently; If content of QMessageBox in S60 is less than messagebox's softlimit, messagebox is not stretched to screen width. http://bugreports.qt.nokia.com/browse/QTBUG-5539 Fix: Regardless of content width, messagebox is stretched to screen width. Task-number: QTBUG-5539 Reviewed-by: Janne Anttila --- src/gui/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/dialogs/qmessagebox.cpp b/src/gui/dialogs/qmessagebox.cpp index d1b2e3f..bd2df9c 100644 --- a/src/gui/dialogs/qmessagebox.cpp +++ b/src/gui/dialogs/qmessagebox.cpp @@ -314,6 +314,7 @@ void QMessageBoxPrivate::updateSize() } width = hardLimit; } + } #ifdef Q_WS_S60 // in S60 portait messageBoxes should always occupy maximum width if (QApplication::desktop()->size().height() > QApplication::desktop()->size().width()){ @@ -323,7 +324,6 @@ void QMessageBoxPrivate::updateSize() width = qMin(QApplication::desktop()->size().height(), hardLimit); } #endif - } if (informativeLabel) { label->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); -- cgit v0.12 From a0d7a5cf999fe3adac2b2166085194cf93a4a424 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 5 Mar 2010 11:10:57 +0200 Subject: Fixed crash at application exit when QProcess was used in Symbian QProcessManagerMediator and QProcessActive were not properly canceled in their destructors, causing crash when global static QProcessManager was deleted. Task-number: QTBUG-7735 Reviewed-by: Janne Anttila --- src/corelib/io/qprocess_symbian.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp index 75cde51..e37bdda 100644 --- a/src/corelib/io/qprocess_symbian.cpp +++ b/src/corelib/io/qprocess_symbian.cpp @@ -371,6 +371,7 @@ QProcessActive::QProcessActive() // Called from ProcessManagerThread QProcessActive::~QProcessActive() { + Cancel(); process = NULL; pproc = NULL; } @@ -477,6 +478,7 @@ QProcessManagerMediator::QProcessManagerMediator() // Called from ProcessManagerThread QProcessManagerMediator::~QProcessManagerMediator() { + Cancel(); processManagerThread.Close(); currentCommand = ENoCommand; currentObserver = NULL; -- cgit v0.12 From ab12c1c804ee40931515a0d53e5dc70db373f3bd Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Fri, 5 Mar 2010 11:22:12 +0200 Subject: Fix for QTBUG-8762 QApplication::setGraphicsSystem("raster") crashes. QRasterGraphicsSystem tries to create QRasterPixmapData and QRasterWindowSurface if QApplication::setGraphicsSystem("raster") is used. On Symbian it should create QS60PixmapData and QS60WindowSurface. Task-number: QTBUG-8762 Reviewed-by: Jason Barron --- src/gui/painting/qgraphicssystem_raster.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/painting/qgraphicssystem_raster.cpp b/src/gui/painting/qgraphicssystem_raster.cpp index f90aea0..909508e 100644 --- a/src/gui/painting/qgraphicssystem_raster.cpp +++ b/src/gui/painting/qgraphicssystem_raster.cpp @@ -41,19 +41,32 @@ #include "qgraphicssystem_raster_p.h" +#ifdef Q_OS_SYMBIAN +#include "private/qpixmap_s60_p.h" +#include "private/qwindowsurface_s60_p.h" +#else #include "private/qpixmap_raster_p.h" #include "private/qwindowsurface_raster_p.h" +#endif QT_BEGIN_NAMESPACE QPixmapData *QRasterGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const { +#ifdef Q_OS_SYMBIAN + return new QS60PixmapData(type); +#else return new QRasterPixmapData(type); +#endif } QWindowSurface *QRasterGraphicsSystem::createWindowSurface(QWidget *widget) const { +#ifdef Q_OS_SYMBIAN + return new QS60WindowSurface(widget); +#else return new QRasterWindowSurface(widget); +#endif } QT_END_NAMESPACE -- cgit v0.12 From d80b0e347bb01d039c0104e857674bb2cf0adc0f Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Fri, 5 Mar 2010 11:48:35 +0200 Subject: QS60Style ignores widget palette when drawing highlighted widget text Currently: QS60Style does not polish widgets with highlight colors. Instead it fetches color information from native theme side and uses that color for drawing the text. http://bugreports.qt.nokia.com/browse/QTBUG-8704 Fix: All widgets with highlighted text (lists, tables, headers, tabs, radiobuttons and checkboxes) polish their palette. This palette value is then used in the drawing code. Earlier it was not possible for developers to define their own highlight text color, now it is possible. Task-number: QTBUG-8704 Reviewed-by: Janne Anttila --- src/gui/styles/qs60style.cpp | 48 ++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 565cc2c..bf5a62e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -759,13 +759,29 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const QApplication::setPalette(widgetPalette, "QMenuBar"); widgetPalette = *palette; + widgetPalette.setColor(QPalette::Text, + s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); + widgetPalette.setColor(QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0)); + QApplication::setPalette(widgetPalette, "QMenu"); + widgetPalette = *palette; + widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0)); + widgetPalette.setColor(QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 3, 0)); QApplication::setPalette(widgetPalette, "QTabBar"); widgetPalette = *palette; + widgetPalette.setColor(QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); + QApplication::setPalette(widgetPalette, "QListView"); + widgetPalette = *palette; + widgetPalette.setColor(QPalette::Text, s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0)); + widgetPalette.setColor(QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0)); QApplication::setPalette(widgetPalette, "QTableView"); widgetPalette = *palette; @@ -789,6 +805,8 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const widgetPalette = *palette; widgetPalette.setColor(QPalette::WindowText, s60Color(QS60StyleEnums::CL_QsnTextColors, 7, 0)); + widgetPalette.setColor(QPalette::HighlightedText, + s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0)); QApplication::setPalette(widgetPalette, "QRadioButton"); QApplication::setPalette(widgetPalette, "QCheckBox"); widgetPalette = *palette; @@ -1241,6 +1259,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_RadioButton: if (const QStyleOptionButton *btn = qstyleoption_cast(option)) { bool isRadio = (element == CE_RadioButton); + QStyleOptionButton subopt = *btn; + // Highlight needs to be drawn first, as it goes "underneath" the text and indicator. if (btn->state & State_HasFocus) { QStyleOptionFocusRect fropt; @@ -1248,8 +1268,10 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, fropt.rect = subElementRect(isRadio ? SE_RadioButtonFocusRect : SE_CheckBoxFocusRect, btn, widget); drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + + subopt.palette.setColor(QPalette::Active, QPalette::WindowText, + subopt.palette.highlightedText().color()); } - QStyleOptionButton subopt = *btn; subopt.rect = subElementRect(isRadio ? SE_RadioButtonIndicator : SE_CheckBoxIndicator, btn, widget); @@ -1408,7 +1430,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, } else { QCommonStyle::drawPrimitive(PE_PanelItemViewItem, &voptAdj, painter, widget);} // draw the focus rect - if (isSelected | hasFocus) { + if (isSelected || hasFocus ) { QRect highlightRect = option->rect.adjusted(1,1,-1,-1); QAbstractItemView::SelectionBehavior selectionBehavior = itemView ? itemView->selectionBehavior() : QAbstractItemView::SelectItems; @@ -1480,15 +1502,10 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, // draw the text if (!voptAdj.text.isEmpty()) { - if (isSelected) { - if (qobject_cast(widget)) - voptAdj.palette.setColor( - QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 11, 0)); - else - voptAdj.palette.setColor( - QPalette::Text, QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 10, 0)); - } - painter->setPen(voptAdj.palette.text().color()); + if (isSelected || hasFocus ) + painter->setPen(voptAdj.palette.highlightedText().color()); + else + painter->setPen(voptAdj.palette.text().color()); d->viewItemDrawText(painter, &voptAdj, textRect); } painter->restore(); @@ -1590,7 +1607,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, const bool selected = optionTab.state & State_Selected; if (selected) optionTab.palette.setColor(QPalette::Active, QPalette::WindowText, - QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnTextColors, 3, option)); + optionTab.palette.highlightedText().color()); const bool verticalTabs = optionTab.shape == QTabBar::RoundedEast || optionTab.shape == QTabBar::RoundedWest @@ -1723,7 +1740,8 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, if (!styleHint(SH_UnderlineShortcut, menuItem, widget)) text_flags |= Qt::TextHideMnemonic; - if ((option->state & State_Selected) && (option->state & State_Enabled)) + const bool selected = (option->state & State_Selected) && (option->state & State_Enabled); + if (selected) QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_ListHighlight, painter, option->rect, flags); QRect iconRect = subElementRect(SE_ItemViewItemDecoration, &optionMenuItem, widget); @@ -1793,6 +1811,10 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, painter->save(); painter->setOpacity(0.5); } + if (selected) + optionMenuItem.palette.setColor( + QPalette::Active, QPalette::Text, optionMenuItem.palette.highlightedText().color()); + QCommonStyle::drawItemText(painter, textRect, text_flags, optionMenuItem.palette, enabled, optionMenuItem.text, QPalette::Text); -- cgit v0.12 From 3fdad84b40b62979844c2d37d16093a0b67222df Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Fri, 5 Mar 2010 11:53:39 +0100 Subject: QPrintPreviewDialog number of pages is partially blocked from view in OSX The problem here is caused by the FormLayout. This patch queries the widget for its sizeHint and then forces it to resize to that size. Once that is done, we add the widget to the layout. Code is #ifdef protected so other platforms are not affected by it. Task-number: QTBUG-7760 Reviewed-by: Trond --- src/gui/dialogs/qprintpreviewdialog.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gui/dialogs/qprintpreviewdialog.cpp b/src/gui/dialogs/qprintpreviewdialog.cpp index 6723b53..f21343e 100644 --- a/src/gui/dialogs/qprintpreviewdialog.cpp +++ b/src/gui/dialogs/qprintpreviewdialog.cpp @@ -273,7 +273,20 @@ void QPrintPreviewDialogPrivate::init(QPrinter *_printer) QWidget *pageEdit = new QWidget(toolbar); QVBoxLayout *vboxLayout = new QVBoxLayout; vboxLayout->setContentsMargins(0, 0, 0, 0); +#ifdef Q_WS_MAC + // We query the widgets about their size and then we fix the size. + // This should do the trick for the laying out part... + QSize pageNumEditSize, pageNumLabelSize; + pageNumEditSize = pageNumEdit->minimumSizeHint(); + pageNumLabelSize = pageNumLabel->minimumSizeHint(); + pageNumEdit->resize(pageNumEditSize); + pageNumLabel->resize(pageNumLabelSize); +#endif QFormLayout *formLayout = new QFormLayout; +#ifdef Q_WS_MAC + // We have to change the growth policy in Mac. + formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); +#endif formLayout->setWidget(0, QFormLayout::LabelRole, pageNumEdit); formLayout->setWidget(0, QFormLayout::FieldRole, pageNumLabel); vboxLayout->addLayout(formLayout); -- cgit v0.12 From 1a802007ca53aa0bd5fa5e474700660df6edf97b Mon Sep 17 00:00:00 2001 From: ninerider Date: Fri, 5 Mar 2010 13:37:17 +0100 Subject: Compile fix for Windows Mobile and OpenGLES2 The native device is now the default screen device. --- src/gui/egl/qegl_wince.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/egl/qegl_wince.cpp b/src/gui/egl/qegl_wince.cpp index dfef39f..87ec648 100644 --- a/src/gui/egl/qegl_wince.cpp +++ b/src/gui/egl/qegl_wince.cpp @@ -89,9 +89,7 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties EGLNativeDisplayType QEglContext::nativeDisplay() { - //HWND win = (static_cast(device))->winId(); - //HDC myDc = GetDC(win); - HDC myDc = GetWindowDC(0); + HDC myDc = GetDC(0); if (!myDc) { qWarning("QEglContext::nativeDisplay(): WinCE display is not open"); -- cgit v0.12 From 4b3b9b792dfe2d25a271f042f23df22e8b9684f6 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 5 Mar 2010 11:28:32 +0100 Subject: QDom: prevent infinite loop when cloning a DTD we forgot to advance the pointer to the current node. Reviewed-by: Frans Englich Task-number: QTBUG-8398 --- src/xml/dom/qdom.cpp | 1 + tests/auto/qdom/tst_qdom.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 8d9ae4f..0150515 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -3487,6 +3487,7 @@ QDomDocumentTypePrivate::QDomDocumentTypePrivate(QDomDocumentTypePrivate* n, boo if (p->isNotation()) // Dont use normal insert function since we would create infinite recursion notations->map.insertMulti(p->nodeName(), p); + p = p->next; } } diff --git a/tests/auto/qdom/tst_qdom.cpp b/tests/auto/qdom/tst_qdom.cpp index d1b2ea5..caf08d6 100644 --- a/tests/auto/qdom/tst_qdom.cpp +++ b/tests/auto/qdom/tst_qdom.cpp @@ -131,6 +131,7 @@ private slots: void setContentWhitespace_data() const; void taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() const; + void cloneDTD_QTBUG8398() const; void cleanupTestCase() const; @@ -1912,5 +1913,29 @@ void tst_QDom::taskQTBUG4595_dontAssertWhenDocumentSpecifiesUnknownEncoding() co QVERIFY(true); } +void tst_QDom::cloneDTD_QTBUG8398() const +{ + QString dtd("\n" + "\n" + "\n" + "]>\n" + "\n"); + QDomDocument domDocument; + QVERIFY(domDocument.setContent(dtd)); + QDomDocument domDocument2 = domDocument.cloneNode(true).toDocument(); + + // for some reason, our DOM implementation reverts the order of entities + QString expected("\n" + "\n" + "\n" + "]>\n" + "\n"); + QString output; + QTextStream stream(&output); + domDocument2.save(stream, 0); + QCOMPARE(output, expected); +} QTEST_MAIN(tst_QDom) #include "tst_qdom.moc" -- cgit v0.12 From 856f76e44a00a710b1c34eddee5a893a3c0ada6a Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 5 Mar 2010 11:08:33 +0100 Subject: Fixed key mappings on X11 Merge request #1742 (6c8c1c5322a26d789165783d7df3e29c672690cb) changed the behavior of one of the keys on X11, this fixes it back and documents that on X11 the key binding is a bit weird - XF86XK_MyComputer is mapped to Qt::Key_Launch0, XF86XK_Launch0 is mapped to Qt::Key_Launch3 and so on. Task-number: QTBUG-7063 Reviewed-by: Marius Storm-Olsen --- src/corelib/global/qnamespace.qdoc | 34 +++++++++++++++++----------------- src/gui/kernel/qkeymapper_x11.cpp | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 6968773..a756565 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1622,22 +1622,22 @@ \value Key_OpenUrl \value Key_LaunchMail \value Key_LaunchMedia - \value Key_Launch0 - \value Key_Launch1 - \value Key_Launch2 - \value Key_Launch3 - \value Key_Launch4 - \value Key_Launch5 - \value Key_Launch6 - \value Key_Launch7 - \value Key_Launch8 - \value Key_Launch9 - \value Key_LaunchA - \value Key_LaunchB - \value Key_LaunchC - \value Key_LaunchD - \value Key_LaunchE - \value Key_LaunchF + \value Key_Launch0 On X11 this key is mapped to "My Computer" (XF86XK_MyComputer) key for legacy reasons. + \value Key_Launch1 On X11 this key is mapped to "Calculator" (XF86XK_Calculator) key for legacy reasons. + \value Key_Launch2 On X11 this key is mapped to XF86XK_Launch0 key for legacy reasons. + \value Key_Launch3 On X11 this key is mapped to XF86XK_Launch1 key for legacy reasons. + \value Key_Launch4 On X11 this key is mapped to XF86XK_Launch2 key for legacy reasons. + \value Key_Launch5 On X11 this key is mapped to XF86XK_Launch3 key for legacy reasons. + \value Key_Launch6 On X11 this key is mapped to XF86XK_Launch4 key for legacy reasons. + \value Key_Launch7 On X11 this key is mapped to XF86XK_Launch5 key for legacy reasons. + \value Key_Launch8 On X11 this key is mapped to XF86XK_Launch6 key for legacy reasons. + \value Key_Launch9 On X11 this key is mapped to XF86XK_Launch7 key for legacy reasons. + \value Key_LaunchA On X11 this key is mapped to XF86XK_Launch8 key for legacy reasons. + \value Key_LaunchB On X11 this key is mapped to XF86XK_Launch9 key for legacy reasons. + \value Key_LaunchC On X11 this key is mapped to XF86XK_LaunchA key for legacy reasons. + \value Key_LaunchD On X11 this key is mapped to XF86XK_LaunchB key for legacy reasons. + \value Key_LaunchE On X11 this key is mapped to XF86XK_LaunchC key for legacy reasons. + \value Key_LaunchF On X11 this key is mapped to XF86XK_LaunchD key for legacy reasons. \value Key_MonBrightnessUp \value Key_MonBrightnessDown \value Key_KeyboardLightOnOff @@ -1663,7 +1663,7 @@ \value Key_ApplicationRight \value Key_Book \value Key_CD - \value Key_Calculator + \value Key_Calculator On X11 this key is not mapped for legacy reasons. Use Qt::Key_Launch1 instead. \value Key_ToDoList \value Key_ClearGrab \value Key_Close diff --git a/src/gui/kernel/qkeymapper_x11.cpp b/src/gui/kernel/qkeymapper_x11.cpp index 4e6c847..b32b626 100644 --- a/src/gui/kernel/qkeymapper_x11.cpp +++ b/src/gui/kernel/qkeymapper_x11.cpp @@ -1073,8 +1073,8 @@ static const unsigned int KeyTbl[] = { XF86XK_AudioNext, Qt::Key_MediaNext, XF86XK_AudioRecord, Qt::Key_MediaRecord, XF86XK_Mail, Qt::Key_LaunchMail, - XF86XK_MyComputer, Qt::Key_Launch0, - XF86XK_Calculator, Qt::Key_Calculator, + XF86XK_MyComputer, Qt::Key_Launch0, // ### Qt 5: remap properly + XF86XK_Calculator, Qt::Key_Launch1, XF86XK_Memo, Qt::Key_Memo, XF86XK_ToDoList, Qt::Key_ToDoList, XF86XK_Calendar, Qt::Key_Calendar, @@ -1172,7 +1172,7 @@ static const unsigned int KeyTbl[] = { XF86XK_Bluetooth, Qt::Key_Bluetooth, XF86XK_Suspend, Qt::Key_Suspend, XF86XK_Hibernate, Qt::Key_Hibernate, - XF86XK_Launch0, Qt::Key_Launch2, + XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 5: remap properly XF86XK_Launch1, Qt::Key_Launch3, XF86XK_Launch2, Qt::Key_Launch4, XF86XK_Launch3, Qt::Key_Launch5, -- cgit v0.12 From 3d51d223bee55011876d12011970a5ad15c4acd0 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Fri, 5 Mar 2010 14:43:34 +0100 Subject: If no IAP defined force IAP dialog Using TCommDbConnPref to force IAP dialog when IAP is not defined Reviewed-by: TrustMe --- examples/network/qftp/sym_iap_util.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/network/qftp/sym_iap_util.h b/examples/network/qftp/sym_iap_util.h index 41e43a9..445036a 100644 --- a/examples/network/qftp/sym_iap_util.h +++ b/examples/network/qftp/sym_iap_util.h @@ -60,6 +60,7 @@ //#include _LIT(KIapNameSetting, "IAP\\Name"); // text - mandatory +_LIT(KIapTableIdField, "IAP\Id"); _LIT(KIapDialogPref, "IAP\\DialogPref"); // TUnit32 - optional _LIT(KIapService, "IAP\\IAPService"); // TUnit32 - mandatory _LIT(KIapServiceType, "IAP\\IAPServiceType"); // text - mandatory @@ -367,20 +368,25 @@ static QString qt_OfferIapDialog() { CleanupClosePushL(connection); socketServ.Connect(); + + TCommDbConnPref prefs; + prefs.SetDialogPreference(ECommDbDialogPrefPrompt); + connection.Open(socketServ); - connection.Start(); + connection.Start(prefs); connection.GetDesSetting(TPtrC(KIapNameSetting), iapName); - //connection.Stop(); iapName.ZeroTerminate(); QString strIapName((char*)iapName.Ptr()); int error = 0; - if(!qt_SetDefaultIapName(strIapName, error)) { - //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error); - strIapName = QString(""); + if(!strIapName.isEmpty()) { + if(!qt_SetDefaultIapName(strIapName, error)) { + //printf("failed setdefaultif @ %i with %s and errno = %d \n", __LINE__, strIapName.toUtf8().data(), error); + strIapName = QString(""); + } } CleanupStack::PopAndDestroy(&connection); -- cgit v0.12 From 8428a5e9dbe8f872ba229aad360c8579638479ae Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Fri, 5 Mar 2010 16:40:04 +0200 Subject: Fix for QTBUG-6659 Parent window accepts pointer events wrongly Parent window accepted pointer events even though the child was modal. That was because closing popup didn't restore pointer grab for modal window. Task-number: QTBUG-6659 Reviewed-by: axis --- src/gui/kernel/qapplication_s60.cpp | 3 +++ src/gui/kernel/qwidget_s60.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 2a90ba6..395ceca 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1473,6 +1473,9 @@ void QApplicationPrivate::closePopup(QWidget *popup) QWidget *fw = QApplicationPrivate::active_window ? QApplicationPrivate::active_window->focusWidget() : q_func()->focusWidget(); if (fw) { + if(fw->window()->isModal()) // restore pointer capture for modal window + fw->effectiveWinId()->SetPointerCapture(true); + if (fw != q_func()->focusWidget()) { fw->setFocus(Qt::PopupFocusReason); } else { diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 7bbc142..7fb21d2 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1237,8 +1237,10 @@ void QWidget::releaseMouse() { if (!qt_nograb() && QWidgetPrivate::mouseGrabber == this) { Q_ASSERT(testAttribute(Qt::WA_WState_Created)); - WId id = effectiveWinId(); - id->SetPointerCapture(false); + if(!window()->isModal()) { + WId id = effectiveWinId(); + id->SetPointerCapture(false); + } QWidgetPrivate::mouseGrabber = 0; #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); -- cgit v0.12 From ddaa4643c1ee96c9dfc16b1c247481a240e2e16b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 5 Mar 2010 15:59:37 +0100 Subject: fix "using namespace" recursion crash Task-number: QTBUG-8360 --- .../lupdate/testdata/good/namespaces/main.cpp | 60 ++++++++++++++++++++++ .../testdata/good/namespaces/project.ts.result | 24 +++++++++ tools/linguist/lupdate/cpp.cpp | 28 +++++++--- 3 files changed, 104 insertions(+), 8 deletions(-) diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp b/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp index 42cc55b..a5b36ca 100644 --- a/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/main.cpp @@ -135,4 +135,64 @@ Q_OBJECT } }; +// QTBUG-8360 +namespace A { + +void foo() +{ + using namespace A; +} + +void goo() +{ + return QObject::tr("Bla"); +} + +} + + +namespace AA { +namespace B { + +using namespace AA; + +namespace C { + +class Test : public QObject { + Q_OBJECT +}; + +} + +} + +using namespace B; +using namespace C; + +void goo() +{ + AA::Test::tr("howdy?"); +} + +} + + +namespace A1 { +namespace B { + +class Test : public QObject { + Q_OBJECT +}; + +using namespace A1; + +void foo() +{ + B::B::B::Test::tr("yeeee-ha!"); +} + +} +} + + #include "main.moc" diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result index c1a34bd..94df9d3 100644 --- a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.ts.result @@ -2,6 +2,22 @@ + A1::B::Test + + + yeeee-ha! + + + + + AA::B::C::Test + + + howdy? + + + + Class @@ -79,4 +95,12 @@ + + QObject + + + Bla + + + diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index 6bd9108..2d5620e 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -260,6 +260,8 @@ private: bool qualifyOneCallbackOwn(const Namespace *ns, void *context) const; bool qualifyOneCallbackUsing(const Namespace *ns, void *context) const; bool qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment, + NamespaceList *resolved, QSet *visitedUsings) const; + bool qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment, NamespaceList *resolved) const; bool fullyQualify(const NamespaceList &namespaces, int nsCnt, const QList &segments, bool isDeclaration, @@ -1036,15 +1038,16 @@ QStringList CppParser::stringListifySegments(const QList &segments) } struct QualifyOneData { - QualifyOneData(const NamespaceList &ns, int nsc, const HashString &seg, NamespaceList *rslvd) - : namespaces(ns), nsCount(nsc), segment(seg), resolved(rslvd) + QualifyOneData(const NamespaceList &ns, int nsc, const HashString &seg, NamespaceList *rslvd, + QSet *visited) + : namespaces(ns), nsCount(nsc), segment(seg), resolved(rslvd), visitedUsings(visited) {} const NamespaceList &namespaces; int nsCount; const HashString &segment; NamespaceList *resolved; - QSet visitedUsings; + QSet *visitedUsings; }; bool CppParser::qualifyOneCallbackOwn(const Namespace *ns, void *context) const @@ -1078,18 +1081,19 @@ bool CppParser::qualifyOneCallbackUsing(const Namespace *ns, void *context) cons { QualifyOneData *data = (QualifyOneData *)context; foreach (const HashStringList &use, ns->usings) - if (!data->visitedUsings.contains(use)) { - data->visitedUsings.insert(use); - if (qualifyOne(use.value(), use.value().count(), data->segment, data->resolved)) + if (!data->visitedUsings->contains(use)) { + data->visitedUsings->insert(use); + if (qualifyOne(use.value(), use.value().count(), data->segment, data->resolved, + data->visitedUsings)) return true; } return false; } bool CppParser::qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment, - NamespaceList *resolved) const + NamespaceList *resolved, QSet *visitedUsings) const { - QualifyOneData data(namespaces, nsCnt, segment, resolved); + QualifyOneData data(namespaces, nsCnt, segment, resolved, visitedUsings); if (visitNamespace(namespaces, nsCnt, &CppParser::qualifyOneCallbackOwn, &data)) return true; @@ -1097,6 +1101,14 @@ bool CppParser::qualifyOne(const NamespaceList &namespaces, int nsCnt, const Has return visitNamespace(namespaces, nsCnt, &CppParser::qualifyOneCallbackUsing, &data); } +bool CppParser::qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment, + NamespaceList *resolved) const +{ + QSet visitedUsings; + + return qualifyOne(namespaces, nsCnt, segment, resolved, &visitedUsings); +} + bool CppParser::fullyQualify(const NamespaceList &namespaces, int nsCnt, const QList &segments, bool isDeclaration, NamespaceList *resolved, QStringList *unresolved) const -- cgit v0.12 From a4a1cfe900ab06ff1f8dbe30d73476937a122582 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 5 Mar 2010 14:57:01 +0100 Subject: Reset the byte order in the iconv codec after using it. Otherwise, if you try run QString(QChar(0xfffe)).toLocal8Bit() iconv will be left in byte-swapping mode. Reviewed-by: Denis Dzyubenko --- src/corelib/codecs/qiconvcodec.cpp | 41 +++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp index 0f73d9b..0fcdf96 100644 --- a/src/corelib/codecs/qiconvcodec.cpp +++ b/src/corelib/codecs/qiconvcodec.cpp @@ -299,6 +299,32 @@ QString QIconvCodec::convertToUnicode(const char* chars, int len, ConverterState Q_GLOBAL_STATIC(QThreadStorage, fromUnicodeState) +static bool setByteOrder(iconv_t cd) +{ +#if !defined(NO_BOM) + // give iconv() a BOM + char buf[4]; + ushort bom[] = { QChar::ByteOrderMark }; + + char *outBytes = buf; + char *inBytes = reinterpret_cast(bom); + size_t outBytesLeft = sizeof buf; + size_t inBytesLeft = sizeof bom; + +#if defined(GNU_LIBICONV) + const char **inBytesPtr = const_cast(&inBytes); +#else + char **inBytesPtr = &inBytes; +#endif + + if (iconv(cd, inBytesPtr, &inBytesLeft, &outBytes, &outBytesLeft) == (size_t) -1) { + return false; + } +#endif // NO_BOM + + return true; +} + QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *convState) const { char *inBytes; @@ -325,17 +351,8 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt IconvState *&state = ts->localData(); if (!state) { state = new IconvState(QIconvCodec::createIconv_t(0, UTF16)); - if (state->cd != reinterpret_cast(-1)) { - size_t outBytesLeft = len + 3; // +3 for the BOM - QByteArray ba(outBytesLeft, Qt::Uninitialized); - outBytes = ba.data(); - -#if !defined(NO_BOM) - // give iconv() a BOM - QChar bom[] = { QChar(QChar::ByteOrderMark) }; - inBytes = reinterpret_cast(bom); - inBytesLeft = sizeof(bom); - if (iconv(state->cd, inBytesPtr, &inBytesLeft, &outBytes, &outBytesLeft) == (size_t) -1) { + if (state->cd == reinterpret_cast(-1)) { + if (!setByteOrder(state->cd)) { perror("QIconvCodec::convertFromUnicode: using ASCII for conversion, iconv failed for BOM"); iconv_close(state->cd); @@ -343,7 +360,6 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt return QString(uc, len).toAscii(); } -#endif // NO_BOM } } if (state->cd == reinterpret_cast(-1)) { @@ -422,6 +438,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt // reset to initial state iconv(state->cd, 0, &inBytesLeft, 0, &outBytesLeft); + setByteOrder(state->cd); ba.resize(ba.size() - outBytesLeft); -- cgit v0.12 From e0534e6cb81894e1fb69ab5c1855aee09db31ead Mon Sep 17 00:00:00 2001 From: Bernhard Rosenkraenzer Date: Fri, 5 Mar 2010 17:06:36 +0100 Subject: Fix build with Mesa 7.8's EGL implementatioon Without this change, when Mesa 7.8 is used, qtextstream.h (included by qdebug.h) complains that it has to be included before any header that defines Status Merge-request: 483 Reviewed-by: Thiago Macieira --- src/gui/egl/qeglproperties.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp index 236ec37..d0d5de7 100644 --- a/src/gui/egl/qeglproperties.cpp +++ b/src/gui/egl/qeglproperties.cpp @@ -39,13 +39,13 @@ ** ****************************************************************************/ +#include +#include + #include "qeglproperties_p.h" QT_BEGIN_NAMESPACE -#include -#include - #include "qegl_p.h" -- cgit v0.12 From 4a72e2f1994324198d1a2c79382185dcca41a576 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Fri, 5 Mar 2010 10:00:01 -0800 Subject: Add some warnings when using DISABLE/WARN in DFB If you specify an operation that is not recognized in QT_DIRECTFB_WARN_ON_RASTERFALLBACKS or QT_DIRECTFB_DISABLE_RASTERFALLBACKS Reviewed-by: muthu --- .../gfxdrivers/directfb/qdirectfbpaintengine.cpp | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 537baf5..e79dceb 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -204,21 +204,36 @@ static void initRasterFallbacksMasks(int *warningMask, int *disableMask) { 0, ALL } }; - const QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|')); - const QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|')); + QStringList warning = QString::fromLatin1(qgetenv("QT_DIRECTFB_WARN_ON_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), + QString::SkipEmptyParts); + QStringList disable = QString::fromLatin1(qgetenv("QT_DIRECTFB_DISABLE_RASTERFALLBACKS")).toUpper().split(QLatin1Char('|'), + QString::SkipEmptyParts); *warningMask = 0; *disableMask = 0; if (!warning.isEmpty() || !disable.isEmpty()) { for (int i=0; operations[i].name; ++i) { const QString name = QString::fromLatin1(operations[i].name); - if (warning.contains(name)) { + int idx = warning.indexOf(name); + if (idx != -1) { *warningMask |= operations[i].operation; + warning.remove(warning.begin() + idx); } - if (disable.contains(name)) { + idx = disable.indexOf(name); + if (idx != -1) { *disableMask |= operations[i].operation; + disable.remove(disable.begin() + idx); } } } + if (!warning.isEmpty()) { + qWarning("QDirectFBPaintEngine QT_DIRECTFB_WARN_ON_RASTERFALLBACKS Unknown operation(s): %s", + qPrintable(warning.join(QLatin1String("|")))); + } + if (!disable.isEmpty()) { + qWarning("QDirectFBPaintEngine QT_DIRECTFB_DISABLE_RASTERFALLBACKS Unknown operation(s): %s", + qPrintable(disable.join(QLatin1String("|")))); + } + } #endif -- cgit v0.12 From 2dd029993b16b8c696de61a0ead5a417d1f778f9 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Fri, 5 Mar 2010 10:17:59 -0800 Subject: QDirectFBPaintEngine optimization If you call fillRect(QBrush(QColor())); we should short-circuit before falling back to the raster engine. Reviewed-by: muthu --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index e79dceb..1bd6dce 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -805,13 +805,14 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) if (d->clipType != QDirectFBPaintEnginePrivate::ComplexClip) { switch (brush.style()) { case Qt::SolidPattern: { + const QColor color = brush.color(); + if (!color.isValid()) + return; + if (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported || !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) { break; } - const QColor color = brush.color(); - if (!color.isValid()) - return; d->setDFBColor(color); const QRect r = state()->matrix.mapRect(rect).toRect(); CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height())); -- cgit v0.12 From 888e05cc903c4a03a6571bb0e0befb86fd9443d5 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Fri, 5 Mar 2010 11:37:04 -0800 Subject: Compile with DirectFB version >= 1.2.0 && < 1.2.9 DSPF_DST was added in 1.2.9, not in 1.2.0 Reviewed-by: muthu --- src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp index 1bd6dce..7dce516 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp @@ -1005,7 +1005,7 @@ void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode m case QPainter::CompositionMode_DestinationOut: surface->SetPorterDuff(surface, DSPD_DST_OUT); break; -#if (Q_DIRECTFB_VERSION >= 0x010200) +#if (Q_DIRECTFB_VERSION >= 0x010209) case QPainter::CompositionMode_Destination: surface->SetPorterDuff(surface, DSPD_DST); break; -- cgit v0.12