Commit Graph

421 Commits

Author SHA1 Message Date
Oliver Wolff
53dc49ffc8 Check for network module when building according auto tests
Change-Id: I68013bf8e07be8d202b3253f997d4f4db05335a4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2013-02-19 19:20:53 +01:00
Frederik Gladhorn
f4900d340a Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/widgets/styles/qmacstyle_mac.mm

Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
2013-02-18 16:14:52 +01:00
Yoann Lopes
c7a51f1858 Added QOffscreenSurface class.
Inherits QSurface and allows to use OpenGL from an arbitrary thread.
Platform plugins can implement QPlatformOffscreenSurface, otherwise an
invisible QWindow is used by QOffscreenSurface.
This patch includes an implementation of QOffscreenSurface for XCB
and EglFS platform plugins using pbuffers.

Change-Id: I57b4fc1db417331f34826dcfa754b7698782fde4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-18 13:42:22 +01:00
Frederik Gladhorn
e65cd6f379 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/concurrent/doc/qtconcurrent.qdocconf
	src/corelib/doc/qtcore.qdocconf
	src/corelib/global/qglobal.h
	src/dbus/doc/qtdbus.qdocconf
	src/dbus/qdbusmessage.h
	src/gui/doc/qtgui.qdocconf
	src/gui/image/qimagereader.cpp
	src/network/doc/qtnetwork.qdocconf
	src/opengl/doc/qtopengl.qdocconf
	src/opengl/qgl.h
	src/plugins/platforms/windows/qwindowswindow.cpp
	src/printsupport/doc/qtprintsupport.qdocconf
	src/sql/doc/qtsql.qdocconf
	src/testlib/doc/qttestlib.qdocconf
	src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf
	src/widgets/doc/qtwidgets.qdocconf
	src/xml/doc/qtxml.qdocconf

Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
2013-02-14 14:24:57 +01:00
Samuel Rødal
733430636d Fixed crashes when using QImage in combination with QCoreApplication.
As long as fonts weren't used we supported using QImage in combination
with QCoreApplication in 4.x, and there's no reason we can't continue
doing so.

Task-number: QTBUG-29643
Change-Id: I2cf351d3c93f1c175bbf624e45024d39ab913111
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2013-02-14 10:55:33 +01:00
Samuel Rødal
62d25e4d4f Fixed QPixmapCache associating path with wrong QPixmap.
QPixmap::load() would not detach, so multiple paths could get associated
with the same QPixmap, causing the wrong pixmap to be shown.

Task-number: QTBUG-29639
Change-Id: I064dd6a9611b5996853bec9fb20b6224a0adcf62
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2013-02-12 15:21:57 +01:00
Samuel Rødal
23b11e792c Added QWindow::Visibility convenience API to QWindow.
This finally makes it possible to make windows fullscreen etc from
QML by doing "visibility: Window.FullScreen". I don't see any reason
from not having the API at the QWindow-level instead of at the
QQuickWindow-level since this way it can benefit other use cases too.

Change-Id: If27344306eb563bc2ccd83296a46b1f2862e2db1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-12 15:02:53 +01:00
Friedemann Kleint
d180560e14 Fix QWindow::setFramePosition() to keep the size.
Change-Id: I14551e0d0573c2e8d86d76eadab4df9f3c8ed5e4
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2013-02-11 15:17:07 +01:00
Samuel Rødal
bfa1584162 Added version() and setVersion() convenience API to QSurfaceFormat.
This lets you write code like format.version() >= qMakePair(3, 2), and
format.setVersion(4, 2) instead of format.setMajorVersion(4);
format.setMinorVersion(2);

Change-Id: Ib052091cc12865ea0d5db52e468ed6cd28f14840
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-08 20:00:00 +01:00
Samuel Rødal
af84313c62 Fixed crash in image reader when reading certain BMP files.
If the high bit in a mask is set, for instance if the mask is
0xff000000, and we shift it to the right by 24 positions, since the mask
was not declared as unsigned we ended up with a mask value of
0xffffffff. We then add 1 to this value and divide by the result,
causing a division by zero crash.

The masks need to be declared unsigned to prevent sign bit extension
when shifting right.

Task-number: QTBUG-29194
Change-Id: I79260344cebfbdd3ea86416a9c734dca76517999
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-02-06 09:59:56 +01:00
Morten Johan Sørvig
a9458a1755 Clean up logical dpi for QImage.
Revert to the pre highdpi-patch behaviour.

Before, both physical and logical DPI would be based
on the dpmx/dpmy variables, which could be changed
with setDotsPerMeter(). The highdpi patch introduced
separate ldpmx/ldpmy variables, which were not
changed by setDotsPerMeter().

This broke when loading images: setDotsPerMeter
would be called but the logical dpi would not change.

Remove ldpmx/ldpmy. Keep scaling the physical dpi
by the devicePixelRatio, which will be set to 1 by
default.

Task-number: QTBUG-29187
Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-31 10:39:38 +01:00
Frederik Gladhorn
3eb588078e Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-29 11:33:35 +01:00
Sze Howe Koh
7bb43454b8 Fix minor typos in docs, printed messages & comments
Missing apostrophes

Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-28 18:12:41 +01:00
Frederik Gladhorn
02ba93dd3d Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
2013-01-28 11:10:29 +01:00
Friedemann Kleint
74c3a2f4f4 Fix warning about redefinition of M_PI in tst_qwmatrix.
Change-Id: Ib5e5fe0f087448b07adfa02984524cbb10c78395
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2013-01-28 09:41:39 +01:00
Sze Howe Koh
63569a68d2 Doc: Fix module name format
Follow the conventions at
http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation

