Commit Graph

6107 Commits

Author SHA1 Message Date
Tony Sarajärvi
12705f70c9 Blacklist a font dialog test that fails
This test has failed already in openSUSE 13.1 where
it has been marked as insignificant. Incorrect font
size is returned from a font dialog in tst_qfontdialog.

Task-number: QTBUG-46056
Change-Id: I7b5841e90d4cbe9d9573b46ec7dec64432160473
Reviewed-by: Akseli Salovaara <akseli.salovaara@theqtcompany.com>
2016-02-26 10:57:50 +00:00
Tony Sarajärvi
78904a38f6 Blacklist tst_QStyleSheetStyle::hoverColors as it is flaky
Task-number: QTBUG-51400
Change-Id: I29793b2da26951ace3a32df7e5e0d0a2dfdac759
Reviewed-by: Akseli Salovaara <akseli.salovaara@theqtcompany.com>
2016-02-26 10:57:45 +00:00
Liang Qi
3ed944b843 Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-02-25 12:23:23 +00:00
Liang Qi
5439451def Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
	mkspecs/features/qt_module.prf
	src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm

Change-Id: I7912c23b02b186831f0e465dbe5d1f9936205439
2016-02-25 09:55:25 +01:00
Tony Sarajärvi
d8f4d4452d Adjust tst_qabstracttextdocumentlayout for border cases
OpenSUSE 42.1 failed this case for some reason. With this change
the test tests the anchor from the middle of the string instead
of looking for it from the end.

Task-number: QTBUG-51345
Change-Id: I2fc7496399f46926f261c7a1f48756bfaf782f7b
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-25 07:37:49 +00:00
Liang Qi
1fadc7292b Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java
	src/plugins/platforms/windows/qwindowsfontengine.cpp
	src/plugins/platforms/windows/qwindowsnativeimage.cpp
	tests/auto/gui/kernel/qwindow/BLACKLIST
	tests/auto/gui/kernel/qwindow/tst_qwindow.cpp

Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
2016-02-24 13:31:14 +01:00
Błażej Szczygieł
7091be1b79 xcb: Deliver mouse enter event to window when closing modal window
When a modal window is closed and the mouse is not under the modal
window - find a proper window and send a fake enter event.

Added auto test for checking enter event on window when modal window
is closed.

Task-number: QTBUG-35109
Change-Id: I370b52d386503820ac9de21e6d05fd019ca456ec
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-24 09:03:14 +00:00
Friedemann Kleint
bf44f002ca Blacklist tst_QTreeView::setSortingEnabledChild() on Windows.
Task-number: QTBUG-51149
Change-Id: I7887aea5a6046353e235655665e53b5953f0854b
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-02-24 08:20:11 +00:00
Błażej Szczygieł
57ecd5aeeb QtWidgets: Proper delivery of enter/leave event to context menus
First-level context menu grabs the mouse, so all mouse events are
delivered to it. This menu passes the mouse events to submenus. Any
platform delivers mouse enter/leave event differently when window is
grabbed. This patch unifies event delivery to context menus - it can
block some unwanted events and it emulates fake events if necessary.

This patch can reduce duplicated events and can provide proper enter
or leave event to additional widgets in the context menu. It can also
prevent submenu from unwanted close on Windows and X11.

Added autotest.

Task-number: QTBUG-45565
Task-number: QTBUG-45893
Task-number: QTBUG-47515
Change-Id: I7dd476d0be23afa34e947e54aef235012d173dcf
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-24 04:33:36 +00:00
Christian Strømme
d392826959 Make it possible to preserve the library/plugin path in tst_selftest
If QT_PRESERVE_TESTLIB_PATH is set, then LD_LIBRARY_PATH and
QT_PLUGIN_PATH won't be filtered out for the sub-tests started by
tst_selftest.

Change-Id: Ic43ba9b4d882ee36b2f7495b1c880f26aefd2629
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2016-02-23 21:16:44 +00:00
Dmitry Shachnev
b6a824d0a3 Add native support for D-Bus global menu
The protocol was originally developed by Canonical, currently supported
by Unity and Plasma.

Adjust some tests to use the non-native menu bar when they require it.

[ChangeLog][XCB / X11] QMenuBar uses the unified D-Bus AppMenu menubar
when the desktop environment supports it.

Change-Id: Iea74b40522573bcc4f70168fe7fa2a49b4f3fc21
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-23 20:56:07 +00:00
Eirik Aavitsland
950bb7185c Autotests: if cross-compiling, ignore dbus status on compilation host
The auto.pro file would bail out or skip based on the availability of
the session bus at qmake time. That does not make sense for cross
compilation: the session bus may be available on the target even if it
is not on the compilation host.

