diff options
94 files changed, 1072 insertions, 1093 deletions
diff --git a/dist/changes-4.6.1 b/dist/changes-4.6.1 index b8994df..cfb82d2 100644 --- a/dist/changes-4.6.1 +++ b/dist/changes-4.6.1 @@ -68,14 +68,56 @@ QtGui - QApplication * [QTBUG-6654] Fix crashes when deleting QWidgets in touch event handlers. - + - QPixmapCache + * Fixed a small leak when using the new QPixmapCAche::Key based API. - QPixmap * load() and loadFromData() can now support compressed GL textures in the DDS, ETC1, PVRTC2, and PVRTC4 formats if the OpenGL graphics system is active and the appropriate extensions are present in the GL implementation. + * [QTBUG-6840] Fixed load() to not modify referenced copies. + * [QTBUG-5840] Fixed a crash in fromImage() when passing in a null image. + * [QTBUG-6116] Fixed memory leak where a global object was not destroyed + at program exit. + - QRasterPixmapData + * [QTBUG-6985] Fixed metric() to return the correct height in mm. - QGraphicsObject * 'id' property was removed. Use the 'objectName' property instead. + - QPrinter + * [QTBUG-3412] QGraphicsProxyWidgets are now rendered correctly when + printing a QGraphicsScene to PDF format. + - QPainter + * [QTBUG-5939] Fixed incorrect redirection matrix that was causing + wrong transformation for QGraphicsProxyWidgets. + * [QTBUG-6684] Added optimizations of 32-bit blend functions + for ARM platforms with NEON support. + - QGraphicsEffect + * [QTBUG-5918] Fixed redraw bugs when using graphics effects on + items while animating them by transformations. + - QGraphicsView + * [QTBUG-6935] When using CacheBackground, the background is now + correctly repainted after the QGraphicsView is shown after being + hidden. + * [QTBUG-6835] Mouse tracking is now automatically enabled when using + AnchorUnderMouse for view transformation. + * [QTBUG-6958] Fix speed regression in _q_polishItems() + * [QTBUG-6544] Fix a crash on the focus chain when removing items from the scene. + * Fix a crash in KDE/Plasma with QGraphicsView with topLevels. + - QGraphicsItem + * [QTBUG-5917] Fixed memory leaks when removing a QGraphicsEffect from + a QGraphicsItem or QWidget with setGraphicsEffect(0). + * [QTBUG-5859] Fixes incorrect rounding of the exposed rectangle of the + QGraphicsItem causing painting issues when scaling the QGraphicsView. + * [QTBUG-5071] Fixes transformation problems when grouping/ungrouping + the item with a QGraphicsItemGroup. + - QGraphicsWidget + * [QTBUG-6272] Only call updateFont if the font have changed. + - QTextDocument + * [QTBUG-5397] Fixed printing of QTextDocuments not including custom + text objects. + + - QTextDocument + * [QTBUG-6051] Fixed an endless loop when printing a QTextDocument. - QGraphicsScene * [QTBUG-6654] Fix crashes when deleting QGraphicsItems in touch @@ -137,6 +179,50 @@ QtOpenGL * bindTexture(QString) now supports DDS, ETC1, PVRTC2, and PVRTC4 compressed textures if the appropriate extensions are present in the GL implementation. + * bindTexture(QImage): Reduce double-copying of textures when flipping. + * [QTBUG-6454] Better EGL extension checking to avoid prefix problems + with EGL_foo matching EGL_foo_bar. + * [QTBUG-6217] Work around problems with glColor4ub() on Intel Q45/Q43 + Express by consistently using glColor4f() everywhere. + * bindTexture(QImage): Fix GL_BGRA formats under OpenGL/ES by using + the same value for both internal and external texture formats. + * [QTBUG-5041] Disable depth testing while in renderText(). + - QGLPaintDevice + * [QTBUG-6204] Rebind window surface fbo after native GL rendering. + - QGLEngineSelector + * [QTBUG-5638] Detect GL2 based on fragment shaders, not programs. + Fragment programs are a GL1 feature. + - QGLFramebufferObject + * [QTBUG-6712] Update docs to better explain how QPainter changes + the GL state when used on an FBO. + - QGLPixmapData + * [QTBUG-6902] Align GL_RGB data on a 4-byte line boundary. + - QTriangulatingStroker + * [QTBUG-6045] Crash in dashed line handling in the GL stroker. + - QGLGlyphCache + * [QTBUG-6936] Fix memory leak of QGLGlyphCoord objects. + - QGLWidget + * [QTBUG-5002, QTBUG-6931] Fixed QGLWidget::renderText(). + * Fixed WA_TranslucentBackground for QGLWidgets on X11/EGL + * Fix EGL surface leaks when re-parenting on X11/EGL + - QGL2PaintEngineEx + * Performance: Don't mark brush as dirty if it hasn't changed + * Performance: Use 3x3 PMV matrices rather than 4x4 + * Performance: Move the 0.5 offset we add for aliased rendering to updateMatrix() + * Performance: Remove superfluous enable/disable vertex arrtib arrays + * Performance: Track the glVertexAttribPointer and only update it if it's changed + * [QTBUG-7094] Introduce new "snapToPixelGrid" flag for drawText + +QtOpenVG +-------- + + - [QT-2555] Automatically destroy VG pixmaps when the last window surface + goes away to reduce memory consumption of backgrounded applications. + - [QTBUG-6639] Recover from out-of-memory when creating VGImage's. + - [QT-2554] Add a VGImage allocation pool to support reclaiming older + images when the GPU runs out of memory. + - [QTBUG-7051] Reset the OpenVG scissor after a native painting call-out. + - [QTBUG-7015] Avoid deep copies of QImage in QImage::bits() calls. QtWebKit -------- @@ -160,8 +246,20 @@ QtScript QtSql ----- - - foo - * bar + - [QTBUG-5373] Fixed QSqlRelationalTableModel doesn't correctly work with relation in other database schema. + - [QTBUG-5298] (OCI) Fixed QSqlDatabase.tables() does not work with system tables. + - [QTBUG-6421] Fixed setForwardOnly() for both OCI and SQLite + - [QTBUG-6618] (ODBC) Fixed segfault when error string is larger than 256 chars. + - [QTBUG-4461] (OCI) Fixed problem with clobs being handled as binary + +QtSvg +----- + + - QSvgRenderer + * [QTBUG-6867] Fixed regression in the parsing of paths with relative + offsets. + * [QTBUG-6899] Fixed crash when parsing invalid coordinate list. + QtXml ----- @@ -172,8 +270,16 @@ QtXml Qt Plugins ---------- - - foo - * bar + - JPEG plugin + * Remove obsolete parameter string handling. + * [QT-2023] Re-implement ScaledSize, ClipRect, ScaledClipRect with + libjpeg features for greater performance. + - PBM plugin + * [QTBUG-6937] Use Mono instead of MonoLSB when writing pbm files. + - TIFF plugin + * [QTBUG-6870] BitsPerSample should default to 1 in TIFF files. + - PNG plugin + * [QTBUG-7161] Avoid a deep copy of QImage::bits() in the png writer. Third party components ---------------------- @@ -203,6 +309,11 @@ Qt for Unix (X11 and Mac OS X) Qt for Linux/X11 ---------------- + - [QTBUG-5732] Fixed querying of GLX extensions under X11. + - [QTBUG-5547] Fixed handling of the "..." button. + - Added new mkspec for Maemo targets (linux-g++-maemo) + - Added new mkspec for Scratchbox host compiler (unsupported/linux-host-g++) + - QGuiEventDispatcherGlib (internal class) * Fix regression introduced in 4.6.0 that could cause X11 event processing to starve timer events. @@ -218,6 +329,7 @@ Qt for Linux/X11 Qt for Windows -------------- + - [QTBUG-5145] Compile fixes for win32-icc. - QAtomicPointer * [QTBUG-6079] Fix compilation for 64-bit Windows targets. @@ -233,6 +345,9 @@ Qt for Windows Qt for Mac OS X --------------- + - QPixmap + * [QTBUG-5070] Fixed a crash on Mac that could occur when loading + pixmaps of different sizes into the same QPixmap object. - [QTBUG-6973] Fixed a memory leak when using QWidget::setWindowIcon() in carbon. - [QTBUG-5186] Fixed a bug which caused drag and drop icons to show incorrectly. diff --git a/doc/src/examples/moveblocks.qdoc b/doc/src/examples/moveblocks.qdoc index 2d0787a..f3e8ce5 100644 --- a/doc/src/examples/moveblocks.qdoc +++ b/doc/src/examples/moveblocks.qdoc @@ -60,7 +60,7 @@ states. \o \c StateSwitchTransition is a custom transition that triggers on \c{StateSwitchEvent}s. - \o \c StateSwitchEvent is a QEvent that trigger \c{StateSwitchTransition}s. + \o \c StateSwitchEvent is a QEvent that triggers \c{StateSwitchTransition}s. \o \c QGraphicsRectWidget is a QGraphicsWidget that simply paints its background in a solid \l{Qt::}{blue} color. \endlist @@ -141,7 +141,7 @@ Finally, we can create the state machine, add our initial state, and start execution of the state graph. - \section2 The \c createGemetryState() Function + \section2 The \c createGeometryState() Function In \c createGeometryState(), we set up the geometry for each graphics item. @@ -155,7 +155,7 @@ \section1 The StateSwitcher Class \c StateSwitcher has state switch transitions to each \l{QState}s - we created with \c createGemetryState(). Its job is to transition + we created with \c createGeometryState(). Its job is to transition to one of these states at random when it is entered. All functions in \c StateSwitcher are inlined. We'll step through diff --git a/examples/animation/moveblocks/main.cpp b/examples/animation/moveblocks/main.cpp index 4475cbb..d70326e 100644 --- a/examples/animation/moveblocks/main.cpp +++ b/examples/animation/moveblocks/main.cpp @@ -147,7 +147,6 @@ QState *createGeometryState(QObject *w1, const QRect &rect1, { QState *result = new QState(parent); result->assignProperty(w1, "geometry", rect1); - result->assignProperty(w1, "geometry", rect1); result->assignProperty(w2, "geometry", rect2); result->assignProperty(w3, "geometry", rect3); result->assignProperty(w4, "geometry", rect4); diff --git a/src/corelib/kernel/qmath.cpp b/src/corelib/kernel/qmath.cpp index e89c1e6..a3586a4 100644 --- a/src/corelib/kernel/qmath.cpp +++ b/src/corelib/kernel/qmath.cpp @@ -44,262 +44,262 @@ QT_BEGIN_NAMESPACE const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = { - 0.0, - 0.024541228522912288, - 0.049067674327418015, - 0.073564563599667426, - 0.098017140329560604, - 0.1224106751992162, - 0.14673047445536175, - 0.17096188876030122, - 0.19509032201612825, - 0.2191012401568698, - 0.24298017990326387, - 0.26671275747489837, - 0.29028467725446233, - 0.31368174039889152, - 0.33688985339222005, - 0.35989503653498811, - 0.38268343236508978, - 0.40524131400498986, - 0.42755509343028208, - 0.44961132965460654, - 0.47139673682599764, - 0.49289819222978404, - 0.51410274419322166, - 0.53499761988709715, - 0.55557023301960218, - 0.57580819141784534, - 0.59569930449243336, - 0.61523159058062682, - 0.63439328416364549, - 0.65317284295377676, - 0.67155895484701833, - 0.68954054473706683, - 0.70710678118654746, - 0.72424708295146689, - 0.74095112535495911, - 0.75720884650648446, - 0.77301045336273699, - 0.78834642762660623, - 0.80320753148064483, - 0.81758481315158371, - 0.83146961230254524, - 0.84485356524970701, - 0.85772861000027212, - 0.87008699110871135, - 0.88192126434835494, - 0.89322430119551532, - 0.90398929312344334, - 0.91420975570353069, - 0.92387953251128674, - 0.93299279883473885, - 0.94154406518302081, - 0.94952818059303667, - 0.95694033573220894, - 0.96377606579543984, - 0.97003125319454397, - 0.97570213003852857, - 0.98078528040323043, - 0.98527764238894122, - 0.98917650996478101, - 0.99247953459870997, - 0.99518472667219682, - 0.99729045667869021, - 0.99879545620517241, - 0.99969881869620425, - 1.0, - 0.99969881869620425, - 0.99879545620517241, - 0.99729045667869021, - 0.99518472667219693, - 0.99247953459870997, - 0.98917650996478101, - 0.98527764238894122, - 0.98078528040323043, - 0.97570213003852857, - 0.97003125319454397, - 0.96377606579543984, - 0.95694033573220894, - 0.94952818059303667, - 0.94154406518302081, - 0.93299279883473885, - 0.92387953251128674, - 0.91420975570353069, - 0.90398929312344345, - 0.89322430119551521, - 0.88192126434835505, - 0.87008699110871146, - 0.85772861000027212, - 0.84485356524970723, - 0.83146961230254546, - 0.81758481315158371, - 0.80320753148064494, - 0.78834642762660634, - 0.7730104533627371, - 0.75720884650648468, - 0.74095112535495899, - 0.72424708295146689, - 0.70710678118654757, - 0.68954054473706705, - 0.67155895484701855, - 0.65317284295377664, - 0.63439328416364549, - 0.61523159058062693, - 0.59569930449243347, - 0.57580819141784545, - 0.55557023301960218, - 0.53499761988709715, - 0.51410274419322177, - 0.49289819222978415, - 0.47139673682599786, - 0.44961132965460687, - 0.42755509343028203, - 0.40524131400498992, - 0.38268343236508989, - 0.35989503653498833, - 0.33688985339222033, - 0.31368174039889141, - 0.29028467725446239, - 0.26671275747489848, - 0.24298017990326407, - 0.21910124015687005, - 0.19509032201612861, - 0.17096188876030122, - 0.1467304744553618, - 0.12241067519921635, - 0.098017140329560826, - 0.073564563599667732, - 0.049067674327417966, - 0.024541228522912326, - 0.0, - -0.02454122852291208, - -0.049067674327417724, - -0.073564563599667496, - -0.09801714032956059, - -0.1224106751992161, - -0.14673047445536158, - -0.17096188876030097, - -0.19509032201612836, - -0.2191012401568698, - -0.24298017990326382, - -0.26671275747489825, - -0.29028467725446211, - -0.31368174039889118, - -0.33688985339222011, - -0.35989503653498811, - -0.38268343236508967, - -0.40524131400498969, - -0.42755509343028181, - -0.44961132965460665, - -0.47139673682599764, - -0.49289819222978393, - -0.51410274419322155, - -0.53499761988709693, - -0.55557023301960196, - -0.57580819141784534, - -0.59569930449243325, - -0.61523159058062671, - -0.63439328416364527, - -0.65317284295377653, - -0.67155895484701844, - -0.68954054473706683, - -0.70710678118654746, - -0.72424708295146678, - -0.74095112535495888, - -0.75720884650648423, - -0.77301045336273666, - -0.78834642762660589, - -0.80320753148064505, - -0.81758481315158382, - -0.83146961230254524, - -0.84485356524970701, - -0.85772861000027201, - -0.87008699110871135, - -0.88192126434835494, - -0.89322430119551521, - -0.90398929312344312, - -0.91420975570353047, - -0.92387953251128652, - -0.93299279883473896, - -0.94154406518302081, - -0.94952818059303667, - -0.95694033573220882, - -0.96377606579543984, - -0.97003125319454397, - -0.97570213003852846, - -0.98078528040323032, - -0.98527764238894111, - -0.9891765099647809, - -0.99247953459871008, - -0.99518472667219693, - -0.99729045667869021, - -0.99879545620517241, - -0.99969881869620425, - -1.0, - -0.99969881869620425, - -0.99879545620517241, - -0.99729045667869021, - -0.99518472667219693, - -0.99247953459871008, - -0.9891765099647809, - -0.98527764238894122, - -0.98078528040323043, - -0.97570213003852857, - -0.97003125319454397, - -0.96377606579543995, - -0.95694033573220894, - -0.94952818059303679, - -0.94154406518302092, - -0.93299279883473907, - -0.92387953251128663, - -0.91420975570353058, - -0.90398929312344334, - -0.89322430119551532, - -0.88192126434835505, - -0.87008699110871146, - -0.85772861000027223, - -0.84485356524970723, - -0.83146961230254546, - -0.81758481315158404, - -0.80320753148064528, - -0.78834642762660612, - -0.77301045336273688, - -0.75720884650648457, - -0.74095112535495911, - -0.724247082951467, - -0.70710678118654768, - -0.68954054473706716, - -0.67155895484701866, - -0.65317284295377709, - -0.63439328416364593, - -0.61523159058062737, - -0.59569930449243325, - -0.57580819141784523, - -0.55557023301960218, - -0.53499761988709726, - -0.51410274419322188, - -0.49289819222978426, - -0.47139673682599792, - -0.44961132965460698, - -0.42755509343028253, - -0.40524131400499042, - -0.38268343236509039, - -0.359895036534988, - -0.33688985339222, - -0.31368174039889152, - -0.2902846772544625, - -0.26671275747489859, - -0.24298017990326418, - -0.21910124015687016, - -0.19509032201612872, - -0.17096188876030177, - -0.14673047445536239, - -0.12241067519921603, - -0.098017140329560506, - -0.073564563599667412, - -0.049067674327418091, - -0.024541228522912448 + qreal(0.0), + qreal(0.024541228522912288), + qreal(0.049067674327418015), + qreal(0.073564563599667426), + qreal(0.098017140329560604), + qreal(0.1224106751992162), + qreal(0.14673047445536175), + qreal(0.17096188876030122), + qreal(0.19509032201612825), + qreal(0.2191012401568698), + qreal(0.24298017990326387), + qreal(0.26671275747489837), + qreal(0.29028467725446233), + qreal(0.31368174039889152), + qreal(0.33688985339222005), + qreal(0.35989503653498811), + qreal(0.38268343236508978), + qreal(0.40524131400498986), + qreal(0.42755509343028208), + qreal(0.44961132965460654), + qreal(0.47139673682599764), + qreal(0.49289819222978404), + qreal(0.51410274419322166), + qreal(0.53499761988709715), + qreal(0.55557023301960218), + qreal(0.57580819141784534), + qreal(0.59569930449243336), + qreal(0.61523159058062682), + qreal(0.63439328416364549), + qreal(0.65317284295377676), + qreal(0.67155895484701833), + qreal(0.68954054473706683), + qreal(0.70710678118654746), + qreal(0.72424708295146689), + qreal(0.74095112535495911), + qreal(0.75720884650648446), + qreal(0.77301045336273699), + qreal(0.78834642762660623), + qreal(0.80320753148064483), + qreal(0.81758481315158371), + qreal(0.83146961230254524), + qreal(0.84485356524970701), + qreal(0.85772861000027212), + qreal(0.87008699110871135), + qreal(0.88192126434835494), + qreal(0.89322430119551532), + qreal(0.90398929312344334), + qreal(0.91420975570353069), + qreal(0.92387953251128674), + qreal(0.93299279883473885), + qreal(0.94154406518302081), + qreal(0.94952818059303667), + qreal(0.95694033573220894), + qreal(0.96377606579543984), + qreal(0.97003125319454397), + qreal(0.97570213003852857), + qreal(0.98078528040323043), + qreal(0.98527764238894122), + qreal(0.98917650996478101), + qreal(0.99247953459870997), + qreal(0.99518472667219682), + qreal(0.99729045667869021), + qreal(0.99879545620517241), + qreal(0.99969881869620425), + qreal(1.0), + qreal(0.99969881869620425), + qreal(0.99879545620517241), + qreal(0.99729045667869021), + qreal(0.99518472667219693), + qreal(0.99247953459870997), + qreal(0.98917650996478101), + qreal(0.98527764238894122), + qreal(0.98078528040323043), + qreal(0.97570213003852857), + qreal(0.97003125319454397), + qreal(0.96377606579543984), + qreal(0.95694033573220894), + qreal(0.94952818059303667), + qreal(0.94154406518302081), + qreal(0.93299279883473885), + qreal(0.92387953251128674), + qreal(0.91420975570353069), + qreal(0.90398929312344345), + qreal(0.89322430119551521), + qreal(0.88192126434835505), + qreal(0.87008699110871146), + qreal(0.85772861000027212), + qreal(0.84485356524970723), + qreal(0.83146961230254546), + qreal(0.81758481315158371), + qreal(0.80320753148064494), + qreal(0.78834642762660634), + qreal(0.7730104533627371), + qreal(0.75720884650648468), + qreal(0.74095112535495899), + qreal(0.72424708295146689), + qreal(0.70710678118654757), + qreal(0.68954054473706705), + qreal(0.67155895484701855), + qreal(0.65317284295377664), + qreal(0.63439328416364549), + qreal(0.61523159058062693), + qreal(0.59569930449243347), + qreal(0.57580819141784545), + qreal(0.55557023301960218), + qreal(0.53499761988709715), + qreal(0.51410274419322177), + qreal(0.49289819222978415), + qreal(0.47139673682599786), + qreal(0.44961132965460687), + qreal(0.42755509343028203), + qreal(0.40524131400498992), + qreal(0.38268343236508989), + qreal(0.35989503653498833), + qreal(0.33688985339222033), + qreal(0.31368174039889141), + qreal(0.29028467725446239), + qreal(0.26671275747489848), + qreal(0.24298017990326407), + qreal(0.21910124015687005), + qreal(0.19509032201612861), + qreal(0.17096188876030122), + qreal(0.1467304744553618), + qreal(0.12241067519921635), + qreal(0.098017140329560826), + qreal(0.073564563599667732), + qreal(0.049067674327417966), + qreal(0.024541228522912326), + qreal(0.0), + qreal(-0.02454122852291208), + qreal(-0.049067674327417724), + qreal(-0.073564563599667496), + qreal(-0.09801714032956059), + qreal(-0.1224106751992161), + qreal(-0.14673047445536158), + qreal(-0.17096188876030097), + qreal(-0.19509032201612836), + qreal(-0.2191012401568698), + qreal(-0.24298017990326382), + qreal(-0.26671275747489825), + qreal(-0.29028467725446211), + qreal(-0.31368174039889118), + qreal(-0.33688985339222011), + qreal(-0.35989503653498811), + qreal(-0.38268343236508967), + qreal(-0.40524131400498969), + qreal(-0.42755509343028181), + qreal(-0.44961132965460665), + qreal(-0.47139673682599764), + qreal(-0.49289819222978393), + qreal(-0.51410274419322155), + qreal(-0.53499761988709693), + qreal(-0.55557023301960196), + qreal(-0.57580819141784534), + qreal(-0.59569930449243325), + qreal(-0.61523159058062671), + qreal(-0.63439328416364527), + qreal(-0.65317284295377653), + qreal(-0.67155895484701844), + qreal(-0.68954054473706683), + qreal(-0.70710678118654746), + qreal(-0.72424708295146678), + qreal(-0.74095112535495888), + qreal(-0.75720884650648423), + qreal(-0.77301045336273666), + qreal(-0.78834642762660589), + qreal(-0.80320753148064505), + qreal(-0.81758481315158382), + qreal(-0.83146961230254524), + qreal(-0.84485356524970701), + qreal(-0.85772861000027201), + qreal(-0.87008699110871135), + qreal(-0.88192126434835494), + qreal(-0.89322430119551521), + qreal(-0.90398929312344312), + qreal(-0.91420975570353047), + qreal(-0.92387953251128652), + qreal(-0.93299279883473896), + qreal(-0.94154406518302081), + qreal(-0.94952818059303667), + qreal(-0.95694033573220882), + qreal(-0.96377606579543984), + qreal(-0.97003125319454397), + qreal(-0.97570213003852846), + qreal(-0.98078528040323032), + qreal(-0.98527764238894111), + qreal(-0.9891765099647809), + qreal(-0.99247953459871008), + qreal(-0.99518472667219693), + qreal(-0.99729045667869021), + qreal(-0.99879545620517241), + qreal(-0.99969881869620425), + qreal(-1.0), + qreal(-0.99969881869620425), + qreal(-0.99879545620517241), + qreal(-0.99729045667869021), + qreal(-0.99518472667219693), + qreal(-0.99247953459871008), + qreal(-0.9891765099647809), + qreal(-0.98527764238894122), + qreal(-0.98078528040323043), + qreal(-0.97570213003852857), + qreal(-0.97003125319454397), + qreal(-0.96377606579543995), + qreal(-0.95694033573220894), + qreal(-0.94952818059303679), + qreal(-0.94154406518302092), + qreal(-0.93299279883473907), + qreal(-0.92387953251128663), + qreal(-0.91420975570353058), + qreal(-0.90398929312344334), + qreal(-0.89322430119551532), + qreal(-0.88192126434835505), + qreal(-0.87008699110871146), + qreal(-0.85772861000027223), + qreal(-0.84485356524970723), + qreal(-0.83146961230254546), + qreal(-0.81758481315158404), + qreal(-0.80320753148064528), + qreal(-0.78834642762660612), + qreal(-0.77301045336273688), + qreal(-0.75720884650648457), + qreal(-0.74095112535495911), + qreal(-0.724247082951467), + qreal(-0.70710678118654768), + qreal(-0.68954054473706716), + qreal(-0.67155895484701866), + qreal(-0.65317284295377709), + qreal(-0.63439328416364593), + qreal(-0.61523159058062737), + qreal(-0.59569930449243325), + qreal(-0.57580819141784523), + qreal(-0.55557023301960218), + qreal(-0.53499761988709726), + qreal(-0.51410274419322188), + qreal(-0.49289819222978426), + qreal(-0.47139673682599792), + qreal(-0.44961132965460698), + qreal(-0.42755509343028253), + qreal(-0.40524131400499042), + qreal(-0.38268343236509039), + qreal(-0.359895036534988), + qreal(-0.33688985339222), + qreal(-0.31368174039889152), + qreal(-0.2902846772544625), + qreal(-0.26671275747489859), + qreal(-0.24298017990326418), + qreal(-0.21910124015687016), + qreal(-0.19509032201612872), + qreal(-0.17096188876030177), + qreal(-0.14673047445536239), + qreal(-0.12241067519921603), + qreal(-0.098017140329560506), + qreal(-0.073564563599667412), + qreal(-0.049067674327418091), + qreal(-0.024541228522912448) }; QT_END_NAMESPACE diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index c70650d..3d59463 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3245,6 +3245,10 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const QString currentLocation = dirModel->rootPath(); QString path = index.data(QFileSystemModel::FilePathRole).toString(); if (!currentLocation.isEmpty() && path.startsWith(currentLocation)) { +#if defined(Q_OS_UNIX) || defined(Q_OS_WINCE) + if (currentLocation == QDir::separator()) + return path.mid(currentLocation.length()); +#endif return path.mid(currentLocation.length() + 1); } return index.data(QFileSystemModel::FilePathRole).toString(); @@ -3300,6 +3304,10 @@ QStringList QFSCompleter::splitPath(const QString &path) const else dirModel = sourceModel; QString currentLocation = QDir::toNativeSeparators(dirModel->rootPath()); +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) + if (currentLocation.endsWith(QLatin1Char(':'))) + currentLocation.append(sep); +#endif if (currentLocation.contains(sep) && path != currentLocation) { QStringList currentLocationList = splitPath(currentLocation); while (!currentLocationList.isEmpty() diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 2a1fba5..cbd9a8a 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -146,9 +146,16 @@ void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index) if (hover == index) return; - q->update(hover); //update the old one + if (selectionBehavior != QAbstractItemView::SelectRows) { + q->update(hover); //update the old one + q->update(index); //update the new one + } else { + QRect oldHoverRect = q->visualRect(hover); + QRect newHoverRect = q->visualRect(index); + viewport->update(QRect(0, newHoverRect.y(), viewport->width(), newHoverRect.height())); + viewport->update(QRect(0, oldHoverRect.y(), viewport->width(), oldHoverRect.height())); + } hover = index; - q->update(hover); //update the new one } void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index) diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index efb8422..d0fa22d 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -1241,15 +1241,6 @@ bool QTreeView::viewportEvent(QEvent *event) viewport()->update(newRect); } } - if (selectionBehavior() == QAbstractItemView::SelectRows) { - QModelIndex newHoverIndex = indexAt(he->pos()); - if (d->hover != newHoverIndex) { - QRect oldHoverRect = visualRect(d->hover); - QRect newHoverRect = visualRect(newHoverIndex); - viewport()->update(QRect(0, newHoverRect.y(), viewport()->width(), newHoverRect.height())); - viewport()->update(QRect(0, oldHoverRect.y(), viewport()->width(), oldHoverRect.height())); - } - } break; } default: break; @@ -2644,10 +2635,13 @@ void QTreeView::selectAll() return; SelectionMode mode = d->selectionMode; d->executePostedLayout(); //make sure we lay out the items - if (mode != SingleSelection && !d->viewItems.isEmpty()) - d->select(d->viewItems.first().index, d->viewItems.last().index, + if (mode != SingleSelection && !d->viewItems.isEmpty()) { + const QModelIndex &idx = d->viewItems.last().index; + QModelIndex lastItemIndex = idx.sibling(idx.row(), d->model->columnCount(idx.parent()) - 1); + d->select(d->viewItems.first().index, lastItemIndex, QItemSelectionModel::ClearAndSelect |QItemSelectionModel::Rows); + } } /*! diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp index 51b3691..ad0c2eb 100644 --- a/src/gui/painting/qoutlinemapper.cpp +++ b/src/gui/painting/qoutlinemapper.cpp @@ -225,9 +225,10 @@ void QOutlineMapper::endOutline() controlPointRect = boundingRect(elements, element_count); #ifdef QT_DEBUG_CONVERT - printf(" - control point rect (%.2f, %.2f) %.2f x %.2f\n", + printf(" - control point rect (%.2f, %.2f) %.2f x %.2f, clip=(%d,%d, %dx%d)\n", controlPointRect.x(), controlPointRect.y(), - controlPointRect.width(), controlPointRect.height()); + controlPointRect.width(), controlPointRect.height(), + m_clip_rect.x(), m_clip_rect.y(), m_clip_rect.width(), m_clip_rect.height()); #endif @@ -235,7 +236,9 @@ void QOutlineMapper::endOutline() const bool do_clip = (controlPointRect.left() < -QT_RASTER_COORD_LIMIT || controlPointRect.right() > QT_RASTER_COORD_LIMIT || controlPointRect.top() < -QT_RASTER_COORD_LIMIT - || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT); + || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT + || controlPointRect.width() > QT_RASTER_COORD_LIMIT + || controlPointRect.height() > QT_RASTER_COORD_LIMIT); if (do_clip) { clipElements(elements, elementTypes(), element_count); diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 0e7adf3..3f2322e 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -475,8 +475,10 @@ bool QRasterPaintEngine::begin(QPaintDevice *device) QRasterPaintEngineState *s = state(); ensureOutlineMapper(); d->outlineMapper->m_clip_rect = d->deviceRect.adjusted(-10, -10, 10, 10); + + // This is the upp QRect bounds(-QT_RASTER_COORD_LIMIT, -QT_RASTER_COORD_LIMIT, - 2*QT_RASTER_COORD_LIMIT, 2*QT_RASTER_COORD_LIMIT); + QT_RASTER_COORD_LIMIT*2 - 1, QT_RASTER_COORD_LIMIT * 2 - 1); d->outlineMapper->m_clip_rect = bounds.intersected(d->outlineMapper->m_clip_rect); diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 3c07451..058f226 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -860,7 +860,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount) for (int i=0; i<count; ++i) { pts[++oset] = points[i].x(); pts[++oset] = points[i].y(); - pts[++oset] = points[i].x() + 0.001; + pts[++oset] = points[i].x() + 1/63.; pts[++oset] = points[i].y(); } QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint); @@ -870,7 +870,7 @@ void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount) } } else { for (int i=0; i<pointCount; ++i) { - qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 0.001, points[i].y() }; + qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 1/63., points[i].y() }; QVectorPath path(pts, 2, 0); stroke(path, pen); } @@ -891,7 +891,7 @@ void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount) for (int i=0; i<count; ++i) { pts[++oset] = points[i].x(); pts[++oset] = points[i].y(); - pts[++oset] = points[i].x() + 0.001; + pts[++oset] = points[i].x() + 1/63; pts[++oset] = points[i].y(); } QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint); @@ -901,7 +901,7 @@ void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount) } } else { for (int i=0; i<pointCount; ++i) { - qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + 0.001, points[i].y() }; + qreal pts[] = { points[i].x(), points[i].y(), points[i].x() +1/63., points[i].y() }; QVectorPath path(pts, 2, 0); stroke(path, pen); } diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index be01549..43f548f 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -97,6 +97,7 @@ public: flags(0) { int ptsPos = 0; + bool isLines = true; for (int i=0; i<path.size(); ++i) { const QPainterPath::Element &e = path.at(i); elements[i] = e.type; @@ -104,6 +105,11 @@ public: points[ptsPos++] = e.y; if (e.type == QPainterPath::CurveToElement) flags |= QVectorPath::CurvedShapeMask; + + // This is to check if the path contains only alternating lineTo/moveTo, + // in which case we can set the LinesHint in the path. MoveTo is 0 and + // LineTo is 1 so the i%2 gets us what we want cheaply. + isLines = isLines && e.type == (QPainterPath::ElementType) (i%2); } if (fillRule == Qt::WindingFill) @@ -111,8 +117,14 @@ public: else flags |= QVectorPath::OddEvenFill; - if (!convex) - flags |= QVectorPath::NonConvexShapeMask; + if (isLines) + flags |= QVectorPath::LinesShapeMask; + else { + flags |= QVectorPath::AreaShapeMask; + if (!convex) + flags |= QVectorPath::NonConvexShapeMask; + } + } QVarLengthArray<QPainterPath::ElementType> elements; QVarLengthArray<qreal> points; diff --git a/src/gui/styles/qcleanlooksstyle.cpp b/src/gui/styles/qcleanlooksstyle.cpp index 49dd47d..0f39b23 100644 --- a/src/gui/styles/qcleanlooksstyle.cpp +++ b/src/gui/styles/qcleanlooksstyle.cpp @@ -2069,7 +2069,7 @@ void QCleanlooksStyle::drawControl(ControlElement element, const QStyleOption *o // This is mainly to handle cases where someone sets the font on the window // and then the combo inherits it and passes it onward. At that point the resolve mask // is very, very weak. This makes it stonger. - font.setPointSizeF(menuItem->font.pointSizeF()); + font.setPointSizeF(QFontInfo(menuItem->font).pointSizeF()); if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem) font.setBold(true); diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index ecb7453..97d69b2 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3996,7 +3996,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter // This is mainly to handle cases where someone sets the font on the window // and then the combo inherits it and passes it onward. At that point the resolve mask // is very, very weak. This makes it stonger. - myFont.setPointSizeF(mi->font.pointSizeF()); + myFont.setPointSizeF(QFontInfo(mi->font).pointSizeF()); p->setFont(myFont); p->drawText(xpos, yPos, contentRect.width() - xm - tabwidth + 1, contentRect.height(), text_flags ^ Qt::AlignRight, s); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 23818b2..ca0b8c7 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -343,7 +343,8 @@ bool QS60StylePrivate::drawsOwnThemeBackground(const QWidget *widget) } QFont QS60StylePrivate::s60Font( - QS60StyleEnums::FontCategories fontCategory, int pointSize) const + QS60StyleEnums::FontCategories fontCategory, + int pointSize, bool resolveFontSize) const { QFont result; int actualPointSize = pointSize; @@ -356,7 +357,7 @@ QFont QS60StylePrivate::s60Font( Q_ASSERT(actualPointSize > 0); const QPair<QS60StyleEnums::FontCategories, int> key(fontCategory, actualPointSize); if (!m_mappedFontsCache.contains(key)) { - result = s60Font_specific(fontCategory, actualPointSize); + result = s60Font_specific(fontCategory, actualPointSize, resolveFontSize); m_mappedFontsCache.insert(key, result); } else { result = m_mappedFontsCache.value(key); @@ -620,8 +621,10 @@ void QS60StylePrivate::setFont(QWidget *widget) const fontCategory = QS60StyleEnums::FC_Title; } if (fontCategory != QS60StyleEnums::FC_Undefined) { + const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont) + && (widget->font().resolve() & QFont::SizeResolved); const QFont suggestedFont = - s60Font(fontCategory, widget->font().pointSizeF()); + s60Font(fontCategory, widget->font().pointSizeF(), resolveFontSize); widget->setFont(suggestedFont); } } diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 11137a4..1417552 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -401,7 +401,7 @@ public: static bool drawsOwnThemeBackground(const QWidget *widget); QFont s60Font(QS60StyleEnums::FontCategories fontCategory, - int pointSize = -1) const; + int pointSize = -1, bool resolveFontSize = true) const; // clears all style caches (fonts, colors, pixmaps) void clearCaches(CacheClearReason reason = CC_UndefinedChange); @@ -484,7 +484,8 @@ private: static QPixmap part(QS60StyleEnums::SkinParts part, const QSize &size, QPainter *painter, SkinElementFlags flags = KDefaultSkinElementFlags); - static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize); + static QFont s60Font_specific(QS60StyleEnums::FontCategories fontCategory, + int pointSize, bool resolveFontSize); static QSize screenSize(); diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index 4767264..be61073 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -909,8 +909,11 @@ TAknsItemID QS60StyleModeSpecifics::partSpecificThemeId(int part) } QFont QS60StylePrivate::s60Font_specific( - QS60StyleEnums::FontCategories fontCategory, int pointSize) + QS60StyleEnums::FontCategories fontCategory, + int pointSize, bool resolveFontSize) { + Q_UNUSED(resolveFontSize); + TAknFontCategory aknFontCategory = EAknFontCategoryUndefined; switch (fontCategory) { case QS60StyleEnums::FC_Primary: diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp index 4499f06..bd43eb7 100644 --- a/src/gui/styles/qs60style_simulated.cpp +++ b/src/gui/styles/qs60style_simulated.cpp @@ -342,10 +342,13 @@ bool QS60StylePrivate::hasSliderGrooveGraphic() return false; } -QFont QS60StylePrivate::s60Font_specific(QS60StyleEnums::FontCategories fontCategory, int pointSize) +QFont QS60StylePrivate::s60Font_specific( + QS60StyleEnums::FontCategories fontCategory, + int pointSize, bool resolveFontSize) { QFont result; - result.setPointSize(pointSize); + if (resolveFontSize) + result.setPointSize(pointSize); switch (fontCategory) { case QS60StyleEnums::FC_Primary: result.setBold(true); diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index d147ad7..4c57dff 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1780,7 +1780,7 @@ Q_GLOBAL_STATIC(QFontSubst, globalFontSubst) static void initFontSubst() { // default substitutions - static const char *initTbl[] = { + static const char * const initTbl[] = { #if defined(Q_WS_X11) "arial", "helvetica", @@ -1812,7 +1812,6 @@ static void initFontSubst() } } - /*! Returns the first family name to be used whenever \a familyName is specified. The lookup is case insensitive. diff --git a/src/gui/widgets/qspinbox.cpp b/src/gui/widgets/qspinbox.cpp index f00296c..726426d 100644 --- a/src/gui/widgets/qspinbox.cpp +++ b/src/gui/widgets/qspinbox.cpp @@ -99,6 +99,10 @@ public: Q_Q(QDoubleSpinBox); q->setInputMethodHints(Qt::ImhFormattedNumbersOnly); } + + // When fiddling with the decimals property, we may lose precision in these properties. + double actualMin; + double actualMax; }; @@ -762,6 +766,7 @@ double QDoubleSpinBox::minimum() const void QDoubleSpinBox::setMinimum(double minimum) { Q_D(QDoubleSpinBox); + d->actualMin = minimum; const QVariant m(d->round(minimum)); d->setRange(m, (d->variantCompare(d->maximum, m) > 0 ? d->maximum : m)); } @@ -792,6 +797,7 @@ double QDoubleSpinBox::maximum() const void QDoubleSpinBox::setMaximum(double maximum) { Q_D(QDoubleSpinBox); + d->actualMax = maximum; const QVariant m(d->round(maximum)); d->setRange((d->variantCompare(d->minimum, m) < 0 ? d->minimum : m), m); } @@ -813,6 +819,8 @@ void QDoubleSpinBox::setMaximum(double maximum) void QDoubleSpinBox::setRange(double minimum, double maximum) { Q_D(QDoubleSpinBox); + d->actualMin = minimum; + d->actualMax = maximum; d->setRange(QVariant(d->round(minimum)), QVariant(d->round(maximum))); } @@ -843,7 +851,7 @@ void QDoubleSpinBox::setDecimals(int decimals) Q_D(QDoubleSpinBox); d->decimals = qBound(0, decimals, DBL_MAX_10_EXP + DBL_DIG); - setRange(minimum(), maximum()); // make sure values are rounded + setRange(d->actualMin, d->actualMax); // make sure values are rounded setValue(value()); } @@ -1051,8 +1059,10 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, QDoubleSpinBoxPrivate::QDoubleSpinBoxPrivate() { - minimum = QVariant(0.0); - maximum = QVariant(99.99); + actualMin = 0.0; + actualMax = 99.99; + minimum = QVariant(actualMin); + maximum = QVariant(actualMax); value = minimum; singleStep = QVariant(1.0); decimals = 2; diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index 6fc4284..da39c4a 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE audio = new QAudioInput(format, this); QTimer::singleShot(3000, this, SLOT(stopRecording())); - audio->start(outputFile); + audio->start(&outputFile); // Records audio for 3000ms } \endcode diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 6b65886..caa679b 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -580,19 +580,19 @@ void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode) } if (newMode == TextDrawingMode) { - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data()); - glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data()); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data()); + setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data()); } if (newMode == ImageDrawingMode) { - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticVertexCoordinateArray); - glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticTextureCoordinateArray); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, staticVertexCoordinateArray); + setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, staticTextureCoordinateArray); } if (newMode == ImageArrayDrawingMode) { - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data()); - glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data()); - glVertexAttribPointer(QT_OPACITY_ATTR, 1, GL_FLOAT, GL_FALSE, 0, opacityArray.data()); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data()); + setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data()); + setVertexAttributePointer(QT_OPACITY_ATTR, (GLfloat*)opacityArray.data()); } // This needs to change when we implement high-quality anti-aliasing... @@ -707,9 +707,9 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) prepareForDraw(currentBrush.isOpaque()); #ifdef QT_OPENGL_CACHE_AS_VBOS glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, 0); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); #else - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, cache->vertices); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); #endif glDrawArrays(cache->primitiveType, 0, cache->vertexCount); @@ -829,7 +829,7 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data, glStencilMask(GL_STENCIL_HIGH_BIT); #if 0 glStencilOp(GL_KEEP, GL_KEEP, GL_INVERT); // Simply invert the stencil bit - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, data); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, data); glDrawArrays(GL_TRIANGLE_STRIP, 0, count); #else @@ -840,7 +840,7 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(const float *data, } else { glStencilFunc(GL_ALWAYS, GL_STENCIL_HIGH_BIT, 0xff); } - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, data); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, data); glDrawArrays(GL_TRIANGLE_STRIP, 0, count); #endif } @@ -954,15 +954,8 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque) void QGL2PaintEngineExPrivate::composite(const QGLRect& boundingRect) { - // Setup a vertex array for the bounding rect: - GLfloat rectVerts[] = { - boundingRect.left, boundingRect.top, - boundingRect.left, boundingRect.bottom, - boundingRect.right, boundingRect.bottom, - boundingRect.right, boundingRect.top - }; - - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, rectVerts); + setCoords(staticVertexCoordinateArray, boundingRect); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, staticVertexCoordinateArray); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } @@ -971,7 +964,7 @@ void QGL2PaintEngineExPrivate::drawVertexArrays(const float *data, int *stops, i GLenum primitive) { // Now setup the pointer to the vertex array: - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, data); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)data); int previousStop = 0; for (int i=0; i<stopCount; ++i) { @@ -1070,7 +1063,7 @@ void QGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &pen) if (opaque) { prepareForDraw(opaque); - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, false, 0, stroker.vertices()); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, stroker.vertices()); glDrawArrays(GL_TRIANGLE_STRIP, 0, stroker.vertexCount() / 2); // QBrush b(Qt::green); @@ -1291,9 +1284,6 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly GLfloat dx = 1.0 / cache->width(); GLfloat dy = 1.0 / cache->height(); - QGLPoint *oldVertexCoordinateDataPtr = vertexCoordinateArray.data(); - QGLPoint *oldTextureCoordinateDataPtr = textureCoordinateArray.data(); - vertexCoordinateArray.clear(); textureCoordinateArray.clear(); @@ -1306,10 +1296,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly textureCoordinateArray.addRect(QRectF(c.x*dx, c.y*dy, c.w * dx, c.h * dy)); } - if (vertexCoordinateArray.data() != oldVertexCoordinateDataPtr) - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data()); - if (textureCoordinateArray.data() != oldTextureCoordinateDataPtr) - glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data()); + setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, (GLfloat*)vertexCoordinateArray.data()); + setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, (GLfloat*)textureCoordinateArray.data()); if (addOffset) { addOffset = false; @@ -1640,6 +1628,8 @@ void QGL2PaintEngineEx::ensureActive() d->needsSync = false; d->shaderManager->setDirty(); d->ctx->d_func()->syncGlState(); + for (int i = 0; i < 3; ++i) + d->vertexAttribPointers[i] = (GLfloat*)-1; // Assume the pointers are clobbered setState(state()); } } diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 37bae6f..ce1b538 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -196,6 +196,9 @@ public: void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints); void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti); + // Calls glVertexAttributePointer if the pointer has changed + inline void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer); + // draws whatever is in the vertex array: void drawVertexArrays(const float *data, int *stops, int stopCount, GLenum primitive); void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) { @@ -230,6 +233,7 @@ public: void regenerateClip(); void systemStateChanged(); + static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; } static QGL2PaintEngineExPrivate *getData(QGL2PaintEngineEx *engine) { return engine->d_func(); } static void cleanupVectorPath(QPaintEngineEx *engine, void *data); @@ -291,8 +295,24 @@ public: QSet<QVectorPath::CacheEntry *> pathCaches; QVector<GLuint> unusedVBOSToClean; + + const GLfloat *vertexAttribPointers[3]; }; + +void QGL2PaintEngineExPrivate::setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer) +{ + Q_ASSERT(arrayIndex < 3); + if (pointer == vertexAttribPointers[arrayIndex]) + return; + + vertexAttribPointers[arrayIndex] = pointer; + if (arrayIndex == QT_OPACITY_ATTR) + glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, pointer); + else + glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, pointer); +} + QT_END_NAMESPACE #endif diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 047876f..0720170 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -81,7 +81,7 @@ void QGLTextureGlyphCache::createTextureData(int width, int height) data[i] = 0; if (m_type == QFontEngineGlyphCache::Raster_RGBMask) - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]); else glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, &data[0]); @@ -127,11 +127,28 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height) glViewport(0, 0, oldWidth, oldHeight); - float vertexCoordinateArray[] = { -1, -1, 1, -1, 1, 1, -1, 1 }; - float textureCoordinateArray[] = { 0, 0, 1, 0, 1, 1, 0, 1 }; - - glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray); - glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray); + GLfloat* vertexCoordinateArray = pex->staticVertexCoordinateArray; + vertexCoordinateArray[0] = -1.0f; + vertexCoordinateArray[1] = -1.0f; + vertexCoordinateArray[2] = 1.0f; + vertexCoordinateArray[3] = -1.0f; + vertexCoordinateArray[4] = 1.0f; + vertexCoordinateArray[5] = 1.0f; + vertexCoordinateArray[6] = -1.0f; + vertexCoordinateArray[7] = 1.0f; + + GLfloat* textureCoordinateArray = pex->staticTextureCoordinateArray; + textureCoordinateArray[0] = 0.0f; + textureCoordinateArray[1] = 0.0f; + textureCoordinateArray[2] = 1.0f; + textureCoordinateArray[3] = 0.0f; + textureCoordinateArray[4] = 1.0f; + textureCoordinateArray[5] = 1.0f; + textureCoordinateArray[6] = 0.0f; + textureCoordinateArray[7] = 1.0f; + + pex->setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, vertexCoordinateArray); + pex->setVertexAttributePointer(QT_TEXTURE_COORDS_ATTR, textureCoordinateArray); pex->shaderManager->useBlitProgram(); pex->shaderManager->blitProgram()->setUniformValue("imageTexture", QT_IMAGE_TEXTURE_UNIT); @@ -179,8 +196,20 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph) for (int x = 0; x < maskWidth; ++x) src[x] = -src[x]; // convert 0 and 1 into 0 and 255 } - } - + } else if (mask.format() == QImage::Format_RGB32) { + // Make the alpha component equal to the average of the RGB values. + // This is needed when drawing sub-pixel antialiased text on translucent targets. + for (int y = 0; y < maskHeight; ++y) { + quint32 *src = (quint32 *) mask.scanLine(y); + for (int x = 0; x < maskWidth; ++x) { + uchar r = src[x] >> 16; + uchar g = src[x] >> 8; + uchar b = src[x]; + quint32 avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding. + src[x] = (src[x] & 0x00ffffff) | (avg << 24); + } + } + } glBindTexture(GL_TEXTURE_2D, m_texture); if (mask.format() == QImage::Format_RGB32) { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 547b33e..a262ded 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1555,7 +1555,7 @@ QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alpha) { - QImage img(size, alpha_format ? QImage::Format_ARGB32 : QImage::Format_RGB32); + QImage img(size, alpha_format ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); int w = size.width(); int h = size.height(); #if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index cc58c09..c823187 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -4931,7 +4931,8 @@ void QOpenGLPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textIte glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); - bool antialias = !(ti.fontEngine->fontDef.styleStrategy & QFont::NoAntialias); + bool antialias = !(ti.fontEngine->fontDef.styleStrategy & QFont::NoAntialias) + && (d->matrix.type() > QTransform::TxTranslate); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, antialias ? GL_LINEAR : GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, antialias ? GL_LINEAR : GL_NEAREST); diff --git a/tests/auto/linguist/lupdate/.gitignore b/tests/auto/linguist/lupdate/.gitignore index 4ba5b79..389f2dc 100644 --- a/tests/auto/linguist/lupdate/.gitignore +++ b/tests/auto/linguist/lupdate/.gitignore @@ -1,4 +1,4 @@ tst_lupdate testdata/good/*/project.ts -testdata/output_ts/toplevel/library/tools/translations/project.ts +testdata/good/*/*/project.ts testdata/recursivescan/*.ts diff --git a/tests/auto/linguist/lupdate/lupdate.pro b/tests/auto/linguist/lupdate/lupdate.pro index 19259dc..bcaaf66 100644 --- a/tests/auto/linguist/lupdate/lupdate.pro +++ b/tests/auto/linguist/lupdate/lupdate.pro @@ -2,6 +2,5 @@ CONFIG += qttest_p4 TARGET = tst_lupdate -HEADERS += testlupdate.h -SOURCES += tst_lupdate.cpp testlupdate.cpp +SOURCES += tst_lupdate.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd index 9b83a04..f0e1ab2 100644 --- a/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd +++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/lupdatecmd @@ -1,3 +1 @@ -# Add the command that lupdate should run here. If it can't find anything it will default to TRANSLATION: ts\project.ts -lupdate -silent project.pro diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro index 3584c89..4698b2b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.pro @@ -1,19 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.01a) ma 22. jan 10:10:16 2007 -###################################################################### - -TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . - -# Input SOURCES += src\main.cpp TRANSLATIONS = ts\project.ts - - -!exists(ts) { - win32: system(md ts) - else: system(mkdir ts) -} diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/backslashes/ts/project.ts.result index d3a5fdf..d3a5fdf 100644 --- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/ts/project.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro index 848ebda..7225608 100644 --- a/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/codecforsrc/project.pro @@ -1,20 +1,7 @@ -TEMPLATE = app -TARGET += -DEPENDPATH += . -INCLUDEPATH += . - -# Input SOURCES += main.cpp +CONFIG+= console TRANSLATIONS = project.ts -CONFIG+= console CODECFORTR = utf-8 CODECFORSRC = utf-8 - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - - diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro index 81273ee..64f3c85 100644 --- a/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr/project.pro @@ -1,19 +1,6 @@ -TEMPLATE = app -TARGET += -DEPENDPATH += . -INCLUDEPATH += . - -# Input SOURCES += main.cpp +CONFIG+= console TRANSLATIONS = project.ts -CONFIG+= console CODECFORTR = CP1251 - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - - diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro index 1d5b071..d5697eb 100644 --- a/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr1/project.pro @@ -1,15 +1,6 @@ -TEMPLATE = app - SOURCES += main.cpp +CONFIG += console TRANSLATIONS = project.ts -CONFIG += console CODECFORTR = CP1252 - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - - diff --git a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro index f4975f2..c95939c 100644 --- a/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/codecfortr2/project.pro @@ -1,16 +1,7 @@ -TEMPLATE = app - SOURCES += main.cpp +CONFIG += console TRANSLATIONS = project.ts -CONFIG += console CODECFORSRC = CP1252 CODECFORTR = UTF-8 - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - - diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt new file mode 100644 index 0000000..093610d --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/expectedoutput.txt @@ -0,0 +1,6 @@ +*.*Function 'eval' is not implemented +Updating 'project\.ts'\.\.\. + Found 3 source text\(s\) \(3 new and 0 already existing\) + Removed 5 obsolete entries + Number heuristic provided 1 translation\(s\) + Same-text heuristic provided 1 translation\(s\) diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd new file mode 100644 index 0000000..6bda261 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/lupdatecmd @@ -0,0 +1,2 @@ +TRANSLATION: project.ts +lupdate -verbose -disable-heuristic similartext -no-obsolete project.pro diff --git a/tests/auto/linguist/lupdate/testlupdate.h b/tests/auto/linguist/lupdate/testdata/good/heuristics/main.cpp index 0b67057..542c228 100644 --- a/tests/auto/linguist/lupdate/testlupdate.h +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/main.cpp @@ -4,7 +4,7 @@ ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** -** This file is part of the Qt Linguist of the Qt Toolkit. +** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** No Commercial Usage @@ -39,49 +39,24 @@ ** ****************************************************************************/ -#ifndef TESTLUPDATE_H -#define TESTLUPDATE_H +// IMPORTANT!!!! If you want to add testdata to this file, +// always add it to the end in order to not change the linenumbers of translations!!! -#include <QObject> -#include <QProcess> -#include <QStringList> +#define QTCORE <QtCore> +#include QTCORE // Hidden from lupdate, but compiles -class TestLUpdate : public QObject -{ +class A: public QObject { Q_OBJECT + void foo() + { + // number Heuristics + tr("version 2.0 now"); -public: - TestLUpdate(); - virtual ~TestLUpdate(); + // same text match + tr("this is the matched same text"); - void setWorkingDirectory( const QString &workDir); - bool run( const QString &commandline); - bool updateProFile( const QString &arguments); - bool qmake(); - QStringList getErrorMessages() { - return make_result; + // failed same text + tr("this is the non-matched same text"); } - void clearResult() { - make_result.clear(); - } -private: - QString m_cmdLupdate; - QString m_cmdQMake; - QString m_workDir; - QProcess *childProc; - QStringList env_list; - QStringList make_result; - - bool child_show; - bool qws_mode; - bool exit_ok; - - bool runChild( bool showOutput, const QString &program, const QStringList &argList = QStringList()); - void addMakeResult( const QString &result ); - void childHasData(); - -private slots: - void childReady(int exitCode); }; -#endif // TESTLUPDATE_H diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro new file mode 100644 index 0000000..759bea0 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.pro @@ -0,0 +1,3 @@ +SOURCES = main.cpp + +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before new file mode 100644 index 0000000..ce82810 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.before @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>A</name> + <message> + <location filename="main.cpp" line="53"/> + <source>version 1.0 now</source> + <translation>teraz wersja 1.0</translation> + </message> +</context> +<context> + <name>B</name> + <message> + <location filename="main.cpp" line="56"/> + <source>this is the matched same text</source> + <translation>der same-text-treffer</translation> + </message> + <message> + <location filename="main.cpp" line="59"/> + <source>this is the non-matched same text</source> + <translation>same-text-reinfall variante eins</translation> + </message> +</context> +<context> + <name>C</name> + <message> + <location filename="main.cpp" line="56"/> + <source>this is the matched same text</source> + <translation>der same-text-treffer</translation> + </message> + <message> + <location filename="main.cpp" line="59"/> + <source>this is the non-matched same text</source> + <translation>völlig andere variante des reinfalls mit same-text</translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result new file mode 100644 index 0000000..402ad9a --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/heuristics/project.ts.result @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.0"> +<context> + <name>A</name> + <message> + <location filename="main.cpp" line="53"/> + <source>version 2.0 now</source> + <translation type="unfinished">teraz wersja 1.0 {2.0 ?}</translation> + </message> + <message> + <location filename="main.cpp" line="56"/> + <source>this is the matched same text</source> + <translation type="unfinished">der same-text-treffer</translation> + </message> + <message> + <location filename="main.cpp" line="59"/> + <source>this is the non-matched same text</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro index 7547a8d..759bea0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/lacksqobject/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES = main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd index 91a4800..82b4b0d 100644 --- a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd +++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/lupdatecmd @@ -1,5 +1 @@ -# Add the command that lupdate should run here. If it can't find anything it will default to -# 'lupdate project.pro -ts project.ts' - -# lupdate project.pro -lupdate -silent -locations relative project.pro +lupdate -locations relative project.pro diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro index e79456f..6149858 100644 --- a/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/merge_ordering/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += foo.cpp -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro index 6c704c2..fa56972 100644 --- a/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/merge_versions/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - FORMS += project.ui -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro index f4faf2f..759bea0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/merge_whitespace/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES = main.cpp -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro index e988c0a..63f5d66 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += finddialog.cpp -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd index d200143..500a822 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/lupdatecmd @@ -1,5 +1 @@ -# Add the command that lupdate should run here. If it can't find anything it will default to -# 'lupdate project.pro -ts project.ts' - -# lupdate project.pro -lupdate -silent -noobsolete project.pro +lupdate -noobsolete project.pro diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro index e988c0a..63f5d66 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += finddialog.cpp -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro index e988c0a..63f5d66 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += finddialog.cpp -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro index 28ba291..fa56972 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - FORMS += project.ui -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro b/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro index 28ba291..fa56972 100644 --- a/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/mergeui_obsolete/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - FORMS += project.ui -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro index 4582705..bbabdfb 100644 --- a/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/multiple_locations/project.pro @@ -1,13 +1,4 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += main.cpp SOURCES += finddialog.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro index 56d472c..c96859b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/namespaces/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro b/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro index cb18ea4..c96859b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/parse_special_chars/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro index 7547a8d..759bea0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/parsecontexts/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES = main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro index 4582705..bbabdfb 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.pro @@ -1,13 +1,4 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += main.cpp SOURCES += finddialog.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt index 8d057d8..e3543c9 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/expectedoutput.txt @@ -5,3 +5,4 @@ .*/lupdate/testdata/good/parsecpp2/main.cpp:61: Excess closing brace .* .*/lupdate/testdata/good/parsecpp2/main.cpp:65: Excess closing brace .* + diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro index 7547a8d..759bea0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp2/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES = main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro b/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro index 7e64c80..657b535 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/parsejava/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = Java - SOURCES += main.java -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro b/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro index bdc06e7..fa56972 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.pro @@ -1,13 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - FORMS += project.ui -TRANSLATIONS = project.ts - -exists( $$TRANSLATIONS ) { - win32 : system(del $$TRANSLATIONS) - unix : system(rm $$TRANSLATIONS) -} - - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro b/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro index 7547a8d..759bea0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/prefix/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES = main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro index 012c7e0..c96859b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/preprocess/project.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += main.cpp -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm -f $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro index 3078817..0e920f9 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsing/project.pro @@ -1,6 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - # Try to reference a variable that does not exist: MYVAR=$$THIS_VARIABLE_IS_NOT_DEFINED @@ -31,10 +28,4 @@ if (exists($$member($$(PATH), 0))) { SOURCES += main_dependpath.cpp } -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm -f $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro index 1d6895a..3dc4208 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsing2/project.pro @@ -3,9 +3,6 @@ # It also tries to verify the behaviour of combining quoted and non-quoted elements with literals. # -TEMPLATE = app -LANGUAGE = C++ - QUOTED = $$quote(variable with spaces) VERSIONAB = "a.b" VAB = $$split(VERSIONAB, ".") @@ -33,10 +30,4 @@ SOURCES += $$Q3 win32: SOURCES += $$system(type files-cc.txt) unix: SOURCES += $$system(cat files-cc.txt) -TRANSLATIONS += project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} - +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro index 820b4fa..6bfe751 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpaths/project.pro @@ -3,8 +3,3 @@ SOURCES += file*.cpp filter.cpp non-existing.cpp include(sub/sub.pri) TRANSLATIONS = project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm -f $$TRANSLATIONS) -} diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro index 3810a02..5e23538 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingpri/project.pro @@ -1,6 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - include(win/win.pri) include(mac/mac.pri) include(unix/unix.pri) @@ -8,9 +5,5 @@ include (common/common.pri) # Important: keep the space before the ' include(relativity/relativity.pri) message($$SOURCES) -TRANSLATIONS = project.ts -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm $$TRANSLATIONS) -} +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro index 4de6622..88f2435 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/project.pro @@ -1,3 +1,2 @@ -TEMPLATE =subdirs - -SUBDIRS = sub1 +TEMPLATE = subdirs +SUBDIRS = sub1 diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro index 1d50c2b..df18c5a 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubdirs/sub1/sub1.pro @@ -1,12 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - SOURCES += main.cpp -TRANSLATIONS += ../project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm -f $$TRANSLATIONS) -} - +TRANSLATIONS = ../project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro index a8b3106..3f6c643 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/common/common.pro @@ -1,5 +1,2 @@ -TEMPLATE = app -LANGUAGE = C++ - -SOURCES += main.cpp +SOURCES += main.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd new file mode 100644 index 0000000..b7e12cc --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/lupdatecmd @@ -0,0 +1 @@ +lupdate project.pro -ts project.ts diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro index 87478bf..a1863b6 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/mac/mac.pro @@ -1,5 +1 @@ -TEMPLATE = app -LANGUAGE = C++ - -SOURCES += main_mac.cpp - +SOURCES += main_mac.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro index 668ecf4..f75a462 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/project.pro @@ -1,7 +1,2 @@ TEMPLATE = subdirs SUBDIRS = win mac unix common - -exists( project.ts ) { - win32: system(del project.ts) - unix: system(rm project.ts) -} diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro index d0ebec7..71b1a22 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/unix/unix.pro @@ -1,5 +1 @@ -TEMPLATE = app -LANGUAGE = C++ - -SOURCES += main_unix.cpp - +SOURCES += main_unix.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro index a9a9751..afd7197 100644 --- a/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro +++ b/tests/auto/linguist/lupdate/testdata/good/proparsingsubs/win/win.pro @@ -1,5 +1 @@ -TEMPLATE = app -LANGUAGE = C++ - -SOURCES += main_win.cpp - +SOURCES += main_win.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd new file mode 100644 index 0000000..da6103f --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/lupdatecmd @@ -0,0 +1,2 @@ +TRANSLATION: translations/project.ts +lupdate project.pro -ts translations/project.ts diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp b/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp index 257b240..257b240 100644 --- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/main.cpp diff --git a/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro b/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro new file mode 100644 index 0000000..4e2e6ad --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/project.pro @@ -0,0 +1,3 @@ +SOURCES += main.cpp + +TRANSLATIONS = translations/project.ts diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result index e398701..e398701 100644 --- a/tests/auto/linguist/lupdate/testdata/output_ts/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/reloutput/translations/project.ts.result diff --git a/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro b/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro index 28ba291..fa56972 100644 --- a/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro +++ b/tests/auto/linguist/lupdate/testdata/good/textsimilarity/project.pro @@ -1,14 +1,3 @@ -TEMPLATE = app -LANGUAGE = C++ - FORMS += project.ui -TRANSLATIONS = project.ts - -# Copy the ts to a temp file because: -# 1. The depot file is usually read-only -# 2. We don't want to modify the original file, since then it won't be possible to run the test twice -# without reverting the original file again. - -win32: system(copy /Y project.ts.before $$TRANSLATIONS) -unix: system(cp -f project.ts.before $$TRANSLATIONS && chmod a+w $$TRANSLATIONS) +TRANSLATIONS = project.ts diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd b/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd deleted file mode 100644 index 80319de..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/lupdatecmd +++ /dev/null @@ -1,5 +0,0 @@ -# Add the command that lupdate should run here. If it can't find anything it will default to -# 'lupdate project.pro -ts project.ts' - -# lupdate project.pro -lupdate toplevel/library/tools/tools.pro diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro deleted file mode 100644 index ec6c01d..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/tools.pro +++ /dev/null @@ -1,12 +0,0 @@ -TEMPLATE = app -LANGUAGE = C++ - -SOURCES += main.cpp - -TRANSLATIONS += translations/project.ts - -exists( $$TRANSLATIONS ) { - win32: system(del $$TRANSLATIONS) - unix: system(rm -f $$TRANSLATIONS) -} - diff --git a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt b/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt deleted file mode 100644 index 83adcd2..0000000 --- a/tests/auto/linguist/lupdate/testdata/output_ts/toplevel/library/tools/translations/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is just a dummy file so that GIT creates this folder - diff --git a/tests/auto/linguist/lupdate/testlupdate.cpp b/tests/auto/linguist/lupdate/testlupdate.cpp deleted file mode 100644 index 9e23a54..0000000 --- a/tests/auto/linguist/lupdate/testlupdate.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** 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 Qt Linguist 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 "testlupdate.h" -#include <stdlib.h> -#include <QtGui/QApplication> -#include <QtCore/QProcess> -#include <QtCore/QTimer> -#include <QtCore/QDir> - -#ifdef Q_OS_WIN32 -# include <windows.h> -#endif - -#include <QtTest/QtTest> - - -TestLUpdate::TestLUpdate() -{ - childProc = 0; - QString binPath = QLibraryInfo::location(QLibraryInfo::BinariesPath); - m_cmdLupdate = binPath + QLatin1String("/lupdate"); - m_cmdQMake = binPath + QLatin1String("/qmake"); -} - -TestLUpdate::~TestLUpdate() -{ - if (childProc) - delete childProc; -} - -void TestLUpdate::setWorkingDirectory(const QString &workDir) -{ - m_workDir = workDir; - QDir::setCurrent(m_workDir); -} - -void TestLUpdate::addMakeResult( const QString &result ) -{ - make_result.append( result ); -} - -bool TestLUpdate::runChild( bool showOutput, const QString &program, const QStringList &argList) -{ - make_result.clear(); - exit_ok = FALSE; - if (childProc) - delete childProc; - - child_show = showOutput; - if ( showOutput ) { - QString S = argList.join(" "); - addMakeResult( program + QLatin1String(" ") + S ); - } - - childProc = new QProcess(); - Q_ASSERT(childProc); - - childProc->setWorkingDirectory(m_workDir); - connect(childProc, SIGNAL(finished(int)), this, SLOT(childReady(int))); - childProc->setProcessChannelMode(QProcess::MergedChannels); - if (argList.isEmpty()) { - childProc->start( program, QIODevice::ReadWrite | QIODevice::Text ); - } else { - childProc->start( program, argList, QIODevice::ReadWrite | QIODevice::Text ); - } - bool ok; - - ok = childProc->waitForStarted(); - - if (ok) - ok = childProc->waitForFinished(); - - if (!ok) - addMakeResult( "Error executing '" + program + "'." ); - - childReady(ok ? 0 : -1); - - return ok; -} - -void TestLUpdate::childReady(int /*exitCode*/) -{ - if (childProc != 0) { - childHasData(); - exit_ok = childProc->state() == QProcess::NotRunning - && childProc->exitStatus() == 0; - childProc->deleteLater(); - } - childProc = 0; -} - -void TestLUpdate::childHasData() -{ - //QByteArray ba = childProc->readAllStandardError(); - //qDebug() << "ERROR:" << ba; - QString stdoutput = childProc->readAllStandardOutput(); - stdoutput = stdoutput.replace("\t", " "); - if (child_show) - addMakeResult(stdoutput); -} - -bool TestLUpdate::run(const QString &commandline) -{ - return runChild(true, m_cmdLupdate + QLatin1String(" ") + commandline); -} - - -bool TestLUpdate::updateProFile(const QString &arguments) -{ - QStringList args = arguments.split(QChar(' ')); - return runChild( true, m_cmdLupdate, args ); -} - -bool TestLUpdate::qmake() -{ - QStringList args; - args << "-r"; - return runChild(true, m_cmdQMake, args); -} diff --git a/tests/auto/linguist/lupdate/tst_lupdate.cpp b/tests/auto/linguist/lupdate/tst_lupdate.cpp index 0776914..568be37 100644 --- a/tests/auto/linguist/lupdate/tst_lupdate.cpp +++ b/tests/auto/linguist/lupdate/tst_lupdate.cpp @@ -39,7 +39,6 @@ ** ****************************************************************************/ -#include "testlupdate.h" #if CHECK_SIMTEXTH #include "../shared/simtexth.h" #endif @@ -55,12 +54,11 @@ class tst_lupdate : public QObject { Q_OBJECT public: - tst_lupdate() { m_basePath = QDir::currentPath() + QLatin1String("/testdata/"); } + tst_lupdate(); private slots: void good_data(); void good(); - void output_ts(); void commandline_data(); void commandline(); #if CHECK_SIMTEXTH @@ -69,7 +67,7 @@ private slots: #endif private: - TestLUpdate m_lupdate; + QString m_cmdLupdate; QString m_basePath; void doCompare(const QStringList &actual, const QString &expectedFn, bool err); @@ -77,72 +75,149 @@ private: }; +tst_lupdate::tst_lupdate() +{ + QString binPath = QLibraryInfo::location(QLibraryInfo::BinariesPath); + m_cmdLupdate = binPath + QLatin1String("/lupdate"); + m_basePath = QDir::currentPath() + QLatin1String("/testdata/"); +} + +static bool prepareMatch(const QString &expect, QString *tmpl, int *require, int *accept) +{ + if (expect.startsWith(QLatin1Char('\\'))) { + *tmpl = expect.mid(1); + *require = *accept = 1; + } else if (expect.startsWith(QLatin1Char('?'))) { + *tmpl = expect.mid(1); + *require = 0; + *accept = 1; + } else if (expect.startsWith(QLatin1Char('*'))) { + *tmpl = expect.mid(1); + *require = 0; + *accept = INT_MAX; + } else if (expect.startsWith(QLatin1Char('+'))) { + *tmpl = expect.mid(1); + *require = 1; + *accept = INT_MAX; + } else if (expect.startsWith(QLatin1Char('{'))) { + int brc = expect.indexOf(QLatin1Char('}'), 1); + if (brc < 0) + return false; + *tmpl = expect.mid(brc + 1); + QString sub = expect.mid(1, brc - 1); + int com = sub.indexOf(QLatin1Char(',')); + bool ok; + if (com < 0) { + *require = *accept = sub.toInt(&ok); + return ok; + } else { + *require = sub.left(com).toInt(); + *accept = sub.mid(com + 1).toInt(&ok); + if (!ok) + *accept = INT_MAX; + return *accept >= *require; + } + } else { + *tmpl = expect; + *require = *accept = 1; + } + return true; +} + void tst_lupdate::doCompare(const QStringList &actual, const QString &expectedFn, bool err) { QFile file(expectedFn); - QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); - QStringList expected = QString(file.readAll()).trimmed().split('\n'); - - int i = 0, ei = expected.size(), gi = actual.size(); - for (; ; i++) { - if (i == gi) { - if (i == ei) - return; - gi = 0; - break; - } else if (i == ei) { - ei = 0; + QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(expectedFn)); + QStringList expected = QString(file.readAll()).split('\n'); + + int ei = 0, ai = 0, em = expected.size(), am = actual.size(); + int oei = 0, oai = 0, oem = em, oam = am; + int require = 0, accept = 0; + QString tmpl; + forever { + if (!accept) { + oei = ei, oai = ai; + if (ei == em) { + if (ai == am) + return; + break; + } + if (!prepareMatch(expected.at(ei++), &tmpl, &require, &accept)) + QFAIL(qPrintable(QString("Malformed expected %1 at %3:%2") + .arg(err ? "output" : "result").arg(ei).arg(expectedFn))); + } + if (ai == am) { + if (require <= 0) { + accept = 0; + continue; + } break; - } else { - QString act = actual.at(i); - act.remove('\r'); - if (err ? !QRegExp(expected.at(i)).exactMatch(act) : - (act != expected.at(i))) { - bool cond = true; - while (cond) { - act = actual.at(gi - 1); - act.remove('\r'); - cond = (ei - 1) >= i && (gi - 1) >= i && - (err ? QRegExp(expected.at(ei - 1)).exactMatch(act) : - (act == expected.at(ei - 1))); - if (cond) { - ei--, gi--; + } + if (err ? !QRegExp(tmpl).exactMatch(actual.at(ai)) : (actual.at(ai) != tmpl)) { + if (require <= 0) { + accept = 0; + continue; + } + ei--; + require = accept = 0; + forever { + if (!accept) { + oem = em, oam = am; + if (ei == em) + break; + if (!prepareMatch(expected.at(--em), &tmpl, &require, &accept)) + QFAIL(qPrintable(QString("Malformed expected %1 at %3:%2") + .arg(err ? "output" : "result") + .arg(em + 1).arg(expectedFn))); + } + if (ai == am || (err ? !QRegExp(tmpl).exactMatch(actual.at(am - 1)) : + (actual.at(am - 1) != tmpl))) { + if (require <= 0) { + accept = 0; + continue; } + break; } - break; + accept--; + require--; + am--; } + break; } + accept--; + require--; + ai++; } QByteArray diff; - for (int j = qMax(0, i - 3); j < i; j++) - diff += expected.at(j) + '\n'; + for (int j = qMax(0, oai - 3); j < oai; j++) + diff += actual.at(j) + '\n'; diff += "<<<<<<< got\n"; - for (int j = i; j < gi; j++) { + for (int j = oai; j < oam; j++) { diff += actual.at(j) + '\n'; - if (j >= i + 5) { + if (j >= oai + 5) { diff += "...\n"; break; } } diff += "=========\n"; - for (int j = i; j < ei; j++) { + for (int j = oei; j < oem; j++) { diff += expected.at(j) + '\n'; - if (j >= i + 5) { + if (j >= oei + 5) { diff += "...\n"; break; } } diff += ">>>>>>> expected\n"; - for (int j = ei; j < qMin(ei + 3, expected.size()); j++) - diff += expected.at(j) + '\n'; + for (int j = oam; j < qMin(oam + 3, actual.size()); j++) + diff += actual.at(j) + '\n'; QFAIL(qPrintable((err ? "Output for " : "Result for ") + expectedFn + " does not meet expectations:\n" + diff)); } void tst_lupdate::doCompare(const QString &actualFn, const QString &expectedFn, bool err) { QFile afile(actualFn); - QVERIFY(afile.open(QIODevice::ReadOnly | QIODevice::Text)); - QStringList actual = QString(afile.readAll()).trimmed().split('\n'); + QVERIFY2(afile.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(actualFn)); + QStringList actual = QString(afile.readAll()).split('\n'); doCompare(actual, expectedFn, err); } @@ -167,20 +242,16 @@ void tst_lupdate::good() QFETCH(QString, directory); QString dir = m_basePath + "good/" + directory; - QString expectedFile = dir + QLatin1String("/project.ts.result"); qDebug() << "Checking..."; - // qmake will delete the previous one, to ensure that we don't do any merging.... - QString generatedtsfile(QLatin1String("project.ts")); + QString generatedtsfile(dir + QLatin1String("/project.ts")); - m_lupdate.setWorkingDirectory(dir); - m_lupdate.qmake(); // look for a command QString lupdatecmd; QFile file(dir + "/lupdatecmd"); if (file.exists()) { - QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); + QVERIFY2(file.open(QIODevice::ReadOnly | QIODevice::Text), qPrintable(file.fileName())); while (!file.atEnd()) { QByteArray cmdstring = file.readLine().simplified(); if (cmdstring.startsWith('#')) @@ -197,72 +268,39 @@ void tst_lupdate::good() file.close(); } - if (lupdatecmd.isEmpty()) { - lupdatecmd = QLatin1String("project.pro -ts project.ts"); - } - lupdatecmd.prepend("-silent "); - m_lupdate.updateProFile(lupdatecmd); - - // If the file expectedoutput.txt exists, compare the - // console output with the content of that file - QFile outfile(dir + "/expectedoutput.txt"); - if (outfile.exists()) { - QString errs = m_lupdate.getErrorMessages().at(1).trimmed(); - QStringList errslist = errs.split(QLatin1Char('\n')); - doCompare(errslist, outfile.fileName(), true); - if (QTest::currentTestFailed()) - return; - } - - doCompare(generatedtsfile, expectedFile, false); -} - -void tst_lupdate::output_ts() -{ - QString dir = m_basePath + "output_ts"; - m_lupdate.setWorkingDirectory(dir); - - // look for a command - QString lupdatecmd; - QFile file(dir + "/lupdatecmd"); - if (file.exists()) { - QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); - while (!file.atEnd()) { - QByteArray cmdstring = file.readLine().simplified(); - if (cmdstring.startsWith('#')) - continue; - if (cmdstring.startsWith("lupdate")) { - cmdstring.remove(0, 8); - lupdatecmd.append(cmdstring); - break; - } - } - file.close(); - } - - QDir parsingDir(m_basePath + "output_ts"); - - QString generatedtsfile = - dir + QLatin1String("/toplevel/library/tools/translations/project.ts"); - QFile::remove(generatedtsfile); + QString beforetsfile = generatedtsfile + QLatin1String(".before"); + if (QFile::exists(beforetsfile)) + QVERIFY2(QFile::copy(beforetsfile, generatedtsfile), qPrintable(beforetsfile)); + if (lupdatecmd.isEmpty()) + lupdatecmd = QLatin1String("project.pro"); lupdatecmd.prepend("-silent "); - m_lupdate.qmake(); - m_lupdate.updateProFile(lupdatecmd); + + QProcess proc; + proc.setWorkingDirectory(dir); + proc.setProcessChannelMode(QProcess::MergedChannels); + proc.start(m_cmdLupdate + ' ' + lupdatecmd, QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(proc.waitForFinished(5000), qPrintable(lupdatecmd)); + QByteArray output = proc.readAll(); + QVERIFY2(proc.exitStatus() == QProcess::NormalExit, + "\"lupdate " + lupdatecmd.toLatin1() + "\" crashed\n" + output); + QVERIFY2(!proc.exitCode(), + "\"lupdate " + lupdatecmd.toLatin1() + "\" exited with code " + + QByteArray::number(proc.exitCode()) + "\n" + proc.readAll()); // If the file expectedoutput.txt exists, compare the // console output with the content of that file QFile outfile(dir + "/expectedoutput.txt"); if (outfile.exists()) { - QString errs = m_lupdate.getErrorMessages().at(1).trimmed(); - QStringList errslist = errs.split(QLatin1Char('\n')); + QStringList errslist = QString::fromLatin1(output).split(QLatin1Char('\n')); doCompare(errslist, outfile.fileName(), true); if (QTest::currentTestFailed()) return; } - doCompare(generatedtsfile, dir + QLatin1String("/project.ts.result"), false); + QString expectedFile = generatedtsfile + QLatin1String(".result"); + doCompare(generatedtsfile, expectedFile, false); } void tst_lupdate::commandline_data() @@ -285,14 +323,21 @@ void tst_lupdate::commandline() QFETCH(QString, generatedtsfile); QFETCH(QString, expectedtsfile); - m_lupdate.setWorkingDirectory(m_basePath + currentPath); QString generated = m_basePath + currentPath + QLatin1Char('/') + generatedtsfile; QFile gen(generated); if (gen.exists()) QVERIFY(gen.remove()); - if (!m_lupdate.run("-silent " + commandline)) - qDebug() << m_lupdate.getErrorMessages().last(); + QProcess proc; + proc.setWorkingDirectory(m_basePath + currentPath); + proc.setProcessChannelMode(QProcess::MergedChannels); + proc.start(m_cmdLupdate + " -silent " + commandline, QIODevice::ReadWrite | QIODevice::Text); + QVERIFY2(proc.waitForFinished(5000), qPrintable(commandline)); + QVERIFY2(proc.exitStatus() == QProcess::NormalExit, + "\"lupdate -silent " + commandline.toLatin1() + "\" crashed\n" + proc.readAll()); + QVERIFY2(!proc.exitCode(), + "\"lupdate -silent " + commandline.toLatin1() + "\" exited with code " + + QByteArray::number(proc.exitCode()) + "\n" + proc.readAll()); doCompare(generated, m_basePath + currentPath + QLatin1Char('/') + expectedtsfile, false); } diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp index e2cad08..258d8dc 100644 --- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp @@ -149,6 +149,7 @@ private slots: void taskQTBUG_5008_textFromValueAndValidate(); void taskQTBUG_6670_selectAllWithPrefix(); + void taskQTBUG_6496_fiddlingWithPrecision(); public slots: void valueChangedHelper(const QString &); @@ -1096,5 +1097,17 @@ void tst_QDoubleSpinBox::taskQTBUG_6670_selectAllWithPrefix() QCOMPARE(spin.value(), 12.); } +void tst_QDoubleSpinBox::taskQTBUG_6496_fiddlingWithPrecision() +{ + QDoubleSpinBox dsb; + dsb.setRange(0, 0.991); + dsb.setDecimals(1); + QCOMPARE(dsb.maximum(), 1.0); + dsb.setDecimals(2); + QCOMPARE(dsb.maximum(), 0.99); + dsb.setDecimals(3); + QCOMPARE(dsb.maximum(), 0.991); +} + QTEST_MAIN(tst_QDoubleSpinBox) #include "tst_qdoublespinbox.moc" diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp index 4c52f57..f2e1dbd 100644 --- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp @@ -116,6 +116,7 @@ private slots: #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) void task226366_lowerCaseHardDriveWindows(); #endif + void completionOnLevelAfterRoot(); void task233037_selectingDirectory(); void task235069_hideOnEscape(); void task236402_dontWatchDeletedDir(); @@ -202,7 +203,7 @@ void tst_QFiledialog::heapCorruption() qDeleteAll(dialogs); } -struct FriendlyQFileDialog : public QFileDialog +struct FriendlyQFileDialog : public QNonNativeFileDialog { friend class tst_QFileDialog; Q_DECLARE_PRIVATE(QFileDialog) @@ -552,6 +553,45 @@ void tst_QFiledialog::task226366_lowerCaseHardDriveWindows() } #endif +void tst_QFiledialog::completionOnLevelAfterRoot() +{ + QNonNativeFileDialog fd; +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + fd.setDirectory("C:"); + QDir current = fd.directory(); + current.mkdir("completionOnLevelAfterRootTest"); +#else + fd.setFilter(QDir::Hidden | QDir::AllDirs | QDir::Files | QDir::System); + fd.setDirectory("/"); + QDir etc("/etc"); + if (!etc.exists()) + QSKIP("This test requires to have an etc directory under /", SkipAll); +#endif + fd.show(); + QLineEdit *edit = qFindChild<QLineEdit*>(&fd, "fileNameEdit"); + QTest::qWait(2000); +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + //I love testlib :D + QTest::keyClick(edit, Qt::Key_C); + QTest::keyClick(edit, Qt::Key_O); + QTest::keyClick(edit, Qt::Key_M); + QTest::keyClick(edit, Qt::Key_P); + QTest::keyClick(edit, Qt::Key_L); +#else + QTest::keyClick(edit, Qt::Key_E); + QTest::keyClick(edit, Qt::Key_T); +#endif + QTest::qWait(200); + QTest::keyClick(edit->completer()->popup(), Qt::Key_Down); + QTest::qWait(200); +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) + QCOMPARE(edit->text(), QString("completionOnLevelAfterRootTest")); + current.rmdir("completionOnLevelAfterRootTest"); +#else + QCOMPARE(edit->text(), QString("etc")); +#endif +} + void tst_QFiledialog::task233037_selectingDirectory() { QDir current = QDir::currentPath(); diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h index 4176122..4e99f18 100644 --- a/tests/auto/qsqldatabase/tst_databases.h +++ b/tests/auto/qsqldatabase/tst_databases.h @@ -221,7 +221,8 @@ public: // addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux // addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // MySQL 5.1.36 Windows // addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql4-nokia.trolltech.com.au" ); // MySQL 4.1.22-2.el4 linux -// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql5-nokia.trolltech.com.au" ); // MySQL 5.0.45-7.el5 linux +// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql50.apac.nokia.com" ); // MySQL 5.0.45-7.el5 linux +// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql51.apac.nokia.com" ); // MySQL 5.1.36-6.7.2.i586 linux // addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no" ); // V7.2 NOT SUPPORTED! // addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5434 ); // V7.2 NOT SUPPORTED! Multi-byte @@ -230,7 +231,8 @@ public: // addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5437 ); // V8.0.3 // addDb( "QPSQL7", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // V8.2.1, UTF-8 // addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "postgres74-nokia.trolltech.com.au" ); // Version 7.4.19-1.el4_6.1 -// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "postgres81-nokia.trolltech.com.au" ); // Version 8.1.11-1.el5_1.1 +// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql81.apac.nokia.com" ); // Version 8.1.11-1.el5_1.1 +// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql84.apac.nokia.com" ); // Version 8.4.1-2.1.i586 // addDb( "QDB2", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // DB2 v9.1 on silence @@ -248,7 +250,7 @@ public: // addDb( "QODBC3", "DRIVER={SQL SERVER};SERVER=iceblink.nokia.troll.no\\ICEBLINK", "troll", "trond", "" ); // addDb( "QODBC3", "DRIVER={SQL Native Client};SERVER=silence.nokia.troll.no\\SQLEXPRESS", "troll", "trond", "" ); -// addDb( "QODBC", "DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql5-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" ); +// addDb( "QODBC", "DRIVER={MySQL ODBC 5.1 Driver};SERVER=mysql5-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" ); // addDb( "QODBC", "DRIVER={MySQL ODBC 5.1 Driver};SERVER=mysql4-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" ); // addDb( "QODBC", "DRIVER={FreeTDS};SERVER=horsehead.nokia.troll.no;DATABASE=testdb;PORT=4101;UID=troll;PWD=trondk", "troll", "trondk", "" ); // addDb( "QODBC", "DRIVER={FreeTDS};SERVER=silence.nokia.troll.no;DATABASE=testdb;PORT=2392;UID=troll;PWD=trond", "troll", "trond", "" ); @@ -259,6 +261,7 @@ public: // addDb( "QODBC3", "DRIVER={SQL SERVER};SERVER=bq-winserv2003-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433", "testuser", "Ee4Gabf6_", "" ); // addDb( "QODBC3", "DRIVER={SQL SERVER};SERVER=bq-winserv2008-x86-01.apac.nokia.com;DATABASE=testdb;PORT=1433", "testuser", "Ee4Gabf6_", "" ); // addDb( "QODBC", "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\dbs\\access\\testdb.mdb", "", "", "" ); +// addDb( "QODBC", "DRIVER={Postgresql};SERVER=postgres81-nokia.trolltech.com.au;DATABASE=testdb", "testuser", "Ee4Gabf6_", "" ); } void open() @@ -335,7 +338,10 @@ public: foreach(const QString &table2, dbtables.filter(table, Qt::CaseInsensitive)) { if(table2.compare(table.section('.', -1, -1), Qt::CaseInsensitive) == 0) { table=db.driver()->escapeIdentifier(table2, QSqlDriver::TableName); - wasDropped = q.exec( "drop table " + table); + if(db.driverName().startsWith( "QPSQL" )) + wasDropped = q.exec( "drop table " + table + " cascade"); + else + wasDropped = q.exec( "drop table " + table); dbtables.removeAll(table2); } } diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index d269cc3..fd4815e 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -236,6 +236,7 @@ private slots: void task248022_changeSelection(); void task245654_changeModelAndExpandAll(); void doubleClickedWithSpans(); + void taskQTBUG_6450_selectAllWith1stColumnHidden(); }; class QtTestModel: public QAbstractItemModel @@ -3678,5 +3679,26 @@ void tst_QTreeView::doubleClickedWithSpans() QTRY_COMPARE(spy.count(), 2); } +void tst_QTreeView::taskQTBUG_6450_selectAllWith1stColumnHidden() +{ + QTreeWidget tree; + tree.setSelectionMode(QAbstractItemView::MultiSelection); + tree.setColumnCount(2); + QList<QTreeWidgetItem *> items; + const int nrRows = 10; + for (int i = 0; i < nrRows; ++i) { + items.append(new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString("item: %1").arg(i)))); + items.last()->setText(1, QString("is an item")); + } + tree.insertTopLevelItems(0, items); + + tree.hideColumn(0); + tree.selectAll(); + + QVERIFY(tree.selectionModel()->hasSelection()); + for (int i = 0; i < nrRows; ++i) + QVERIFY(tree.selectionModel()->isRowSelected(i, QModelIndex())); +} + QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" diff --git a/tests/benchmarks/qtext/main.cpp b/tests/benchmarks/qtext/main.cpp index 3c973b6..4bd2bee 100644 --- a/tests/benchmarks/qtext/main.cpp +++ b/tests/benchmarks/qtext/main.cpp @@ -41,19 +41,36 @@ #include <QDebug> #include <QTextDocument> +#include <QTextDocumentWriter> #include <QTextLayout> +#include <QTextCursor> #include <QFile> +#include <QBuffer> #include <qtest.h> +Q_DECLARE_METATYPE(QTextDocument*) + class tst_QText: public QObject { Q_OBJECT +public: + tst_QText() { + m_lorem = QString::fromLatin1("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."); + } + private slots: void loadHtml_data(); void loadHtml(); void shaping_data(); void shaping(); + + void odfWriting_empty(); + void odfWriting_text(); + void odfWriting_images(); + +private: + QString m_lorem; }; void tst_QText::loadHtml_data() @@ -63,7 +80,7 @@ void tst_QText::loadHtml_data() QTest::newRow("simple") << QString::fromLatin1("<html><b>Foo</b></html>"); QTest::newRow("simple2") << QString::fromLatin1("<b>Foo</b>"); - QString parag = QString::fromLatin1("<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. <b>Duis <i>autem</i> vel eum </b> iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>"); + QString parag = QString::fromLatin1("<p>%1</p>").arg(m_lorem); QString header = QString::fromLatin1("<html><head><title>test</title></head><body>"); QTest::newRow("long") << QString::fromLatin1("<html><head><title>test</title></head><body>") + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag + parag @@ -87,7 +104,7 @@ void tst_QText::shaping_data() { QTest::addColumn<QString>("parag"); QTest::newRow("empty") << QString(); - QTest::newRow("lorem") << QString::fromLatin1("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."); + QTest::newRow("lorem") << m_lorem; QTest::newRow("short") << QString::fromLatin1("Lorem ipsum dolor sit amet"); QFile file(QString::fromLatin1(SRCDIR) + QLatin1String("/bidi.txt")); @@ -120,6 +137,64 @@ void tst_QText::shaping() } } +void tst_QText::odfWriting_empty() +{ + QVERIFY(QTextDocumentWriter::supportedDocumentFormats().contains("ODF")); // odf compiled in + QTextDocument *doc = new QTextDocument(); + // write it + QBENCHMARK { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + QTextDocumentWriter writer(&buffer, "ODF"); + writer.write(doc); + } + delete doc; +} + +void tst_QText::odfWriting_text() +{ + QTextDocument *doc = new QTextDocument(); + QTextCursor cursor(doc); + QTextBlockFormat bf; + bf.setIndent(2); + cursor.insertBlock(bf); + cursor.insertText(m_lorem); + bf.setTopMargin(10); + cursor.insertBlock(bf); + cursor.insertText(m_lorem); + bf.setRightMargin(30); + cursor.insertBlock(bf); + cursor.insertText(m_lorem); + + // write it + QBENCHMARK { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + QTextDocumentWriter writer(&buffer, "ODF"); + writer.write(doc); + } + delete doc; +} + +void tst_QText::odfWriting_images() +{ + QTextDocument *doc = new QTextDocument(); + QTextCursor cursor(doc); + cursor.insertText(m_lorem); + QImage image(400, 200, QImage::Format_ARGB32_Premultiplied); + cursor.insertImage(image); + cursor.insertText(m_lorem); + + // write it + QBENCHMARK { + QBuffer buffer; + buffer.open(QIODevice::WriteOnly); + QTextDocumentWriter writer(&buffer, "ODF"); + writer.write(doc); + } + delete doc; +} + QTEST_MAIN(tst_QText) #include "main.moc" diff --git a/tools/linguist/lupdate/cpp.cpp b/tools/linguist/lupdate/cpp.cpp index 12c06b1..6bd9108 100644 --- a/tools/linguist/lupdate/cpp.cpp +++ b/tools/linguist/lupdate/cpp.cpp @@ -1732,7 +1732,7 @@ void CppParser::parseInternal(ConversionData &cd, QSet<QString> &inclusions) plural = true; } } - if (!pendingContext.isEmpty()) { + if (!pendingContext.isEmpty() && !prefix.startsWith(strColons)) { QStringList unresolved; if (!fullyQualify(namespaces, pendingContext, true, &functionContext, &unresolved)) { functionContextUnresolved = unresolved.join(strColons); diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index ecdb0e3..2129265 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -237,18 +237,12 @@ int main(int argc, char **argv) Verbose | // verbose is on by default starting with Qt 4.2 HeuristicSameText | HeuristicSimilarText | HeuristicNumber; int numFiles = 0; - bool standardSyntax = true; bool metTsFlag = false; bool recursiveScan = true; QString extensions = m_defaultExtensions; QSet<QString> extensionsNameFilters; - for (int i = 1; i < argc; ++i) { - if (args.at(i) == QLatin1String("-ts")) - standardSyntax = false; - } - for (int i = 1; i < argc; ++i) { QString arg = args.at(i); if (arg == QLatin1String("-help") @@ -375,8 +369,6 @@ int main(int argc, char **argv) numFiles++; - QString fullText; - codecForTr.clear(); codecForSource.clear(); diff --git a/tools/linguist/lupdate/merge.cpp b/tools/linguist/lupdate/merge.cpp index 421f07d..fffdf9b 100644 --- a/tools/linguist/lupdate/merge.cpp +++ b/tools/linguist/lupdate/merge.cpp @@ -50,9 +50,6 @@ #include <QtCore/QTextCodec> #include <QtCore/QVector> -typedef QList<TranslatorMessage> TML; -typedef QMap<QString, TranslatorMessage> TMM; - QT_BEGIN_NAMESPACE @@ -63,7 +60,7 @@ static bool isDigitFriendly(QChar c) static int numberLength(const QString &s, int i) { - if (i < s.size() || !s.at(i).isDigit()) + if (i >= s.size() || !s.at(i).isDigit()) return 0; int pos = i; @@ -90,7 +87,7 @@ static QString zeroKey(const QString &key) QString zeroed; bool metSomething = false; - for (int i = 0; i != key.size(); ++i) { + for (int i = 0; i < key.size(); ++i) { int len = numberLength(key, i); if (len > 0) { i += len; @@ -225,31 +222,36 @@ static QString translationAttempt(const QString &oldTranslation, */ int applyNumberHeuristic(Translator &tor) { - TMM translated, untranslated; - TMM::Iterator t, u; - TML all = tor.messages(); - TML::Iterator it; + QMap<QString, QPair<QString, QString> > translated; + QVector<bool> untranslated(tor.messageCount()); int inserted = 0; - for (it = all.begin(); it != all.end(); ++it) { - bool hasTranslation = it->isTranslated(); - if (it->type() == TranslatorMessage::Unfinished) { + for (int i = 0; i < tor.messageCount(); ++i) { + const TranslatorMessage &msg = tor.message(i); + bool hasTranslation = msg.isTranslated(); + if (msg.type() == TranslatorMessage::Unfinished) { if (!hasTranslation) - untranslated.insert(it->context() + QLatin1Char('\n') - + it->sourceText() + QLatin1Char('\n') - + it->comment(), *it); - } else if (hasTranslation && it->translations().count() == 1) { - translated.insert(zeroKey(it->sourceText()), *it); + untranslated[i] = true; + } else if (hasTranslation && msg.translations().count() == 1) { + const QString &key = zeroKey(msg.sourceText()); + if (!key.isEmpty()) + translated.insert(key, qMakePair(msg.sourceText(), msg.translation())); } } - for (u = untranslated.begin(); u != untranslated.end(); ++u) { - t = translated.find(zeroKey((*u).sourceText())); - if (t != translated.end() && !t.key().isEmpty() - && t->sourceText() != u->sourceText()) { - u->setTranslation(translationAttempt(t->translation(), t->sourceText(), - u->sourceText())); - inserted++; + for (int i = 0; i < tor.messageCount(); ++i) { + if (untranslated[i]) { + TranslatorMessage &msg = tor.message(i); + const QString &key = zeroKey(msg.sourceText()); + if (!key.isEmpty()) { + QMap<QString, QPair<QString, QString> >::ConstIterator t = + translated.constFind(key); + if (t != translated.constEnd() && t->first != msg.sourceText()) { + msg.setTranslation(translationAttempt(t->second, t->first, + msg.sourceText())); + inserted++; + } + } } } return inserted; @@ -268,43 +270,42 @@ int applyNumberHeuristic(Translator &tor) int applySameTextHeuristic(Translator &tor) { - TMM translated; - TMM avoid; - TMM::Iterator t; - TML untranslated; - TML::Iterator u; - TML all = tor.messages(); - TML::Iterator it; + QMap<QString, QStringList> translated; + QMap<QString, bool> avoid; // Want a QTreeSet, in fact + QVector<bool> untranslated(tor.messageCount()); int inserted = 0; - for (it = all.begin(); it != all.end(); ++it) { - if (!it->isTranslated()) { - if (it->type() == TranslatorMessage::Unfinished) - untranslated.append(*it); + for (int i = 0; i < tor.messageCount(); ++i) { + const TranslatorMessage &msg = tor.message(i); + if (!msg.isTranslated()) { + if (msg.type() == TranslatorMessage::Unfinished) + untranslated[i] = true; } else { - QString key = it->sourceText(); - t = translated.find(key); - if (t != translated.end()) { + const QString &key = msg.sourceText(); + QMap<QString, QStringList>::ConstIterator t = translated.constFind(key); + if (t != translated.constEnd()) { /* The same source text is translated at least two different ways. Do nothing then. */ - if (t->translations() != it->translations()) { + if (*t != msg.translations()) { translated.remove(key); - avoid.insert(key, *it); + avoid.insert(key, true); } } else if (!avoid.contains(key)) { - translated.insert(key, *it); + translated.insert(key, msg.translations()); } } } - for (u = untranslated.begin(); u != untranslated.end(); ++u) { - QString key = u->sourceText(); - t = translated.find(key); - if (t != translated.end()) { - u->setTranslations(t->translations()); - ++inserted; + for (int i = 0; i < tor.messageCount(); ++i) { + if (untranslated[i]) { + TranslatorMessage &msg = tor.message(i); + QMap<QString, QStringList>::ConstIterator t = translated.constFind(msg.sourceText()); + if (t != translated.constEnd()) { + msg.setTranslations(*t); + ++inserted; + } } } return inserted; diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp index 83a182e..4331ce6 100644 --- a/tools/linguist/shared/translator.cpp +++ b/tools/linguist/shared/translator.cpp @@ -44,6 +44,10 @@ #include "simtexth.h" #include <stdio.h> +#ifdef Q_OS_WIN +#include <io.h> // required for _setmode, to avoid _O_TEXT streams... +#include <fcntl.h> // for _O_BINARY +#endif #include <QtCore/QDebug> #include <QtCore/QDir> @@ -207,6 +211,10 @@ bool Translator::load(const QString &filename, ConversionData &cd, const QString QFile file; if (filename.isEmpty() || filename == QLatin1String("-")) { +#ifdef Q_OS_WIN + // QFile is broken for text files + ::_setmode(0, _O_BINARY); +#endif if (!file.open(stdin, QIODevice::ReadOnly)) { cd.appendError(QString::fromLatin1("Cannot open stdin!? (%1)") .arg(file.errorString())); @@ -243,6 +251,10 @@ bool Translator::save(const QString &filename, ConversionData &cd, const QString { QFile file; if (filename.isEmpty() || filename == QLatin1String("-")) { +#ifdef Q_OS_WIN + // QFile is broken for text files + ::_setmode(1, _O_BINARY); +#endif if (!file.open(stdout, QIODevice::WriteOnly)) { cd.appendError(QString::fromLatin1("Cannot open stdout!? (%1)") .arg(file.errorString())); diff --git a/translations/qt_de.ts b/translations/qt_de.ts index ff0dc5d..d916733 100644 --- a/translations/qt_de.ts +++ b/translations/qt_de.ts @@ -7958,6 +7958,34 @@ Bitte wählen Sie einen anderen Dateinamen.</translation> </message> </context> <context> + <name>QXmlPatternistCLI</name> + <message> + <location filename="../src/xmlpatterns/api/qcoloringmessagehandler.cpp" line="+87"/> + <source>Warning in %1, at line %2, column %3: %4</source> + <translation>Fehler in %1, bei Zeile %2, Spalte %3: %4</translation> + </message> + <message> + <location line="+7"/> + <source>Warning in %1: %2</source> + <translation>Warnung in %1: %2</translation> + </message> + <message> + <location line="+16"/> + <source>Unknown location</source> + <translation>unbekannt</translation> + </message> + <message> + <location line="+14"/> + <source>Error %1 in %2, at line %3, column %4: %5</source> + <translation>Fehler %1 in %2, bei Zeile %3, Spalte %4: %5</translation> + </message> + <message> + <location line="+8"/> + <source>Error %1 in %2: %3</source> + <translation>Fehler %1 in %2: %3</translation> + </message> +</context> +<context> <name>QXmlStream</name> <message> <location filename="../src/corelib/xml/qxmlstream.cpp" line="+611"/> |