QtCore         -> Qt Core
QtDBus         -> Qt D-Bus
QtDesigner     -> Qt Designer
QtGui          -> Qt GUI
QtImageFormats -> Qt Image Formats
QtNetwork      -> Qt Network
QtPrintSupport -> Qt Print Support
QtScript       -> Qt Script
QtSql          -> Qt SQL
QtSvg          -> Qt SVG
QtTest         -> Qt Test
QtWebKit       -> Qt WebKit
QtWidgets      -> Qt Widgets
QtXml          -> Qt XML

QtConcurrent   -> Qt Concurrent (partial)
QtQuick        -> Qt Quick      (partial)

Also, distinguish between "module" and "library"

Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2013-01-25 17:27:44 +01:00
Frederik Gladhorn
7df08a8b63 Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev 2013-01-23 22:12:54 +01:00
Allan Sandfeld Jensen
06e4b1cff4 QImage plugins should report supported mime types
Introduces the methods QImageReader::supportedMimeTypes and
QImageWriter::supportedMimeTypes which corresponds to the similar
supportedImageFormats methods, except they return lists of MIME types.

Task-number: QTBUG-28177
Change-Id: Ibb0e264a12eaf972a8bfd6bd891dcd9f89efd085
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-23 17:19:22 +01:00
Frederik Gladhorn
c608ec8254 Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
	src/corelib/io/qsavefile_p.h
	src/corelib/tools/qregularexpression.cpp
	src/gui/util/qvalidator.cpp
	src/gui/util/qvalidator.h

Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
2013-01-22 18:40:13 +01:00
Sergio Ahumada
48e0c4df23 Update copyright year in Digia's license headers
Change-Id: Ic804938fc352291d011800d21e549c10acac66fb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-18 09:07:35 +01:00
Michael Brasser
f156e578d7 Ensure raster pixmap cache key is the same as that of pixmap.toImage()
This is done to support texture uploads in an image provider. It ensures
we can load the texture using QImage in the image provider, and when
it is later painted as a pixmap, the cacheKey will be identical
(assuming no format conversion was required).

Change-Id: I54229511ed91ce5430cc478af5aff0d96685a2da
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-11 21:24:23 +01:00
Frederik Gladhorn
cdf13ce286 Merge branch 'stable' into dev
Conflicts:
	tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp

Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47
2013-01-07 15:18:16 +01:00
Giuseppe D'Angelo
2d8910cbed Introduce QRegularExpressionValidator
QRegularExpression counterpart for QRegExpValidator.

Change-Id: Ib391e73dd49e32aeb9b48e6f2217b67a17a83a11
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-01-07 12:04:53 +01:00
Stephen Kelly
cc69dff01b Gui: Remove declaration of built-in and automatic metatypes.
These types are either built-in or 'automatically declared' and so
don't need to be explicitly declared as metatypes.

Change-Id: I95b8b4b674e85b2b3c374931f6231d60f35be984
Reviewed-by: David Faure <david.faure@kdab.com>
2013-01-04 18:39:08 +01:00
Frederik Gladhorn
ca2f44680c Merge branch 'stable' into dev
Conflicts:
	examples/widgets/painting/shared/shared.pri
	src/corelib/tools/qharfbuzz_p.h
	src/corelib/tools/qunicodetools.cpp
	src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp
	src/plugins/platforms/windows/qwindowsfontdatabase.cpp

Change-Id: Ibc9860abf570e5ce8b052fb88feb73ec35e64bd3
2013-01-04 11:12:05 +01:00
Eskil Abrahamsen Blomfeldt
248ccb2889 Fix possible crash in QTextDocument
With trailing spaces in some cases, we would not get the
"no justification at end of paragraph" special case, and continue
in the code, getting the unexpected case where line_length becomes
< 0 which would lead to memory corruption because we were writing
outside our buffers. I added an assert to catch this type of bug
earlier, and I added the trailing spaces to the test for the end
of the paragraph.

The test case added is one example which would crash.

Task-number: QTBUG-27354
Change-Id: Id720a6fa55dbc709ce04dd5321e55687bf960d75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-01-03 16:15:37 +01:00
Stephen Kelly
4319f698c8 Remove metatype registration of built-in types.
As they are built-in, they are effectively registered at compile-time
already.

Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2013-01-03 16:15:37 +01:00
Oswald Buddenhagen
586adeabe4 add and use qtHaveModule() function
this is much more elegant than the so far propagated !isEmpty(QT.foo.name).
also replace feature-specific tests (no-gui and no-widgets) and the
obsolete contains(QT_CONFIG, foo) syntax.

Change-Id: Ia4b3c8febcabf9eeca67b1f9173a523820b1038b
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-12-21 19:05:02 +01:00
Konstantin Ritt
9b0fab6b62 Update Qt internals to use QChar::Script
...and remove the outdated QUnicodeTables::Script enum.
QFontEngineData now has one extra slot that never used
(engines[QChar::Script_Inherited]). engines[QChar::Script_Unknown],
if accessed, would be set with a Box engine instance, and could be used
as a minor optimization some time later.

In order to preserve the existing behavior, we map all scripts up to Latin to Common.

Change-Id: Ide4182a0f8447b4bf25713ecc3fe8097b8fed040
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-12-21 19:01:35 +01:00
aavit
a3a4114f53 Fixes: out of bounds memory access in QImage autotest
A pointer to the data of one qimage is used, with an offset, in a copy.
In the mono case, that could lead to overflow: the last row would
of the copy would stretch 1 byte beyond the end of the allocated
area. Fix by reducing the height of the copy, so that it keeps
within the allocated memory.

