Commit Graph

7246 Commits

Author SHA1 Message Date
Lars Knoll
4d0424b671 Ask the platform drag for the correct default drag action
This fixes a remaining feature regression from Qt 4.x, where the
dragmanager also determined the default action for a drag given
the set of supported actions and the keyboard modifiers.

Task-number: QTBUG-25373
Change-Id: I80b23b135ba218eb5b7ccc692f12140477bc7809
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-05-29 20:13:03 +02:00
Thiago Macieira
a4ca3280c0 QApplication::activeWindow is replaced by QApplication::focusWindow
Change-Id: I28ec9b59171fbacbe5c7c0dd1cc998d75538545f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-05-29 20:12:53 +02:00
Friedemann Kleint
a09c20f19b QWidget::grab: Add a default value for the QRect parameter.
The documentation is misleading in that a default-constructed
rectangle that has size = 0 causes the entire widget to be
painted; this happens only if the one of the size values is
 < 0.

Add a default value such that size < 0 and the entire widget is
painted based on the rationale that a size = 0 might be the result
of some calculation and it would be unexpected to get a pixmap
containing the entire widget in that case.

Change-Id: I2a5fb38cd407b4b64348213101d8196b2c40ad9a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-05-29 20:12:39 +02:00
Friedemann Kleint
65a264c4a1 QWidget::grab(): Do not call adjustSize() unconditionally.
This breaks the combo dropdown animation on Windows as it
uses special layout tricks and potentially other (unlaid-out)
widgets.

If the size is unknown, call prepareToRender instead.

Reverts d6f971c854.

Change-Id: If44e2a7e7fb134c228674cf228bbee0d5520e04f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-05-29 20:12:32 +02:00
Friedemann Kleint
97659d87be Windows QPA plugin: Add \internal to class documentation.
Prevent the classes from appearing in the Qt documentation.

Change-Id: I62abff0c57effdf16629f9d5a0dc384ea2c43d5a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-05-29 20:12:24 +02:00
Holger Hans Peter Freyther
486f0e93de Only build devicediscovery on linux systems
libudev and linux/input.h are Linux specific. Instead of add a !*bsd*
to the pro line I have decided to only check for linux-*. This is fixing
the compilation on FreeBSD.

Change-Id: If59481421e811eca205407031db593e00b6e8534
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-05-29 19:54:25 +02:00
Laszlo Agocs
243a0660e1 Make qWaitForWindowShown more robust on X
Try ensuring the window has received its valid position from the WM.

Change-Id: Ibd75bc19ae820765bfaadd30c22e77a19cd28849
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-05-29 11:37:35 +02:00
Eskil Abrahamsen Blomfeldt
2e6b8b4734 Disable GSUB feature when text contains surrogates
This is a work-around for a feature missing in Harfbuzz that
can make a text run that contains a surrogate and a ligature
crash. This will potentially cause the ligatures to break up
if you combine them with a surrogate, causing visual changes
to the text, but the scripts that require GSUB should not be
affected by this, since they will not use surrogates. Still,
it's not a permanent fix, but will serve as a bandaid for the
crash until the underlying problem has been fixed.

Task-number: QTBUG-22275
Change-Id: I90c37fba76bc7d1f369f3afddd1bd0dc306f5750
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-05-29 11:35:21 +02:00
Thiago Macieira
291b05e4b2 QApplication::syncX doesn't do anything in Qt 5 anymore
Change-Id: I325f8badeb5bd7120c691b49fdf51dc9b2649f68
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-05-29 11:35:21 +02:00
Bradley T. Hughes
19e2b4d6eb Remove unnecessary forward declaration in std namespace
qiterator.h doesn't use std::bidirectional_iterator_tag or
std::random_access_iterator_tag, so remove the forward declarations.
(These actually confuse clang when building with C++11 support enabled).

Change-Id: Idd0daa0840a0995e6e5b0ffc01ddcdf06f048149
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-29 11:35:21 +02:00
Thiago Macieira
fad1fa65ed QtDBus: compile with QT_STRICT_ITERATORS
Unlike most other modules, QtDBus in its use of QVector also needs to
check if the item isn't null, which makes for some special changes.

