Commit Graph

6072 Commits

Author SHA1 Message Date
Liang Qi
d0eaa737e1 Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	qmake/doc/src/qmake-manual.qdoc
	src/corelib/tools/qstring.h
	src/gui/image/qimagereader.cpp
	src/network/access/qnetworkaccessmanager.cpp
	src/tools/qdoc/doc/examples/examples.qdoc
	src/widgets/accessible/qaccessiblewidgetfactory_p.h
	src/widgets/doc/qtwidgets.qdocconf

Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
2015-10-02 16:59:55 +02:00
Edward Welbourne
2c5126b9de Purge extraneous execute permissions.
Source files should not be executable.

Change-Id: If9b9eaa6c8c7348ca6f48fa9253f3540e95aca37
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-09-30 18:26:21 +00:00
Friedemann Kleint
3130f0865a Improve tst_qfile.
- Introduce consistent error messages for failing QFile::open()
  and existence checks to make errors about non-available
  UNC paths on Windows clearer.
- Introduce a guard class to ensure the stdin reader processes
  are terminated properly in case of failures, which currently
  occur for MSVC2015.
- Fix brace coding style and remove unnecessary QString
  conversions.

Task-number: QTBUG-48504
Change-Id: I890b13088558ef05391fb152a6b815276df0fe8c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-30 17:28:49 +00:00
Friedemann Kleint
0bc3983b8a Improve messages in tst_qdir/tst_fileinfo/tst_qfiledialog2.
Introduce error messages showing the path in file existence,
file type and directory entry list tests to make fails related
to missing UNC shares clearer.

Task-number: QTBUG-48504
Change-Id: I5fb401b94cfa8b58562a906b8d9765039e334027
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-30 17:27:58 +00:00
Edward Welbourne
b86efb1ab9 Initialize QFutureWatcherBasePrivate::finished and test
It's accessed by QFutureWatcherBase::isFinished(), potentially before
anything has set it.  It gets to be initially true until setFuture()
has given it us unfinished future and set it false.

Add a regression test for matching state in future and watcher.