Task-number: QTBUG-28322

Change-Id: I09abfc83f738f8af000fc50f8c94f63dba3a6cfe
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-12-20 16:48:36 +01:00
Samuel Rødal
52619ae778 Fixed invalid memory read in SSSE3 image blending code.
We need to do bounds comparison on the actual offset we're going to use
with _mm_load_si128 to read 16 bytes from memory (even though we won't
use the trailing bytes in the end).

Task-number: QTBUG-28324
Change-Id: Id0d6094da796ca67338d8ad225fa6b2f309bbe6e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-12-14 17:12:44 +01:00
Eskil Abrahamsen Blomfeldt
02032fb229 Mark QAbstractTextDocumentLayout test as insignificant
This test fails on some setups and a pending critical change
causes the existing bug to trigger in CI. To avoid blocking
other changes because of this bug, it's been marked as
insignificant until such a time when it can be fixed.

Change-Id: Ide41f7b1c76209f9c05f95f996b2364d5dea5e67
Reviewed-by: Liang Qi <liang.qi@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-12-14 06:37:41 +01:00
Eskil Abrahamsen Blomfeldt
04f25ac46c Mark QGlyphRun and QStaticText tests as insignificant on Linux
These tests have been failing on certain setups for a while,
but some new critical changes causes the failure to trigger
on the CI system as well. We mark them as insignificant until
they can be fixed.

Change-Id: I467e7030c55d6f23515275b4062c17068d2b688c
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
2012-12-13 20:19:00 +01:00
Samuel Rødal
7da7bbcd87 Removed requestOrientation() API from QWindow.
There are no proper implementations of this API, and as it stands it
only acts to confuse anyone who stumbles across it. It will be better to
revisit the full cross platform orientation API story for 5.1.

Change-Id: Iff7054a32c6e5e4ad0cc0493a5e4ecc35a6ec4f3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2012-12-06 20:37:13 +01:00
Oswald Buddenhagen
5ea41a2efa properly syncqt-ize harfbuzz headers
we were already installing them into QtCore/private, so turn them into
proper private headers to start with. this cleans up our project files.

Change-Id: I0795f79e03b60b5854de9e4dc339e9b5a5e6fd87
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-12-04 13:57:55 +01:00
Samuel Rødal
7a7102ad07 Fixed abbreviations in QWindow::framePos() and QWindow::setFramePos().
As 672e7c875e did changing pos() to
position() and setPos() to setPosition().

Luckily there's not much code that uses these.

Change-Id: I1e1982f00412a22bd376e667a5e8c30b6149f9b5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-27 15:24:31 +01:00
Mitch Curtis
3249439b20 Remove warnings from qtbase.
geometryengine.cpp: In member function 'void
GeometryEngine::drawCubeGeometry(QGLShaderProgram*)':
geometryengine.cpp:159:93:  warning: cast to pointer from integer of
different sie [-Wint-to-pointer-cast] geometryengine.cpp:167:95:
warning: cast to pointer f rom integer ofdifferent size
[-Wint-to-pointer-cast]
benchmarking.cpp: In member function 'void TestBenchmark::multiple()':
benchmarking.cpp:85:9: warning: variable 'result' set but not used
[-Wunused-but-set-variable]
benchmarking.cpp: In member function 'void TestBenchmark::series()':
benchmarking.cpp:120:9: warning: variable 'result' set but not used
[-Wunused-but-set-variable]
qstandarditemmodel.cpp:2717:45: warning: unused variable 'd'
[-Wunused-variable]
qxcbconnection.cpp: In member function 'xcb_timestamp_t
QXcbConnection::getTimestamp()': qxcbconnection.cpp:930:40: warning:
suggest  parentheses around assignment used as truth value
[-Wparentheses]
tst_qguiapplication.cpp: In constructor
'BlockableWindow::BlockableWindow()':  tst_qguiapplication.cpp:340:9:
warning:'BlockableWindow::enters' will be initialized after [-Wreorder]
tst_qguia pplication.cpp:339:9: warning 'int BlockableWindow::leaves'
[-Wreorder] tst_qguiapplication.cpp:342:12:  waring: when initialized
here [-Wreorder]
tst_qsqltablemodel.cpp:570:10: warning: unused parameter 'value'
[-Wunused-parameter]
tst_qabstractitemview.cpp:1546:8: warning: unused parameter 'index'
[-Wunused-parameter]

Change-Id: I49c88547182e4669cfde2c2536403fc5573ca2da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-11-21 18:23:59 +01:00
Konstantin Ritt
09d0f2d447 test: Remove Q_WS_X11 from tst_QTextScriptEngine
remove private->public hack, make it build on all platforms;
replace homebrew testing code with QtTest based one

Change-Id: Iaed93fd21938620e58ae90189456df1b8061f2f5
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-11-11 12:10:57 +01:00
aavit
d91c1422a9 Fix GIF image decoding: do not zero transparent pixels
For the special transparent color index, the decoder would skip
writing anything out (thus leaving the pixels at 0 rgba value).
Although correct for later frames, for the initial frame this would
loose the color information for such pixels (which one otherwise
could have made visible e.g. by converting then image to an
alpha-less image format).