Change-Id: Ia22ad2a6b26c9c34dc09ab882d81323a941d166a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-05-29 11:35:21 +02:00
Thiago Macieira
395f7579c0 Make qdoc compile with QT_STRICT_ITERATORS
Change-Id: I2923315678d1aef516b35a8c83fe734367723a28
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-29 11:35:21 +02:00
Giuseppe D'Angelo
779e2f38ea QtOpenGL: remove \link usages
Change-Id: I34509eaf87a91bf31a78b08c91d9a57e704d8989
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-29 11:35:21 +02:00
Giuseppe D'Angelo
5343ec6cff QtXml: remove \link usages
Change-Id: Ifcf1e66bad04e312c29de623fee47fabb91cc108
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-29 11:35:21 +02:00
Giuseppe D'Angelo
3471e2de78 QtWidgets: remove \link usages
Change-Id: I9887a24485233f29d07054b3110d4db9e499b9f4
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-29 11:35:21 +02:00
Giuseppe D'Angelo
358f78f215 QtGui: remove \link usages
Change-Id: Ib8cca14a8fa35fbc631bfea9b4873225eac3677f
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-29 11:35:21 +02:00
Giuseppe D'Angelo
2c49ea852f QtCore: remove \link usages
Change-Id: I0de764b51a972de0b6eb2bf3c04d2b190f581f52
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-05-29 11:35:21 +02:00
Rohan McGovern
dd3e4f1dbe Set explicit testcase.timeout for slow tests
We'd like to decrease the default timeout for tests in the Qt Project CI
so that we waste less time waiting for hanging tests.

Tests which genuinely take a long time to run, such as these, should
have their timeout explicitly set in their .pro file.

Change-Id: I4fe6249e9efa764b230251d73a1115c24411e168
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
4e9e4d940f Make tst_qfiledialog2 closer to parallel-safe.
Use a QTemporaryDir instead of the system-wide temporary directory.

The test is still not entirely parallel-safe (at least on X11) due to
requiring the shown dialog to have keyboard focus.

Change-Id: I628dc6ab52dda49f6957a301eea8944bb9d81453
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
b1e59467fb Make tst_selftests parallel-safe.
Use a QTemporaryDir for temporary files, instead of the current working
directory.

Change-Id: Ifeb2944238f785a1f7beb0dc2a7c1e092d121db5
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
70ad49d661 Mark tst_qsharedpointer as parallel-safe.
This autotest seems to be parallel-safe.  It was not marked as such due
to an issue which rarely causes the test to hang on exit on Windows, but
that appears unrelated to whether or not the test is run in parallel.

Change-Id: I30bac75be3ddc14139594605481eb6af3f6795e7
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
f21832a465 Marked tst_qmake as parallel-safe
This autotest fails a parallel-stress test because it writes into its
own source/build directory.  However, by inspection, it appears not
likely to cause issues with any tests other than itself.

Change-Id: I13789ba14bab240d34c22c5b77d6407995423afc
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 09:39:18 +02:00
Bradley T. Hughes
88da8b4878 QMutex: de-inline lock(), unlock(), and tryLock()
See the discussion of this topic on the mailing list:
http://lists.qt-project.org/pipermail/development/2012-May/003943.html

The consensus is to not have these methods have inline code to actually
acquire the lock (i.e. no atomic test-and-set or similar). QBasicMutex
is unchanged, and continues to have inlined lock(), tryLock(), and
unlock(). QMutexLocker has been changed to always call QMutex::lock()
(even though the constructor takes a QBasicMutex parameter).

Change-Id: Ic7d2d9d581e6b254c84fdfdd8ce6c425535a8078
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-29 07:35:31 +02:00
Rohan McGovern
61904b8cfc Make tst_qfilesystemmodel parallel-safe.
Changed one testfunction to use the test's own QTemporaryDir instead of
the system-wide temporary directory.

Change-Id: I6740a7f4ba7f53174cd0730239d8dc088e5111ba
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 03:04:29 +02:00
Rohan McGovern
c68f4367f6 Make tst_qnetworkreply parallel-safe.
Ensure we always use a unique filename when writing to test files.
The test already contained code for this, but it was not applied in a
couple of places.

Change-Id: I1e29ee162c390e014688ab46e3658e2a463d203e
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 03:04:29 +02:00
John Layt
5bd5f6ae69 QtPrintSupport: Change QPrinterInfo::defaultPrinter() behaviour
In Qt4 QPrinterInfo::defaultPrinter() has inconsistant behaviour
depending on the platform.  On Mac and Unix if no default printer
is set in the system then the first available printer is returned.
but on Windows it returns a null QPrinterInfo.

