Commit Graph

8468 Commits

Author SHA1 Message Date
Marc Mutz
15f041e6d5 QtOpenGL: use nullary version of qRegisterMetaType<T>("T")
Using the nullary version has the advantage that multiple calls
during a program run are much more efficient, since an inlined
atomic is used to store the result. For this, it requires
Q_DECLARE_METATYPE(T), so add, too.

Change-Id: Ic9a9013aa13ff9d8f917f9df033dd2197944f84a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-25 00:48:38 +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
Stephen Kelly
f9db44ad15 Make sure that unknown types use the handler for unknown types.
This fixes an assert in the QVariant checkDataStream unit test when
it no longer links to QtGui.

Change-Id: Ib45139cf790f3ac6ee80e1c59f50d08d0b51ffa4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-25 00:48:28 +02:00
Stephen Kelly
80cd5d2017 Use a large core type for the QVariant::setValue test.
The type needs to be large enough that
QVariantIntegrator<T>::CanUseInternalSpace is true.

Change-Id: I311c44bedfebd946e41639975df206c27b6d55ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-25 00:48:24 +02:00
Stephen Kelly
dec9666dd4 Make qRegisterMetaType constexpr for built-in types.
For consistency with qMetaTypeId, and because we can.

Change-Id: I6882a16ef3c0d84539048c9f2c201c4a2b2ca7ad
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-07-25 00:48:20 +02:00
Stephen Kelly
a5b0290497 Don't make the CMake file generation dependent on DESTDIR.
It is expected to be well defined for the CMake files to be generated
correctly, but if that stops being the case, it should fail loudly. All
of the generated CMake packages are CI tested.

Change-Id: I67c7fa6ef1fe0a019c40936cb12db282669e9ee8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-25 00:48:10 +02:00
Kevin Ottens
a31ac11d98 QNX: Remove mouse events synthetized from touch events
This behavior is now implemented in a finer way in QtQuick and
QtWidgets, it's not needed anymore in the platform plugin.

Change-Id: Iacdcd313253627fbba094abe4e9a9c1d23a431e1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
2012-07-24 22:28:44 +02:00
Marc Mutz
e9ecf1b420 QtDBus: use qMetaTypeId<T>() instead of qRegisterMetaType<T>("T")
Using qMetaTypeId<T> has the advantage that multiple calls during
a program run are much more efficient, since an inlined atomic
is used to store the result. It also ensures that
Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>
(the unary version) will happily register anything.

Had to add a proper default constructor to QDBusError, as the
one doubling as the default constructor wasn't available under
QT_BOOTSTRAP, but Q_DECLARE_METATYPE requires a default ctor.

Also changed a nullary qRegisterMetaType() to qMetaTypeId() in
qDBusRegisterMetaType(). They're equivalent, since the former
just calls the latter, but apart from the miniscule optimisation
that the compiler has to instantiate one function less, the result
is also used, so using qMetaTypeId() better expresses what 'id'
is.

Change-Id: Ib9dde17923ab9ee55f9464138a625ab8cd55c482
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 20:11:05 +02:00
David Faure
95232af3ef QAbstractNativeEventFilter: document return value
(paragraph taken "as is" from the QObject::eventFilter documentation)

Change-Id: I1b7e92736103042d7105f1b26ba4784cbcc43dc2
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 12:45:02 +02:00
Oswald Buddenhagen
1a470256e1 remove support for rvct_linker config from MinGW generator again
yet another symbian remnant (building windows arm executables for the
simulator).
This reverts commit 5c88141ed0b25d8ab9318bf4cb5dda54b90b2ce1.

Change-Id: I6eb147c0e2710eba09a4339fa4a08a5b08f8dab3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 12:45:02 +02:00
Oswald Buddenhagen
8fa9249acc $$QMAKE_LIBDIR contents belong into $(LIBS), not $(LFLAGS)
unlike for the unix linker, this does not matter for the windows linker,
but keeping it consistent has advantages.

Change-Id: Ib9b9efa18c31d87c026d3cac5a8737f4612ad1c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 12:45:02 +02:00
Oswald Buddenhagen
2184b27462 do not run findLibraries() over QMAKE_LFLAGS
libraries and related flags have no business in that variable, by
definition.