Change-Id: I316cefce8f21797feedebfbf98296ad84eaa4b99
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
(cherry picked from qt/c309d424f45dc0e7b62fbbbabf20dbfe355f48a7)
Reviewed-by: aavit <eirik.aavitsland@digia.com>
2012-11-09 16:07:51 +01:00
Shawn Rutledge
672e7c875e Remove QWindow pos, geometry and size as properties; pos->position
Abbreviated properties are to be avoided.  But all 3 of these
properties are redundant from the QML perspective; and because QRect,
QPoint and QSize are (wisely) not QObjects, it's not possible to bind
to _their_ properties, which make these QWindow properties less useful
than users might assume that they are.

Change-Id: I19c00b54b1d2712f9418e8bcf56e35a8008b89ef
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-08 15:01:30 +01:00
Shawn Rutledge
cd34da5426 Rename all QWindow properties that have "window" in them
windowTitle, windowModality, windowIcon and so on are named that way
to be similar to the ones in QWidget.  However QQuickWindow inherits
all of the declared properties, and we would like to have shorter
property names in QML.  If you are working with a Window then it's
obvious the title property is the window title.  Unfortunately,
there must be patches in many other modules which depend on this one.
In order to avoid the need to merge them all at the same time,
there is also patch https://codereview.qt-project.org/#change,39001
which temporarily adds backwards-compatible accessors, which can be
removed after the other modules are able to build without them.

We should not rename windowState to state, because in QML, state
usually drives the state machine for animation transitions etc.
(although QWindow is not an Item, a user might get confused about it).

Related patches are
https://codereview.qt-project.org/#change,39001
https://codereview.qt-project.org/#change,37764
https://codereview.qt-project.org/#change,37765
https://codereview.qt-project.org/#change,37766
https://codereview.qt-project.org/#change,37762

Change-Id: Ie4424ec15fbdef6b29b137f90a2ae33f173edd21
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-07 21:26:08 +01:00
Julien Brianceau
07ea3cf0b3 qpa: Fix rendering issue in blitter engine (negative scaling factors)
A 180° rotation results in a TxScale QTransform with negative scaling
factors (x=-1.0 y=-1.0). This is not properly handled by blitter paint
engine yet, so use software rendering fallback in this case.

This rendering issue can be seen when using "-webkit-transform" CSS
property in WebKit with DirectFB QPA platform.

Change-Id: Iee496b6bf0c90ffe36c4235ceaa2c80f296b2ca4
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-11-07 14:19:00 +01:00
Samuel Rødal
f01b498310 Introduced QWindow properties {min/max}imum{Width/Height}
These are useful when QWindow is exposed to QML.

Change-Id: I7ec49ef365183e2c784605889e8ea22c2ef34781
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-11-02 12:16:49 +01:00
Stephen Kelly
3de5a8e78b Strip trailing whitespace in itemviews.
Using

 git ls-files -z |     xargs -0 sed -i 's/ \+$//'

in the relevant directories.

Change-Id: I861ef9952fb32ed2db9ec8b67864ec7d0d61f0f2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-11-01 16:10:32 +01:00
Miikka Heikkinen
a48508cd76 Send leave to most recently entered window when modal dialog is shown.
If a modal dialog was shown as a response to button click, the button
retained its hover highlight, because it didn't get leave event.

Fixed by tracking the most recently entered window and sending a leave
to it when modal dialog is shown that blocks it.

Also modified tst_QGuiApplication::modalWindow() autotest to check
for enters and leaves.

Task-number: QTBUG-27644
Change-Id: I387647e18a762a39d523e3df31221b9583a39f9d
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-30 12:53:46 +01:00
Sergio Ahumada
fd7b3ffe5c test: Remove QSKIP from tst_QPainter::drawText_subPixelPositionsInRaster_qtbug5053()
Change-Id: I1aa329323767a3e849beca8fe41e39dbe98de4ee
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-30 12:53:46 +01:00
Konstantin Ritt
7aa0adf130 QFontEngineMulti: Fix possible crash in stringToCMap()
in case when the layout is partially initialized.
We shouldn't access any data except of indices
if GlyphIndicesOnly flag has been passed in.

Change-Id: I264689b498e0f9de8b5c040d47dbae4f6ef391c4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-29 20:31:08 +01:00
Sergio Ahumada
67a0f546c5 test: Remove dead code from tst_QPixmap
Change-Id: I1945a0f431364f47a43cf7f600ad38fdba5f4a08
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-27 00:24:16 +02:00
Sergio Ahumada
c3237f58ab test: Remove tst_QPixmap::grabWindow() function
QPixmap::grabWindow() was deprecated by 41914453d3

Task-number: QTBUG-20863
Change-Id: I7e675c124cd96cf1815b65e57f3fba19e5065066
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-25 16:22:43 +02:00
Sergio Ahumada
cdd75e9e4b test: Remove QSKIP from tst_QClipboard::copy_exit_paste()
Change-Id: Ib64680dbd966940c56ab089ff1b7727b237fdaee
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-24 01:39:04 +02:00
Giuseppe D'Angelo
bbda968a0a Fix QRegExpValidator::validate docs about the pos parameter
The code sets it to input.length() iff the regexp doesn't
match the string, while the docs say it's *always* set.

Therefore, make the docs match what the code does and
add a simple test to enforce it.

We're not changing the code to match the docs because

1) it's better to stay conservative (we don't want
to break existing behaviour);