Change-Id: I459a518f3411acb39e8dcdad9d32ded1f9b57029
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-23 12:19:31 +00:00
Simo Fält
0ac8c8698c Autotest: Blacklist tst_QFontDialog::setFont()
This test fails in distros using GNOME due to
most likely bad usage of native dialogs.

Task-number: QTBUG-51148
Change-Id: I6e539b429266e298ce413565e0191bffa7fbe6bc
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-23 07:30:34 +00:00
Samuel Gaist
6129aade00 QListWidget: setup connections when changing selection model.
QListWidget uses a set of slots for its selection model that are
connected only at creation time. This patch adds the missing
connections cleanup and setup when a user changes the selection
model.

Task-number: QTBUG-50891
Change-Id: I942bae6c471ea1ae22637d09b96d6fbd422f653f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-21 20:50:18 +00:00
Marc Mutz
1da975cdc5 QLatin1String: add at()/op[]/mid()/right()/left()
QLatin1String can be used as a string-view-like type.
When attempting to do so in uic, mid() and at() were
found to be missing. Added the others for completeness.

Use the new functions in uic, for which they were
originally conceived.

[ChangeLog][QtCore][QLatin1String] Added at(),
operator[](), mid(), right(), left().

Change-Id: I4cfe3e9ed1157dedee754b2012d9678fe72b161e
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-19 18:16:38 +00:00
Simon Hausmann
bcc965ef4b Merge remote-tracking branch 'origin/5.7' into dev
Change-Id: I7bee7df50af3d607a349b68103cd2c67791281fb
2016-02-19 12:02:49 +01:00
Friedemann Kleint
11cd0902e6 Re-enable tst_QTreeView::setSortingEnabled on Windows.
The test was made insignificant for Windows in change
f3939d943e. As the failure is not
reproduceable locally, re-enable it. Also split apart the test.

Task-number: QTBUG-51149
Change-Id: I6a06bdf2369bc3bdbc73dfe4fa416e9d644f8b01
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-18 22:54:19 +00:00
Friedemann Kleint
5d2068b912 Prospective fix to stabilize tst_QMdiArea::subWindowActivated2()/xcb.
Ensure that the window is active (as otherwise
QMdiArea::activeSubWindow() returns 0) and add a QTRY_COMPARE.

Change-Id: I7edb01d43fd2635864266614ef9a0e844f76edbf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-02-18 22:53:22 +00:00
Liang Qi
4fe2fbcf82 Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 018e670a26.

The change was introduced in 5.6. After the refactoring, 14960f52,
in 5.7 branch and a merge, it is not needed any more.

Conflicts:
	.qmake.conf
	src/corelib/io/qstandardpaths_mac.mm
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp

Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
2016-02-18 20:50:35 +01:00
Vyacheslav Grigoryev
34472e946a QSqlDriver: use table prefix in WHERE clauses
If the WHERE clause is used in a query involving multiple tables,
such as generated by QSqlRelationalTableModel, the table prefix
may be necessary to disambiguate column references. It is harmless
if not needed.

Task-number: QTBUG-43320
Change-Id: I39e1ab7359bf748afa8bcd8578220e3abb3ee24a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-02-17 23:13:58 +00:00
Oswald Buddenhagen
86c5a337e3 Merge "Merge dev into 5.7" into refs/staging/5.7 2016-02-17 19:57:54 +00:00
Stephen Kelly
bfeb2fdd79 QStandardItemModel: Reset the flags on clear()
Pass modeltest after clear().  Otherwise it fails because more flags
than Qt::ItemIsDropEnabled get returned for the QModelIndex().

Change-Id: I8f11515cc7dc9383f528f785312ffb77b3c2699d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 11:39:13 +00:00
Tony Sarajärvi
837d717b13 Blacklist tzTest in openSUSE 42.1
The test was already blacklisted in openSUSE 13.1 and
was found not to work in 42.1 either.

Task-number: QTBUG-51172
Change-Id: I9f8f7b2251a230596a25183dee04ed37824f8ad7
Reviewed-by: Akseli Salovaara <akseli.salovaara@theqtcompany.com>
2016-02-17 11:28:31 +00:00
Tony Sarajärvi
042f9eaeb4 Blacklist tst_QStorageInfo::storageList
A bad test that assumes hard disk being
partitioned in a specific way

Task-number: QTBUG-51174
Change-Id: Ic4d56fbd041444e00bd656372e9190ba07ff2704
Reviewed-by: Akseli Salovaara <akseli.salovaara@theqtcompany.com>
2016-02-17 11:28:23 +00:00
Anton Kudryavtsev
a3b8e355fc QListView: fix skipping indexes in selectedIndexes().
Remove spurious increment of i.

Task-number: QTBUG-51086
Change-Id: I4307a6728de1e7f25c8afa31fe2066f92373f3fc
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-17 04:53:16 +00:00
Maurice Kalinowski
ad16703fa8 Update testdata
Some entries were not updated and tests failed to succeed on platforms
which need to deploy content/testdata.