Change-Id: Ic958a3e082a498945ab56bc12ec05d4083ee43a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 12:45:02 +02:00
Oswald Buddenhagen
e5b203dbc7 dispose of MSVCPROJ_LIBS
this way QMAKE_LIBS{,_PRIVATE} can be treated the same as in all other
generators, which allows us to:
- make the windows generators' findLibraries() be more like the unix
  version
- dispose of QMAKE_INTERNAL_PRL_LIBS handling while reading prl files
  (because the output always goes to QMAKE_LIBS)
- as a side effect, QMAKE_LIBS_PRIVATE are not subjected to prl file
  resolution any more, which is again consistent with unix - the
  correctness of that needs to be assessed separately.

Change-Id: Ie9bc04d117eff6a7cde846677f98acf3c64aa6ee
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 12:45:02 +02:00
Oswald Buddenhagen
c1056c80fb remove apparently pointless call to findLibraries()
the function was already called long before. if it really needs to be
called again, it's a) probably affecting the other windows generators as
well and b) the actual problem should be fixed instead.

This reverts commit d50c3c6624b2343e42d0df4b72212d9ced8f3682.

Change-Id: Iaa2007640fbc9acdc50ba3b0681efeb0d184f224
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 12:45:02 +02:00
Stephen Kelly
94c2745074 Remove obsolete or commented use of Q_DECLARE_METATYPE.
Change-Id: I15bc845801b9f84a9252a0092fbd69f0e1b3f4ea
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
35a5f7f661 Remove obsolete TODO.
This will probably not be done in time for Qt 4.7.

Change-Id: Ie9112cee021e31849f5b43eefb8eb57537d01a2d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-24 10:46:24 +02:00
Kevin Ottens
7808ec795c Propagate synthesized mouse events in parallel (lock-step) with touch
This patch implement the equivalent of
468626e99a90d6ac21cb311cde05c658ccb3b781 in qtdeclarative but for
QtWidgets.

If a widget doesn't accept a touch event, then QApplication gives it
another try by synthesizing a corresponding mouse event. This way
QtQuick and QtWidget behave in a similar way, removing the need for
platform backends to try to emulate a mouse event from a touch event
unconditionally.

Also add relevant unit tests and adjust old QApplication ones.

Change-Id: Iddbf6d756c4b52931a9d1c314b50d7a31dbcdee9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
349f16b03c Replace old typedefs with their built-in equivalents.
Change-Id: I3ecb75ace431b92a13de67aa6426cf570398587f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
86992d6adb Fix typo pallete -> palette.
Change-Id: I17b71bfed22c3692b027556ef2e5d6ece4f3f77e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-24 10:46:24 +02:00
Marc Mutz
c76a641a27 QAbstractItemView: don't qRegisterMetaType<QModelIndex>
QModelIndex is a build-in type nowadays and doesn't
need to be registered anymore.

Also remove them from the tests.

Change-Id: I47029972651c045c880cee86fb292116a29493d5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 10:46:24 +02:00
Stephen Kelly
45cb8be4f9 Add tests of the various testlib definition possibilities.
The behavior of QTEST_MAIN depends on whether QT_GUI_LIB or QT_WIDGETS_LIB
is defined. It could create a QGuiApplication or QApplication which
could cause linking issues if the corresponding library is not linked to.

The failure cases are also tested.

Change-Id: I61ed0bc760564ef42ce1dbd86c83c06348c860ff
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-24 08:44:27 +02:00
Laszlo Papp
4eb6482751 Remove the unnecessary qdebug.h includes in the QPoint(F) tests
Change-Id: I5c45af9d498e20b46d6faf8c96de87586eca7b4a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-24 06:31:26 +02:00
Thomas McGuire
f83954c631 Provide access to (dis)connectNotify() from other objects.
This is the first step to fix (dis)connectNotify() not getting called
for QML signal handlers and bindings.

Change-Id: I5cfc126a5562a20031d3af8415c60d101603dd8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-07-24 04:23:45 +02:00
Marc Mutz
d4c241a980 QtConcurrentFilter: remove unused typedef (GCC 4.8 warning)
This one actually triggers a failure in tst_headersclean.