2) this behaviour mimics what the int/double validators do
(they don't move pos at all).

Change-Id: I958074558de6b0fc5944101c6535fc7e00442ae9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-22 22:42:26 +02:00
Samuel Rødal
b213d5bfa3 Make QPen default to 1-width non-cosmetic.
Use the Qt4CompatiblePainting render hint when painting with QPainter to
treat default constructed QPens as cosmetic still.

The NonCosmeticDefaultPen render hint gets documented as obsolete, since
it was in any case not respected by the raster nor OpenGL paint engine.

Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-10-22 19:36:43 +02:00
Marc Mutz
2ec2edc24d normalise signal/slot signatures [QtGui tests]
Change-Id: I42e11de9ef1d8a04b2a8e200afb84f2245f3361a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-10-22 08:41:27 +02:00
Konstantin Ritt
9690548113 QFont: Don't invalidate engine unless request has been changed
This makes QFont do a "light" detach when the font attributes data has been changed.
The new test clearly shows that the engine is now shared between
two font instances after changing the kerning attribute.

Change-Id: I59db822f459f02d111686dba7101b98e361fada9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-19 18:04:36 +02:00
Samuel Rødal
7b8e10ddd0 Fixed inconsistent QPainter fill rules for aliased painting.
Qt 5 is the time to get rid of all the old inconsistencies in the raster
paint engine caused by trying to preserve the old X11 based
coordinate system where (0, 0) is in the center of the top-left pixel
instead of the upper left corner of said pixel. However, this was only
adhered for line drawing and path / rect filling, and not for image or
pixmap drawing and not at all when doing antialiased painting. By
defining the antialiased coordinate system as being the right one and
letting the aliased fill rules follow from that we finally end up with
some consistent behavior that doesn't lead to surprises and workarounds
in application code.

It is still possible for applications to get the old behavior by
setting the QPainter::Qt4CompatiblePainting render hint. This should
make porting easier for the few cases where an application relies on the
aliased fill rules we used to have in Qt 4.

Task-number: QTBUG-27500
Change-Id: If86b95e77d838ec83033d64af86632b9a73c74a9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-19 02:43:05 +02:00
Andy Shaw
d060620e6c Use the right properties when checking the frame's margins
Changed it to check the Frame*Margin property instead of the
Block*Margin property as this was incorrect for a QTextFrameFormat.

Task-number: QTBUG-22173
Change-Id: I2c3066165fb592ed034874b1180593822859f933
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-10-18 20:56:05 +02:00
Caroline Chao
8a2d1ce2c6 Test: remove QSKIP and remove whole test cases instead.
Change-Id: I8b625d20a2cf9215cbfdb96cd252bf1c81bba522
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2012-10-17 21:06:30 +02:00
Konstantin Ritt
3e030a9652 QRawFont: improve performance and safety of glyphIndexesForString()
As of 98c1eb1750, partially initialized
QGlyphLayout is ok for stringToCMap() if GlyphIndicesOnly flag is set,
thus we can use the glyphIndexes buffer directly and avoid copying.
Also add some checks to guarantee we're not falling into an undefined behavior
for the empty text or NULL buffer.

Change-Id: I662953703e4c65edbebabbe4b753972417d963f3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-15 10:18:31 +02:00
Rafael Roquetto
703fa6c361 Do not skip tst_QClipboard::copy_exit_paste on QNX
This test is valid on QNX platforms.

Change-Id: Ic9657c2b92628a649ab52367135dcb3a77450913
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-10-13 21:23:12 +02:00
Giuseppe D'Angelo
491247acd4 Make QValidator tests do not require a QApplication
Change-Id: I9aae997e33672203470b0429cc061a1adf88dfe9
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-10-13 05:51:19 +02:00
J-P Nurmi
6b04ee10e6 Auto tests: revise cursor dependant tests
Cursor dependant auto tests are currently skipped in various ways.
Some are checking PlatformQuirks::haveMouseCursor() that tries to
detect if the desktop environment is MeeGo, using obsolete Q_WS_X11.
Some are skipped if QT_NO_CURSOR or Q_OS_WINCE is defined and
some are actually missing the approriate guards.

=> unify by defining QTEST_NO_CURSOR in qtest-config.h when
appropriate ie. for platforms that have no regular mouse cursor
support or when QT_NO_CURSOR is defined.

Task-number: QTBUG-22551
Change-Id: I9a1e0e3156617945ae46226c79268955454c8a9a
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-10-13 05:51:19 +02:00
Konstantin Ritt
ec4593d6d0 QGlyphRun: Fix isEmpty() and boundingRect() didn't work after setRawData()
Change-Id: I44a347ef24961493d6b8353abbb215c713ccce52
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2012-10-13 03:17:53 +02:00
Samuel Rødal
dfb55f8a6c Fixed cosmetic line drawing where begin and end points are equal.
This case has typically required specific work-arounds in other
rendering paths as well.

Task-number: QTBUG-25153
Change-Id: I217e710a30222792ebca3bf297e438d944c32992
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-10-11 13:11:48 +02:00
Pierre Rossi
9adf7fb708 Revert "Handle additional format ranges when itemizing."
This reverts commit 101d04681f.
That change seems to have introduced a few regressions, and
Creator hits an assertion that it introduced because it assumes
the additionalFormats consists of well-formed ranges
(QTCREATORBUG-7995).

Change-Id: Ic4ae761e6e7f6df8a6b5ca565ceb250647420c15
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-10 23:27:03 +02:00
Giuseppe D'Angelo
361ab4fe86 Move QValidator tests to QtGui
Q*Validator classes are not in QtWidgets,
so move them where they should stay.

Change-Id: Ie6ea45a026e640fad131002bc9762c575235f3f4
Reviewed-by: David Faure <david.faure@kdab.com>
2012-10-10 23:27:03 +02:00
Morten Johan Sorvig
d4d81fe68a Remove handleSynchronous* functions.
There are now two different ways to implement synchronous
event processing. The platform plugins can choose which
one to use.

1) flushWindowSystemEvents()
   Use to flush the event queue at one point, making
   preceding calls synchronous.