Task-number: QTBUG-12358
Change-Id: Iae7bdaa434ab80f518afe4d7d55df99c391991a4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-09-30 08:25:34 +00:00
Friedemann Kleint
0ebebeb983 MSVC2015: Blacklist tests reading from stdin in buffered/text mode.
- tst_QProcess::fileWriterProcess()
- tst_QProcess::readLineStdin()
- [tst_QProcess::readLineStdin_lineByLine()

The test fails apparently due to a bug in its runtime library
(fread() dropping data).

Task-number: QTBUG-48455
Task-number: QTBUG-48504
Change-Id: I972e560e88312cea0d3dbcea9450c59285a15d5a
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-09-30 07:54:58 +00:00
Joni Poikelin
0f48a0ed04 Clean unused parameter warning from QItemSelectionModel test
Change-Id: I6bd40e8de7b44630ef5c7475b8159ab9a0361cb9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-09-30 06:36:21 +00:00
Friedemann Kleint
a2995c180b tst_qprocess: Improve handling of helpers.
Verify exit status and code where applicable. Avoid unnecessary
data conversions in fileWriterProcess. Improve error handling in
helper processes.

Task-number: QTBUG-47370
Task-number: QTBUG-48455
Change-Id: Ib5c4f546027131db02caaa05154a5880edac5cf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-30 04:29:56 +00:00
Friedemann Kleint
78f9b16d60 Skip tst_QNumeric::addOverflow() for MSVC2015.
The code still produces  Internal Compiler Errors in release mode.

Task-number: QTBUG-46344
Change-Id: I86d3608b13a197a0b65b83829d1512203e1578f8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-09-30 04:28:39 +00:00
Friedemann Kleint
9facf1be9b Tests: Always verify whether QTemporaryDir/File creation succeeded.
Use QVERIFY2() with QTemporaryDir/File::errorString() consistently.
Attempt to catch issues like the below warning and follow-up issues.

QSYSTEM: tst_QFiledialog::clearLineEdit() QFileSystemWatcher: FindNextChangeNotification failed for "C:\Users\qt\_____aaaaaaaaaaaaaaaaaaaaaa"  (Access is denied.)

Task-number: QTBUG-47370
Change-Id: I58a6e87c502627e976efa62ad73c912f3b2d49fa
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-09-28 15:05:43 +00:00
Christian Kandeler
d24366a632 Fix comparisons between QByteArray and QString.
QByteArray::operator< and friends had their logic reversed.

Task-number: QTBUG-48350
Change-Id: I625209cc922b47e78dfb8de9fe100411f285a628
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-28 07:42:51 +00:00
Lorn Potter
bb281eea17 Make sure networkAccessibilityChanged is emitted
Task-number: QTBUG-46323
Change-Id: I8297072b62763136f457ca6ae15282d1c22244f4
Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-26 19:14:03 +00:00
Frederik Gladhorn
b2e664df61 Enable tst_qaccessibilitylinux
This test caused problems because it relies on the at-spi services to
run. In addition it could trigger orca (screen reader) to be launched
as a side-effect of the dbus call to the screen-reader-enabled setting.
Instead just export QT_LINUX_ACCESSIBILITY_ALWAYS_ON to make sure that
accessibility will work. This means we won't test the dbus startup any
more, but the test will be reliable.
There is still a dbus call to org.a11y.Bus to launch the service in case
it's not running yet.

Task-number: QTBUG-27732
Task-number: QTBUG-44434
Change-Id: Idb86ed98ca4b47cb209027c8b41529e7e5285197
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
2015-09-26 00:50:44 +00:00
Friedemann Kleint
3cbb89fa5a tst_qprocess: Instantiate QProcess objects on the stack.
Instantiate the QProcess object on the stack to ensure resource
cleanup and remove the QProcess * member variable.
Use qobject_cast<QProcess *>(QObject::sender()) instead
of the member variable in the helpers slots to ensure that signals
from a leaked QProcess do not interfere with other tests.

Task-number: QTBUG-47370
Change-Id: Ifc0dccb7e4b18069d236df53bccdcb6a47df6346
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-25 20:22:17 +00:00
Friedemann Kleint
f322e2aa08 tst_qprocess: Port to Qt 5 connection syntax.
Task-number: QTBUG-47370
Change-Id: I09489a6fb4598238fa5e0120bf751fe5af6f31af
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-25 20:22:00 +00:00
Shawn Rutledge
61b608dfb5 QScreen manual test: don't crash when a QScreen is null
Need to survive having screens detached/reattached on X11.

Task-number: QTBUG-42985
Change-Id: I81cf9721f0cb61a29180c60d44d588063266e651
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-09-24 20:15:35 +00:00
Thiago Macieira
3bcb3c64e2 Use QTypeInfo<T>::isRelocatable in QVariant
Change-Id: Ib306f8f647014b399b87ffff13f1f01c40dc3ef7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-09-24 16:55:10 +00:00
Christian Kandeler
73b8cd879c QSettings: Special-case serialization of QDateTime.
QDateTime values with a UTC offset are not correctly serialized with
QDataStream::Qt_4_0. So use a newer QDataStream format for this type and
mark it with "@DateTime" instead of "@Variant".

Task-number: QTBUG-46551
Change-Id: I211c89e8cd0211c949ec993e6ffd5192d0eebbb3
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-24 11:25:36 +00:00
Joni Poikelin
61f2e9a9a7 Fix QItemSelectionModel deselection range
Left and right were swapped which caused invalid selection ranges to be
emitted through selectionChanged.

Task-number: QTBUG-48402
Change-Id: I18692c2b50c49ab39065f9b360b37b7615227ee9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-09-24 08:13:07 +00:00
Friedemann Kleint
7183d08095 Tests: Harmonize code checking on platform name.
Use case insensitive comparison and static invocation
of QGuiApplication::platformName().

Change-Id: I8c197c7b4f0669f71c019fbcee09a0f03dfab399
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-09-24 07:49:30 +00:00
Thiago Macieira
0d75f8e95a tst_QDBusAbstractInterface: fix racy test failing every so often
The explanation is in the code comment. Ever since QDBusConnections
began being processed in a separate thread, we were relying on the fact
that the main thread didn't begin processing its event queue until the
second event got posted (the event loop only exits after it has finished
processing all pending events). We had a race between the main thread
starting its processing, at which point it decides which is the last
event it will process, and the QDBusConnectionManager thread posting the
second event.

This is very fragile code, since it depends on the behavior of
QDBusConnectionPrivate (how it stores the signal relays in a hash) and
that of QHash with duplicate keys. This only works because the hash
key between the two connections is the same (it's only dependent on the
method name and interface name). If we ever begin using something that
isn't the same between "control" and "p", then with QHash's randomness,
we'll be racy again.

Change-Id: I42e7ef1a481840699a8dffff1406c3a4674ec3a6
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-24 07:37:05 +00:00
Jędrzej Nowacki
a153bb232c Stabilize qguieventloop test.
The test assumed that an event loop can be tested for emptiness
multiple times, which is wrong because an event can be delivered any
time.

Change-Id: Ic44245321eeed2091b640ada2c83d205b83a1cc2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-24 07:36:25 +00:00
Frederik Gladhorn
493d08aeea Fix tst_qthreadstorage
This test when running on Windows has a race condition since in qthread_win.cpp the
finished signal is emitted before everything is cleaned up.

Change-Id: I3c03d9a245e297e8f79b2be2c34398bf7bac9bae
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-09-24 07:34:06 +00:00
Thiago Macieira
29bc68cf16 Add code to perform overflow-checking additions and multiplication
Most processors have carry flags which they set on addition overflow, so
it's a good idea to access them whenever possible. Most of them also
have widening multiply instructions that can be used to detect overflow
of the non-widening version.

Tested to compile on:
 Architecture     Compiler
  x86             GCC 4.9, GCC 5*, Clang 3.6*, ICC 16 beta
  x86-64          GCC 4.9, GCC 5*, Clang 3.6*, ICC 16 beta
  x86-64 ILP32    GCC 4.9, GCC 5*, Clang 3.6*
  IA-64 LP64      GCC 4.8
  ARMv7-A         GCC 4.9, Clang 3.6*
  AArch64         Clang 3.6*
  MIPS            GCC 4.9, Clang 3.6*
  MIPS64          GCC 4.9, Clang 3.6*
  PowerPC         GCC 4.9, Clang 3.6*
  PowerPC 64      GCC 4.9, Clang 3.6*
  SPARC           Clang 3.6*
  SPARCv9         Clang 3.6*

[*] supports the intrinsics

If the compiler does not offer a way to detect an overflow, we do it by
hand. For unsigned additions, that's easy, since the C++ language
specifies the behavior of the overflow. That's also the reason why this
code is implemented only for unsigned integers.

For the multiplication, if the compiler does not support widening
multiplications, we do it with a division instead. This is necessary for
GCC < 4.5 and compilers not compatible with GCC or MSVC.

Change-Id: I049a653beeb5454c9539ffff13e637de0f1338c1
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-23 16:19:45 +00:00
Christian Kandeler
c619d2daac QDateTime: Ensure a valid timezone when using the "offset constructor".
The timeZone() function used to assert when called on such an object
(or, for a release build, return an invalid time zone).

Change-Id: I6ae8316b2ad76f1f868e2498f7ce8aa3fcabf4a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-23 06:46:44 +00:00
Tor Arne Vestbø
5f3529be32 Silence warnings about missing dbus-send command not found
Without piping the output to /dev/null, we'd get the following:

  sh: dbus-send: command not found

And if dbus support is only limited to runtime support, we don't
treat it as a fatal error and only notice the user.

Change-Id: Ia7750a074b8d563bf9694fa8fa628b4017e8bb68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-22 21:19:04 +00:00
Rafael Roquetto
f5b682d320 QGraphicsProxyWidget: forward touch events to QWidget
When working with QGraphicsView/QGraphicsScene, touch events are sent to
QGraphicsView's viewport() event handler, which then dispatches it to the
corresponding QGraphicsItem, if any. In the case of QGraphicsProxyWidget, we
need to forward these touch events to the encapsulated QWidget, otherwise it
will never receive them (i.e. the event chain for touch events terminates at
QGraphicsProxyWidget).

This also enables QWidgets associated with QGraphicsProxyWidget to grab
gestures.

Task-id: QTBUG-45737
Change-Id: Ia441d3576afb6c97376be6f2ff073901e6e928a5
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2015-09-22 20:54:44 +00:00
Friedemann Kleint
d417f81f28 QAbstractSpinBox::inputMethodQuery(): Consider input method hints set on the spin box.
The derived classes (QSpinBox, QDoubleSpinBox, QDateTimeEdit, QTimeEdit)
set various input method hints on the spin box in the init() methods
of their private classes which did not have any effect since
QAbstractSpinBox::inputMethodQuery() was implemented to return the
hints of the embedded QLineEdit only. Change it so that hints set
on the QAbstractSpinBox are also considered.

Change-Id: I76b7c4d3e0869589c110cf3a0b2c3f94201db5d5
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-22 14:26:26 +00:00
Gabriel de Dietrich
a14fadfb64 Add getter and setter for qt_qhash_seed
In some cases it's not possible to use QT_HASH_SEED, specially when
we need to set the environment variable from inside the application,
as dynamically loaded libraries or plugins may create static QHash
instances. That would set qt_qhash_seed to a value different from
-1 and skip the env var value.

For those cases, and when we still want to set qt_qhash_seed, we
provide a way to enforce its value.

Auto-tests accessing qt_qhash_seed directly have been updated
accordingly. Usage in qdoc, uic and rcc has been left as is
for the time being.

Change-Id: I3b35b4fa0223c83b1348a6508641905a2a63266f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-22 14:17:46 +00:00
Jędrzej Nowacki
f17837fbf9 Fix taskQTBUG_34717_collapseAtBottom test
The test is moved from tst_qtreeview to tst_qtreewidget as it tests
qtreewidget class.

C++ usage is fixed, there was an illegal C cast that was causing crashes

Change-Id: I80e90a9b531e87f9b133186b6f48be42f54901b5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2015-09-22 14:12:20 +00:00
Serge Lysenko
f807a6de2c Fix QImageReader::size() to return correct size for .ico files.
According to MSDN, the zero value of ICONDIRENTRY bHeight and bWidth
fields mean a maximum icon size 256 pixels. So QtIcoHandler::option()
should return 256 instead of 0 pixels for such icons. Also there is
fixed wrong seek offset at the second call on this method.

http://blogs.msdn.com/b/oldnewthing/archive/2010/10/18/10077133.aspx

Task-number: QTBUG-48103
Change-Id: I99f0c9720fd58889045b0c73c51498f2065b0b91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-09-17 16:30:37 +00:00
Andy Shaw
d36a1dfb51 Serialize the capitalization value of QFont
By serializing the capitalization value of QFont, it ensures that it is
correctly preserved when QPicture streams it and later plays it back.

Subsequently the QDataStream version has been bumped up to account for the
change of the data format for serializing QFont.

[ChangeLog][QtGui][QFont] QFont now serializes the capitalization setting.
[ChangeLog][Important Behavior Changes] QDataStream version bumped up to
17 to account for changes in the serialization of QFont.

Task-number: QTBUG-15214
Change-Id: I042680760e5a69d18d41e786b7500a3eebbe562f
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-09-15 13:30:09 +00:00
Friedemann Kleint
45bf434cdc Diaglib: Output QGuiApplication::focusObject() in focus changes, too.
This is useful for diagnosing QML focus issues.

Task-number: QTBUG-48199
Change-Id: Iff2cc35850e7020a9198b38256d1331587d0eefb
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2015-09-15 13:24:14 +00:00
Tor Arne Vestbø
0e342fce4c Replace direct QPA access in tst_qguiappliction with testlib wrapper
Change-Id: I698aa9d7633992d257296759f5e04307ff0d8331
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-15 07:41:17 +00:00
Tor Arne Vestbø
0a1206a8b2 Remove QGraphicsView autotest that doesn't test anything
It sends a shortcut override event directly, which should go
though QPA anyways.

Change-Id: Ie2c6f45cd44222cd9be8846099573dcd2968a77c
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-09-15 07:40:49 +00:00
Thiago Macieira
75f6f1d843 tst_QDBusAbstractAdaptor: fix reception of signals from P2P connection
P2P connections don't have senders and receivers, so asking
QDBusConnection to connect to a signal with a sender was a mistake
(added in 5368e44a86). Due to an internal
bug, this never presented itself -- double fault.

Fix the connection so that we don't get unit test failures when the bug
is solved.

Change-Id: I9a75ad8521ae4e5cbbe5ffff13d1a78b7dea6d07
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-15 02:09:00 +00:00
Thiago Macieira
f744aece9d QDBusServiceWatcher: Move the logic to QDBusConnectionPrivate
With kdbus, we won't have a regular signal, but instead a special
message. So keep the logic of what to do in QDBusConnectionPrivate.

The #ifdef is to make sure the bootstrapped qdbuscpp2xml continues to
build in cross-compilation environments.

Change-Id: Iee8cbc07c4434ce9b560ffff13d06f0d9904cb6d
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-15 02:08:50 +00:00
Thiago Macieira
ea01d7784a And move the creation of connections to the thread
Now we know that all timers and socket notifiers get created only in the
QDBusConnectionManager thread.

Incidentally, this reduced code duplication.

Change-Id: I27eaacb532114dd188c4ffff13d5075a8d2efb0b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-15 02:08:45 +00:00
Thiago Macieira
c2049f67e4 Use a dedicated thread for handling incoming libdbus-1 events
Each application will have one thread dedicated for this, for all
QDBusConnections. I wouldn't mind sharing such a thread with other uses
in Qt, provided none of them ever block (the QProcessManager thread
comes to mind, but it's going away soon).

The cost associated with this change in this commit is so far rather
minimal. All incoming D-Bus calls need to be handled after an event is
posted anyway, to avoid deadlocking on reentering libdbus-1 functions
that acquire locks still held. The cost is the one more thread running
and the cost of synchronizing them when an event is posted.

The benefits far outweigh that cost: no longer will we have problems of
QtDBus failing to run if the main system or session connections are used
before QCoreApplication is run. Moreover, events can be received and
handled in aux threads even if the main thread is blocked on some
operation.

Note: this commit may not be testable (tst_qdbusconnection may fail)

Task-number: QTBUG-43585
Change-Id: Ic5d393bfd36e48a193fcffff13b737556ccd11a8
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-15 02:08:36 +00:00
Thiago Macieira
939b7c630d Implement the blocking QtDBus call in terms of the non-blocking one
This simplifies the code a little by having a single code path. More
importantly, we no longer need to call the evil function
dbus_connection_send_with_reply_and_block. That function acquires a lock
on the socket transport inside libdbus-1, which means all threads need
to wait until the one call gets unblocked before they can continue.

To do that, this commit reimplements the QDBus::Block part of
QDBusConnectionPrivate::sendWithReply by reusing the existing call to
sendWithReplyAsync() and then doing a blocking-wait with
QDBusPendingCallPrivate::waitForFinished().

By using (Q)DBusPendingCall and the threaded connection approach (next
commit), now we never block on the socket. That also means the code to
call dbus_pending_call_block() is no longer necessary and the
waitForFinished() function itself can be considerably simplified.

As a side-effect of no longer blocking, a number of pre-existing race
conditions that used to be hidden showed up.

Note: this commit deadlocks without the threading (next commits).

Task-number: QTBUG-43585
Change-Id: Ic5d393bfd36e48a193fcffff13b73754954a3f7d
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-09-15 02:08:34 +00:00
Tuomas Heimonen
9f452719f3 tst_QUndoGroup, tst_QUndoStack Fixed flag QT_NO_PROCESS
Change-Id: I6c36475e343de72c954fcc917132977eb1f8d61a
Reviewed-by: Tuomas Heimonen <tuomas.heimonen@theqtcompany.com>
Reviewed-by: Marko Kangas <marko.kangas@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-09-14 06:26:39 +00:00
Thiago Macieira
d691c50072 Autotest: Make tst_QNetworkInterface::interfaceFromXXX data-driven
Change-Id: I7de033f80b0e4431b7f1ffff13f98c015ae37dc6
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-09-13 18:54:10 +00:00
Thiago Macieira
d878107001 Declare QNetworkAddressEntry and QNetworkInterface as metatypes
Change-Id: I7de033f80b0e4431b7f1ffff13f98c092ea3ba3e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-09-13 18:54:09 +00:00
Alex Trotsenko
a6ec869211 Fix the spurious socket notifications under Windows
To handle network events, QEventDispatcherWin32 uses I/O model
based on notifications through the window message queue. Having
successfully posted notification of a particular event to an
application window, no further messages for that network event
will be posted to the application window until the application
makes the function call that implicitly re-enables notification
of that network event. With these semantics, an application need
not read all available data in response to an FD_READ message:
a single recv in response to each FD_READ message is appropriate.
If an application issues multiple recv calls in response to a
single FD_READ, it can receive multiple FD_READ messages
(including spurious).

To solve this issue, this patch always disables the notifier
after getting a notification, and re-enables it only when the
message queue is empty.

Task-number: QTBUG-46552
Change-Id: I05df67032911cd1f5927fa7912f7864bfbf8711e
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-09-10 12:51:02 +00:00
Alex Trotsenko
378e26dd14 QUdpSocket: avoid infinite read notifier blocking
There was a small amount of time between the last readDatagram() call
and disabling a read notifier in case the socket had a pending
datagram. If a new datagram arrived in this period, this qualified as
absence of a datagram reader. Do not change the read notifier state
because it is disabled on canReadNotification() entry and always enabled
by the datagram reader.

Thanks to Peter Seiderer, who investigated the same: "Querying
hasPendingDatagrams() for enabling/disabling setReadNotificationEnabled()
is racy (a new datagram could arrive after readDatagam() is called and
before hasPendingDatagrams() is checked). But for unbuffered sockets the
ReadNotification is already disabled before the readReady signal is
emitted and should be re-enabled when calling read() or readDatagram()
from the user."

However, this patch does not completely solve the problem under Windows,
as the socket notifier may emit spurious notifications.

Task-number: QTBUG-46552
Change-Id: If7295d53ae2c788c39e86303502f38135c4d6180
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-10 12:50:58 +00:00
Pasi Petäjäjärvi
4b2db07b42 Fix tst_QGuiApplication for embedded platforms using eglfs QPA
Disable input and cursor for QGuiApplication instances used in
autotest to initialize it properly.

Change-Id: I78dc9b776269c082c20f244a51f858289129275d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-09-10 06:29:11 +00:00
Tuomas Heimonen
c258422cf9 tst_QProcess_and_GuiEventLoop: Added flag QT_NO_PROCESS
Change-Id: I895b9c12de8734c20ec87ac30a9a9cca8f4242d7
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-09 07:15:15 +00:00
David Faure
5e41f4137d QMimeDatabase: warn instead of asserting on bad magic.
An invalid mime magic definition could lead to an assert. Replaced with
a qWarning. Move all checking to the QMimeMagicRule constructor, and do
keep invalid rules since they are need to parse child rules.

Unit test added, with QTest::ignoreMessage when using the XML backend
(there's no warning from update-mime-database when using the cache).
Also make it easier to add more shared mime info files for tests.

Task-number: QTBUG-44319
Done-with: Eike Ziller <eike.ziller@theqtcompany.com>
Change-Id: Ie39a160a106b650cdcee88778fa7eff9e932a988
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-09-04 20:00:22 +00:00
Friedemann Kleint
c486cacba8 Testlib/Windows: Output crash information on stdout instead of stderr.
Make it easier to capture information about crashing tests in log files,
since it is not possible to do something like
foo > log.txt 2> errlog.txt
on Windows.
Adapt selftest.

[ChangeLog][QtTest][Important Behavior Changes] Crash/exception
information is now logged to standard output on Windows.

Task-number: QTBUG-47370
Change-Id: I3e6a2d25855ed0f20516418a031990b562f5f757
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-09-03 14:16:30 +00:00
Tor Arne Vestbø
54dbdc26ba Move min left/right bearing calculations to QFontEngine baseclass
The logic used in the FreeType font engine can be generalized
and move to the QFontEngine baseclass. This allows the CoreText
font engine to correctly report the minimum left/right bearings,
which decreases the chance that an optimization in QTextLayout's
line breaking algorithm will produce wrong results.

The calculation of left and right bearing has been moved to the
glyph_metrics_t type to reduce code duplication. This allows us
to use the with and height of the bounding box to determine if
the glyph has any contours.

Change-Id: I864697d3f31ed56f22f04666199b6c5023c5e585
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2015-09-02 09:11:31 +00:00