Change-Id: Id37184bacf910702879fa68014705ed5399cea1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 00:08:28 +02:00
David Faure
42c86bba9d Remove winEventFilter, replaced with installNativeEventFilter.
No reason to keep a virtual method for Windows when all other similar methods
(macEvent and x11Event) have been removed, and when installNativeEventFilter
provides a much nicer solution (no need to derive from QApplication).

Change-Id: Ia2a7960e320fcbd04cef91f467900861dbb377c1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-07-24 00:08:28 +02:00
Friedemann Kleint
607c37befb Remove usage of deprecated qWaitForWindowShown in dialog tests.
Change-Id: Id3ebe202d65ee682e8e2e3ae107808e9abb6cc15
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-24 00:08:28 +02:00
Mitch Curtis
d38fb0b535 Correct QDomDocument documentation re deletion of internal objects.
Task-number: QTBUG-25641
Change-Id: If1f46757d2d1e678e4b9e939da89a497da71dccf
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-07-23 22:02:18 +02:00
Mitch Curtis
300e15f688 Fix q_check_ptr typo in QtGlobal documentation.
Task-number: QTBUG-24093
Change-Id: Ia6b4ef49e07910ceddd826b3b7cc81ca41f33d01
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-07-23 22:02:18 +02:00
Mitch Curtis
d499d04a17 Replace Q_REGISTER_METATYPE in QAbstractSocket::stateChanged doc.
Should be Q_DECLARE_METATYPE.

Task-number: QTBUG-24692
Change-Id: I9c8b8d503fba254661e8f0d72855758d5d03ada1
Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>
2012-07-23 22:02:18 +02:00
Mitch Curtis
2fee2412c2 Correct QLineEdit::inputMask documentation.
The documentation says:

"Unset the mask and return to normal QLineEdit operation by passing an
empty string ("") or just calling setInputMask() with no arguments."

However, the parameter for setInputMask is a const QString&, so calling
it with no arguments will result in a compile error. The documentation
should not advise calling setInputMask() without arguments.

Change-Id: Icd8e063dcd3d745bd4bf0c6851a38f63481957ae
Task-number: QTBUG-24803
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
2012-07-23 22:02:18 +02:00
Giuseppe D'Angelo
58ec01e278 More qHash(T, uint) support
Add the seed to QPair, QUuid, QPersistentModelIndex's qHash(), and fix
qHash documentation for them and for many other datatypes.

Change-Id: I1386f3ed42ee1a832371a242ee5c82895ba92c2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-23 19:57:07 +02:00
Lars Knoll
acbfb4d777 Move the windows locale codec into it's own file
Simple cleanup, that will make it easier to refactor
the code to use ICU.

Change-Id: I7486f36d27b8c521cf970327eb94b2236338d4ec
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2012-07-23 19:57:07 +02:00
Laszlo Agocs
7a3dd20b98 Add basic backingstore implementation to kms
This allows using the kms plugin in QWidget apps having a single
(preferably fullscreen) top-level widget.

Based on eglfs' implementation. Dirty rectangle tracking is missing,
should be added later.

There is no composition so multiple TLWs will not work nicely.

Change-Id: Ia78589d1a375925ebdcc46aa20fc1619ec14d6cc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
2012-07-23 19:57:07 +02:00
Mitch Curtis
c2942cb7b6 Clarify ambiguous sentence in QVariant::toBool() documentation.
Task-number: QTBUG-26482
Change-Id: Id9158ba1f7ffa5af169f808aed4559f7a0470e20
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-07-23 19:57:07 +02:00
Jan-Arve Saether
4d573117c4 If the GL driver is singlebuffered, reflect that in QSurfaceFormat
Change-Id: Iafed64d0a35f8d49357f147c8b7b4c0e9f4b9173
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-23 19:57:07 +02:00
Jan-Arve Saether
6fbf9506e6 If swapBehavior is TripleBuffer, set WGL_DOUBLE_BUFFER_ARB to TRUE
Previously, if the drivers' swap behaviour was single-buffered
it would fallthrough (just like DefaultSwapBehavior) and remain
single-buffered.

Change-Id: I4b93ad7a49094aa992d0b8fb3429c163bbbf655d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-07-23 19:57:07 +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
Sean Harmer
0026b80cd2 Improve the loading performance of QLibrary
If an absolute path is specified we try that first. Otherwise we first
try the most likely system-specific format (e.g. libfoo.so) on Unix.
This improves performance especially on systems with slow flash devices.