2) setSynchronousWindowsSystemEvents(bool enable)
   Makes all handle* functions synchronous, bypassing
   the event queue completely.

Change-Id: I020b80c731fd13f855a377d7c91d06a4e39b6a0b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2012-10-10 19:49:22 +02:00
Konstantin Ritt
008e5ba61a Invalidate old QImage data if load()/loadFromData() has failed
This guarantees one will never get `!img.isNull()` after
load()/loadFromData() has failed, even if the image was
not null before.
Apply the same fix to QPixmap and QPicture.

Change-Id: Ida1ad6a6f0fc830df8e75ada0c163fc2d3360dea
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-10-10 13:24:23 +02:00
Stephen Kelly
43325a23f3 Delete the QVariant ctors taking global Qt enum values.
They have unexpected results in Qt 5 (the Qt::GlobalColor one works
as expected in Qt 4, but was removed in Qt 5):

 QVariant v = QVariant(Qt::red);
 qDebug() << v; // QVariant(int, 7)
 v = Qt::red;
 qDebug() << v; // QVariant(int, 7)

The correct way is to use:

 QVariant v = QVariant::fromValue(QColor(Qt::red));

The deleted constructors are the ones for which there is a class
with an implicit constructor taking the enum, and that class is
a built-in metatype.

QLocale::Language and QKeySequence::StandardKey would also fit
the description, but I can't include the header for QKeySequence
as it is in QtGui, and I don't want to include the qlocale header
in qvariant.h. Putting a QLocale::Language is probably very
uncommon anyway.

The QTextFormat test is doing the wrong thing, but the result isn't
being tested. Added new tests which fail before the patch.

Change-Id: Ia38a0784990f4d40ff7457a86daf58aabd4964eb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-10 08:45:22 +02:00
David Sansome
c3ffcbd9a2 Scale icons returned by QIcon::fromTheme.
The icon engine behind icons that are loaded from QIcon::fromTheme does
not scale any pixmaps that it returns. When using an icon theme with an
incomplete set of icons (for example, only a "128x128" folder),
QIcon::pixmap will always return 128x128 pixmaps even if you ask for
one of size 22x22.

This is contrary to the QIcon::pixmap documentation that says "The
pixmap might be smaller than requested, but never larger."

This patch uses the same code that is in the main QIcon class in the
PixmapEntry QIconLoaderEngineEntry to scale pixmaps if they are too big.

Change-Id: Ic25a3628ac82cfb899574245f658490a2dd49d54
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
2012-10-10 08:45:22 +02:00
Pierre Rossi
101d04681f Handle additional format ranges when itemizing.
This is useful when the additional formats are used on a
text layout using a raw font. It can also come in handy for
input methods operating on a QTextDocument.
We now consider all format range edges to generate the
associated items. The capitalization can be overridden via
the additionnal formats mechanism.

Adds an autotest that checks that this works with font capitalization.

Change-Id: I782d2c48d05b0dfbad480a9ca77198465292b358
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-10-08 17:22:56 +02:00
Caroline Chao
67391eedfe Test: Enable tst_QWMatrix::operator_star_qwmatrix
Expecting results were not correct. The test is passing.

Task-number: QTBUG-22362

Change-Id: Ie41c262019f76aace9062d7897d7934dc7437c3a
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-27 21:13:52 +02:00
J-P Nurmi
b0b7d9cf6b Revise QClipboard auto tests
Use PlatformClipboard::isAvailable() and fix build
when QT_NO_CLIPBOARD is defined.

Change-Id: I18c3af42fe39cf7618c2530723149848a10db985
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-27 09:14:51 +02:00
Simon Hausmann
ce1f994e9b Fix QScreen::orientation() not always being updated after changing the update orientation mask
The back-end might report screen orientation changes at any point and we
record it in screen.d->orientation. However QScreen::orientation()
returns the orientation filtered according to the mask.

Changing the mask sends a notification to the back-end, which might send
another update as a result of a possible subscription to system services
(accelerometer). However on platforms where no subscription is required, where
the platform plugin ignores the mask and always sends the latest orientation,
we should "simulate" the update by updating the filtered orientation according
to the new mask. The function is cheap to call as it won't emit any signals
unless the orientation actually changes.

This patch also adds missing flush() calls after handleScreenOrientationChange
calls in the tests to ensure that the (synthetic) window system events are
actually delivered to QScreen/QGuiApplication.

Change-Id: Iebdd050f947e658ff5bc388629aa4cb31ab497fe
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
2012-09-26 19:55:00 +02:00
Simon Hausmann
c4e736cf9d Fix events being processed on application start
Commit ef2efafcc6 introduced a call to
QWindowSystemInterface::sendWindowSystemEvents() in
QGuiApplicationPrivate::init(), which in its implementation ends up calling
sendPostedEvents() before flushing and processing any pending (internal) window
system events.

This patch changes the call in init() to use
QWindowSystemInterface::flushWindowSystemEvents() instead, which is more gentle
in that regard.

The provided unit test verifies that no posted events are processed during the
execution of the QGuiApplication constructor while at the same time verifying
what the original changed tried to do: Allow a generic plugin to provide window
system specific defaults that are implemented using the event queue of
QWindowSystemInterface.

Task-number: QTBUG-26886

Change-Id: I129a907c00d947df60fe1a02efc67857580fce24
Reviewed-by: David Faure <faure@kde.org>
2012-09-26 19:54:19 +02:00
Sergey Hambardzumyan
931640391a test:Remove QSKIP from tst_QPainter
Removed QSKIP ("currently broken... ") from tst_qpainter.cpp.