Currently Qt5 returns the first printer on all platforms, but this
causes an inconsistency if you call isDefault() on the returned
QPrinterInfo.

The apidox is slightly ambiguous, but does seem to imply no printer
will be returned if no default is set.

The only place in Qt the public api is used is in QPrinter which is
coded expecting that defaultPrinter() may return null but for there
still to be availablePrinters().

Change-Id: I1bbef8cba259b7d51980a0199e9fd6d5466d921f
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-05-29 00:41:46 +02:00
John Layt
d9a7f9488f QtPrintSupport: Fix QPrintDialog assert
Fix an assert that wasn't changed when the "Print to PS" option was
removed

Change-Id: Ife7350976707059861660a74dc2f89d302d861f0
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-05-29 00:41:43 +02:00
Jiewen Wang
3be6ca3ee8 Eliminate QTreeWidget drag crash
In QTreeViewPrivate::adjustViewOptionsForIndex() wrong index had been
used when referencing to array of viewItems. Variable row is set to the
index of the QModelIndex, however it is not as same as the index in
viewItems[] when there was hidden item in treeWidget. Index of viewItems[]
should be used here. Unit test is added as well.

Change-Id: Idc7eda979e7d09c5a07bd6dffd92b7abbac10e67
Task-Id: QTBUG-25333
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-05-28 16:49:56 +02:00
Rohan McGovern
177070cb7b Add CONFIG+=parallel_test to suspected parallel-safe tests.
These tests have passed a parallel stress test on all three of Linux,
Mac, Windows.  Mark them with CONFIG+=parallel_test to allow CI to run
them in parallel, saving time.

Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-28 07:33:01 +02:00
Rohan McGovern
f5c5063623 Marked tst_qprocess insignificant on mac
tst_qprocess::lockupsInStartDetached sometimes locks up on mac.
Mark this as a known issue.

Task-number: QTBUG-25895
Change-Id: I08b1bcf39f2bf373e74509a06415d9ba514b8993
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-28 03:30:21 +02:00
Jędrzej Nowacki
db06953ca1 Replace QVariant::typeToName usage by QMetaType::typeName call.
Type information is kept in QMetaType class. QVariant is delegating
operations, so it is better to use QMetaType directly.

Change-Id: I91209fa1c9dc4303d6bd47c96824d3cd64ce5291
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-28 03:30:21 +02:00
Mitch Curtis
cebcfcc66b Fixed unused function warning in qtextdocumentfragment test.
Change-Id: I74bb961bf23c4ca1e8e5dc77e870d43fcecc5c09
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-05-28 01:12:34 +02:00
Simon Hausmann
709111e920 Fix compiler warnings when simply including qgraphicsscene.h
Commit 02b80ebb52 marked itemAt(x, y) and
itemAt(point) as deprecated, causing a warning when code calls the function.
Unfortunately the itemAt(x, y) overload calls the itemAt(point) overload,
causing a compiler warning even when not using any functions from
qgraphicsscene.h at all.

This commit fixes itemAt(x, y) to not call itemAt(point) but use the
non-deprecated items() function directly.

Change-Id: I9c4d3a070d65f3406cdab00345c56d4fc62e76c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-27 21:50:30 +02:00
Gatis Paeglis
02b80ebb52 Fix To-Do's in QGraphicsScene.
Mark obsolete functions with QT_DEPRECATED.

Task-number: QTBUG-25092

Change-Id: I89d9e508479b75ad2d8bf131c69f6158b71fcda8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-26 10:15:36 +02:00
Gatis Paeglis
2defa750b7 Qt 5 to-do in QXcbKeyboard
Rescheduling to Qt 6 since Qt 5.0 was decided to have as little source incompatible changes as possible.

Change-Id: I47cd3e236dd90717efb287aef8fbbedacea1bc0f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-05-26 10:14:23 +02:00
Gatis Paeglis
9b7b90cf55 Fix Qt 5 to-do's in QGraphicsProxyWidget
Task-number: QTBUG-25091

Change-Id: Ic4160f90f69167d40ee1e569562d25eb009615aa
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-26 10:14:12 +02:00
Mitch Curtis
ccd56e9844 Clarify QByteArray::size() documentation.
QTBUG-25438