For example, prior to this commit loading the Xcursor library (in the
xcb plugin) results in attempts to dlopen:

"Xcursor"
"Xcursor.so.1"
"libXcursor"
"libXcursor.so.1"

With this commit this is reduced to a single attempt of:

"libXcursor.so.1"

Plugin loading uses absolute paths with QLibrary so there is no
performance penalty for plugins with this commit.

This is however a behavioural change with respect to Qt4 but one
that I believe is justified and wanted.

Change-Id: I7813afa335f9bf515e87934c2f8f97888818c69c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-23 17:56:13 +02:00
Sean Harmer
b182940340 XCB: Record the OpenGL profile in the format
Change-Id: I68f9e78e15fc798ec801feed74e0cb900ef577ae
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-07-23 17:55:40 +02:00
Sean Harmer
3e760da85a QNX: Use new native event filtering api
Change-Id: Iaf25697e6250ad29085647db4b8e50e274599227
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: David Faure <faure@kde.org>
2012-07-23 17:55:26 +02:00
Stephen Kelly
73d127397d Quote the SONAME properly.
It does not make a big difference, but it is what was intended
initially.

Change-Id: Idd7e06c857533030b000726ff87b48bb2619df06
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-23 17:48:51 +02:00
Marc Mutz
401e6f2581 QPaintBuffer: use the nullary version of qRegisterMetaTypeStreamOperators()
The name is taken from the existing Q_DECLARE_METATYPE()s.
Also don't call qRegisterMetaType<>, as that is done within
qRegisterMetaTypeStreamOperators<> already.

Change-Id: Ia782868b49bc97d78e0cec29ef9f8b5709420e2a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-23 17:48:39 +02:00
Marc Mutz
e20047c6cb QStyleFactory: remove unused typedef (GCC 4.8 warning)
Change-Id: I50ef91f4df3cdf1ae039dce269e37185eece6b8d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-23 17:48:34 +02:00
Stephen Kelly
cb43dec31e Split QWidgetsVariant tests into a separate testcase.
This allows building the QVariant tests without the QtWidgets module.

Change-Id: I7cd7e78a60c7bc7614ec16df1abe1e93e45d4923
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-23 17:47:51 +02:00
Stephen Kelly
58b3dd71d8 Create CMake files conditionally on the internal_module CONFIG option.
This includes a revert of 195df6e8e0
so that the solution scales better to other Qt modules, and other
logic related to 'internal' modules.

Change-Id: Ie4c1f10d20953aeb15438273081a810ab8bc9ec9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-23 17:39:39 +02:00
James Turner
78d8c201f1 QTBUG-26296, dock widget moving
Cocoa lacked implementation of FrameStrut events, and also frameMargins on
QPlatformWindow. Fix both of these issues. Unfortunately QDockWidget also
contains a tangle of #ifdef MAC behaviour which I am unclear about. What's
included here disables some logic on Mac that seems definitely wrong -
while moving a window on Mac we now generate NonClientArea events
(as intended, I believe), but this should not cause dock-widget dragging to end.

Note the window titlebar is the only frame-strut/non-client area on Mac (as far as I can see)

Task-number: QTBUG-26296
Change-Id: Id0c6e954db64b9f9f71d16355cb92922877e5ebe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-23 17:12:57 +02:00
Stephen Kelly
2dc1722b9e Add the CMake directory created during unit testing to .gitignore.
Change-Id: I769857ffca9ff14147d6704079fd0a55ff82fb79
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-23 07:06:23 +02:00
Stephen Kelly
01d69e37f4 Exclude the delayed resource file test on Windows.
The feature does not work there.

Change-Id: I4c19577d3882b5ea01d20f4a67a512c1e6bc803e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-23 07:02:37 +02:00
Stephen Kelly
450d9ce4ba Add a test for all QtBase modules.
Change-Id: Ib87e56f063603d474e232a137246ab6a60f63a23
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-23 07:00:04 +02:00
Kai Koehne
e6558184eb Logging: Simplify message handler logic for windows
Incorporate the functionality of qWinMessageHandler in qDefaultMessageHandler.

Change-Id: Iec5b19e187c0d2e3d8d0874280ba57f6fb21d7b4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-21 16:24:43 +02:00