Change-Id: I2a5af009198d26015779ca368ef82188ddf1b060
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-26 04:03:41 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00
Konstantin Ritt
ceb9a8232c A step out from Harfbuzz (reduce dependency)
Introduce QCharAttributes and use it instead of HB_CharAttributes everywhere in Qt
(in Harfbuzz, the HB_CharAttributes is only used in the text segmentation algorithm
which has been moved from HB to Qt (well, most of it)).
Rename some members to better reflect their meaning,
remember to keep HB_CharAttributes in sync with QCharAttributes.
Also replace HB_ScriptItem with a (temporary) QUnicodeTools::ScriptItem struct
that will be replaced with a more efficient/friendly solution a bit later.

The soft hyphen and the mandatory break detection has been factored out
of the default text breaking algorithm to a higher level in order to refactor
the QCharAttributes bitfields and to optimize the implementation for the common case.

Change-Id: Ieb365623ae954430f1c8b2dfcd65c82973143eec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-22 00:47:40 +02:00
Samuel Rødal
ed8dec360c Fixed multiple modal windows from all blocking each other.
A modal window in front in the modal window list should never be blocked
by a modal window further back in the list. This was taken care of in
QGuiApplicationPrivate::isWindowBlocked(), we just need to make sure it
gets called when a new modal window gets shown so that its blocked
status is up to date.

Task-number: QTBUG-27206
Change-Id: I590f1715e66067edb178081352636f34fe54a885
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2012-09-21 22:04:00 +02:00
Samuel Rødal
72aaba336c Fixed inconsistent rounding of square cap pens.
A horizontal line should round up at the same time as a vertical line
with square cap, when rendering at subpixel coordinates. Thus, the
special casing in the cosmetic stroker of offsetting by half a pixel
should be for flat caps instead of for square caps.

Task-number: QTBUG-26013
Change-Id: Ic09249337f814c7de95a17976ec9e651561a744b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-20 23:08:44 +02:00
Kai Koehne
1dd4790aee Autotests: Use qInstallMessageHandler
qInstallMsgHandler got deprecated in Qt 5.

Change-Id: Ib36983e66b3a8090b99f14e3fd4e210602a3f018
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-14 15:23:15 +02:00
Sergio Ahumada
34cd8fd566 tests: Don't omit the body of a test function with QT_BUILD_INTERNAL
Changing it outside of the test function definition to avoid running
empty/inapplicable test functions.

Change-Id: I713560cde7f715696984ed082d682900f5f1bcdd
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Caroline Chao <caroline.chao@nokia.com>
2012-09-14 06:24:38 +02:00
Eskil Abrahamsen Blomfeldt
e640ebacb9 Fix regression in QTextDocument::toHtml() with font pixel size
Introduced by 2e0003eda4. We were
missing a attributesEmitted=true which caused the output from
toHtml() to sometimes be invalid when using pixel sizes to
specify the font size.

Task-number: QTBUG-25778
Change-Id: Ied61fcaef425a590d71c0b52292ac676cb88ba52
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
2012-09-12 16:05:12 +02:00
Pekka Vuorela
e06999bd62 Remove deprecated inputItem and inputWindow from QInputMethod
Interfaces introduced and deprecated during Qt5 development.

Change-Id: I804a02df8c4a03ed6558f4a86375f97d09513d5c
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-11 09:35:28 +02:00
Sean Harmer
51d40d7e9b Make gui/math3d classes use float rather than qreal
This corrects the mismatch between using floats for internal storage
and qreal in the API of QVector*D which leads to lots of implicit
casts between double and float.

This change also stops users from being surprised by the loss of
precision when using these classes on desktop platforms and removes
the need for the private constructors taking a dummy int as the final
argument.

The QMatrix4x4 and QQuaternion classes have been changed to use float
for their internal storage since these are meant to be used in
conjunction with the QVector*D classes. This is to prevent unexpected
loss of precision and to improve performance.

The on-disk format has also been changed from double to float thereby
reducing the storage required when streaming vectors and matrices. This
is potentially a large saving when working with complex 3D meshes etc.

This also has a significant performance improvement when passing
matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no
longer have to iterate and convert the data to floats. This is
an operation that could easily be needed many times per frame.

This change also opens the door for further optimisations of these
classes to be implemented by using SIMD intrinsics.

This needs to be applied in conjunction with

https://codereview.qt-project.org/#change,33548

Task-number: QTBUG-21035
Task-number: QTBUG-20661
Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-09-07 13:27:38 +02:00
Samuel Rødal
c1e5f600ab Made QImage::fill(uint pixel) for RGB888 accept QRgb values.
Previously QImage::fill() for Format_RGB888 expected a BGR value
instead of the RGB order defined by QRgb, making it counter intuitive to
use related to the 32-bit formats.

Fixed the QPixelLayout data for RGB888 and changed the byte order of
quint24 based on what the optimized image conversion routines expect.

Change-Id: I72926debbc6f5b5cb10b8aa0b2a2a916a04db946
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-08-29 16:53:00 +02:00
Eskil Abrahamsen Blomfeldt
4712d88c0e Make letter spacing APIs in QTextFormat more consistent
Change d060b6f04f introduced some
new properties to QTextFormat which were unfinished and did not
match the documentation in the same change. I've updated the API
and docs to use the regular QFont enum for letter spacing type
instead of introducing bools (which inhibits expansions later)
or mutually exclusive properties in the text format.