Change-Id: Ieb2b44c375b04cbaaecc1fb2303cc2478b86a100
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:50:50 +00:00
Maurice Kalinowski
8b0dc80294 winrt: Fix usage of testdata
testdata needs to be deployed to temp and current directory
needs to be set to that directory for the test to succeed.

Change-Id: I2dd023af9073d90afbb4ad60fcfb50bb1af4e159
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:50:14 +00:00
Maurice Kalinowski
6c7c34f219 winrt: Disable tests which connect to localhost
WinRT does not allow do connect to the localhost due to security
constraints and sandboxing. Hence we need to disable those
currently.

Change-Id: Idb8c71397a41e5fa5bad9d618dba1bb389e71b9c
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-16 19:35:10 +00:00
David Faure
78b8f7803b QtConcurrentRun: add unittest for polling for isFinished()
I had intermittent failures with this kind of code in my unittests,
not sure why yet. This test seems to pass reliably, apart from
helgrind saying it triggers the known race in QFuture::isFinished,
for which Marc is working on a fix.

Change-Id: I4aabe77566dc1af859a016ffe8a4cce19ddf25c8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-15 13:53:57 +00:00
David Faure
bbc830ce3e QIcon::fromTheme(): add support for absolute paths.
This allows methods that return an icon name, to sometimes also
return an icon full path (e.g. because the icon was dynamically generated
and stored into a local cache on disk)

Change-Id: Ib01c3955f4b64236463846241d9814b2d0686634
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-15 13:53:54 +00:00
David Faure
e8ed29d679 tst_QTemporaryFile: test value of openMode() after open().
I had a doubt about what it would be, turns out it's ReadWrite.
Turns out it's documented, too :-)

Change-Id: I87c2ffc81aa240ffa88c495fe250b022d7fb3c21
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-15 13:53:51 +00:00
Peter Kümmel
ab8cc8387f Add qOverload to select overloaded functions
[ChangeLog][QtCore][Global] qOverload added to select
overloaded functions.

Change-Id: I7c9b1b054e6631eca0b5594db59e1202ef552c33
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-15 12:33:24 +00:00
Liang Qi
80bf4bfe3d Merge remote-tracking branch 'origin/5.6.0' into 5.6
Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
2016-02-15 08:09:50 +01:00
Sérgio Martins
6139fbeb5f Introduce QHash::equal_range()
Similar to QMap::equal_range().
Will allow to easily fix inefficient code such as:

    foreach (auto value, hash.values(key)) { ... }

[ChangeLog][QtCore][QHash] Added QHash::equal_range()

Change-Id: I6e19e25de632e897ad83d3141d9d07f0313f7200
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-14 06:43:52 +00:00
Marc Mutz
8ce34c2e81 QRect(F): add transposed()
I didn't add a transpose(), because r = r.transposed() is
perfectly capable of filling that role, and just as
efficient. Existing API mistakes are no excuse to create
more of them.

[ChangeLog][QtCore][QRect/QRectF] Added transposed().

Change-Id: Ic38721e9028496fc9b50f4d4cef2e7a60532eed8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-13 18:18:48 +00:00
Marc Mutz
afc7da09ec QRegion: add move ctor
After this change, this was the distribution of calls in
QtGui and QtWidgets when the patch was developed for 5.4:

      QtGui  QtWidgets
move  23     63
copy  23     36

Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-13 18:18:32 +00:00
Paolo Angelelli
c5d4972577 Fix for deferredDelete() bug when calling the glib loop directly
This patch makes sure that all events posted using Qt on top of the
GLib event loop have the loopLevel counter incremented.
This is done since Qt depends on the fact that all deleteLater() calls
are issued within the scope of some signal handler (in other words,
triggered by the chain sendEvent() -> notifyInternal2()).
There is a side effect though: in the conditions affected by this
patch, that is deleteLater()s issued within a glib event handler for
example, manually calling processEvents() or sendPostedEvents() with
or without the QEvent::DeferredDelete flag has the same effect, and
deferred deleted events are always processed.
While this is not a currently working feature which the patch breaks,
this side effect seems to be difficult to avoid without separating
sendPostedEvents() and processEvents() into a public and a private
method, in order to detect when they are manually called.
Such change could perhaps be done for Qt6.
An autotest for QTBUG-36434 is also included.
Autotesting for QTBUG-32859 seems to be more challenging in this
respect, due to its dependency on GLib.

Task-number: QTBUG-18434
Task-number: QTBUG-32859
Task-number: QTBUG-36434
Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-12 19:06:11 +00:00
J-P Nurmi
5be4f95d95 Fix QFileSelectorPrivate::addStatics()
It must clear the previously cached sharedData->staticSelectors,
or else QFileSelectorPrivate::updateSelectors() does nothing and
the newly added static selectors end up being ignored.

