From 7127f5ba2cc5729cfa12f5705e2dcfdcb99e1b91 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 15 Jan 2010 13:04:04 +0100 Subject: Text drawing is not fast currently --- src/gui/painting/qpainter.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index fd67f96..a917e0d 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1374,9 +1374,6 @@ void QPainterPrivate::updateState(QPainterState *newState) opacity with non-smooth transformation mode (\c QPainter::SmoothPixmapTransform not enabled as a render hint). - \o Text drawing with regular font sizes with simple - transformations with solid colors using no or 8-bit antialiasing. - \o Rectangle fills with solid color, two-color linear gradients and simple transforms. -- cgit v0.12 From 092cfe31463146c17f99543e36cdd7da85961afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 20 Jan 2010 09:34:47 +0100 Subject: Fixed a crash under X11 when drawing QPixmaps to QGLPixelBuffers. Task-number: QTBUG-7476 Reviewed-by: Kim --- src/opengl/qgl_x11.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index f4cc7c7..61a16be 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -1651,8 +1651,12 @@ static bool qt_resolveTextureFromPixmap(QPaintDevice *paintDevice) { return false; // Can't use TFP without NPOT } + const QX11Info *xinfo = qt_x11Info(paintDevice); - QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen())); + Display *display = xinfo ? xinfo->display() : X11->display; + int screen = xinfo ? xinfo->screen() : X11->defaultScreen; + + QGLExtensionMatcher extensions(glXQueryExtensionsString(display, screen)); if (extensions.match("GLX_EXT_texture_from_pixmap")) { glXBindTexImageEXT = (qt_glXBindTexImageEXT) qglx_getProcAddress("glXBindTexImageEXT"); glXReleaseTexImageEXT = (qt_glXReleaseTexImageEXT) qglx_getProcAddress("glXReleaseTexImageEXT"); -- cgit v0.12 From 8721d060a67a01ac891cab9d3d17aacf7373bcf0 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 20 Jan 2010 09:29:08 +0100 Subject: Fixed QBitmap::load to load into bitmap format again. Task: http://bugreports.qt.nokia.com/browse/QTBUG-7468 Reviewed-by: Trond --- src/gui/image/qpixmap.cpp | 21 ++++++++++++++------- tests/auto/qpixmap/tst_qpixmap.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 7b522f5..5a43de7 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -833,14 +833,21 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers if (QPixmapCache::find(key, *this)) return true; - QPixmapData *tmp = QPixmapData::create(0, 0, QPixmapData::PixmapType); - if (tmp->fromFile(fileName, format, flags)) { - data = tmp; - QPixmapCache::insert(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(); } - delete tmp; - return false; + + if (ok) + QPixmapCache::insert(key, *this); + + return ok; } /*! diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index 0164c9d..0d60ed0 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -171,6 +171,8 @@ private slots: void preserveDepth(); void splash_crash(); + + void loadAsBitmapOrPixmap(); }; static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) @@ -1510,5 +1512,41 @@ void tst_QPixmap::preserveDepth() QCOMPARE(depth, source.depth()); } +void tst_QPixmap::loadAsBitmapOrPixmap() +{ + QImage tmp(10, 10, QImage::Format_RGB32); + tmp.save("tmp.png"); + + bool ok; + + // Check that we can load the pixmap as a pixmap and that it then turns into a pixmap + QPixmap pixmap("tmp.png"); + QVERIFY(!pixmap.isNull()); + QVERIFY(pixmap.depth() > 1); + QVERIFY(!pixmap.isQBitmap()); + + pixmap = QPixmap(); + ok = pixmap.load("tmp.png"); + QVERIFY(ok); + QVERIFY(!pixmap.isNull()); + QVERIFY(pixmap.depth() > 1); + QVERIFY(!pixmap.isQBitmap()); + + // The do the same check for bitmaps.. + QBitmap bitmap("tmp.png"); + QVERIFY(!bitmap.isNull()); + QVERIFY(bitmap.depth() == 1); + QVERIFY(bitmap.isQBitmap()); + + bitmap = QBitmap(); + ok = bitmap.load("tmp.png"); + QVERIFY(ok); + QVERIFY(!bitmap.isNull()); + QVERIFY(bitmap.depth() == 1); + QVERIFY(bitmap.isQBitmap()); +} + + + QTEST_MAIN(tst_QPixmap) #include "tst_qpixmap.moc" -- cgit v0.12 From 13b00abc9316cdbd2ebc1cd3311ea210a9176b6e Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 20 Jan 2010 11:50:26 +0200 Subject: Generic solution for plugin stub exports for IBY usage Previous s60installs specific fix was flawed in that it failed to generate exports when doing clean build. Replaced that with a more generic solution that exports plugin stubs under \epoc32\data\z always. Task-number: QTBUG-6972 Reviewed-by: Janne Anttila --- .../symbian/initprojectdeploy_symbian.cpp | 1 - .../generators/symbian/initprojectdeploy_symbian.h | 2 ++ qmake/generators/symbian/symmake.cpp | 32 ++++++++++++++++++---- qmake/generators/symbian/symmake.h | 5 ++-- src/s60installs/qt.iby | 26 +++++++++--------- src/s60installs/s60installs.pro | 5 ---- 6 files changed, 44 insertions(+), 27 deletions(-) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 755f73f..f3e3c3a 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -46,7 +46,6 @@ #include #include -#define PLUGIN_STUB_DIR "qmakepluginstubs" #define SYSBIN_DIR "\\sys\\bin" #define SUFFIX_DLL "dll" diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.h b/qmake/generators/symbian/initprojectdeploy_symbian.h index 2f43818..e23e6a9 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.h +++ b/qmake/generators/symbian/initprojectdeploy_symbian.h @@ -52,6 +52,8 @@ #include "epocroot.h" +#define PLUGIN_STUB_DIR "qmakepluginstubs" + struct CopyItem { CopyItem(const QString& f, const QString& t) : from(f) , to(t) { } diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index 6e76c9e..20e2d0e 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include "symmake.h" -#include "initprojectdeploy_symbian.h" #include #include @@ -62,6 +61,7 @@ #define BLD_INF_TAG_MMPFILES "prj_mmpfiles" #define BLD_INF_TAG_TESTMMPFILES "prj_testmmpfiles" #define BLD_INF_TAG_EXTENSIONS "prj_extensions" +#define BLD_INF_TAG_EXPORTS "prj_exports" #define RSS_RULES "RSS_RULES" #define RSS_RULES_BASE "RSS_RULES." @@ -202,6 +202,8 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) // Generate pkg files if there are any actual files to deploy bool generatePkg = false; + DeploymentList depList; + if (targetType == TypeExe) { generatePkg = true; } else { @@ -214,10 +216,10 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) } if (generatePkg) { - generatePkgFile(iconFile); + generatePkgFile(iconFile, depList); } - writeBldInfContent(t, generatePkg, iconFile); + writeBldInfContent(t, generatePkg, iconFile, depList); // Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile, // but all required data is not yet available. @@ -272,7 +274,7 @@ bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) return true; } -void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile) +void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList) { QString pkgFilename = QString("%1_template.%2") .arg(fixedTarget) @@ -396,7 +398,6 @@ void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile) } // deploy any additional DEPLOYMENT files - DeploymentList depList; QString remoteTestPath; remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid); @@ -1171,7 +1172,7 @@ void SymbianMakefileGenerator::writeMmpFileRulesPart(QTextStream& t) } } -void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile) +void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList) { // Read user defined bld inf rules @@ -1300,6 +1301,25 @@ void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploy t << item << endl; userBldInfRules.remove(BLD_INF_TAG_EXTENSIONS); + t << endl << BLD_INF_TAG_EXPORTS << endl << endl; + + // Generate export rules + + // Export any deployed plugin stubs under /epoc32/data/z to support ROM builds + for (int i = 0; i < depList.size(); ++i) { + int index = depList.at(i).from.indexOf(PLUGIN_STUB_DIR); + if (index != -1) { + t << QString("%1 /epoc32/data/z%2") + .arg(QString(depList.at(i).from).mid(index).replace('\\','/')) + .arg(QString(depList.at(i).to).mid(2).replace('\\','/')) << endl; + } + } + + userItems = userBldInfRules.value(BLD_INF_TAG_EXPORTS); + foreach(QString item, userItems) + t << item << endl; + userBldInfRules.remove(BLD_INF_TAG_EXPORTS); + // Add rest of the user defined content for (QMap::iterator it = userBldInfRules.begin(); it != userBldInfRules.end(); ++it) { diff --git a/qmake/generators/symbian/symmake.h b/qmake/generators/symbian/symmake.h index 45209d1..77d61da 100644 --- a/qmake/generators/symbian/symmake.h +++ b/qmake/generators/symbian/symmake.h @@ -42,6 +42,7 @@ #ifndef SYMMAKEFILE_H #define SYMMAKEFILE_H +#include "initprojectdeploy_symbian.h" #include QT_BEGIN_NAMESPACE @@ -86,7 +87,7 @@ protected: QString canonizePath(const QString& origPath); virtual bool writeMakefile(QTextStream &t); - void generatePkgFile(const QString &iconFile); + void generatePkgFile(const QString &iconFile, DeploymentList &depList); bool containsStartWithItem(const QChar &c, const QStringList& src); virtual void init(); @@ -106,7 +107,7 @@ protected: QString &checkString); void writeHeader(QTextStream &t); - void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile); + void writeBldInfContent(QTextStream& t, bool addDeploymentExtension, const QString &iconFile, DeploymentList &depList); static bool removeDuplicatedStrings(QStringList& stringList); diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby index f24ac4b..bdd668c 100644 --- a/src/s60installs/qt.iby +++ b/src/s60installs/qt.iby @@ -90,27 +90,27 @@ file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll S60_APP_RESOURCE(s60main) // imageformats stubs -data=\epoc32\data\qt\qtlibspluginstubs\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin +data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin // codecs stubs -data=\epoc32\data\qt\qtlibspluginstubs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin -data=\epoc32\data\qt\qtlibspluginstubs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin +data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin // iconengines stubs -data=\epoc32\data\qt\qtlibspluginstubs\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin +data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin // Phonon MMF backend -data=\epoc32\data\qt\qtlibspluginstubs\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin +data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin // graphicssystems -data=\epoc32\data\qt\qtlibspluginstubs\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin +data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin // Stub sis file data=ZSYSTEM\install\qt.sis System\Install\qt.sis diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index bbc758b..55eaee1 100644 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -112,9 +112,4 @@ symbian: { BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)" BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)" - PLUGIN_STUBS = $$files(qmakepluginstubs/*) - for(STUB, PLUGIN_STUBS) { - STUB_FILENAME = $$basename(STUB) - BLD_INF_RULES.prj_exports += "qmakepluginstubs/$${STUB_FILENAME} /epoc32/data/qt/qtlibspluginstubs/$${STUB_FILENAME}" - } } -- cgit v0.12 From baf0f7a203281e3e1184cdfe327fb1dfa6df03ea Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Tue, 19 Jan 2010 19:09:14 +0100 Subject: Add command to qmake to do symbian-uid generation The UID3 as required by symbian has to be auto-generated when the user doesn't supply one. To allow this to be done in a mkspec we need a function to do the hashing. This method adds that. Reviewed-By: Marius Storm-Olsen --- qmake/project.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qmake/project.cpp b/qmake/project.cpp index 2ad6112..c2e033e 100644 --- a/qmake/project.cpp +++ b/qmake/project.cpp @@ -79,7 +79,7 @@ enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, E_FIND, E_SYSTEM, E_UNIQUE, E_QUOTE, E_ESCAPE_EXPAND, E_UPPER, E_LOWER, E_FILES, E_PROMPT, E_RE_ESCAPE, E_REPLACE, - E_SIZE }; + E_SIZE, E_GENERATE_UID }; QMap qmake_expandFunctions() { static QMap *qmake_expand_functions = 0; @@ -111,6 +111,7 @@ QMap qmake_expandFunctions() qmake_expand_functions->insert("prompt", E_PROMPT); qmake_expand_functions->insert("replace", E_REPLACE); qmake_expand_functions->insert("size", E_SIZE); + qmake_expand_functions->insert("generate_uid", E_GENERATE_UID); } return *qmake_expand_functions; } @@ -1864,6 +1865,9 @@ QMakeProject::doProjectExpand(QString func, QStringList args, return doProjectExpand(func, args_list, place); } +// defined in symbian generator +extern QString generate_test_uid(const QString& target); + QStringList QMakeProject::doProjectExpand(QString func, QList args_list, QMap &place) @@ -2301,6 +2305,14 @@ QMakeProject::doProjectExpand(QString func, QList args_list, ret += QString::number(size); } break; } + case E_GENERATE_UID: + if (args.count() != 1) { + fprintf(stderr, "%s:%d: generate_uid(var) requires one argument.\n", + parser.file.toLatin1().constData(), parser.line_no); + } else { + ret += generate_test_uid(args.first()); + } + break; default: { fprintf(stderr, "%s:%d: Unknown replace function: %s\n", parser.file.toLatin1().constData(), parser.line_no, -- cgit v0.12 From 67fbf535e50a0e92ff237f9ad23bf065821ba2a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Wed, 20 Jan 2010 14:12:56 +0100 Subject: Move the labels a bit down so that they align better vertically with the field. This was a "showstopper" for QFormLayout being used in Qt Creator. Task-number: QT-958 Reviewed-by: Michael Goddard --- src/gui/kernel/qformlayout.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp index b44cd50..aebc3a5 100644 --- a/src/gui/kernel/qformlayout.cpp +++ b/src/gui/kernel/qformlayout.cpp @@ -1925,11 +1925,11 @@ void QFormLayoutPrivate::arrangeWidgets(const QVector& layouts, Q /* If the field on the right-hand side is tall, we want the label to be top-aligned, but not too - much. So we introduce a 5 / 4 factor so that it - gets a few extra pixels at the top. + much. So we introduce a 7 / 4 factor so that it + gets some extra pixels at the top. */ height = qMin(height, - qMin(label->sizeHint.height() * 5 / 4, + qMin(label->sizeHint.height() * 7 / 4, label->maxSize.height())); } -- cgit v0.12 From 29423dcc76970253fd5bca43d0abba4876b85b85 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 20 Jan 2010 14:12:49 +0100 Subject: Fix crashes in QByteArray tst_QByteArray is was crashing on linux 64bit. The memory was freed twice, once by qRealloc, and one by QScopePointer::reset This patch will leak if qRealloc fails because of OutOfMemory. But we do not care as it is a corner case. Reviewed-by: Harald Fernengel Reviewed-by: Robert Griebl --- src/corelib/tools/qbytearray.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index d2fbf5a..4049925 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -538,7 +538,7 @@ QByteArray qUncompress(const uchar* data, int nbytes) forever { ulong alloc = len; - d.reset(q_check_ptr(static_cast(qRealloc(d.data(), sizeof(QByteArray::Data) + alloc)))); + d.reset(q_check_ptr(static_cast(qRealloc(d.take(), sizeof(QByteArray::Data) + alloc)))); if (!d) { // we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS qWarning("qUncompress: could not allocate enough memory to uncompress data"); @@ -551,7 +551,7 @@ QByteArray qUncompress(const uchar* data, int nbytes) switch (res) { case Z_OK: if (len != alloc) { - d.reset(q_check_ptr(static_cast(qRealloc(d.data(), sizeof(QByteArray::Data) + len)))); + d.reset(q_check_ptr(static_cast(qRealloc(d.take(), sizeof(QByteArray::Data) + len)))); if (!d) { // we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS qWarning("qUncompress: could not allocate enough memory to uncompress data"); -- cgit v0.12 From 5464cee529a26832517607b764e805bef96ea9f1 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 18 Jan 2010 11:45:07 +0100 Subject: Implemented event filter functions for Symbian. Previously only the symbian specific event filters were called, but now all filters in QApplication, QAbstractEventDispatcher and QInputContext should be called. Task: QT-2629 RevBy: Jason Barron Autotest: Passed --- src/gui/kernel/qapplication_p.h | 6 ++--- src/gui/kernel/qapplication_s60.cpp | 47 +++++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h index f8943a8..9c001ab 100644 --- a/src/gui/kernel/qapplication_p.h +++ b/src/gui/kernel/qapplication_p.h @@ -501,9 +501,9 @@ public: static TUint resolveS60ScanCode(TInt scanCode, TUint keysym); QSet nativeWindows; - int symbianProcessWsEvent(const TWsEvent *event); - int symbianHandleCommand(int command); - int symbianResourceChange(int type); + int symbianProcessWsEvent(const QSymbianEvent *symbianEvent); + int symbianHandleCommand(const QSymbianEvent *symbianEvent); + int symbianResourceChange(const QSymbianEvent *symbianEvent); #endif #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 8c77728..361d231 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1528,6 +1528,12 @@ void QApplication::beep() qt_S60Beep->Play(); } +static inline bool callSymbianEventFilters(const QSymbianEvent *event) +{ + long unused; + return qApp->filterEvent(const_cast(event), &unused); +} + /*! \warning This function is only available on Symbian. \since 4.6 @@ -1544,6 +1550,9 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event) QScopedLoopLevelCounter counter(d->threadData); + if (d->eventDispatcher->filterEvent(const_cast(event))) + return 1; + QWidget *w = qApp ? qApp->focusWidget() : 0; if (w) { QInputContext *ic = w->inputContext(); @@ -1556,29 +1565,34 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event) switch (event->type()) { case QSymbianEvent::WindowServerEvent: - return d->symbianProcessWsEvent(event->windowServerEvent()); + return d->symbianProcessWsEvent(event); case QSymbianEvent::CommandEvent: - return d->symbianHandleCommand(event->command()); + return d->symbianHandleCommand(event); case QSymbianEvent::ResourceChangeEvent: - return d->symbianResourceChange(event->resourceChangeType()); + return d->symbianResourceChange(event); default: return -1; } } -int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) +int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent) { // Qt event handling. Handle some events regardless of if the handle is in our // widget map or not. + const TWsEvent *event = symbianEvent->windowServerEvent(); CCoeControl* control = reinterpret_cast(event->Handle()); const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control); switch (event->Type()) { case EEventPointerEnter: - if (controlInMap) + if (controlInMap) { + callSymbianEventFilters(symbianEvent); return 1; // Qt::Enter will be generated in HandlePointerL + } break; case EEventPointerExit: if (controlInMap) { + if (callSymbianEventFilters(symbianEvent)) + return 1; if (S60) { // mouseEvent outside our window, send leave event to last focused widget QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos, @@ -1591,6 +1605,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) } break; case EEventScreenDeviceChanged: + if (callSymbianEventFilters(symbianEvent)) + return 1; if (S60) S60->updateScreenSize(); if (qt_desktopWidget) { @@ -1603,6 +1619,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) return 0; // Propagate to CONE case EEventWindowVisibilityChanged: if (controlInMap) { + if (callSymbianEventFilters(symbianEvent)) + return 1; const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged(); QWidget *w = QWidgetPrivate::mapper->value(control); if (!w->d_func()->maybeTopData()) @@ -1620,6 +1638,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) } break; case EEventFocusGained: + if (callSymbianEventFilters(symbianEvent)) + return 1; #ifndef QT_NO_CURSOR //re-enable mouse interaction if (S60->mouseInteractionEnabled) { @@ -1633,6 +1653,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event) #endif break; case EEventFocusLost: + if (callSymbianEventFilters(symbianEvent)) + return 1; #ifndef QT_NO_CURSOR //disable mouse as may be moving to application that does not support it if (S60->mouseInteractionEnabled) { @@ -1684,11 +1706,16 @@ bool QApplication::symbianEventFilter(const QSymbianEvent *event) \sa s60EventFilter(), s60ProcessEvent() */ -int QApplicationPrivate::symbianHandleCommand(int command) +int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent) { Q_Q(QApplication); int ret = 0; + if (callSymbianEventFilters(symbianEvent)) + return 1; + + int command = symbianEvent->command(); + switch (command) { #ifdef Q_WS_S60 case EAknSoftkeyExit: { @@ -1728,14 +1755,18 @@ int QApplicationPrivate::symbianHandleCommand(int command) Currently, KEikDynamicLayoutVariantSwitch and KAknsMessageSkinChange are handled. */ -int QApplicationPrivate::symbianResourceChange(int type) +int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent) { int ret = 0; + int type = symbianEvent->resourceChangeType(); + switch (type) { #ifdef Q_WS_S60 case KEikDynamicLayoutVariantSwitch: { + if (callSymbianEventFilters(symbianEvent)) + return 1; if (S60) S60->updateScreenSize(); @@ -1760,6 +1791,8 @@ int QApplicationPrivate::symbianResourceChange(int type) #ifndef QT_NO_STYLE_S60 case KAknsMessageSkinChange: + if (callSymbianEventFilters(symbianEvent)) + return 1; if (QS60Style *s60Style = qobject_cast(QApplication::style())) { s60Style->d_func()->handleSkinChange(); ret = 1; -- cgit v0.12 From 9bfabc79567355bc0e5502bfc04e74e70e3488b4 Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 18 Jan 2010 13:53:11 +0100 Subject: Corrected alphabetic order in the docs for events. RevBy: Trust me --- src/corelib/kernel/qcoreevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 1b167e2..3f69b4f 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -107,13 +107,13 @@ QT_BEGIN_NAMESPACE \value ApplicationLayoutDirectionChange The default application layout direction has changed. \value ApplicationPaletteChange The default application palette has changed. \value ApplicationWindowIconChange The application's icon has changed. - \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP). \value ChildAdded An object gets a child (QChildEvent). \value ChildInserted An object gets a child (QChildEvent). Qt3Support only, use ChildAdded instead. \value ChildPolished A widget child gets polished (QChildEvent). \value ChildRemoved An object loses a child (QChildEvent). \value Clipboard The clipboard contents have changed (QClipboardEvent). \value Close Widget was closed (QCloseEvent). + \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP). \value ContentsRectChange The margins of the widget's content rect changed. \value ContextMenu Context popup menu (QContextMenuEvent). \value CursorChange The widget's cursor has changed. -- cgit v0.12 From e7b0998325a66ecb9f979f253d732db85e1f43d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 19 Jan 2010 16:52:22 +0100 Subject: QGraphicsItem::hasFocus() performance regression. Problem was that we always climbed the parent chain to look for a panel item (QGraphicsItem::isActive()) before checking the scene's focus item. Task-number: QTBUG-6749 Reviewed-by: alexis --- src/gui/graphicsview/qgraphicsitem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index cae9660..1361a89 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -2997,9 +2997,16 @@ void QGraphicsItem::setActive(bool active) */ bool QGraphicsItem::hasFocus() const { + if (!d_ptr->scene || !d_ptr->scene->isActive()) + return false; + if (d_ptr->focusProxy) return d_ptr->focusProxy->hasFocus(); - return isActive() && (d_ptr->scene && d_ptr->scene->focusItem() == this); + + if (d_ptr->scene->d_func()->focusItem != this) + return false; + + return panel() == d_ptr->scene->d_func()->activePanel; } /*! -- cgit v0.12 From c3637e53cb4e4d64a60664874f15292982acbdbd Mon Sep 17 00:00:00 2001 From: David Boddie Date: Wed, 20 Jan 2010 17:47:23 +0100 Subject: Doc: Fixed some earlier incorrect documentation fixes. Reviewed-by: Trust Me --- doc/src/getting-started/examples.qdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index 2582c4f..6b4ec61 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -648,10 +648,10 @@ These examples show the use of graphics widgets and layouts. \list - \o \l{graphicsview/anchorlayouts}{Anchor Layouts} + \o \l{graphicsview/anchorlayout}{Anchor Layout} \o \l{graphicsview/flowlayout}{Flow Layout} - \o \l{graphicsview/simpleanchorlayouts}{Simple Anchor Layouts} - \o \l{graphicsview/weatheranchorlayouts}{Weather Anchor Layouts} + \o \l{graphicsview/simpleanchorlayout}{Simple Anchor Layout} + \o \l{graphicsview/weatheranchorlayout}{Weather Anchor Layout} \endlist Some examples demonstrate the use of graphics effects with canvas items. -- cgit v0.12 From cd5e75810d59ab6e92c88189015aee77448160e4 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 20 Jan 2010 16:30:37 +0100 Subject: 1st attempt at USB serial port enumerator for linux Enumerate the ACM ports which are created in /dev after plugging in the phone. Tested on Kubuntu (karmic koala), using 5800XM and N95. Linux has two USB drivers of interest. 1: CDC-ACM, this loads automatically, and creates /dev/ttyACM for the USB modem interface 2: USBSERIAL, this needs to be loaded manually using modprobe, and creates /dev/ttyUSB for each ACM interface on the phone The second ttyUSB port is the one we need, this enumerator does not pick the correct port yet. (1st port is ECACM:0, i.e. the modem, 2nd port is ECACM:1, i.e. the general purpose port used by TRK) according to lsusb, the 1st ACM descriptor has: class 2 (comms) subclass 2 (abstract - modem) protocol 1 (AT commands) 2nd ACM descriptor has: class 2 (comms) subclass 2 (abstract - modem) protocol 255 (vendor specific) Linux 2.6.33 RC3 has a hardcoded list of nokia phones in cdc-acm.c for which the protocol 255 ACM port will be recognised as a second ttyACM Task-number: QTBUG-7446 Reviewed-by: Miikka Heikkinen --- tools/runonphone/main.cpp | 4 +++ tools/runonphone/runonphone.pro | 6 ++++ tools/runonphone/serenum_stub.cpp | 53 ++++++++++++++++++++++++++++++++ tools/runonphone/serenum_unix.cpp | 64 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 tools/runonphone/serenum_stub.cpp create mode 100644 tools/runonphone/serenum_unix.cpp diff --git a/tools/runonphone/main.cpp b/tools/runonphone/main.cpp index d8c306f..c7fc43f 100644 --- a/tools/runonphone/main.cpp +++ b/tools/runonphone/main.cpp @@ -175,7 +175,11 @@ int main(int argc, char *argv[]) } if(loglevel > 0) outstream << "Connecting to target via " << serialPortName << endl; +#ifdef Q_OS_WIN launcher->setTrkServerName(QString("\\\\.\\") + serialPortName); +#else + launcher->setTrkServerName(serialPortName); +#endif launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile); launcher->setCommandLineArgs(cmdLine); diff --git a/tools/runonphone/runonphone.pro b/tools/runonphone/runonphone.pro index cf0c055..cb27d1b 100644 --- a/tools/runonphone/runonphone.pro +++ b/tools/runonphone/runonphone.pro @@ -18,3 +18,9 @@ windows { -luuid \ -ladvapi32 } +unix:!symbian { + SOURCES += serenum_unix.cpp +} +else { + SOURCES += serenum_stub.cpp +} diff --git a/tools/runonphone/serenum_stub.cpp b/tools/runonphone/serenum_stub.cpp new file mode 100644 index 0000000..f39765e --- /dev/null +++ b/tools/runonphone/serenum_stub.cpp @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "serenum.h" +#include +#include +#include + +QList enumerateSerialPorts() +{ + QList list; + qWarning() << "enumerateSerialPorts not implemented" << endl; + return list; +} + diff --git a/tools/runonphone/serenum_unix.cpp b/tools/runonphone/serenum_unix.cpp new file mode 100644 index 0000000..ca6c437 --- /dev/null +++ b/tools/runonphone/serenum_unix.cpp @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "serenum.h" +#include +#include +#include +#include +#include + +QList enumerateSerialPorts() +{ + QList list; + QDir dir("/dev/serial/by-id/"); + QFileInfoList ports(dir.entryInfoList()); + foreach(QFileInfo info, ports) { + if (!info.isDir()) { + SerialPortId id; + id.friendlyName = info.fileName(); + id.portName = info.canonicalFilePath(); + list << id; + } + } + return list; +} + -- cgit v0.12 From f7a9d99a39a2d2f2936ca2fa2802721d4b56ed00 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Fri, 15 Jan 2010 12:50:18 -0800 Subject: Fix semitransparent windows with DirectFB This filling of the window surface is a bug. Reviewed-by: Jervey Kong --- src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index cb9c921..6764e75 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -378,9 +378,6 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion ®ion, return; } screen->flipSurface(dfbSurface, flipFlags, region, offset); - if (noSystemBackground) { - dfbSurface->Clear(dfbSurface, 0, 0, 0, 0); - } #else setOpaque(windowOpacity != 0xff); if (mode == Offscreen) { -- cgit v0.12 From a5834ce3f97c1a8e01f1c7cad51ff02d21a20c68 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 21 Jan 2010 08:27:20 +0100 Subject: uic3: Introduced option to preserve layout object names of Designer 3. Introduce options flag mask for better handling in UI3Reader. Pass on layout name. Task-number: QTBUG-7404 Reviewed-by: Jarek Kobus Initial-patch-by: Andy Shaw --- src/tools/uic3/converter.cpp | 20 ++++++++++++++------ src/tools/uic3/form.cpp | 8 ++++---- src/tools/uic3/main.cpp | 18 ++++++++---------- src/tools/uic3/ui3reader.cpp | 22 +++++++--------------- src/tools/uic3/ui3reader.h | 16 +++++++++------- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/tools/uic3/converter.cpp b/src/tools/uic3/converter.cpp index 8fe2a24..2bf293d 100644 --- a/src/tools/uic3/converter.cpp +++ b/src/tools/uic3/converter.cpp @@ -121,7 +121,7 @@ static inline bool isKDEClass(const QString &className) return className.at(1) .isUpper() && className.at(2).isLower(); } -DomUI *Ui3Reader::generateUi4(const QDomElement &widget, bool implicitIncludes) +DomUI *Ui3Reader::generateUi4(const QDomElement &widget) { QDomNodeList nl; candidateCustomWidgets.clear(); @@ -474,7 +474,7 @@ DomUI *Ui3Reader::generateUi4(const QDomElement &widget, bool implicitIncludes) // Magic header generation feature for legacy KDE forms // (for example, filesharing/advanced/kcm_sambaconf/share.ui) - if (implicitIncludes && isKDEClass(customClass)) { + if ((m_options & ImplicitIncludes) && isKDEClass(customClass)) { QString header = customClass.toLower(); header += QLatin1String(".h"); DomHeader *domHeader = new DomHeader; @@ -710,10 +710,13 @@ DomWidget *Ui3Reader::createWidget(const QDomElement &w, const QString &widgetCl ui_action_list.append(a); } else if (t == QLatin1String("property")) { // skip the property it is already handled by createProperties - - QString name = e.attribute(QLatin1String("name")); // change the varname this widget - if (name == QLatin1String("name")) - ui_widget->setAttributeName(DomTool::readProperty(w, QLatin1String("name"), QVariant()).toString()); + const QString name = e.attribute(QLatin1String("name")); // change the varname this widget + if (name == QLatin1String("name")) { + // Do not name QLayoutWidget if layout names are to be used. + const bool applyName = !(m_options & PreserveLayoutNames) || className != QLatin1String("QLayoutWidget"); + if (applyName) + ui_widget->setAttributeName(DomTool::readProperty(w, QLatin1String("name"), QVariant()).toString()); + } } else if (t == QLatin1String("row")) { DomRow *row = new DomRow(); row->read(e); @@ -797,6 +800,11 @@ DomLayout *Ui3Reader::createLayout(const QDomElement &w) createProperties(w, &ui_property_list, className); createAttributes(w, &ui_attribute_list, className); + if (m_options & PreserveLayoutNames) { + const QString layoutName = getLayoutName(w); + if (!layoutName.isEmpty()) + lay->setAttributeName(layoutName); + } QDomElement e = w.firstChild().toElement(); while (!e.isNull()) { diff --git a/src/tools/uic3/form.cpp b/src/tools/uic3/form.cpp index ac2668b..df1314f 100644 --- a/src/tools/uic3/form.cpp +++ b/src/tools/uic3/form.cpp @@ -100,7 +100,7 @@ QByteArray combinePath(const char *infile, const char *outfile) \sa createFormImpl() */ -void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes) +void Ui3Reader::createFormDecl(const QDomElement &e) { QDomElement body = e; @@ -138,7 +138,7 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes) QString tagName = n3.tagName().toLower(); if (tagName == QLatin1String("class")) { cl = n3.firstChild().toText().data(); - if (!nofwd) + if (m_options & CustomWidgetForwardDeclarations) forwardDecl << cl; customWidgets.insert(cl, 0); } else if (tagName == QLatin1String("header")) { @@ -257,10 +257,10 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes) d.option().copyrightHeader = false; d.option().extractImages = m_extractImages; d.option().qrcOutputFile = m_qrcOutputFile; - d.option().implicitIncludes = implicitIncludes; + d.option().implicitIncludes = (m_options & ImplicitIncludes) ? 1 : 0; if (trmacro.size()) d.option().translateFunction = trmacro; - DomUI *ui = generateUi4(e, implicitIncludes); + DomUI *ui = generateUi4(e); d.uic(fileName, ui, &out); delete ui; diff --git a/src/tools/uic3/main.cpp b/src/tools/uic3/main.cpp index ecc345e..6acc94f 100644 --- a/src/tools/uic3/main.cpp +++ b/src/tools/uic3/main.cpp @@ -78,13 +78,11 @@ int runUic3(int argc, char * argv[]) QByteArray image_tmpfile; const char* projectName = 0; const char* trmacro = 0; - bool nofwd = false; bool fix = false; bool deps = false; - bool implicitIncludes = true; + unsigned readerOptions = Ui3Reader::ImplicitIncludes|Ui3Reader::CustomWidgetForwardDeclarations; QByteArray pchFile; - QApplication app(argc, argv, false); for (int n = 1; n < argc && error == 0; n++) { @@ -146,9 +144,11 @@ int runUic3(int argc, char * argv[]) } else if (opt == "d") { deps = true; } else if (opt == "no-implicit-includes") { - implicitIncludes = false; + readerOptions &= ~Ui3Reader::ImplicitIncludes; } else if (opt == "nofwd") { - nofwd = true; + readerOptions &= ~Ui3Reader::CustomWidgetForwardDeclarations; + } else if (opt == "layout-names") { + readerOptions |= Ui3Reader::PreserveLayoutNames; } else if (opt == "nounload") { // skip } else if (opt == "convert") { @@ -253,6 +253,7 @@ int runUic3(int argc, char * argv[]) "\t-extract qrcFile Create resource file and extract embedded images into \"image\" dir\n" "\t-pch file Add #include \"file\" as the first statement in implementation\n" "\t-nofwd Omit forward declarations of custom classes\n" + "\t-layout-names Preserve layout names of Qt Designer 3\n" "\t-no-implicit-includes Do not generate #include-directives for custom classes\n" "\t-nounload Do not unload plugins after processing\n" "\t-tr func Use func() instead of tr() for i18n\n" @@ -289,9 +290,8 @@ int runUic3(int argc, char * argv[]) QTextStream out(&fileOut); - Ui3Reader ui3(out); + Ui3Reader ui3(out, readerOptions); ui3.setExtractImages(extract, qrcOutputFile); - if (projectName && imagecollection) { out.setEncoding(QTextStream::Latin1); ui3.embed(projectName, images); @@ -349,7 +349,7 @@ int runUic3(int argc, char * argv[]) return 0; } else if (convert) { - ui3.generateUi4(QFile::decodeName(fileName), QFile::decodeName(outputFile), doc, implicitIncludes); + ui3.generateUi4(QFile::decodeName(fileName), QFile::decodeName(outputFile), doc); return 0; } @@ -388,8 +388,6 @@ int runUic3(int argc, char * argv[]) subcl, QString::fromUtf8(trmacro), QString::fromUtf8(className), - nofwd, - implicitIncludes, convertedUi); if (!protector.isEmpty()) { diff --git a/src/tools/uic3/ui3reader.cpp b/src/tools/uic3/ui3reader.cpp index 6c5bda3..fd50a19 100644 --- a/src/tools/uic3/ui3reader.cpp +++ b/src/tools/uic3/ui3reader.cpp @@ -176,7 +176,6 @@ void Ui3Reader::init() { outputFileName.clear(); trmacro.clear(); - nofwd = false; fileName.clear(); writeFunctImpl = true; @@ -241,11 +240,10 @@ QDomElement Ui3Reader::parse(const QDomDocument &doc) return widget; } -Ui3Reader::Ui3Reader(QTextStream &outStream) - : out(outStream), trout(&languageChangeBody) +Ui3Reader::Ui3Reader(QTextStream &outStream, unsigned options) : + m_options(options), out(outStream), trout(&languageChangeBody), + m_porting(new Porting), m_extractImages(false) { - m_porting = new Porting(); - m_extractImages = false; } Ui3Reader::~Ui3Reader() @@ -255,14 +253,13 @@ Ui3Reader::~Ui3Reader() void Ui3Reader::generate(const QString &fn, const QString &outputFn, QDomDocument doc, bool decl, bool subcl, const QString &trm, - const QString& subClass, bool omitForwardDecls, bool implicitIncludes, const QString &convertedUiFile) + const QString& subClass, const QString &convertedUiFile) { init(); fileName = fn; outputFileName = outputFn; trmacro = trm; - nofwd = omitForwardDecls; QDomElement e = parse(doc); @@ -281,21 +278,21 @@ void Ui3Reader::generate(const QString &fn, const QString &outputFn, createSubImpl(e, subClass); } else { if (decl) - createFormDecl(e, implicitIncludes); + createFormDecl(e); else createFormImpl(e); } } -void Ui3Reader::generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc, bool implicitIncludes) +void Ui3Reader::generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc) { init(); fileName = fn; outputFileName = outputFn; - DomUI *ui = generateUi4(parse(doc), implicitIncludes); + DomUI *ui = generateUi4(parse(doc)); if (!ui) return; @@ -317,11 +314,6 @@ void Ui3Reader::setTrMacro(const QString &trmacro) this->trmacro = trmacro; } -void Ui3Reader::setForwardDeclarationsEnabled(bool b) -{ - nofwd = !b; -} - void Ui3Reader::setOutputFileName(const QString &fileName) { outputFileName = fileName; diff --git a/src/tools/uic3/ui3reader.h b/src/tools/uic3/ui3reader.h index cd17835..144ef05 100644 --- a/src/tools/uic3/ui3reader.h +++ b/src/tools/uic3/ui3reader.h @@ -68,23 +68,24 @@ typedef QList > ColorGroup; class Ui3Reader { public: - Ui3Reader(QTextStream &stream); + enum Options { CustomWidgetForwardDeclarations = 0x1, ImplicitIncludes = 0x2, PreserveLayoutNames = 0x4 }; + + explicit Ui3Reader(QTextStream &stream, unsigned options); ~Ui3Reader(); void computeDeps(const QDomElement &e, QStringList &globalIncludes, QStringList &localIncludes, bool impl = false); - void generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc, bool implicitIncludes); + void generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc); void generate(const QString &fn, const QString &outputFn, QDomDocument doc, bool decl, bool subcl, const QString &trm, - const QString& subclname, bool omitForwardDecls, bool implicitIncludes, const QString &convertedUiFile); + const QString& subclname, const QString &convertedUiFile); void embed(const char *project, const QStringList &images); void setTrMacro(const QString &trmacro); - void setForwardDeclarationsEnabled(bool b); void setOutputFileName(const QString &fileName); - void createFormDecl(const QDomElement &e, bool implicitIncludes); + void createFormDecl(const QDomElement &e); void createFormImpl(const QDomElement &e); void createWrapperDecl(const QDomElement &e, const QString &convertedUiFile); @@ -125,7 +126,7 @@ private: void errorInvalidSlot(const QString &slot, const QString &widgetName, const QString &widgetClass, int line, int col); - DomUI *generateUi4(const QDomElement &e, bool implicitIncludes); + DomUI *generateUi4(const QDomElement &e); DomWidget *createWidget(const QDomElement &w, const QString &widgetClass = QString()); void createProperties(const QDomElement &e, QList *properties, const QString &className); void createAttributes(const QDomElement &e, QList *properties, const QString &className); @@ -145,6 +146,8 @@ private: void fixLayoutMargin(DomLayout *ui_layout); + const unsigned m_options; + QTextStream &out; QTextOStream trout; QString languageChangeBody; @@ -157,7 +160,6 @@ private: QString formName; QString lastItem; QString trmacro; - bool nofwd; struct Buddy { -- cgit v0.12 From f6f4e2b73391dcc24382583f9c52f09bb4ced37a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 21 Jan 2010 08:35:49 +0100 Subject: Designer: Fixed a crash when previewing in a non-existent style. Task-number: QTBUG-7432 Reviewed-by: Jarek Kobus --- tools/designer/src/lib/shared/widgetfactory.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/designer/src/lib/shared/widgetfactory.cpp b/tools/designer/src/lib/shared/widgetfactory.cpp index eda551d..c7b13a1 100644 --- a/tools/designer/src/lib/shared/widgetfactory.cpp +++ b/tools/designer/src/lib/shared/widgetfactory.cpp @@ -774,6 +774,8 @@ void WidgetFactory::applyStyleTopLevel(const QString &styleName, QWidget *w) void WidgetFactory::applyStyleToTopLevel(QStyle *style, QWidget *widget) { + if (!style) + return; const QPalette standardPalette = style->standardPalette(); if (widget->style() == style && widget->palette() == standardPalette) return; -- cgit v0.12 From 984c931c4a7385281d0acbc22adb22e49ded768e Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 21 Jan 2010 09:40:24 +0100 Subject: Merge TRK client changes from upstream (QtCreator) commit 1b77161e7183cdd4b5493698b4cddc727468f0f5 Author: hjk Date: Fri Jan 15 12:01:26 2010 +0100 debugger: clean up verbosity settings in trk adapter commit 4d7341becac684f5feb908e45d8b1756b4823c20 Author: hjk Date: Wed Jan 13 14:48:29 2010 +0100 debugger: whitespace commit d3cdfe813444b6afca483c7d13ac80c4c8eda62b Author: hjk Date: Wed Jan 13 14:46:13 2010 +0100 debugger: add some debug output to trk device commit 7cd27f2eecd5f77bc35f6b705c6f0422b09e534d Author: hjk Date: Mon Jan 4 13:17:38 2010 +0100 debugger: add list of thread ids to TRK session state object Reviewed-by: Shane Kearns --- tools/runonphone/trk/trkdevice.cpp | 34 ++++++++++++++++++++++++++++++---- tools/runonphone/trk/trkutils.h | 7 ++++++- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/tools/runonphone/trk/trkdevice.cpp b/tools/runonphone/trk/trkdevice.cpp index 53f4490..fe3261b 100644 --- a/tools/runonphone/trk/trkdevice.cpp +++ b/tools/runonphone/trk/trkdevice.cpp @@ -99,6 +99,8 @@ QString winErrorMessage(unsigned long error) #endif +enum { verboseTrk = 0 }; + namespace trk { /////////////////////////////////////////////////////////////////////// @@ -128,6 +130,12 @@ TrkMessage::TrkMessage(byte c, byte t, TrkCallback cb) : { } +QDebug operator<<(QDebug d, const TrkMessage &msg) +{ + return d << "Message: Code: " << msg.code + << " Token: " << msg.token << " " << msg.data.toHex(); +} + } // namespace trk Q_DECLARE_METATYPE(trk::TrkMessage) @@ -204,6 +212,8 @@ byte TrkWriteQueue::nextTrkWriteToken() ++m_trkWriteToken; if (m_trkWriteToken == 0) ++m_trkWriteToken; + if (verboseTrk) + qDebug() << "Write token: " << m_trkWriteToken; return m_trkWriteToken; } @@ -334,7 +344,8 @@ DeviceContext::DeviceContext() : /////////////////////////////////////////////////////////////////////// -class WriterThread : public QThread { +class WriterThread : public QThread +{ Q_OBJECT Q_DISABLE_COPY(WriterThread) public: @@ -400,15 +411,18 @@ int WriterThread::writePendingMessage() m_waitMutex.unlock(); if (m_terminate) return 1; + // Send off message m_dataMutex.lock(); TrkMessage message; const TrkWriteQueue::PendingMessageResult pr = m_queue.pendingMessage(&message); m_dataMutex.unlock(); + switch (pr) { case TrkWriteQueue::NoMessage: break; case TrkWriteQueue::PendingMessage: { + //qDebug() << "Write pending message " << message; // Untested: try to re-send a few times bool success = false; for (int r = 0; !success && (r < MaxAttempts); r++) { @@ -428,6 +442,8 @@ int WriterThread::writePendingMessage() break; case TrkWriteQueue::NoopMessageDequeued: // Sync with thread that owns us via a blocking signal + if (verboseTrk) + qDebug() << "Noop message dequeued" << message; emit internalNoopMessageDequeued(message); break; } // switch @@ -499,6 +515,8 @@ static inline bool overlappedSyncWrite(HANDLE file, bool WriterThread::write(const QByteArray &data, QString *errorMessage) { + if (verboseTrk) + qDebug() << "Write raw data: " << data.toHex(); QMutexLocker locker(&m_context->mutex); #ifdef Q_OS_WIN DWORD charsWritten; @@ -557,6 +575,7 @@ void WriterThread::slotHandleResult(const TrkResult &result) tryWrite(); // Have messages been enqueued in-between? } + /////////////////////////////////////////////////////////////////////// // // ReaderThreadBase: Base class for a thread that reads data from @@ -566,7 +585,8 @@ void WriterThread::slotHandleResult(const TrkResult &result) // /////////////////////////////////////////////////////////////////////// -class ReaderThreadBase : public QThread { +class ReaderThreadBase : public QThread +{ Q_OBJECT Q_DISABLE_COPY(ReaderThreadBase) public: @@ -625,7 +645,8 @@ void ReaderThreadBase::readMessages() // /////////////////////////////////////////////////////////////////////// -class WinReaderThread : public ReaderThreadBase { +class WinReaderThread : public ReaderThreadBase +{ Q_OBJECT Q_DISABLE_COPY(WinReaderThread) public: @@ -835,7 +856,8 @@ void UnixReaderThread::terminate() { // Trigger select() by writing to the pipe char c = 0; - write(m_terminatePipeFileDescriptors[1], &c, 1); + int written = write(m_terminatePipeFileDescriptors[1], &c, 1); + // FIXME: Use result. wait(); } @@ -1021,6 +1043,8 @@ void TrkDevice::setVerbose(int b) void TrkDevice::slotMessageReceived(const trk::TrkResult &result, const QByteArray &rawData) { d->writerThread->slotHandleResult(result); + if (d->verbose > 1) + qDebug() << "Received: " << result.toString(); emit messageReceived(result); if (!rawData.isEmpty()) emit rawDataReceived(rawData); @@ -1057,6 +1081,8 @@ bool TrkDevice::sendTrkAck(byte token) TrkMessage msg(0x80, token); msg.token = token; msg.data.append('\0'); + if (verboseTrk) + qDebug() << "Write synchroneous message: " << msg; return d->writerThread->trkWriteRawMessage(msg); // 01 90 00 07 7e 80 01 00 7d 5e 7e } diff --git a/tools/runonphone/trk/trkutils.h b/tools/runonphone/trk/trkutils.h index c636ac0..328dd2b 100644 --- a/tools/runonphone/trk/trkutils.h +++ b/tools/runonphone/trk/trkutils.h @@ -119,7 +119,8 @@ struct Library uint dataseg; }; -struct TrkAppVersion { +struct TrkAppVersion +{ TrkAppVersion(); void reset(); @@ -153,6 +154,10 @@ struct Session typedef QList Libraries; Libraries libraries; + typedef uint Thread; + typedef QList Threads; + Threads threads; + // Gdb request uint currentThread; QStringList modules; -- cgit v0.12 From 1d83d3028320bcc071de1ad65e94f821850bd9be Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Tue, 12 Jan 2010 11:05:41 +0100 Subject: Changelog. Adding my changes to the changelog for 4.6.1. --- dist/changes-4.6.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index 3df6887..4a567bb 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -247,6 +247,8 @@ QtSvg * [QTBUG-6867] Fixed regression in the parsing of paths with relative offsets. * [QTBUG-6899] Fixed crash when parsing invalid coordinate list. + - QtXmlPatterns + * [QTBUG-6771] Fixed static builds. Qt Plugins ---------- -- cgit v0.12 From 0481c2dfbbcc59b76bde3f72fbe6d1e4003c913a Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Thu, 21 Jan 2010 10:17:29 +0100 Subject: Menubar and dock disappear after hiding a fullscreen widget on Cocoa. The problem here was exiting the full screen mode. In Cocoa we don't activate windows as we do in Carbon, therefore we were not exiting from the full screen mode. This patch adds a check when hiding a window, if the window is in full screen mode then we go through the list of top level windows checking if there are any other visible and not-minimized windows that are also in full screen mode. If none if found, the we exit the full screen mode. Task-number: QTBUG-7312 Reviewed-by: Prasanth --- src/gui/kernel/qwidget_mac.mm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index b18830f..3dbc843 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -3414,6 +3414,38 @@ void QWidgetPrivate::hide_sys() ShowHide(window, false); #else [window orderOut:window]; + // Unfortunately it is not as easy as just hiding the window, we need + // to find out if we were in full screen mode. If we were and this is + // the last window in full screen mode then we need to unset the full screen + // mode. If this is not the last visible window in full screen mode then we + // don't change the full screen mode. + if(q->isFullScreen()) + { + bool keepFullScreen = false; + QWidgetList windowList = qApp->topLevelWidgets(); + int windowCount = windowList.count(); + for(int i = 0; i < windowCount; i++) + { + QWidget *w = windowList[i]; + // If it is the same window, we don't need to check :-) + if(q == w) + continue; + // If they are not visible or if they are minimized then + // we just ignore them. + if(!w->isVisible() || w->isMinimized()) + continue; + // Is it full screen? + // Notice that if there is one window in full screen mode then we + // cannot switch the full screen mode off, therefore we just abort. + if(w->isFullScreen()) { + keepFullScreen = true; + break; + } + } + // No windows in full screen mode, so let just unset that flag. + if(!keepFullScreen) + qt_mac_set_fullscreen_mode(false); + } #endif toggleDrawers(false); #ifndef QT_MAC_USE_COCOA -- cgit v0.12 From d83e82e5c8a7fa0f6b1dcc4b1ab56f22afd942f6 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 21 Jan 2010 11:10:36 +0100 Subject: Fix pro file error affecting windows builds Reviewed-by: axis --- tools/runonphone/runonphone.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/runonphone/runonphone.pro b/tools/runonphone/runonphone.pro index cb27d1b..2c1be98 100644 --- a/tools/runonphone/runonphone.pro +++ b/tools/runonphone/runonphone.pro @@ -18,7 +18,7 @@ windows { -luuid \ -ladvapi32 } -unix:!symbian { +else:unix:!symbian { SOURCES += serenum_unix.cpp } else { -- cgit v0.12 From a6165c5ec3b16d3f778a2da38d90a8afe8d58cd8 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Thu, 21 Jan 2010 11:26:14 +0100 Subject: Fix missing focus rect for check and radio buttons in some GTK+ themes Some themes such as Nodoka does not draw a focus rect but instead reads the focus flag on the widget itself. Hence we have to set this flag before drawing. Task-number: QTBUG-7504 Reviewed-by: thorbjorn --- src/gui/styles/qgtkstyle.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp index 211f4ce..b5f052b 100644 --- a/src/gui/styles/qgtkstyle.cpp +++ b/src/gui/styles/qgtkstyle.cpp @@ -1106,8 +1106,14 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, // ### Note: Ubuntulooks breaks when the proper widget is passed // Murrine engine requires a widget not to get RGBA check - warnings GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); - gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, QLS("radiobutton")); - + QString key(QLS("radiobutton")); + if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag + key += QLatin1Char('f'); + GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); + } + gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, key); + if (option->state & State_HasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); } break; @@ -1128,6 +1134,11 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, int spacing; GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton")); + QString key(QLS("checkbutton")); + if (option->state & State_HasFocus) { // Themes such as Nodoka checks this flag + key += QLatin1Char('f'); + GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); + } // Some styles such as aero-clone assume they can paint in the spacing area gtkPainter.setClipRect(option->rect); @@ -1137,7 +1148,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element, QRect checkRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing); gtkPainter.paintCheckbox(gtkCheckButton, checkRect, state, shadow, gtkCheckButton->style, - QLS("checkbutton")); + key); + if (option->state & State_HasFocus) + GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS); + } break; -- cgit v0.12 From 967b6980372b3a3b988d2284bdd10b8154482680 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 21 Jan 2010 12:30:31 +0100 Subject: Add qttracereplay.exe to gitignore Reviewed-by: TrustMe --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2069ad5..c8153fc 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ bin/qmake* bin/qdoc3* bin/qt3to4* bin/qtdemo* +bin/qttracereplay* bin/rcc* bin/uic* bin/patternist* -- cgit v0.12 From af30aeb6a1ebb7307f06c122c0c93d152f4d958c Mon Sep 17 00:00:00 2001 From: ck Date: Thu, 21 Jan 2010 12:46:38 +0100 Subject: QtHelp: Enable dynamic translation. Task-number: QTBUG-7420 Reviewed-by: kh1 --- tools/assistant/lib/qhelpsearchquerywidget.cpp | 71 ++++++++++++++++++------- tools/assistant/lib/qhelpsearchquerywidget.h | 3 +- tools/assistant/lib/qhelpsearchresultwidget.cpp | 8 +++ tools/assistant/lib/qhelpsearchresultwidget.h | 1 + 4 files changed, 63 insertions(+), 20 deletions(-) diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index a2b3ca2..b614cb4 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -120,6 +120,22 @@ private: // nothing todo } + void retranslate() + { + simpleSearchLabel->setText(tr("Search for:")); + prevQueryButton->setToolTip(tr("Previous search")); + nextQueryButton->setToolTip(tr("Next search")); + searchButton->setText(tr("Search")); +#ifdef QT_CLUCENE_SUPPORT + advancedSearchLabel->setText(tr("Advanced search")); + similarLabel->setText(tr("words similar to:")); + withoutLabel->setText(tr("without the words:")); + exactLabel->setText(tr("with exact phrase:")); + allLabel->setText(tr("with all of the words:")); + atLeastLabel->setText(tr("with at least one of the words:")); +#endif + } + QString escapeString(const QString &text) { QString retValue = text; @@ -360,6 +376,13 @@ private: friend class QHelpSearchQueryWidget; bool simpleSearch; + QLabel *simpleSearchLabel; + QLabel *advancedSearchLabel; + QLabel *similarLabel; + QLabel *withoutLabel; + QLabel *exactLabel; + QLabel *allLabel; + QLabel *atLeastLabel; QPushButton *searchButton; QWidget* advancedSearchWidget; QToolButton *showHideAdvancedSearchButton; @@ -408,19 +431,17 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent) vLayout->setMargin(0); QHBoxLayout* hBoxLayout = new QHBoxLayout(); - QLabel *label = new QLabel(tr("Search for:"), this); + d->simpleSearchLabel = new QLabel(this); d->defaultQuery = new QLineEdit(this); d->defaultQuery->setCompleter(&d->searchCompleter); d->prevQueryButton = new QToolButton(this); d->prevQueryButton->setArrowType(Qt::LeftArrow); - d->prevQueryButton->setToolTip(tr("Previous search")); d->prevQueryButton->setEnabled(false); d->nextQueryButton = new QToolButton(this); d->nextQueryButton->setArrowType(Qt::RightArrow); - d->nextQueryButton->setToolTip(tr("Next search")); d->nextQueryButton->setEnabled(false); - d->searchButton = new QPushButton(tr("Search"), this); - hBoxLayout->addWidget(label); + d->searchButton = new QPushButton(this); + hBoxLayout->addWidget(d->simpleSearchLabel); hBoxLayout->addWidget(d->defaultQuery); hBoxLayout->addWidget(d->prevQueryButton); hBoxLayout->addWidget(d->nextQueryButton); @@ -439,15 +460,15 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent) d->showHideAdvancedSearchButton->setText(QLatin1String("+")); d->showHideAdvancedSearchButton->setMinimumSize(25, 20); - label = new QLabel(tr("Advanced search"), this); + d->advancedSearchLabel = new QLabel(this); QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); - sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth()); - label->setSizePolicy(sizePolicy); + sizePolicy.setHeightForWidth(d->advancedSearchLabel->sizePolicy().hasHeightForWidth()); + d->advancedSearchLabel->setSizePolicy(sizePolicy); QFrame* hLine = new QFrame(this); hLine->setFrameStyle(QFrame::HLine); hBoxLayout->addWidget(d->showHideAdvancedSearchButton); - hBoxLayout->addWidget(label); + hBoxLayout->addWidget(d->advancedSearchLabel); hBoxLayout->addWidget(hLine); vLayout->addLayout(hBoxLayout); @@ -457,32 +478,32 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent) QGridLayout *gLayout = new QGridLayout(d->advancedSearchWidget); gLayout->setMargin(0); - label = new QLabel(tr("words similar to:"), this); - gLayout->addWidget(label, 0, 0); + d->similarLabel = new QLabel(this); + gLayout->addWidget(d->similarLabel, 0, 0); d->similarQuery = new QLineEdit(this); d->similarQuery->setCompleter(&d->searchCompleter); gLayout->addWidget(d->similarQuery, 0, 1); - label = new QLabel(tr("without the words:"), this); - gLayout->addWidget(label, 1, 0); + d->withoutLabel = new QLabel(this); + gLayout->addWidget(d->withoutLabel, 1, 0); d->withoutQuery = new QLineEdit(this); d->withoutQuery->setCompleter(&d->searchCompleter); gLayout->addWidget(d->withoutQuery, 1, 1); - label = new QLabel(tr("with exact phrase:"), this); - gLayout->addWidget(label, 2, 0); + d->exactLabel = new QLabel(this); + gLayout->addWidget(d->exactLabel, 2, 0); d->exactQuery = new QLineEdit(this); d->exactQuery->setCompleter(&d->searchCompleter); gLayout->addWidget(d->exactQuery, 2, 1); - label = new QLabel(tr("with all of the words:"), this); - gLayout->addWidget(label, 3, 0); + d->allLabel = new QLabel(this); + gLayout->addWidget(d->allLabel, 3, 0); d->allQuery = new QLineEdit(this); d->allQuery->setCompleter(&d->searchCompleter); gLayout->addWidget(d->allQuery, 3, 1); - label = new QLabel(tr("with at least one of the words:"), this); - gLayout->addWidget(label, 4, 0); + d->atLeastLabel = new QLabel(this); + gLayout->addWidget(d->atLeastLabel, 4, 0); d->atLeastQuery = new QLineEdit(this); d->atLeastQuery->setCompleter(&d->searchCompleter); gLayout->addWidget(d->atLeastQuery, 4, 1); @@ -490,6 +511,8 @@ QHelpSearchQueryWidget::QHelpSearchQueryWidget(QWidget *parent) vLayout->addWidget(d->advancedSearchWidget); d->advancedSearchWidget->hide(); + d->retranslate(); + connect(d->exactQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); connect(d->similarQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); connect(d->withoutQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); @@ -531,4 +554,14 @@ void QHelpSearchQueryWidget::focusInEvent(QFocusEvent *focusEvent) } } +/*! \reimp +*/ +void QHelpSearchQueryWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + d->retranslate(); + else + QWidget::changeEvent(event); +} + QT_END_NAMESPACE diff --git a/tools/assistant/lib/qhelpsearchquerywidget.h b/tools/assistant/lib/qhelpsearchquerywidget.h index a99bae0..2afc4b4 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.h +++ b/tools/assistant/lib/qhelpsearchquerywidget.h @@ -74,7 +74,8 @@ Q_SIGNALS: void search(); private: - void focusInEvent(QFocusEvent *focusEvent); + virtual void focusInEvent(QFocusEvent *focusEvent); + virtual void changeEvent(QEvent *event); private: QHelpSearchQueryWidgetPrivate *d; diff --git a/tools/assistant/lib/qhelpsearchresultwidget.cpp b/tools/assistant/lib/qhelpsearchresultwidget.cpp index 3cac880..a3f5aed 100644 --- a/tools/assistant/lib/qhelpsearchresultwidget.cpp +++ b/tools/assistant/lib/qhelpsearchresultwidget.cpp @@ -408,6 +408,14 @@ QHelpSearchResultWidget::QHelpSearchResultWidget(QHelpSearchEngine *engine) connect(engine, SIGNAL(searchingFinished(int)), d, SLOT(setResults(int))); } +/*! \reimp +*/ +void QHelpSearchResultWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) + d->setResults(d->searchEngine->hitCount()); +} + /*! Destroys the search result widget. */ diff --git a/tools/assistant/lib/qhelpsearchresultwidget.h b/tools/assistant/lib/qhelpsearchresultwidget.h index d078079..ff29adc 100644 --- a/tools/assistant/lib/qhelpsearchresultwidget.h +++ b/tools/assistant/lib/qhelpsearchresultwidget.h @@ -75,6 +75,7 @@ private: QHelpSearchResultWidgetPrivate *d; QHelpSearchResultWidget(QHelpSearchEngine *engine); + virtual void changeEvent(QEvent *event); }; QT_END_NAMESPACE -- cgit v0.12 From 694be5a31be7e24761753ab9eccd87e8d08607e0 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 21 Jan 2010 11:28:00 +0100 Subject: qUncompress: Fix terminating \0 Task-number: 6666 Reviewed-by: Harald Fernengel --- src/corelib/tools/qbytearray.cpp | 1 + tests/auto/qbytearray/tst_qbytearray.cpp | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 4049925..556093f 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -561,6 +561,7 @@ QByteArray qUncompress(const uchar* data, int nbytes) d->ref = 1; d->alloc = d->size = len; d->data = d->array; + d->array[len] = 0; return QByteArray(d.take(), 0, 0); diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp index 35e4463..5c72c7a 100644 --- a/tests/auto/qbytearray/tst_qbytearray.cpp +++ b/tests/auto/qbytearray/tst_qbytearray.cpp @@ -76,6 +76,7 @@ private slots: void qCompress(); void qUncompress_data(); void qUncompress(); + void qCompressionZeroTermination(); #endif void constByteArray(); void leftJustified(); @@ -261,6 +262,14 @@ void tst_QByteArray::qUncompress() } QCOMPARE(res, out); } + +void tst_QByteArray::qCompressionZeroTermination() +{ + QString s = "Hello, I'm a string."; + QByteArray ba = ::qUncompress(::qCompress(s.toLocal8Bit())); + QVERIFY((int) *(ba.data() + ba.size()) == 0); +} + #endif void tst_QByteArray::constByteArray() -- cgit v0.12 From 0a9e29a58bd501af2e52f868386b27b29ebb1a72 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 20 Jan 2010 22:37:03 +0100 Subject: QNAM HTTP: make it give some better error messages in case of socket failure. Reviewed-By: Peter Hartmann --- src/network/access/qhttpnetworkconnection.cpp | 7 ++++--- src/network/access/qhttpnetworkconnection_p.h | 3 ++- src/network/access/qhttpnetworkconnectionchannel.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 20baac8..fff7097 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -564,7 +564,8 @@ bool QHttpNetworkConnectionPrivate::fillPipeline(QList &queue, } -QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket) +QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket, + const QString &extraDetail) { Q_ASSERT(socket); @@ -581,7 +582,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection closed")); break; case QNetworkReply::TimeoutError: - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed")); + errorString = QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Socket operation timed out")); break; case QNetworkReply::ProxyAuthenticationRequiredError: errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy requires authentication")); @@ -600,7 +601,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e break; default: // all other errors are treated as QNetworkReply::UnknownNetworkError - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed")); + errorString = extraDetail; break; } return errorString; diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h index 76da883..03cf09c 100644 --- a/src/network/access/qhttpnetworkconnection_p.h +++ b/src/network/access/qhttpnetworkconnection_p.h @@ -185,7 +185,8 @@ public: void createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request); - QString errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket); + QString errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket, + const QString &extraDetail = QString()); #ifndef QT_NO_COMPRESS bool expand(QAbstractSocket *socket, QHttpNetworkReply *reply, bool dataComplete); diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 1955dba..b80ae9a 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -872,7 +872,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket break; } QPointer that = connection; - QString errorString = connection->d_func()->errorDetail(errorCode, socket); + QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString()); if (send2Reply) { if (reply) { reply->d_func()->errorString = errorString; -- cgit v0.12 From b9ef8332db374ef22ebd1045560c4cca1301e2c3 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 21 Jan 2010 14:03:43 +0100 Subject: doc: Documented the return value for QDomNode::appendChild(). Task-number: QTBUG-7498 --- src/xml/dom/qdom.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 657c79a..cae959b 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -2596,11 +2596,15 @@ QDomNode QDomNode::removeChild(const QDomNode& oldChild) already has an element node as a child, \a newChild is not added as a child and a null node is returned. - Calling this function on a null node(created, for example, with the - default constructor) does nothing. + Returns a new reference to \a newChild on success or a \link + isNull() null node\endlink on failure. - The DOM specification disallow inserting attribute nodes, but due - to historical reasons QDom accept them nevertheless. + Calling this function on a null node(created, for example, with + the default constructor) does nothing and returns a \link isNull() + null node\endlink. + + The DOM specification disallow inserting attribute nodes, but for + historical reasons, QDom accepts them anyway. \sa insertBefore() insertAfter() replaceChild() removeChild() */ -- cgit v0.12 From c86ab3fcedd3bcfa195d42d45fb732cb8315319d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 20 Jan 2010 21:06:32 +0100 Subject: SSL Certificate: don't crash when the END CERTIFICATE line ends without CRLF If the file/data ends in the END CERTIFICATE line without a newline, the certificate is still valid. If it's followed by anything other than a newline, then it's no longer valid. Also add another test for the BEGIN CERTIFICATE ending without newline, to ensure we don't crash there either. Reviewed-By: Peter Hartmann --- src/network/ssl/qsslcertificate.cpp | 8 ++++---- .../more-certificates/malformed-just-begin-no-newline.pem | 1 + .../more-certificates/malformed-just-begin.pem | 1 + .../qsslcertificate/more-certificates/no-ending-newline.pem | 13 +++++++++++++ tests/auto/qsslcertificate/tst_qsslcertificate.cpp | 3 +++ 5 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem create mode 100644 tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem create mode 100644 tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 8993e72..9a9b1b5 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -696,11 +696,11 @@ QSslCertificate QSslCertificatePrivate::QSslCertificate_from_X509(X509 *x509) static bool matchLineFeed(const QByteArray &pem, int *offset) { - char ch = pem.at(*offset); + char ch; // ignore extra whitespace at the end of the line - while (ch == ' ' && *offset < pem.size()) - ch = pem.at(++*offset); + while (*offset < pem.size() && (ch = pem.at(*offset)) == ' ') + ++*offset; if (ch == '\n') { *offset += 1; @@ -732,7 +732,7 @@ QList QSslCertificatePrivate::certificatesFromPem(const QByteAr break; offset = endPos + sizeof(ENDCERTSTRING) - 1; - if (!matchLineFeed(pem, &offset)) + if (offset < pem.size() && !matchLineFeed(pem, &offset)) break; QByteArray decoded = QByteArray::fromBase64( diff --git a/tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem new file mode 100644 index 0000000..75f3c32 --- /dev/null +++ b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin-no-newline.pem @@ -0,0 +1 @@ +-----BEGIN CERTIFICATE----- \ No newline at end of file diff --git a/tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem new file mode 100644 index 0000000..a71aecf --- /dev/null +++ b/tests/auto/qsslcertificate/more-certificates/malformed-just-begin.pem @@ -0,0 +1 @@ +-----BEGIN CERTIFICATE----- diff --git a/tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem b/tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem new file mode 100644 index 0000000..f8056c7 --- /dev/null +++ b/tests/auto/qsslcertificate/more-certificates/no-ending-newline.pem @@ -0,0 +1,13 @@ +-----BEGIN CERTIFICATE----- +MIIB8zCCAVwCAREwDQYJKoZIhvcNAQEFBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD +VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNMDcwNDE3MDc0MDI2WhcNMDcwNTE3 +MDc0MDI2WjApMRowGAYDVQQDExFuYW1lL3dpdGgvc2xhc2hlczELMAkGA1UEBhMC +Tk8wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOud6QOsME+pWANExxgmL0iT +1ayg++hTxHsqAYnm/FoMxfUh+NdKkgJn2/GfNppinfPOSI667VqonU+7JBZDTLV5 +CPbZIo9fFQpDJQN6naev4yaxU1VeYFfI7S8c8zYKeGSR+RenNNeLvfH80YxPpZZ1 +snv8IfDH2V8MVxiyr7lLAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAleaU4pgzV6KY ++q9QuXapUYMsC2GiNtDmkG3k+MTHUO8XlE4hqPrIM6rRf7zKQdZ950R2wL9FSnYl +Qm1Tdv38dCka6ivMBqvRuOt9axH3m0G7nzHL7U3zaCbtEx3yVln+b3yYtiVpTuq0 +3MLrt7tQGAW6ra8ISf6YY1W65/uVXZE= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp index 44f8522..c76c11f 100644 --- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp @@ -543,6 +543,9 @@ void tst_QSslCertificate::fromPath_data() QTest::newRow("\"d.*/c.*.pem\" wildcard der") << QString("d.*/c.*.pem") << int(QRegExp::Wildcard) << false << 0; QTest::newRow("trailing-whitespace") << QString("more-certificates/trailing-whitespace.pem") << int(QRegExp::FixedString) << true << 1; + QTest::newRow("no-ending-newline") << QString("more-certificates/no-ending-newline.pem") << int(QRegExp::FixedString) << true << 1; + QTest::newRow("malformed-just-begin") << QString("more-certificates/malformed-just-begin.pem") << int(QRegExp::FixedString) << true << 0; + QTest::newRow("malformed-just-begin-no-newline") << QString("more-certificates/malformed-just-begin-no-newline.pem") << int(QRegExp::FixedString) << true << 0; } void tst_QSslCertificate::fromPath() -- cgit v0.12 From e96c1d6ea945c12fb5de929709ab33c476a63cb5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 21 Jan 2010 11:57:42 +0100 Subject: Revert "Make an empty QUrl also be considered non-detached (d == 0)." as agreed with Warwick. This reverts commit 089ee7094eabb2058b478f5d2f306a69f6c0b3bf. --- src/corelib/io/qurl.cpp | 2 +- tests/auto/qurl/tst_qurl.cpp | 20 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 74e5f74..a131d6c 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -5932,7 +5932,7 @@ void QUrl::detach() */ bool QUrl::isDetached() const { - return d && d->ref == 1; + return !d || d->ref == 1; } diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index ecd6f09..33812fe 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -90,7 +90,6 @@ public slots: private slots: void getSetCheck(); void constructing(); - void isDetached(); void assignment(); void comparison(); void copying(); @@ -319,25 +318,6 @@ void tst_QUrl::constructing() QVERIFY(!buildUNC.isEmpty()); } -void tst_QUrl::isDetached() -{ - QUrl url; - QVERIFY(!url.isDetached()); - - url = "http://qt.nokia.com/"; - QVERIFY(url.isDetached()); - - url.clear(); - QVERIFY(!url.isDetached()); - - url.setHost("qt.nokia.com"); - QVERIFY(url.isDetached()); - - QUrl url2 = url; - QVERIFY(!url.isDetached()); - QVERIFY(!url2.isDetached()); -} - void tst_QUrl::assignment() { QUrl url("http://qt.nokia.com/"); -- cgit v0.12 From c2573f74fb8a09484b385e4469d887bb0fea8cb9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 21 Jan 2010 14:48:34 +0100 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( 8f5ca3ba5da63a47d4f90bbd867d3e8453443dd3 ) Changes in WebKit/qt since the last update: * Girish: Fix positioning of ComboBox popup in QGraphicsWebView. -- https://bugs.webkit.org/show_bug.cgi?id=33887 --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/platform/PopupMenu.h | 2 ++ .../webkit/WebCore/platform/qt/PopupMenuQt.cpp | 21 +++++++++++++++++++-- .../webkit/WebCore/platform/qt/QWebPopup.cpp | 5 +++++ 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 9dd9377..6fe71d6 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 - e15bd5454732bab9ffff4e1e5a755f41fd4e2eff + 8f5ca3ba5da63a47d4f90bbd867d3e8453443dd3 diff --git a/src/3rdparty/webkit/WebCore/platform/PopupMenu.h b/src/3rdparty/webkit/WebCore/platform/PopupMenu.h index 2315f02..f2fffb5 100644 --- a/src/3rdparty/webkit/WebCore/platform/PopupMenu.h +++ b/src/3rdparty/webkit/WebCore/platform/PopupMenu.h @@ -44,6 +44,7 @@ typedef struct HBITMAP__* HBITMAP; namespace WebCore { class QWebPopup; } +class QGraphicsProxyWidget; #elif PLATFORM(GTK) typedef struct _GtkMenu GtkMenu; typedef struct _GtkMenuItem GtkMenuItem; @@ -147,6 +148,7 @@ private: void clear(); void populate(const IntRect&); QWebPopup* m_popup; + QGraphicsProxyWidget* m_proxy; #elif PLATFORM(WIN) // ScrollBarClient virtual void valueChanged(Scrollbar*); diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp index f6ec4f7..989b34c 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp @@ -1,6 +1,7 @@ /* * This file is part of the popup menu implementation for