Change-Id: Ife44993b6746c413e421fdaf92ebaaab6ba95977
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-27 10:58:03 +02:00
Mitch Curtis
09dd19df5c Do not consider sign in qIsNull.
The current implementation of qIsNull only returns true if the value is
positive zero. This behaviour is not useful for use cases like
QPointF::isNull, where QPointF(-0, -0).isNull() will return false.
There doesn't seem to be a reason why the function exhibits this
behaviour (-0.0 is not accounted for in the unit tests), and for the
case of QSizeF::scale it causes a bug: qIsNull is used to check for
division by 0.0 before it proceeds, which fails in the case of -0.0.

Task-number: QTBUG-7303
Change-Id: I767e5280bd26614e8e78ae62b274eb9bc4ade385
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-22 04:04:57 +02:00
Andreas Holzammer
f2fabf77f9 Fix freetype font rendering for Windows CE
Windows CE does not have support for GetGlyphOutline.
So addGlyphToPath will not work. QML uses it for their
distance field rendering. One option to bypass this issue
is to use freetype as rendering backend.

Change-Id: I965254344945cbdad771a5d505fb61c1cc2087df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-08-20 12:25:03 +02:00
J-P Nurmi
fd234c2fc6 Auto test for passing QTextEdit as QSyntaxHighlighter parent
Change-Id: Ia225723de5b0b2085a72a2af26e2a563b65955d8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-18 10:58:46 +02:00
Stephen Kelly
dbe4b45f9b Remove some dead code wrapped in Q_WS_QWS.
Change-Id: Ie1ee8c4af603b924abe40145041357981d174445
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-08-03 11:24:28 +02:00
Paul Olav Tvete
3d0af143ca Revert "Move QWindowSystemInterface out of qpa."
This reverts commit 784a877d3c.

Conflicts:

	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/testlib/qtestkeyboard.h
	src/testlib/qtestmouse.h
	src/testlib/qtesttouch.h

Change-Id: Iebfed179b3eb7f30e4c95edcae5a8ad6fd50330e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-03 00:38:09 +02:00
Paul Olav Tvete
5ac4a1304b Make tests compile without gui-private
Add new qt_handleXXX functions that forward to the QWindowSystemInterface
functions, and use those in the testlib inline functions. Remove use of
struct QWindowSystemInterface::TouchPoint from the testlib header files
(requiring some slight increase in ugliness in the two tests that use
that struct).

Also remove the qmake hack that adds private headers to all tests

Change-Id: Iec23537e55a44802f6e9cd463f7a0f82007c5250
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-08-02 17:25:37 +02:00
Thiago Macieira
672b5b7ab6 Set the Qt API level to compatibility mode in all tests.
Qt 5.0 beta requires changing the default to the 5.0 API, disabling
the deprecated code. However, tests should test (and often do) the
compatibility API too, so turn it back on.

Task-number: QTBUG-25053
Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-01 15:37:46 +02:00
Rohan McGovern
3f5f692630 tests: disable qstandarditemmodel test when building without QtWidgets
This test uses QTreeView.

Change-Id: I6ba56ad6ec3687a5b90d516be10d6f88e248d53d
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-07-30 06:06:10 +02:00
Stephen Kelly
9784dd8d06 Implement implicit constructors for built-in classes.
Change-Id: I6b0b104bc1da3252d014615c50b81830de42e722
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-27 03:27:23 +02:00
Marc Mutz
e083d25395 QMetaTypeId2::IsBuiltIn: (new) template meta-function to check for built-in types
This allows to check whether QMetaTypeId2::MetaType exists, and can help
turn run-time into compile-time expressions, even without constexpr support,
or in situations where constexpr can't be used (because you can't overload
on it). This was designed for the QMetaType::registerConversion feature,
but it's much more widely applicable.

Change-Id: Iafa04add04bcb531b3f7fe3e751c7e91ee6a3bc0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-26 15:01:04 +02:00
Friedemann Kleint
aaaf60aeab Remove usage of deprecated qWaitForWindowShown(QWidget *) method.
Remove usages from autotests with the exception of
widgets/kernel, widgets/widgets and widgets/graphicsview.

Change-Id: I917b2857ed0cd07a6b3dbcd69244f558086c6586
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-25 17:32:21 +02:00
Friedemann Kleint
4677cf3d01 Deprecate the qWaitForWindowShown(QWindow *) method.
While the qWaitForWindowShown(QWidget *) is inherited
from Qt 4.8, the qWaitForWindowShown(QWindow *) was introduced
in Qt 5. As it is identical to qWaitForWindowExposed()
and removed already, it can be deprecated in Qt 5.

Remove its usages in qtbase.

Change-Id: I28788d120ad687a49f02b2b44de6b38a2832fe5c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-25 07:24:49 +02:00
Stephen Kelly
b3694d1295 Split the QGuiVariant test from the Core one.
This makes development on the meta type system easier because only
QtCore must be re-built to run most of the tests. The existing
QGuiVariant test needs to be run before pushing anyway, but not
so frequently.

Change-Id: I1fa66edbd790c957e1a232226847dd550227a477
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-25 00:48:33 +02:00
Friedemann Kleint
bcb5e564ff WindowSystemInterface::sendWindowSystemEvents(): Remove unused parameter.
No need to pass the dispatcher. Get rid of Windows logic to maintain
a stack of dispatcher associated with flags.

Change-Id: Ic2daad4b6762a46fac3274937effc188af436c9a
Reviewed-by: David Faure <faure@kde.org>
2012-07-23 19:57:07 +02:00