Change-Id: If6997664629199be9f00de64c5dd01de2bf0a044
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-12 14:10:29 +00:00
Liang Qi
321658d288 Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-02-11 12:57:10 +00:00
Liang Qi
d456f87ece Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
	src/corelib/io/qfilesystemwatcher_win.cpp
	src/corelib/plugin/plugin.pri
	src/plugins/platforms/cocoa/qcocoaaccessibility.mm
	tests/auto/corelib/tools/qlocale/tst_qlocale.cpp

Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
2016-02-11 08:25:04 +01:00
Simo Fält
5d8354e63a Autotest: Enable make check on rhel 7.1
Blacklisting all tests, which were failing locally.

Task-number: QTQAINFRA-949
Change-Id: I40c25ab0155b8977596d61297ab252a546515f87
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
2016-02-11 05:47:38 +00:00
Gabriel de Dietrich
9e8c84aa14 Add SH_ItemView_ScrollMode style hint and use it in QMacStyle
On OS X, the default scrolling mode of item views should be
per pixel instead of per item. We enforce this through a new
style hint. On all other platforms, the behavior remains the
same.

It's still possible to override the style hint by using the
regular scroll mode setters. Any subsequent style change will
result in a no-op once the setters have been called and until
the properties are reset.

Some auto-tests had to be update to to take the new behavior
into account.

[ChangeLog][QtWidgets][Styles] Added SH_ItemView_ScrollMode
style hint.

[ChangeLog][QtWidgets][Item Views] Item views scroll per pixel
on OS X now.

[ChangeLog][QtWidgets][Item Views] QAbstractItemView::verticalScrollMode
and QAbstractItemView::horizontalScrollMode are now resettable.

Change-Id: I3f923275c99aa4389323b52fc1c5455fe71f8d73
Task-number: QTBUG-50102
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-02-11 04:50:36 +00:00
Aleix Pol
8b4ac65e29 Provide QCss with the correct font for <pre> blocks
Labels would use a statically defined font for <pre> blocks.
Use the one defined by the QPlatformTheme instead, through
QFontDatabase::systemFont(FixedFont)

Task-number: QTBUG-50564
Change-Id: I5491bd0defce651bdf809bcbc6a529a900f4959b
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2016-02-09 21:24:46 +00:00
Maurice Kalinowski
2ddd11dde2 Cleanup testcase for platforms without QProcess support.
Change-Id: Ib56c90262605ad975772f6b26c6232020e308ca6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-09 15:45:17 +00:00
Andre Somers
21861e6fd1 Add setFlag method to QFlags
This makes implementing class methods that enable or disable a feature
stored in a QFlags<> member easier.

[ChangeLog][QtCore][QFlags] Added setFlag method to set or unset a flag

Task-number: QTBUG-27100
Change-Id: Ic602abbbf3100df78f21b7918573744d1bbd18c1
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-08 10:25:09 +00:00
Eirik Aavitsland
e4f71b0cb5 Crash fix: reject certain malformed bmp images
A malformed bmp file header could specify a negative color table
size. The bmp handler would then return a QImage that claimed to be
valid, but actually was invalid, having an empty color table. This
would cause crash later, e.g. when attempting to paint it.

Change-Id: I7df7c40867557a82dbcee44c7de061226ff232c0
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2016-02-05 04:14:35 +00:00
Louai Al-Khanji
e9802a1073 tst_qeventloop: replace select with poll
Change-Id: Ib2b71696e24249b0b13bb925a7bb627ef09f2dff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-04 22:33:51 +00:00
Allan Sandfeld Jensen
6ec7d7658d Fix rounding error in fetchTransformedBilinear
To calculate the real count we need to use the actual fixed point
increment and can not use the floating point value increment wass based
on since it might round differently.

Includes auto-test by Gabriel de Dietrich.

Task-number: QTBUG-50153
Change-Id: Ia973088f361c90370fa20bac14a4b8f373b5d234
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-02 22:47:10 +00:00
Edward Welbourne
bb1924c345 Pass -silent to lrelease to avoid cruft in test logs.
Change-Id: I7cf2808187f97b6319f7561fe06ddef476fa9aa0
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-02 16:28:07 +00:00
Edward Welbourne
04def3a878 Don't clutter up the source tree with .qm files generated by testing.
Generate the qundo*.qm files for tst_QUndo*::commandTextFormat() in
the current directory (out of source, for a shadow build) rather than
alongside the qundo*.ts from which they're derived (in the source
tree); and remove them once loaded, if that succeeds.  (On failure, we
might even want to look at them.)

Task-number: QTBUG-49081
Change-Id: I666985fa3ceb8c25c917b617d6d39141eddebb76
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2016-02-02 16:27:55 +00:00