Change-Id: I8cf9bfb295195548b6f7d4410682e4d675181a65
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-05-26 02:47:01 +02:00
Johannes Zellner
9a17206b5c devicediscovery: add more sophisticated discovery
Detect devices based on bit testing through evdev ioctl api. As this is
for the udev replacement, the bit testing is done similar to what udev
does. The current keyboard detection is based on testing if the KEY_Q is
available. This might be adjusted in the future.

Change-Id: I3f4176681a351e33d90a1425f1afedc8ce3640b8
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-05-26 02:47:01 +02:00
Sean Harmer
48768ab433 QNX: Adding native file dialog support for Blackberry
This patch enables use of native file dialogs in the application
modal case.

The native file open dialog is reasonable but the native file save
dialog could do with some improvements to make it more usable.
Perhaps providing our own "native" dialog UI would be an option
once the widget style is finished.

Change-Id: If5fb7cf73d27e52db7bfa6d97d8f8fb7912960bb
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
2012-05-26 00:34:40 +02:00
Thiago Macieira
c4fbe872be Itemviews: compile with QT_STRICT_ITERATORS
Just a few mixed up iterators.

Change-Id: I19f62457ee24bc844fadd182ba61866e259e9636
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-05-26 00:34:40 +02:00
Tasuku Suzuki
576d4a1cce Fix xcb plugin compilation for -qconfig large
Change-Id: I1ee1fb9c140396e83272d607ee4dd63ce2c50b8d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-26 00:34:40 +02:00
Konstantin Ritt
ad7d953963 Declare typeinfo-s for QLatin1String, QStringRef, and QCharRef
Change-Id: I05e0f866c632f2a7e966e6bae9c73eeb77d99217
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-25 21:49:35 +02:00
Konstantin Ritt
10da6417ee Replace const QCharRef & with QCharRef where appropriate
in order of consistency with QChar

Change-Id: I8a7cf8960eb64ef177113d4569f1c49ae31c828e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-25 21:49:27 +02:00
Konstantin Ritt
09f20e75a4 Replace const QLatin1String & with QLatin1String where appropriate
Task-Id: QTBUG-24502

Change-Id: I360dee4dc68c165de0631ce4cf34e76fd873080e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-25 21:49:21 +02:00
Konstantin Ritt
c31681ab62 Move QLatin1String up to QString
This is needed for the change that follows

Change-Id: I05611defe422fa4bbb5be27b102e39b1f61a1cbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-25 21:49:15 +02:00
Konstantin Ritt
f728afcd85 Centralize C-string and QByteArray string length calculation
QString::from{Ascii|Latin1|Utf8|Local8Bit} does the string length calculation for us,
so let's use that and don't repeat the copy-paste bugs like the previous commit has fixed.

Change-Id: If0bced3ebaf75b56dde6be1266c47c3fbf89dab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-25 21:49:05 +02:00
Konstantin Ritt
e96e80687e QString: get rid of public qStringComparisonHelper()
Unify all it's overloads into a single private helper functionand use this new helper
where possible - so we could optimize all those operators in one step some later
(this also fixes `QBytArray("a\0b") < "a"` didn't respect the \0 while operator==
handles nul(s) correctly);
Add operators <,>,<=,>=(const char*) to QStringRef so that they doesn't create a temporary QString object;
Add missing QT_NO_CAST_FROM_ASCII

Change-Id: I8b6562a92fdb96e67aadee181f23f823d206f5fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-25 21:48:55 +02:00
Konstantin Ritt
2b15c1b30f Move ScriptSentinel enum from header to .cpp
Change-Id: Ic74e8e2471e92aa2014735f6ab0bb4f3b88de206
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-25 21:48:44 +02:00
Thiago Macieira
7c1e0fef8e Gestures & events: compile with QT_STRICT_ITERATORS.
There are a few mixed up iterators that needed cleaning up. We're
missing a constUpperBound and constLowerBound function, though...

This commit sneaks in one change to qtextformat related to
QT_STRICT_ITERATORS but not to gestures and events.

Change-Id: I8c7c840fb5f46c790adbf52952c6009c5b5f2f43
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-05-25 21:46:55 +02:00
Friedemann Kleint
57f243594e OpenGL/HelloWindow example: Fix resource leaks.
Change-Id: Icf776b5581b3a632e8cef19af1059503146c158c
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-05-25 21:42:14 +02:00